1 Reply Latest reply on Nov 8, 2007 11:37 AM by Pete Muir

    Clearing entity field through a selectOneMenu

    Erik Hellman Newbie

      I have a selectOneMenu that contains a list of entities. When selecting an entry in the list and submitting the form, the selected entity will be set as a reference in another entity (i.e., the entity we are editing).

      Now, if I want to clear this reference using the selectOneMenu, how would I do then? Currently, my JSF-page looks like this:

      <h:selectOneMenu value="#{edt.workShift}" styleClass="thinSelectMenu" required="false" rendered="#{emt.editMode}" >
       <s:convertEntity />
       <s:selectItems value="#{workShifts}" var="workShift" label="#{workShift.name}" noSelectionLabel="-"/>
      </h:selectOneMenu>


      It doesn't work adding a custom entry with an empty value. Any suggestions on how to solve this?

      // Erik