-
1. Re: Problem in displaying data in Richface DataTable
mp911de Jun 28, 2011 2:50 PM (in response to jayesh_rhds)Hi Jayesh,
have you defined your Class as Managed Bean? (JSF 1.x: faces-config.xml, JSF 2.0: @ManagedBean, @SessionScoped (for example) annotations in your Class).
Best regards,
Mark
-
2. Re: Problem in displaying data in Richface DataTable
jayesh_rhds Jun 29, 2011 7:26 AM (in response to mp911de)Hi,
A very strange thing happenned. Yesterday the whole day i was tried to run it by changing codes, face-config, republishing etc but it didn't run. Today the first thing i did was open up the app and run it and there it was, running very well, displaying all the data. earlier whne i changed the static content, it did reflect in the web page, so publishing was working.
Anyhow now i have to implement sorting but the moment i click in the sort header, nothing happens except that the URL is appended by a # sign. Here is the sorting class which i have defined:
package demo; import org.richfaces.component.SortOrder; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.bean.SessionScoped; @ManagedBean @ViewScoped @SessionScoped public class sorting { private SortOrder capSort = SortOrder.unsorted; public void sortByCaps(){ if (capSort.equals(SortOrder.ascending)) { setCapSort(SortOrder.descending); } else { setCapSort(SortOrder.ascending); } } public SortOrder getCapSort() { return capSort; } public void setCapSort(SortOrder capSort) { this.capSort = capSort; } }
And the modified xhtml page is as below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:form> <rich:dataTable value="#{AList.myArr}" var="capt" id="table"> <rich:column sortBy="#{capt}" id="name" sortOrder="#{Sort.capSort}"> <f:facet name="header"> <a4j:commandLink value="Sort by Name" render="table" action="#{Sort.sortByCaps}" /> </f:facet> <h:outputText value="#{capt}" /> </rich:column> </rich:dataTable> </h:form> </ui:composition>
Kindly help me with this...
Edit Note: In IE, I am getting a warning error on bottom-left of the browser which on clicking displays 'RichFaces' is undefined. Its a warning error though.
-
jsfHello.rar.zip 3.0 MB
-