incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hane <chrish...@gmail.com>
Subject <f:selectItems/> and Empty value
Date Wed, 25 Apr 2007 15:34:39 GMT

This works great!  Sometimes though I want to have a "blank" selection in 
the drop down.  I've tried to put a null into the returned list for 
<f:selectItems/>; but that generates an NPE during page generation.

Can I use this mechanism if it includes a "blank" value or do I have to 
write a custom converter and use passthru="true" for this use case?

Thanks,
Chris....


Adam Winer wrote on 6/26/2006:
 > Yes, it's the expected behavior.  By default, we don't send
 > values of selectItems to the client - just indices.  If you
 > really want the values, then set passthru="true" on the
 > selectOne/selectMany.
 >
 > Among the advantages of the indexed values approach
 > is that you don't need a converter, and can therefore trivially
 > use complex objects as values of selectItems.
 >
 > -- Adam
 >
 >
 >
 > On 6/26/06, Martin Koci <[EMAIL PROTECTED]> wrote:
 > > I have simple form:
 > > <h:form>
 > > <af:selectOneChoice id="idSubComitee"
 > > value="#{s012modelId.publicationWGBlockModel.insertDto.idSubComitee}">
 > >         <f:converter converterId="javax.faces.Long"/>
 > >         <f:selectItems value="#{comiteeciselnik.selectItems}" />
 > > </af:selectOneChoice>
 > >
 > > <af:commandButton text="OK"/>
 > > </h:form>
 > >
 > > But instance of org.apache.myfaces.adfinternal.convert.LongConverter or
 > > javax.faces.convert.LongConverter is never called after clicking OK
 > > button.  h:selectOneMenu works fine in same case.
 > >
 > > Is that expected behavior?
 > >
 > > Thanks,
 > >
 > > Martin
 > >
 > >
 > >
 > >
 > >
 > >
 >

Mime
View raw message