Hi dushyant,

thanks for response -

which value I should return in getAsString method? - actual Key
element or Value element? - because the selectOneItem is populated by
SelectItem's elements.

and why in debug I see that getAsString method is being called for N
times (over all elements in binded array)?

2008/11/7 dushyant agarwal <[EMAIL PROTECTED]>:
> In case of selection,  the getAsObject would convert the selected value as 
> specified and send it to BB. In getAsString() method you again have to 
> specify some code to change the BB value into one of the values in the 
> selectItem list, bound to the selectOneMenu component.
>
>
>
> --- On Fri, 7/11/08, Anton Gavazuk <[EMAIL PROTECTED]> wrote:
>
>> From: Anton Gavazuk <[EMAIL PROTECTED]>
>> Subject: Re: confused about selectOneItem and converter and data binding
>> To: "MyFaces Discussion" <[email protected]>
>> Date: Friday, 7 November, 2008, 3:41 PM
>> Guys,
>> does anyone have any idea?
>>
>> 2008/11/6 Anton Gavazuk <[EMAIL PROTECTED]>:
>> > Hi all,
>> >
>> > have a problem
>> >
>> > I have the JSF Bean dataBean with property complexprop
>> - the type of
>> > field is ComplexType
>> > I want to set an certain property to the bean via
>> selectItems, which
>> > is being collected from the
>> anotherDataBean.selectItems - it returns
>> > array of SelectItems.
>> >
>> > so it looks like
>> >
>> > <!--page-->
>> > <h:selectOneMenu id="in_property"
>> value="#{dataBean.complexprop}">
>> >        <f:selectItems
>> value="#{anotherDataBean.selectItems}"/>
>> >        <f:converter
>> converterId="geoConverter"/>
>> > </h:selectOneMenu>
>> >
>> > Of course it wouldnt not work because JSF would try
>> convert the String
>> > value from UI to internal dataBean.complexprop type
>> and vice versa so
>> > I added the converter
>> > But I cannot understand how to work properly with it -
>> during the call
>> > the method is being called for count =
>> selectItems.size()
>> > Converter.getAsString(FacesContext facesContext,
>> UIComponent
>> > uiComponent, Object o)
>> >
>> > What could be wrong?
>> >
>> > How to link together all such things?
>> >
>
>
>      Add more friends to your messenger and enjoy! Go to 
> http://messenger.yahoo.com/invite/
>

Reply via email to