gsftsubmit not calling the UI action from UI macro

kumvipin
Mega Contributor

Have written a simple code section in the UI Macro to call the gsftsubmit, not sure why its not calling the UI action.

in a further debug in chrome it seems to be calling the gsftSubmit function of SN and going till f.submit() but doesn't gets into UI Action.

For a simple debug just wrote gs.log in ui action.

<script>
function moveTo(str)
{
alert('moveTo 1');
//var form = document.getElementById("change_request.do");
var form = gel("change_request.do");
gsftSubmit(null, form, 'ss_move_to');
//gsftSubmit(null, form, 'sysverb_update');
alert('moveTo 2');

}

</script>
1 ACCEPTED SOLUTION

kumvipin
Mega Contributor

Thanks all for your kind replies and time got the issue it was nothing wrong in the way the code was written.


Sometime we devs are bit impatient the old code was cached not sure for some reason. cache.do helped


View solution in original post

9 REPLIES 9

kumvipin
Mega Contributor

yes using it as exact name, to simplify the code have simplified the code further.


Client Script where the script looks like this.


function onLoad() {


    //Type appropriate comment here, and begin script below    


}




function moveTo(str)


{


  alert('moveTo 1');


  g_form.setValue('description', 'This is from the Client Script.');


  gsftSubmit(null, g_form.getFormElement(), 'ss_move_to');


  //gsftSubmit(null, g_form.getFormElement(), 'sysverb_update');


  alert('moveTo 2');


}



The UI Action is again with the action name ss_move_to


action.setRedirectURL(current);

current.update();



Now if i call this button via form on click it updates the changes. But when called via gsftSubmit


First try with the below script in XML field,


function moveTo(str)


{


alert('moveTo 1');


gsftSubmit(gel('ss_move_to'));


}



if it is not working ,write the same code in client script field.


Anurag Tripathi
Mega Patron
Mega Patron

instead fo


gsftSubmit(null, form, 'ss_move_to');



try


g_form.save();


-Anurag

kumvipin
Mega Contributor

Thanks all for your kind replies and time got the issue it was nothing wrong in the way the code was written.


Sometime we devs are bit impatient the old code was cached not sure for some reason. cache.do helped


The snnipet of code which i am using


gsftSubmit(null, g_form.getFormElement(), 'ss_move_to');

This was in earlier code was commented and first var form was used to contain this value.


But as said please check cache.do as sometime it didnt happened for some reason when i tried this in incident.



Again thanks all for responses and really great to see this forum is very responsive.