- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2015 02:23 AM
Hello.
I'm trying to Retrieve value from calendar to variable.
the calendar object is this:
<g:ui_date class="form-control" name="end_date" id="end_date" />
and the jelly syntax that supposed to retrieve the value into jvar_max variable is this:
<g:evaluate jelly="true" var="jvar_max">
var date =gel('end_date').value;
date;
</g:evaluate>
I've also tried this:
<g:evaluate jelly="true" var="jvar_max">
var date =document.getElementById('end_date').value;;
date;
</g:evaluate>
But still, every time that i send jvar_max into angular function it's alerted as "null"
<form ng-submit="updateRecordList('${jvar_max}')" >
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2015 09:37 AM
Hi.
I've tried all of your suggestion' but nothing seems to work.
eventually i used this o the custom element on ui page:
<g:ui_date_custom title="date_pick" class="date-picker"
name="start_date_row1" id="start_date_row1" ng-model="numbers" value = "${gs.now()}" onchange="angular.element(this).scope().onload()"/>
I've created the element with the help of the post: onchange event not working for ui_date field type in UI Page?
the onchange event call this angular function :
$scope.onload = function() {
$scope.updateRecordList(document.getElementById('start_date_row1').value);
};
Thank you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2015 10:13 PM
Hi Avi,
I believe you're mixing some concepts in here.
Keep in mind that the jelly script runs in the server to create that actual page in html that later is sent to the client to be run. I don't think you can do a getElementeById in your Jelly code since document is only available on the client side.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2015 10:22 PM
Instead of doing the <g:evaluate> you're doing. Give a try to the following
- <form ng-submit="updateRecordList(end_date.value)" >
or try
- <form ng-submit="updateRecordList(end_date)" >
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2015 10:24 PM
That's assuming that your calendar object actually has the date selected by the user once it's displayed at the client (the browser). Once the user does the submit of the form, then the form will use the respective end_date value as a parameter to call the updateRecordList method.
I hope this is helpful!
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2015 09:37 AM
Hi.
I've tried all of your suggestion' but nothing seems to work.
eventually i used this o the custom element on ui page:
<g:ui_date_custom title="date_pick" class="date-picker"
name="start_date_row1" id="start_date_row1" ng-model="numbers" value = "${gs.now()}" onchange="angular.element(this).scope().onload()"/>
I've created the element with the help of the post: onchange event not working for ui_date field type in UI Page?
the onchange event call this angular function :
$scope.onload = function() {
$scope.updateRecordList(document.getElementById('start_date_row1').value);
};
Thank you for your help.