Fórum

How to put mutltiple porltet based AngularJs

Nitish kumar, modificado 9 Anos atrás.

How to put mutltiple porltet based AngularJs

New Member Postagens: 6 Data de Entrada: 29/01/15 Postagens Recentes
Hai every one
I am using AngularJS for my validation purpose.
1) if i use more than one portlet in page use of angularJS , then any one of the porltlet is working. remaining portlet is not loading with angularJs
2) If i using Action Request how to get the form parameter in the java controller class.


thanks in advance
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: How to put mutltiple porltet based AngularJs

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Well that's really the rub, isn't it. Angular wants to be a SPA, not multiple instances on a single page.

I know there's a lot of folks working on angular in Liferay but my guess is at this point you really shouldn't have relied on angular, especially just for validation purposes.

#2 is likely some sort of namespace issue where you have not namespaced your fields correctly.
Nitish kumar, modificado 9 Anos atrás.

RE: How to put mutltiple porltet based AngularJs

New Member Postagens: 6 Data de Entrada: 29/01/15 Postagens Recentes
Nitish kumar:
not for only validation,
i need to load up values in starting

while getting values in java class, i am using the ajax call.
if speak about angularjs we use ng-model
here my code to send the data

$scope.submitform =function() {

var data = $scope.formData;

$http({
method: 'POST' ,
url : demoUrl ,
data :{firstName:"nithish"},

}).success(function(data) {
});
}



but this not getting the values in java class
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: How to put mutltiple porltet based AngularJs

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Well first you don't show demo url, but it would have to be formatted per an <portlet:actionURL /> tag to get to your portlet.

Secondly only namespaced parameters will end up in the ActionRequest object in your method. firstName is definitely not namespaced.
Nitish kumar, modificado 9 Anos atrás.

RE: How to put mutltiple porltet based AngularJs

New Member Postagens: 6 Data de Entrada: 29/01/15 Postagens Recentes
this is my jsp

<portlet:actionURL var="actionURL">
<portlet:param name="submitURL" value="formSubmitSuccess" />
</portlet:actionURL>

<div ng-app="DemoApp" ng-controller="personController">
<form name="myForm">

First Name: <input type="text" ng-model="firstName">
<button ng-click="clickMe()">reset</button>
</form>
</div>
<script>
var demoUrl = '<%= actionURL.toString() %>';

$scope.submitform =function() {
var requestData = '<portlet:namespace/>firstName=sathees';
$http({
method: 'GET' ,
url : demoUrl ,
data : requestData

}).success(function(data) {
$window.alert(data2);
});
}
</script>




above code i am trying.
i tried by directly setting the data for <portlet:namespace/>
but still i am getting null
thumbnail
Aymen Debbabi, modificado 9 Anos atrás.

RE: How to put mutltiple porltet based AngularJs

New Member Postagens: 5 Data de Entrada: 02/03/15 Postagens Recentes
Hi, I have the same problem than you.. have you find a solution pleasee
thumbnail
Dhandapani S, modificado 8 Anos atrás.

RE: How to put mutltiple porltet based AngularJs

Regular Member Postagens: 176 Data de Entrada: 24/03/09 Postagens Recentes
Hi Nitish,

I am also facing same problem, could you found solution ? please help me on same.