-
1. a4j:ajax inside rich:dataTable
snaker May 6, 2011 4:11 AM (in response to nikh123123)Maybe if you use a jsFunction for load a table, only have to put the attribute "status" status="nameStatus"
and later cretate the status
<a4j:status name="nameStatus" onstart="#{rich:component('Loading')}.show();" onstop="#{rich:component('Loading')}.hide();" />
-
2. a4j:ajax inside rich:dataTable
nikh123123 May 9, 2011 3:26 AM (in response to snaker)@Kike I'm Sorry for this late reply. Yes I'm aware of this method. I wanted something like
1. when the grid is rendered, it should show a loading image inside.
2. When the data is fetched, if the data is empty, show a message like "No data". If the data is not empty, show the data. By this time the image should be gone.
Here's what I did
1. assigned a loading image as a background for the class rf-dt-nd
2. called the a4j:jsFunction on dom ready of page
3. on completion of a4j:jsFunction, if there's no data, replaced the text inside rf-dt-nd-c classes with "No data" and removed the background image. Both with jQuery.
4. If there's data, i didnt need to do anything as it does not render rf-dt-nd class at all
-
3. a4j:ajax inside rich:dataTable
snaker May 9, 2011 4:05 AM (in response to nikh123123)there is an example in demo richfaces about jquery
something like this:
<rich:jQuery selector=".table1 tr" event="mouseover" query="jQuery(this).addClass('activeRow')" />
<rich:jQuery selector=".table1 tr" event="mouseout" query="jQuery(this).removeClass('activeRow')"/>.activeRow{
background-color: lightyellow;/*Moccasin*/
cursor: pointer;
}Do you need something like this??
-
4. a4j:ajax inside rich:dataTable
ilya_shaikovsky May 9, 2011 8:45 AM (in response to nikh123123)Here's what I did
1. assigned a loading image as a background for the class rf-dt-nd
2. called the a4j:jsFunction on dom ready of page
3. on completion of a4j:jsFunction, if there's no data, replaced the text inside rf-dt-nd-c classes with "No data" and removed the background image. Both with jQuery.
4. If there's data, i didnt need to do anything as it does not render rf-dt-nd class at all
that sounds like valid approach actually. So on which state you having a problem?
-
5. a4j:ajax inside rich:dataTable
nikh123123 May 9, 2011 9:54 AM (in response to ilya_shaikovsky)@Ilya and @Kike,
Sorry I should have made it clear in my last reply itself - the approach which I took does work , but I just wanted to share it here
And now that its been confirmed by @Ilya, I'm glad to know that I'm on the right track! Thanks both!
PS: In case anyone trying this later on, need to remember that noDataLabel needs to be kept " " i.e. a space. Otherwise the rf-dt-nd class and its subclasses will never get rendered.