• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Send Ajax request to refresh dataTable

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a dropdown and a dataTable in the page

everytime i change value in the dropdown, i have to hide dataTable in the page, which is NOT working

what i observed is that change in the value for drop down, i can send ajax request only to hide and display individual components like textbox

what it's not working for the dataTable

It MIGHT work(i am not sure, still haven't tried), if i use a4j:outputPanel, but if i use this one then for every ajax request in that page refreshes the dataTable, which i don't want
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What it sounds like you should be doing is updating the datatable based upon the selection
from the menu, i.e. select Department A, get list of employees from department A. I don't
get the show/hide thing, this sounds like a javascript hangover.

Do something like this:



Try this.

Brendan.
 
naveen gupta
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
after selecting the value from dropdown, i will click on "Search" button to show the list in dataTable
I am displaying the results only after clicking on the search button and not after selecting the value in drop down


What i want to do is send ajax request based on the change of value selected from dropdown
and the ajax request basically hides the dataTable

Brendan, you understood correctly

But your solution is not working for me ( i am using RichFaces for your information )
 
naveen gupta
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it resolved. Following is the code

<a4j:outputPanel id="dataRegion" ajaxRendered="true" >
<rich:panel rendered="#{rTestBean.pclist}">

</rich:panel>
</a4J:outputPanel>


The mistake i was doing was

<a4j:outputPanel id="dataRegion" ajaxRendered="true" rendered="#{rTestBean.pclist}">
<rich:panel >

</rich:panel>
</a4J:outputPanel>
 
Brendan Healey
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[I wasn't correct as it turns out - the last reply wasn't there when I typed this in]

Ok, I think I know what the problem is:



You are not including execute= for the selectOneMenu, am I correct?
This is only a guess as you've not posted any code.

Regards,
Brendan.
 
naveen gupta
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hhhmm......

you are using JSF 2.0 and i am using JSF 1.2, so for AJAX functionality i am using RichFaces

 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic