-
1. Re: passing value from selectOneMenu
pmuir Feb 19, 2008 9:53 PM (in response to boki)<h:selectOneMenu id="categories"required="true" value="#{prodManager.selectedId}"> <s:selectItems value="#{prodManager.allCategories}" var="category" label="#{category.name}" itemValue="#{category.catId}" /> </h:selectOneMenu>
And, take a look at <s:convertEntity />
-
2. Re: passing value from selectOneMenu
boki Feb 19, 2008 10:03 PM (in response to boki)Thanks, Pete.
Is there a way to simply pass that id w/o convertEntity? In case of convertEntity, I believe I would need to use TransactionalSeamPhaseListener, right? For now, I'd like to avoid that. -
3. Re: passing value from selectOneMenu
pmuir Feb 19, 2008 10:10 PM (in response to boki)If you are using Seam 2.0.1 then what I posted will work, otherwise, you are better off using <f:selectItems /> I guess. If you are using Seam2, then you are using Seam Managed Transactions anyway.
-
4. Re: passing value from selectOneMenu
wachtda.scsi.gmx.ch Feb 26, 2008 1:57 PM (in response to boki)Hello Pete
If I try to implement your example, I get this error:
13:32:05,234 WARN [lifecycle] executePhase(PROCESS_VALIDATIONS 3,com.sun.faces.context.FacesContextImpl@8ce5fe) threw exception javax.faces.FacesException at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:108)
13:32:05,250 ERROR [ExceptionFilter] exception root cause java.lang.IllegalArgumentException at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:166)
My View:
<h:form> <h:selectOneMenu id="functions" required="true" value="#{facilityAction.functionID}"> <s:selectItems value="#{facility.functions}" var="function" label="#{function.functionIndication.labelKey}" itemValue="#{function.ID}" /> </h:selectOneMenu> <h:commandLink action="#{facilityAction.selectFunction}">Test</h:commandLink> </h:form>
My Bean:
private String m_FunctionID; public void selectFunction() { System.out.println("Function: " + m_FunctionID); } public String getFunctionID() { return m_FunctionID; } public void setFunctionID(String p_FunctionID) { m_FunctionID = p_FunctionID; }
What could be the reason for this error?
Any hints? Thank you for helping... -
5. Re: passing value from selectOneMenu
pmuir Feb 27, 2008 12:14 PM (in response to boki)Whole stack trace please.
-
6. Re: passing value from selectOneMenu
boki Feb 27, 2008 4:38 PM (in response to boki)I implemented Pete's suggestion without any problems, so I can only assume it is something else in your code, but without looking at the stack trace or the whole code it is not easy to see what it may be.
-
7. Re: passing value from selectOneMenu
wachtda.scsi.gmx.ch Feb 28, 2008 3:54 PM (in response to boki)Hello Pete and Bojan
Thank you for answering...
I just get it working now.
It was a mistake in the Bean.Greetings