| Author |
Send Ajax request to refresh dataTable
|
naveen gupta
Ranch Hand
Joined: Apr 12, 2006
Posts: 129
|
|
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 utputPanel, but if i use this one then for every ajax request in that page refreshes the dataTable, which i don't want
|
 |
Brendan Healey
Ranch Hand
Joined: May 12, 2009
Posts: 218
|
|
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
Joined: Apr 12, 2006
Posts: 129
|
|
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
Joined: Apr 12, 2006
Posts: 129
|
|
it resolved. Following is the code
<a4j utputPanel id="dataRegion" ajaxRendered="true" >
<rich:panel rendered="#{rTestBean.pclist}">
</rich:panel>
</a4J utputPanel>
The mistake i was doing was
<a4j utputPanel id="dataRegion" ajaxRendered="true" rendered="#{rTestBean.pclist}">
<rich:panel >
</rich:panel>
</a4J utputPanel>
|
 |
Brendan Healey
Ranch Hand
Joined: May 12, 2009
Posts: 218
|
|
[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
Joined: Apr 12, 2006
Posts: 129
|
|
hhhmm......
you are using JSF 2.0 and i am using JSF 1.2, so for AJAX functionality i am using RichFaces
|
 |
 |
|
|
subject: Send Ajax request to refresh dataTable
|
|
|