-
1. Re: h:message for / s:decorate question
pmuir Oct 10, 2007 9:21 AM (in response to holgerprause)Fixed in JSF 1.2 - http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/h/inputText.html - use the label attribute.
-
2. Re: h:message for / s:decorate question
holgerprause Oct 10, 2007 9:36 AM (in response to holgerprause)I am using the js implementation coming with jboss-4.0.5.GA ()
i specified the label attribute on the inputText, still same behaviour.
Well guess ill try to update the jsf implementation libs on my jboss server
I realized that the newest myfaces implemenations are horrible slow so i tried to avoid an update.
Sigh ok ill post here when i am done with it , thx for your quick help pete. -
3. Re: h:message for / s:decorate question
pmuir Oct 10, 2007 9:58 AM (in response to holgerprause)You should use the JSF RI (1.2) - instructions in the ref manual for 1.2.1 on how to upgrade iirc.
-
4. Re: h:message for / s:decorate question
holgerprause Oct 10, 2007 10:28 AM (in response to holgerprause)Hello i update to the newest myfaces jar , same behaviour, i am currently
trying to upgrade to jsf-1.2_04-b07
but i get the error message
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
I guess i have to update the jboss server too.
I just want to upgrade the jars , damn its all so complicated oo.
Il post here if i get it to work -
5. Re: h:message for / s:decorate question
holgerprause Oct 10, 2007 11:08 AM (in response to holgerprause)If u want to upgrade to jsf 1.2 too, take a look here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=94738
I am switiching to last jboss server, i let u know if i get it (finally) to work. -
6. Re: h:message for / s:decorate question
holgerprause Oct 10, 2007 11:55 AM (in response to holgerprause)well i try also to get tomahawk working together with jsf ri.
wish me luck - good night -
7. Re: h:message for / s:decorate question
holgerprause Oct 10, 2007 12:44 PM (in response to holgerprause)Now i finally upgraded everything the behaviour is slightly better, but still not like expected:
I am using latest jsf ri implementation and jboss-4.2.1.GA
in my messages.propertiesmyInput=Label for my Inputfield
in my facelets page<h:inputText id="myInput" required="true" value="#{TestBean.value}" errorStyle="color:red" label="#{messages['myInput']}" /> <h:message for="myInput" />
The output should be:"Label for my Inputfield": Value required
but in fact it is:Value required
He seems to ignore the label attribute, and i am getting insane on this :-/
Pls help, well at least this behaviour is slightly better than before.
Do i really have to rewrite message tag to get this to work?
Thx very much ,
Holger -
8. Re: h:message for / s:decorate question
christian.bauer Oct 10, 2007 1:01 PM (in response to holgerprause)Man, just configure your messages.properties file - there are many examples and documentation - and override the message. Done.
-
9. Re: h:message for / s:decorate question
holgerprause Oct 10, 2007 1:11 PM (in response to holgerprause)I dont think u got it right, my message properties file is just as it should, the
entry that should be used as label is there and configured.
Its just the h:message tag in combination with the h:inputText tag that just dont work together.
The code i posted (the 2 lines) are so simple, well what can i do/is wrong, its just like in the documentation, i spent a whole day on this. -
10. Re: h:message for / s:decorate question
holgerprause Oct 10, 2007 1:50 PM (in response to holgerprause)Well finally i found out how to(semi dirty workaround in my opinion)
Dont override the required message in your messages.properties
It will take effect for all your input fields where required is specified
When u got an internet application with just 1 form field thats maybe an solution
Instead specify the requiredMessage attribute on inputText tag<h:inputText id="myInput" requiredMessage="#{messages['inputLabel']}: #{messages['javax.faces.component.UIInput.REQUIRED']}" value="#{TestBean.value}" required="true" /> <h:message for="myInput" />
Do the same for validation and converter messages, if your validator or converter outputs different message u got a problem becourse the decision what error message to output have to be made in the facelet via the
validatorMessage attribute.
From jsf 1.2 api
...will be used as the text of the validator message, replacing any message that comes from the validator.
The problem on this approach is the you override the default messages coming from the pre defined validators.
Maybe its all working in your enviroment better.
Well anyway i like seam but i dont like jsf
Bye and thx,
Holger -
11. Re: h:message for / s:decorate question (cause of the proble
holgerprause Oct 10, 2007 3:00 PM (in response to holgerprause)Well first of all sorry to all for the confusion.
First of all 1 thing:
1) its working like expected (upgrade to jsf 1.2 and use label attribute )
I was so sure that my message template(generated from redhat developer studio) was the same like in the jsf implementation and that i am doing everything right, but that was wrong.
//from generated messages_en.properties
javax.faces.component.UIInput.REQUIRED=value is required
//from jsf impl.jar
javax.faces.component.UIInput.REQUIRED={0}: Validation Error: Value is required.
so why i thought that label attribute is ignored was that missing
{0}: in my properties file
christian.bauer@jboss.com wrote:
Man, just configure your messages.properties file - there are many examples and documentation - and override the message. Done.
When i read this i was so angry course i was so absolutly sure that it has nothing to with the properties file and that i was treated like a noob.
Well what to say, chrisitan was absolutly right :-)
I am such a damn noob(i admit it).To my excuse - that was a simple but mean little problem.
Sorry again for spamming forum.
But let me say this at least : i still dont like jsf. XD
Thx very much its finally working all and me very happy now.
With best regards / whishes (Dont give up - its mostly worth it)
Holger