[jboss-user] [JBoss Seam] - Re: @In (create=true)

blackers do-not-reply at jboss.com
Thu Jun 7 08:21:44 EDT 2007


In the end to get it working i duplicated TeamHome.java and renamed the original too.

Now i have HomeTeamHome.java and OppTeamHome.java

with seam names 

@Name("homeTeamName")
&
@Name("oppTeamName")

respectively.

With a few changes to TeamList.xhtml, TeamList.page.xml, GameEdit.xhtml and GameEdit.page.xml (based on the versions generated by seam gen) I got the desired result.


GameEdit.page.xml

  | <param name="oppTeamTeamId" value="#{oppTeamHome.teamTeamId}"/>
  | <param name="homeTeamTeamId" value="#{homeTeamHome.teamTeamId}"/>

GameEdit.xhtml
(changes in bold/red)
<div class="actionButtons">
  |             <s:button value="Select Away Team"
  |                        view="/TeamList.xhtml">
  |                 <f:param name="from" value="GameEdit"/>
  | 		<f:param name="forOppTeam" value="1"/>
  |             </s:button>
  |         </div>
  | 

and

<div class="actionButtons">
  |             <s:button value="Select Home Team"
  |                        view="/TeamList.xhtml">
  |                 <f:param name="from" value="GameEdit"/>
  | 		<f:param name="forHomeTeam" value="1"/>
  |             </s:button>
  |         </div>


TeamList.page.xml

<param name="forOppTeam"/>
  | <param name="forHomeTeam"/>


TeamList.xhtml


<s:link view="/#{empty from ? 'Team' : from}.xhtml" 
  |                    value="#{team.teamName}" 
  |                       id="team" rendered="#{not empty forOppTeam}">
  |                 <f:param name="oppTeamTeamId" value="#{team.teamId}"/>
  |             </s:link>
  | 				<s:link view="/#{empty from ? 'Team' : from}.xhtml" 
  |                    value="#{team.teamName}" 
  |                       id="team" rendered="#{not empty forHomeTeam}">
  | 			<f:param name="homeTeamTeamId" value="#{team.teamId}"/>
  |             </s:link>


There is probably a nicer way to do the last block without making 2 separate links and only rendering the appropriate one based on the forXXXXTeam value being used. But my JSF knowledge is pretty minimal at the moment. A rendered attribute for the f:param tag would have been nice.  

Thanks for all of your help

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

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



More information about the jboss-user mailing list