In code set up the listing behavior with:
@DataModel
private List locationList;
@DataModelSelection
private Location selectedLocation;
your jsp code could look like: I'm not sure about xhtml
<h:dataTable value="#{locationList}" var="location"
rendered="#{locationList.rowCount>0}"
rowClasses="rvgRowOne,rvgRowTwo" headerClass="rvgOrder">
<h:column>
<f:facet name="header">
<h:commandLink value="#{msg.Location_id}"
action="#{locationFinder.reorder}">
<f:param name="orderBy" value="id"/>
</h:commandLink>
</f:facet>
<h:outputText value="#{location.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:commandLink value="#{msg.Location_street}"
action="#{locationFinder.reorder}">
<f:param name="orderBy" value="street"/>
</h:commandLink>
</f:facet>
<h:outputText value="#{location.street}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:commandLink value="#{msg.Location_city}"
action="#{locationFinder.reorder}">
<f:param name="orderBy" value="city"/>
</h:commandLink>
</f:facet>
<h:outputText value="#{location.city}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:commandLink value="#{msg.Location_state}"
action="#{locationFinder.reorder}">
<f:param name="orderBy" value="state"/>
</h:commandLink>
</f:facet>
<h:outputText value="#{location.state}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:commandLink value="#{msg.Location_zip}"
action="#{locationFinder.reorder}">
<f:param name="orderBy" value="zip"/>
</h:commandLink>
</f:facet>
<h:outputText value="#{location.zip}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:commandLink value="#{msg.Location_opentime}"
action="#{locationFinder.reorder}">
<f:param name="orderBy" value="opentime"/>
</h:commandLink>
</f:facet>
<h:outputText value="#{location.opentime}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:commandLink value="#{msg.Location_closetime}"
action="#{locationFinder.reorder}">
<f:param name="orderBy" value="closetime"/>
</h:commandLink>
</f:facet>
<h:outputText value="#{location.closetime}"/>
</h:column>
<h:column>
<f:facet name="header"><h:outputText
value="#{msg.Action}"/></f:facet>
<h:commandButton action="#{locationSelector.select}"
value="#{locationSelector.buttonLabel}"/>
</h:column>
</h:dataTable>
then in your method locationSelector.select:
public String select() {
locationEditor.setInstance(locationFinder.getSelection());
locationEditor.setNew(false);
return "editLocation";
}
the editLocation string return will be used by the page flow to identfy the
page to display: Here is an example from the faces-config.xml file
<!-- navigation rules for com.devx.res.example.Location -->
<navigation-rule>
<navigation-case>
<from-outcome>editLocation</from-outcome>
<to-view-id>/editLocation.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>selectLocation</from-outcome>
<to-view-id>/findLocation.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>findLocation</from-outcome>
<to-view-id>/findLocation.jsp</to-view-id>
</navigation-case>
</navigation-rule>
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3936599#3936599
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3936599
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user