[jboss-user] [JBoss Seam] - Re: ClassCastException with @DataModel

tony.herstell@gmail.com do-not-reply at jboss.com
Sun May 6 06:40:19 EDT 2007


This might have helped... (scope page)

  |     // Used to diaply the final choices in the menu section
  |     @DataModel(value="finalKeywordsDatamodel", scope=ScopeType.PAGE)
  |     private LinkedHashSet<Keyword> finalKeywordsSet;
  | 
  |     // Used to diaply the final choices in the menu section
  |     @DataModel(value="finalCategoriesDatamodel", scope=ScopeType.PAGE)
  |     private LinkedHashSet<Category> finalCategoriesSet;
  | 

But what really got me out of the poo was NOT using @DataModelSelection!


Use EL instead and pass in the selected item (if you can) as a parameter as I have shown below (action="#{keywordsStepController.deleteKeyword(eachKeyword)}"):



  |     @DataModel(value="keywordsDatamodel", scope=ScopeType.PAGE)
  |     private LinkedHashSet<Keyword> keywordsSet;
  | 



  | <h:dataTable var="eachKeyword" value="#{keywordsDatamodel}" rendered="#{keywordsDatamodel.rowCount>0}">
  | 
  | 	<h:column>
  | 		<f:facet name="header">
  | 			<h:outputText value="#{messages.keyword}" />
  | 		</f:facet>
  | 		<h:outputText value="#{eachKeyword.keyword}" />
  | 	</h:column>
  | 
  | 	<h:column>
  | 		<h:commandButton value="#{messages.button_delete}"	
  | 	action="#{keywordsStepController.deleteKeyword(eachKeyword)}"/>
  | 	</h:column>
  | </h:dataTable>
  | 


I didnt put this in Jira.. but I could not get DataModelSelection to work for me!

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

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



More information about the jboss-user mailing list