5 Replies Latest reply: Jan 28, 2013 10:35 PM by Nadir RSS

    Struggling with SPEL

    Nadir
      Hi

      I have a region which is being displayed in a workflow notification. There is a radio button with two values e.g. A and B.

      There is an Lov input e.g. Person. Person's 'Required' property is ${oa.ItemsRequestsVO1.xxPersonRequired}

      and 'Disabled' property is ${oa.ItemsRequestsVO1.xxPersonDisabled}

      Radiobutton has firePartialAction action type and calls an event. Event calls handleRadioButton method. Here is handleRadioButton :

      public void handleRadioButton(String radioValue) {
      OAViewObject pVO = (OAViewObject)getItemsRequestsVO1();
      OARow row = (OARow)pVO.getCurrentRow();
      if("B".equals(radioValue)) {
      row.setAttribute("xxPersonRequired", "no");
      row.setAttribute("xxPersonDisabled", Boolean.TRUE);
      }
      else{
      row.setAttribute("xxPersonRequired", "yes");
      row.setAttribute("xxPersonDisabled", Boolean.FALSE);
      }
      }

      When I open notification, A is selected, Person is required. When I select B, Person is still enabled and required. Could anyone figure out why on selecting B, person doesn't become disabled and not required?

      JDeveloper version 10.1.3.3.0
        • 1. Re: Struggling with SPEL
          Neo_
          Hi
          Nadir,


          you Use SOP(system.out.println) to check whether u get right value and is xxPersonRequired Transient attribute or what data type? .


          Regards
          Azad
          • 2. Re: Struggling with SPEL
            ShrawanSri
            Hi Nadir,

            Replace ur code with the code given below:-


            public void handleRadioButton(String radioValue) {
            OAViewObject pVO = (OAViewObject)getItemsRequestsVO1();
            if(pVO!=null)
            {
            pVO.setMaxFetchSize(0);
            }
            Row row = (Row)pVO.createRow();

            if(row!=null)
            {
            pVO.insertRow(row);
            if("B".equals(radioValue)) {
            row.setAttribute("xxPersonRequired", "no");
            row.setAttribute("xxPersonDisabled", Boolean.TRUE);
            }
            else{
            row.setAttribute("xxPersonRequired", "yes");
            row.setAttribute("xxPersonDisabled", Boolean.FALSE);
            }
            }
            }

            Best Regards,
            • 3. Re: Struggling with SPEL
              Nadir
              It is still same. When I select B, 'A value must be entered for "Person" ' still appears and person is enabled.
              • 4. Re: Struggling with SPEL
                ShrawanSri
                Try to set Disable server side validation and Client Side validation to true for RadionButton.
                • 5. Re: Struggling with SPEL
                  Nadir
                  The messagebox doesn't appear but the person field/input still doesn't become disabled.

                  Is there something like SPEL doesn't work when a Region is called/displayed inside a notification ?

                  If it wasn't in a notification, I could have validated the person field from Submit button. Since the region is inside a notification and I am unable to modify the default approve and reject buttons of the notification.