Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to rendered a <tr:commandButton (trinidad) via ajax

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In order to rendered a button in a form I am using the onchange=this.form.submit();


Is there a more elegant why?
Meaning instead of using java script maybe I can use ajax ?
I know that there is the autoSubmit option but I didn’t succeed to implement it in my code

Thanks

 
Ranch Hand
Posts: 171
Spring Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Ajax is not only elegant way, it's more probably of dealing with performance. (Requesting only want we need, refresh will happen only on particular component). If you use form.submit() the whole form elements will be send with request and re-rendered which is not need as per your requirement.

<f:ajax render="which component id to be rendered" event="on which event" onevent="where to hit" />
 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one more questions regarding this issue:

The following example is working ok:


But when I change it to a <h:selectBooleanCheckBox> the rendered option is not working:


Do you know why ?


Thanks

 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic