incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lessard" <simon.lessar...@gmail.com>
Subject Re: Custom Converter not getting called
Date Fri, 10 Nov 2006 17:42:35 GMT
Hmmm let me think...

You could override the renderers, but this is tedious for something looking
so trivial... Did you try an empty String value by any chance? I'm not sure
of the behavior, that could be a potential solution... Also, what kind of
component are we talking about? Trinidad's select* components have an
unselectedLabel (unselectedText?) or something attribute (gee I really gotta
learn all those attribute names by heart).

I never quite understood why the spec did that with converters and null
values...


Regards,

~ Simon


On 11/10/06, David Brunette <David.Brunette@chordiant.com> wrote:
>
>
>     Aha... I think you've got it right, Simon.  I had not tried it with
> a non-null value yet.  I just set a default value for myProperty and
> tried it again.  Sure enough, the converter was called as expected.
>
>     Other than using required="true", is there a way to get the
> converter to be called with a null value when the page is rendered?  If
> I can't do that, then the only other option I can think of for my
> scenario is to have TWO components on the page (one that renders the
> value, and another that renders "--"), and set the rendered="" attribute
> accordingly so that only one is shown based on the value being null or
> not-null.  This works, but it does not seem very clean to me.
>
> Dave
>
> -----Original Message-----
> From: Simon Lessard [mailto:simon.lessard.3@gmail.com]
> Sent: Friday, November 10, 2006 12:07 PM
> To: adffaces-user@incubator.apache.org
> Subject: Re: Custom Converter not getting called
>
> I think that's might be your issue. Did yo utest with a non-null value
> to
> see if the converter get called? I'll check the spec but I think null
> never
> get converted nor validated except for "required=true" fields.
>
> On 11/10/06, David Brunette <David.Brunette@chordiant.com> wrote:
> >
> >
> >     Great, thanks for confirming the client-side stuff for me.
> >
> >     Yes, 'myProperty' is a String.  I am not trying to convert from
> one
> > type to another, just trying to change the value if needed (i.e., if
> the
> > value is null, then display the String "--" instead).
> >
> > Dave
> >
> > -----Original Message-----
> > From: Adam Winer [mailto:awiner@gmail.com]
> > Sent: Friday, November 10, 2006 11:45 AM
> > To: adffaces-user@incubator.apache.org
> > Subject: Re: Custom Converter not getting called
> >
> > No, you shouldn't be required to do anything differently at all.
> > If there's no client converter, it eliminates client-side validation
> > for that element, but that's it.
> >
> > BTW, is myProperty of type String?  There might be a bug
> > where Strings aren't getting passed through Converters.
> >
> > -- Adam
> >
> >
> > On 11/9/06, David Brunette <David.Brunette@chordiant.com> wrote:
> > >
> > >
> > >      Hi everybody.  I am trying to create and use a custom converter
> > > that will change the value for an inputText based on some criteria.
> I
> > > have written the Java class (implementing Converter), and setup the
> > > configuration in my faces-config.xml.  With the following test,
> > > everything worked just as I expected it to work:
> > >
> > >
> > >
> > > <h:inputText label="The Property:" value="#{myBean.myProperty}">
> > >
> > >    <f:converter converterId="converter.MyStringValueConverter" />
> > >
> > > </h:inputText>
> > >
> > >
> > >
> > >      But when I change that test to use a <tr:inputText /> instead
> of
> > > the regular JSF <h:inputText />, my custom converter was not being
> > > called when the page is rendered.  Is there anything that I need to
> do
> > > different to get this to work with a Trinidad inputText if it
> already
> > > works for a regular JSF inputText?  I know that Trinidad has the
> > > capability to have client-side converters and validators, but I am
> > > simply trying to use my same, simple converter class with the
> Trinidad
> > > component.  If I am using the Trinidad component, am I forced to use
> a
> > > client-side converter?
> > >
> > >
> > >
> > >      Thanks...
> > >
> > >
> > >
> > > Dave
> > >
> > > The information transmitted herewith is sensitive      information
> of
> > Chordiant Software or its customers and is intended only for use to
> the
> > individual or entity to which it is addressed. If the reader of this
> > message is not the intended recipient, you are hereby notified that
> any
> > review, retransmission, dissemination, distribution, copying or other
> > use of, or taking of any action in reliance upon, this information is
> > strictly prohibited. If you have received this communication in error,
> > please contact the sender and delete the material from your computer.
> > >
> > >
> > The information transmitted herewith is sensitive      information of
> > Chordiant Software or its customers and is intended only for use to
> the
> > individual or entity to which it is addressed. If the reader of this
> message
> > is not the intended recipient, you are hereby notified that any
> review,
> > retransmission, dissemination, distribution, copying or other use of,
> or
> > taking of any action in reliance upon, this information is strictly
> > prohibited. If you have received this communication in error, please
> contact
> > the sender and delete the material from your computer.
> >
> The information transmitted herewith is sensitive      information of
> Chordiant Software or its customers and is intended only for use to the
> individual or entity to which it is addressed. If the reader of this message
> is not the intended recipient, you are hereby notified that any review,
> retransmission, dissemination, distribution, copying or other use of, or
> taking of any action in reliance upon, this information is strictly
> prohibited. If you have received this communication in error, please contact
> the sender and delete the material from your computer.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message