views:

11

answers:

1

We've got h:selectOneMenu that receive the value from a thirdparty thirdpartyObj.type (got a get and set) thirdpartyObj.type.codeName (got only a get and the set is called toCodeName instead) The list of option is given by the thirdpartyService codeNameBean.codeNameList (the type of the object)

    <h:selectOneMenu id="currentType" value="#{client.thirdpartyObj.Type}">
        <f:converter converterId="codeNameConverter" />
        <f:selectItems value="#{codeNameBean.codeNameList}" />
        <a4j:support event="onchange" reRender="previous" ajaxSingle="true" />
    </h:selectOneMenu>

I'm trying to make a converter with these value, since it not working I created a get thirdpartyObj.getCodeName and setcodeName and created a converter for codename with string.

Is there any other way to do this, can it all be done in the converter instead?

A: 

It's unclear what problem you have with it since you didn't tell anything about the occurred errors. At least, the converter will be applied on the value of the h:selectOneMenu and on each item represented by the value of the f:selectItems. So they both needs to be of the same type. It's namely a common mistake to think that it applies on the value of the h:selectOneMenu only.

BalusC