This content has been marked as final.
Show 5 replies
-
1. Re: Default value for inputText and inputTextarea
cash1981 Jul 28, 2010 3:20 AM (in response to delarue)Constructors won't work in Seam like that.
Instead you should use the @Create method
@Create public void startup() { setXml(Messages.instance().get("messages.sample")); }
-
2. Re: Default value for inputText and inputTextarea
cash1981 Jul 28, 2010 3:22 AM (in response to delarue)Also to output something from the message file in the xhtml pages you should do like this:
messages['messages.sample']
-
3. Re: Default value for inputText and inputTextarea
delarue Jul 28, 2010 3:37 AM (in response to delarue)Thank's for reply.
I don't understand where to put the
messages['messages.sample']
in this xhtml snippet
<s:decorate id="XmlDecorate" template="layout/edit.xhtml"> <ui:define name="label">Flux xml à parser</ui:define> <h:inputTextarea required="true" id="xml" rows="10" cols="80" value="#{XPathExtractor.xml}" /> </s:decorate>
Toward the @Create annotation, don't you agree that defaulting a value for sample purpose should be better at View side, thus JSF, xhtml rather that at the Model side in the java code ?
regards
-
4. Re: Default value for inputText and inputTextarea
cash1981 Jul 28, 2010 3:42 AM (in response to delarue)
christophe delarue wrote on Jul 28, 2010 03:37:
Thank's for reply.
I don't understand where to put themessages['messages.sample']
in this xhtml snippetYou can put it anywhere.
#{messages['foo.bar']} or in h:outputText h:outputText value="#{messages['foo.bar']}"
christophe delarue wrote on Jul 28, 2010 03:37:<s:decorate id="XmlDecorate" template="layout/edit.xhtml"> <ui:define name="label">Flux xml à parser</ui:define> <h:inputTextarea required="true" id="xml" rows="10" cols="80" value="#{XPathExtractor.xml}" /> </s:decorate>
Toward the @Create annotation, don't you agree that defaulting a value for sample purpose should be better at View side, thus JSF, xhtml rather that at the Model side in the java code ?
regardsNo I always put default values on the server side (Java code)
-
5. Re: Default value for inputText and inputTextarea
delarue Jul 28, 2010 7:22 AM (in response to delarue)Ok thank's, I'll follow this convetion to default in the java code.
Btw the messages was to much. the correction version is :
@Create public void startup() { setXml(Messages.instance().get("sample")); }