[jboss-user] [JBoss Seam] - Re: Question on using @DataModelSelection & open a page in a

lle do-not-reply at jboss.com
Thu Dec 21 14:02:30 EST 2006


Here are some relevant code snippet:
main.xhtml (page with datatable and show details link):

  | <ui:define name="secondNav">		
  | <div class="actionButtons clearfix">			
  | <div class="button separator"><s:link target="account" view="/account/details.xhtml" action="#{detailsearch.findSessions}" value="Account Detail" onclick="openDetailWindow();return false;"  /></div
  | </div>
  | <div class="decorativeElement"/>
  | </ui:define>
  | <ui:define name="listing">		
  | <t:dataTable id="sessionTable" forceId="true" var="sess" value="#{alertsList}" border="0" cellpadding="0" cellspacing="0" styleClass="listView" width="100%" renderedIfEmpty="true" forceIdIndexFormula="#{sess.id}" org.apache.myfaces.dataTable.ROW_ID="#{sess.id}" rowIndexVar="rowIndex" rowOnClick="selectRow(this.id, #{rowIndex});" >
  | <t:column width="20px">
  | <f:facet name="header"></f:facet>
  | <t:htmlTag value="span" styleClass="icon-viewed">V</t:htmlTag>
  | </t:column>
  | <t:column width="72px">
  | <f:facet name="header">
  | <a4j:commandLink action="#{alertssearch.sortRisk}" value="Risk"/>
  | </f:facet>
  | <t:div styleClass="#{sess.styleClass}">
  | <t:htmlTag value="p">
  | <h:outputText value="#{sess.risk}">
  | <f:convertNumber maxFractionDigits="3"/>
  | </h:outputText>
  | </t:htmlTag>
  | </t:div>
  | </t:column>
  | <t:column width="80px">
  | <f:facet name="header">Account</f:facet>#{sess.account}</t:column>
  | <t:column width="80px" styleClass="rightDoubleBorder">
  | <f:facet name="header">Session</f:facet>#{sess.kvalue}</t:column>
  | <t:columns value="#{alertssearch.sessionDisplayProperties}" var="prop" style="#{alertssearch.colStyle}">
  | <f:facet name="header">#{prop.propDef.displayName}</f:facet>
  | <h:outputText value="#{prop.firstParam.value}" styleClass="#{prop.styleClassForAlert}" rendered="#{not empty prop.firstParam}"/></t:columns>
  | <t:column styleClass="doubleBorder">
  | <f:facet name="header">Date</f:facet>
  | <h:outputText value="#{sess.timestamp}">
  | <f:convertDateTime pattern="MM/dd/yyyy"/>
  | </h:outputText>
  | </t:column>
  | </t:dataTable>
  | </ui:define>
alertsearch action class:
@Name("alertssearch")
  | @Scope(ScopeType.SESSION)
  | @GALoggedIn
  | public class GASessionSearchAction {
  | 	
  | 	@In
  | 	private Session gadb;
  | 	@In(create=true) @Out
  | 	private GAFilter sessionfilter;
  | 	@In
  | 	private GAHostAppInfo hostApp;	
  | 	@In
  | 	private FacesMessages facesMessages;	
  | 	@Logger
  | 	private Log log;
  | 	@DataModel
  | 	private List<GASession> alertsList;
  | 	@DataModelSelection
  | 	@Out(required=false)
  | 	private GASession selectedSession;
  | ...
  | }
detailsearch action class:

  | @Name("detailsearch")
  | @Scope(ScopeType.CONVERSATION)
  | public class GAAccountDetailsAction {
  | 	
  | 	@In
  | 	private Session gadb;
  | 	@In
  | 	private GAHostAppInfo hostApp;	
  | 	@In
  | 	private FacesMessages facesMessages;	
  | 	@Logger
  | 	private Log log;
  | 	@DataModel
  | 	private List<GASession> sessionList;
  | 	@DataModelSelection
  | 	@In @Out
  | 	private GASession selectedSession;
  | ...
  | }

Thanks a lot.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995696#3995696

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995696



More information about the jboss-user mailing list