<f:loadBundle var="varMyBundle" basename="org.acme.Bundle"/>
<h:inputtext ...>
<s:commonsvalidator type="required" arg="#{varMyBundle.lblUserName
}".....
is this code working with shale.1.0.4 version? can you verify it?
because, my code exactly same as above.. it's working with 1.0.2 version but
not with 1.0.4 version... there is no problem with my bundles.. because i
can see its value in a <h:outputtext>... like:
<h:outputtext value="#{varMyBundle.lblUserName}" .../>
hasan...
On 2/23/07, Gary VanMatre <[EMAIL PROTECTED]> wrote:
>From: "Hasan Turksoy" <[EMAIL PROTECTED]>
>
> this is not a dynamically changing value.. it is simply
> internationalization!... instead of hard coding the field's name, i am
> binding it to my bundle.. so that i can internationalize my app by using
> bundles for my all messages, labels, field names, etc...
>
I see, then there should not be a problem. The following should work as
expected as long as there is a properties file supporting the locale.
<f:loadBundle var="varMyBundle" basename="org.acme.Bundle"/>
<h:inputtext ...>
<s:commonsvalidator type="required" arg="#{varMyBundle.lblUserName
}".....
> hasan...
>
Gary
>
> On 2/23/07, Gary VanMatre wrote:
> >
> > >From: "Hasan Turksoy"
> > >
> > > hi all,
> > >
> > > commonsvalidator's "arg" argument used as the first argument of
messages
> > at
> > > validator-rules.xml... in my application, i'm using those "arg"
> > arguments to
> > > hold some info(in general field's name) about my field which is
being
> > > validated....
> > > it's like:
> > >
> > >
> > >
> > > above code works as expected and gives appropriate validation
message if
> > > that field is not valid (like: "User Name is required.")
> > >
> > > But, if i bind my "arg" argument to a key in my bundle, my message
is
> > being
> > > as "null is required.".. sample code is as below;
> > >
> > >
> > > > > />
> > > I dive into code and find the problem & solution...
> > ValidatorTag class is
> > >
> > > setting "arg" argument's value directly instead of evaluating the
> > expression
> > > and putting the resulting value into it... Some of the arguments
> > ("type",
> > > "message", "client", "server") are early binding at the tag class
but
> > not
> > > "arg" argument...
> > >
> > > shouldn't the "arg" argument set by early binding as above
attributes?
> > isn't
> > > this an issue?
> > >
> >
> > I'm curious as to why the value from the resouce bundle doesn't exist
at
> > the point the JSP tag is processed?
> >
> > The reason for the late binding of the attributes is to handle the
case
> > where the component is in a dataTable and the validation arguments
need to
> > be changed for each row in the table.
> >
> > I guess I just never thought there would be a usecase were someone
wanted
> > to dynamically change the name of an input field on a form. Is that
the
> > scenario you are talking about? Why do you need late binding on the
"arg"
> > property?
> >
> >
> >
> >
> > > regards,
> > >
> > > hasan..
> > > http://www.jroller.com/page/hasant
> >
> >
> > Gary