Hello,
first of all ill explain what i want to do and then let me ask if its possible with seam
look at the following code, it displays an error message for an input field
| <h:inputText id="myInput" required="true"
value="#{TestBean.value}" errorStyle="color:red" />
| <h:message for="myInput" />
|
This will produce the following output:
"myInput":Value required
The thing is that if you use the "for" attribute of a <h:message> tag
It will display the id of the inputText in the resulting error message
"myInput":Value required
Thats a very very ugly behaviour becourse:
1) if you want to support internationalization you have to localize the ids!(id should be
unique and identify sth, and an id is not a label! - very very bad idea) or you have to
use <h:messages> to display all messages-
2) i use the ids for updating issues, i cant localized them and ids cant contain spaces,
as i already said in point 1 its very stupid design(in my opinion)
I whish it could be like this
| <h:inputText id="myInput" required="true"
value="#{TestBean.value}" errorStyle="color:red"
label="#{messages['myInput']}" />
| <h:message for="myInput" />
|
So what to do now?
My question is: Is this possible to either get rid of the id string in the error
message(and still use the for attribute) or to localize the id part of the error
message(without actually changing the value of the id attribute) without programming
anything ?
(Just with the seam s:message or h:message tags)
OR
Do i have to programm my own inputText and message implementation?
(And how to start with that).Will s:decorate still work with my own implementation(i doubt
it) ?
Hmm just some words on JSF:
I am using jsf for a while now and i am wondering if any of the designers actually use
their own framework, such simple things(and many many more) are not possible, very
inflexible and far away from daily work, seriously....
JSF sucks but whats worse, JSF is best Java Web Framework currrently.
Anyway thx for your help, and it could all be worse ^^
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093483#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...