2 Replies Latest reply on May 10, 2013 4:27 PM by Arie Morgenstern

    What makes select items of Select Many Checkbox persist?

    Arie Morgenstern
      I have one Bounded Task Flow (BTF#1) calling another Bounded Task Flow (BTF#2) (XML below). BTF#2 has a .jspx page (A.jspx) that is displayed as an inline popup, and a Task Flow Return component. That is it, very simple.

      On A.jspx is an af:selectManyCheckbox which is bound to a View Object (XML below). The View Object is queried using a beforePhase call to a backing bean method.
      <f:view beforePhase="#{backingBeanScope.backing_orders.prepScreen}">
      When the user goes from BTF#1 to BTF#2 and to A.jspx, the View Object queries fine. No problem. User makes his/her selection, and presses a CommandButton. The CommandButton calls a method using the ActionListener property, and the Action property calls a Control Flow Case to the Task Flow Return component. No problem here either.

      When the user does other things in the Application, then navigates back to A.jspx, using the call from BTF#1 to BTF#2, the View Object bound to the af:selectManyCheckbox is requeried, potentially displaying different choices (and this works correctly). My problem is that some of the checkboxes remain checked.

      So, on the first time if the user checked choices #1 and #3, as an example; than choices #1 and #3 will be checked the second time, and any subsequent time in that session. Even when the View Object is refreshed with different data.

      I cannot figure out what type of problem this is, or how to even Google for assistance. Can you help?

      Another hint, if it is useful is this: if the user first selects choice #8, and on subsequent returns to A.jspx there are not 8 choices, a message in the Console log will appear:
      <SimpleSelectManyRenderer> <_getSelectedItems> Could not find value:8 of type:java.lang.Integer among list of SelectItems
      Thanks,
      Arie
      JDeveloper Studio Edition Version 11.1.1.6.0
      Build JDEVADF_11.1.1.6.0_GENERIC_111205.1733.6192.1





      Call to BTF#2:
      <task-flow-call id="change-workcenter-state">
            <task-flow-reference>
              <document>/WEB-INF/change-workcenter-state.xml</document>
              <id>change-workcenter-state</id>
            </task-flow-reference>
            <input-parameter id="__29">
              <name>newWorkCenterState</name>
              <value>#{pageFlowScope.changeStateTo}</value>
            </input-parameter>
            <input-parameter id="__31">
              <name>currentWorkCenterState</name>
              <value>#{pageFlowScope.currState}</value>
            </input-parameter>
            <input-parameter id="__33">
              <name>workCenterNo</name>
              <value>#{pageFlowScope.workCenterNo}</value>
            </input-parameter>
            <input-parameter id="__30">
              <name>clockNo</name>
              <value>#{pageFlowScope.clockNo}</value>
            </input-parameter>
            <run-as-dialog>
              <display-type id="__34">
                <inline-popup/>
              </display-type>
            </run-as-dialog>
          </task-flow-call>
      XML for af:selectManyCheckbox:
      <af:selectManyCheckbox value="#{bindings.SchedShopOrdersSeqAndPartsLOV1.inputValue}"
                                             binding="#{backingBeanScope.backing_orders.smc1}"
                                             id="smc1">
                        <f:selectItems value="#{bindings.SchedShopOrdersSeqAndPartsLOV1.items}"
                                       binding="#{backingBeanScope.backing_orders.si1}"
                                       id="si1"/>
                      </af:selectManyCheckbox>
        • 1. Re: What makes select items of Select Many Checkbox persist?
          Frank Nimphius-Oracle
          Hi,

          you open the second task flow as an inline popup if I am not mistaken. Obviously the component is not getting re-set properly and still keeps the select index (which causes the error because the new data does nit fit). I remember such an issue from a case where a POJO DC was used and the POJO collection did not have one of its attributes marked as the PK. You can do this on the data control that gets created for the POJO. You edit the collection (Data Control window, right mouse click on the collection, and then choose edit). Set one of the attributes to be the primary key- Though in the case from the past it was a table sorting issue this one here sounds familiar.

          Frank
          • 2. Re: What makes select items of Select Many Checkbox persist?
            Arie Morgenstern
            Frank, you are correct, it is an inline popup, and it is not getting reset properly, and it still keeps the select index. All that is correct.

            I needed to change the Bounded Task Flow. Went to the Property Inspector of the BTF, went to Behavior, went to Transaction, and changed it to "Always Begin New Transaction". To do that, I needed to also create two task-flow-returns, one for Commit and one for Rollback.

            I'm not sure if this was the exact best way to do it, but it worked for me. Solved my problem and provided me the results I was looking for.
            And I decided to use the mantra: the best solution is the one that works.

            Thanks,
            Arie