8 Replies Latest reply: May 25, 2012 6:37 AM by grodno RSS

    problem setting SelectOneChoice by Id with init values upon dialog popups

    grodno
      Hi,

      it works when setting by values since description is exposed in the binding.
      how do i set value by Id?
      i'd like to set inital values for selectOneChoice when a popup shows up.
      No problems with InputText :-), but soc1.setValue(initVal) sets the relevant to null :-(
      please help what am i doing wrong?

      on page there is a selectiOneChoice in a dialog
      <af:popup id="p1"
      binding="#{backingBeanScope.backing_dca.p1}"
      popupFetchListener="#{backingBeanScope.backing_dca.editPopupFetchListener}"
      popupCanceledListener="#{backingBeanScope.backing_dca.editPopupCancelListener}"
      contentDelivery="lazyUncached">
      <af:dialog id="d2" type="okCancel" title="Создание реестра DCA" resize="on"
      inlineStyle="height:319px; width:480px; border-color:Blue; border-style:double;"
      dialogListener="#{backingBeanScope.backing_dca.editDialogListener}"
      contentWidth="460">
      ...
      <af:selectOneChoice value="#{bindings.RefDcaView11.inputValue}"
      label="Агентство" required="#{bindings.RefDcaView11.hints.mandatory}"
      binding="#{backingBeanScope.backing_dca.soc1}"
      shortDesc="#{bindings.RefDcaView11.hints.tooltip}"
      id="soc1">
      <f:selectItems value="#{bindings.RefDcaView11.items}" id="si1"/>
      </af:selectOneChoice>
      ...
      in backing bean
      public void editPopupFetchListener(PopupFetchEvent popupFetchEvent) {
      ...
      oracle.jbo.domain.Number dcaId=new oracle.jbo.domain.Number(row.getAttribute("DcaId").toString());
      soc1.setValue(dcaId);