UI page - g:evaulate, adding params or fetching variables from HTML

Sitrix
Tera Guru

Hello everyone 🙂

So the issue that I'm facing is adding input to an evaluate in the page.

 

I basically have a g:evaluate that need to run some serverside code and return an response, i.e. a string.

The issue is that this need to be based the value in one of the UI fields (input). I've searched high and low, but found nothing that works.

 

Some say that having (jelly="true") should allow fetching variables within the eval, i.e. via a jelly.jvar_myvariable - but it doesnt seem to work.

 

Test example HTML:

<input type="hidden" id="jvar_myvariable" name="jvar_myvariable" value="Test"/>

 

<g:evaluate var="jvar_gr" jelly="true">
jelly.jvar_myvariable; // This should return 
</g:evaluate>

 

Client script call:

alert('$[jvar_gr]'); // This shows up empty - should show text "test".

 

Edit: BTW - it would be even better if I could simply add a parameter to the evaluate when calling it. Is this possible?

Also, note that its a field on the actual UI page - it cannot be transferred via setpreferences in UI action.

 

 

 

 

1 ACCEPTED SOLUTION

Sitrix
Tera Guru

Seems its not possible due to evaluate being processed on load. 

If interested, it was answered here- https://stackoverflow.com/questions/74823398/ui-page-jelly-how-to-use-dynamic-data-in-gevaluate

View solution in original post

1 REPLY 1

Sitrix
Tera Guru

Seems its not possible due to evaluate being processed on load. 

If interested, it was answered here- https://stackoverflow.com/questions/74823398/ui-page-jelly-how-to-use-dynamic-data-in-gevaluate