-
1. Re: I don't get how @In and @Out work
kenclark Apr 22, 2009 3:54 PM (in response to kenclark)I believe I have worked around this in the past by using a java bean type object instead of the direct usage of a String.
So instead of the above, I would do:
@Out(scope=ScopeType.CONVERSATION,required=false)
@In (required=false)
private MyBean myBean;
where MyBean has an attribute customDataValidValuesText with getters and setters, and then update the page code as:
<h:inputTextarea value="#{myBean.customDataValidValuesText}" rows="6" cols="30"
rendered="#{customDataConfiguration.customDataType.customDataTypeCode=='select'}"/>
Is this a proper workaround? Can anyone explain why this is necessary?
Thanks,
ken -
2. Re: I don't get how @In and @Out work
gonorrhea Apr 22, 2009 6:42 PM (in response to kenclark)typically there is a getter/setter public method for each HtmlInput* control.
also, b/c a SFSB has CONVERSATION as default scope, the @Out does not need to explicitly define CONVERSATION b/c it defaults to the scope of the component.
also note that outjection only occurs if the public method completes successfully...
-
3. Re: I don't get how @In and @Out work
kenclark Apr 22, 2009 7:48 PM (in response to kenclark)Thanks for the response.
Arbi Sookazian wrote on Apr 22, 2009 18:42:
typically there is a getter/setter public method for each HtmlInput* control.I am not sure what you are saying here?
also note that outjection only occurs if the public method completes successfully...In this case, its the injection that does not work as I expect (I get nulls, even though I have entered text in the text area connected to my injected attribute)
Thanks,
ken -
4. Re: I don't get how @In and @Out work
gonorrhea Apr 22, 2009 10:01 PM (in response to kenclark)you need to read a Seam book, ref doc or look at the booking example source code.
in backing bean:
public void setCustomDataValidValuesText(String foo){ this.customDataValidValuesText = foo; } public String getCustomDataValidValuesText(){ return customDataValidValuesText; }
in .xhtml:
<h:inputTextarea value="#{customDataAction.customDataValidValuesText}"/>
in the value attribute EL, you must always reference the Seam component name, followed by dot operator (for invoking methods), followed by context variable name (JSF/Seam will invoke the appropriate getFoo() or setFoo() method depending on phase of JSF cycle).
e.g., value=#{componentName.myMethod}
The exception to this rule is if you're using the @DataModel to outject a ListDataModel for a dataTable component. Then the following is allowed:
<rich:dataTable value="#{myList}" var="foo"/>