javascript - Issue in submitting form through tr:commandButton - POST request is not generated -


in jsf 1.2 application, i'm using trinidad extended service addscript functionality invoke javascript function.

i can see following javascript console logs js method being called. post request not being generated. there're many other(normal)buttons in page working without issues. there no js errors in console. i've ensured included pages don't have forms , form.

and biggest headache is, working fine in local workspace , i've problems while hitting application url directly. happening across ie versions.

can suggest issue?

in bean:

facescontext facescontext = facescontext.getcurrentinstance();                       extendedrenderkitservice service = service.getrenderkitservice(                                   facescontext, extendedrenderkitservice.class);                       service.addscript(facescontext, “clickhiddenbutton();”); 

javascript:

function clickhiddenbutton () {       if(null != console)             console.log('before calling hidden button close');       document.getelementbyid('hiddenbutton').click();       if(null != console)             console.log('after calling hidden button close');  } 

my page hidden button component:

<tr:commandbutton id="hiddenbutton" action="#{bean.actionhidden}" immediate="true"></tr:commandbutton>                                                                                                                                                                   

it's working after made method pause 500 milliseconds before clicking hidden button following code. probably, not right approach(that's why haven't accepted answer). believe explain issue clearly.

function clickhiddenbutton () {       settimeout('clickhiddenbuttonafterdelay()',500)  }     function clickhiddenbuttonafterdelay() {           if(null != console)                 console.log('before calling hidden button close');           document.getelementbyid('hiddenbutton').click();           if(null != console)                 console.log('after calling hidden button close');      } 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -