Two Laptop Bag*
The moose likes JSF and the fly likes JSF + RichFaces not able to reRender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF + RichFaces not able to reRender" Watch "JSF + RichFaces not able to reRender" New topic
Author

JSF + RichFaces not able to reRender

Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

I want to show the contents of the dataTable on clicking of the button. The results are getting populated but the problem is that the headers of the table are coming on each display. I want to hide the dataTable before the user clicks on it and make it visible only when it has some results.

For this i did the following things:
1. <h:dataTable var="car" value="#{bean.carList}" id="searchTable"
bgcolor="#F1F1F1" border="1" cellpadding="5" cellspacing="3"
width="100%" rendered="#{bean.show}">

2. And i m setting this proprty to true on the click event. But hen also it is not getting visible.

Please help.


<h:dataTable var="car" value="#{bean.carList}" id="searchTable"
bgcolor="#F1F1F1" border="1" cellpadding="5" cellspacing="3"
width="100%" rendered="#{bean.show}">
<h:column>
<f:facet name="header" >
<hutputText value="Location"/>
</f:facet>
<hutputText value="#{car.location}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Model"/>
</f:facet>
<hutputText value="#{car.model}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Make"/>
</f:facet>
<hutputText value="#{car.make}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Consigner"/>
</f:facet>
<hutputText value="#{car.consigner}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Year"/>
</f:facet>
<hutputText value="#{car.year}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Auction Type"/>
</f:facet>
<hutputText value="#{car.auctionType}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Series"/>
</f:facet>
<hutputText value="#{car.series}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Color"/>
</f:facet>
<hutputText value="#{car.color}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="Odometer"/>
</f:facet>
<hutputText value="#{car.odometer}"/>
</h:column>

<h:column>
<f:facet name="header" >
<hutputText value="BodyStyle"/>
</f:facet>
<hutputText value="#{car.bodyStyle}"/>
</h:column>
</h:dataTable>


-----------------------------------------------------------------------
<a4j:commandButton value="Ajax Search" action="#{bean.search}" reRender="searchTable" />
-----------------------------------------------------------------------
public void search(){
this.show = true;
this.carList = CarInventory.getCarList();
}


My Blog SCJP 5 SCWCD 5
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

Do we have someone who can look into this.....
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

Hey got the problem solved.... i wrote everything in a panel and it worked..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF + RichFaces not able to reRender