2 Replies Latest reply on Oct 12, 2007 4:49 PM by Pete Muir

    Problems with HtmlSelectOneListBox and EntityConverter added

    Markus Neubrand Newbie

      Hi,

      I try to add a SelectOneListbox, which uses the Seam EntityConverter, dynamically in a method of a EJB-Stateful-Session-Bean with the following code:

      HtmlSelectOneListbox headerHersteller2 = new HtmlSelectOneListbox();
      headerHersteller2.setId("edit_headerHersteller2");
      headerHersteller2.setSize(5);
      HtmlSelectItems headerFirmenItems = new HtmlSelectItems();
      ValueBinding vb = context.getApplication().createValueBinding("#{logins.firmenItems}");
      headerFirmenItems.setValueBinding("value", vb);
      headerFirmenItems.setVar("firma");
      headerFirmenItems.setValueBinding("label", context.getApplication().createValueBinding("#{firma.namen}"));
      headerHersteller2.getChildren().add(headerFirmenItems);
      headerHersteller2.setConverter(context.getApplication().createConverter("org.jboss.seam.ui.EntityConverter"));
      headerHersteller2.setValueBinding("value", context.getApplication().createValueBinding("#{logins.umgebung.solution.firma}"));
      


      The SelectOneListbox is added with the items as expected but there is no option preselected even tough the corresponding value for the ValueBinding #{logins.umgebung.solution.firma} is containing an object.

      I read through the FAQ of the Entity-Converter and marked the method adding the Listboxm with the @Begin-Annotation to ensure Seam is in a long-running conversation.

      Is there another setter i need to call on either the HtmlSelectOneListBox or the HtmlSelectItems (maybe the setValue()) ?

      I am using JBoss-4.2.1.GA and Seam-2.0.0.CR1.

      Thanks in advance.

      Regards

      Markus Neubrand