- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 02:55 AM
Hi All,
i want to read the value from catalog fields in widget client controller.
when i click the button, the function needs to get value of website url in client controller.
Html :
<div>
<input type="button" ng-click="c.clearForm()" class="btn btn-primary" ng-model="website_url" value="Check Website"/>
</div>
client controller:
function($scope){
var c= this;
$scope.c.clearForm = function(){
gs.log("website"+$scope.website_url);
c.server.update().then(function(respons){
})
}
}
which method i need to use get value of catalog variable in the client controller. please advice me.
Regards,
Surendra
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 03:03 AM
i assume you are taking about catalog variables, if yes? then ..
e.g. if variable name is u_name then in controller..type in
$scope.page.g_form.getValue('u_name'); // this will fetch the value of variable u_name
||rly $scope.page.g_form.setValue('u_name','Aditya');
etc..
in brief use prefix $scope.page.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 02:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 03:03 AM
i assume you are taking about catalog variables, if yes? then ..
e.g. if variable name is u_name then in controller..type in
$scope.page.g_form.getValue('u_name'); // this will fetch the value of variable u_name
||rly $scope.page.g_form.setValue('u_name','Aditya');
etc..
in brief use prefix $scope.page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 05:05 AM
Hi Ghosh,
Thanks for response.
I tried with the below its not reading from the field.
function($scope) {
var c = this;
c.clearForm = function(){
var abc =$scope.page.g_form.getvalue("website_url");
alert("from the button:"+abc);
c.server.update().then(function(response){
//c.data.weburl=$scope.page.g_form.getvalue("website_url");
})
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 05:40 AM
try this...
function($scope, spMacro, spUtil, $uibModal, $http, $timeout) {
alert( $scope.page.g_form.getValue("website_url");
}
e.g. i used
<input type="button" ng-mouseover="GetFromServer_1()" ng-click="addNew_1(TableInfos_1)" class="btn btn-primary addNew_1 pull-right" value="Add New"/>
CS--
function($scope, spMacro, spUtil, $uibModal, $http, $timeout) {
$scope.addNew_1 = function(TableInfos_1){
//ServerScript
//$scope.GetFromServer_1();
//map variables
$scope.InitVars_1();
//checking mandatory and valid entries
if (!$scope.ReqNDup_1()) return;
var arrval= "";
//alert($scope.getValsCnt_1); index start from 0, ignoring the last split
var item = {};
:
:
:
:
:
:
}
you may look at below link, where in portal widget I have used time element in HTML and in CS, I am fetching its
value & storing into a catalog variable..