5 Replies Latest reply on May 21, 2007 9:58 AM by Mihai Anescu

    @Embeddable question

    Mihai Anescu Newbie


      We're trying to use an @Embeddable class in our project. It's a seam generated project, but we keep our entities and modify the views as needed.

      So, we have a ABC @Embeddable class which has one field

      private String name;

      And this class is embedded into another, XYZ.

      On the interface i have a field:
      <s:decorate id="ABCNameDecoration" template="layout/edit.xhtml">
       <ui:define name="label"><h:outputText value="#{messages['XYZ.ABCName.label']}" /></ui:define>
       <h:inputText id="ABCName"
       value="#{xyzHome.instance.ABC.name}" title="#{messages['XYZ.ABCName.tooltip']}">
       <a:support event="onblur" reRender="ABCNameDecoration"/>

      The page renders ok, but when i try to edit/add an entity and put some value into this field I get a validation error:
      value could not be converted to the expected type

      No error shows up in the log, even on debug mode.

      I browsed the forum and found somewhere something about needing a converter for this entity. I also found some examples on how to build a custom JSF converter. So, my questions are:
      1) is there a doc on how to do custom converters on seam (what needs to be configured and so on)
      2) If my ABC class has 5 fields, all rendered on the page of the owing entity (XYZ) as separate fields, do I need 5 converters, one for each field????
      Tnx, I wait for your reply...