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
      JDeveloper Studio Edition Version
      Build JDEVADF_11.

      Call to BTF#2:
      <task-flow-call id="change-workcenter-state">
            <input-parameter id="__29">
            <input-parameter id="__31">
            <input-parameter id="__33">
            <input-parameter id="__30">
              <display-type id="__34">
      XML for af:selectManyCheckbox:
      <af:selectManyCheckbox value="#{bindings.SchedShopOrdersSeqAndPartsLOV1.inputValue}"
                        <f:selectItems value="#{bindings.SchedShopOrdersSeqAndPartsLOV1.items}"
        • 1. Re: What makes select items of Select Many Checkbox persist?
          Frank Nimphius-Oracle

          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.

          • 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.