This discussion is archived
5 Replies Latest reply: Jan 28, 2013 8:35 PM by Nadir RSS

Struggling with SPEL

Nadir Newbie
Currently Being Moderated
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_ Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    Try to set Disable server side validation and Client Side validation to true for RadionButton.
  • 5. Re: Struggling with SPEL
    Nadir Newbie
    Currently Being Moderated
    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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points