Download Developing Business Processes with Oracle Business Process
Transcript
Multiple Choice
}
if(next2.clicked)
{
step2.expanded = false;
step3.expanded = true;
}
Multiple Choice
This rule makes the appropriate input text controls visible depending on the choice a
user makes in a radio option controls searchChoice.
if (searchChoice.value == 'Organizations')
{
orgname.visible = true;
firstname.visible = false;
lastname.visible = false;
clientId.visible = false;
}
else if (searchChoice.value == 'Individuals')
{
orgname.visible = false;
firstname.visible = true;
lastname.visible = true;
clientId.visible = false;
} else if (searchChoice.value == 'Client ID')
{
orgname.visible = false;
firstname.visible = false;
lastname.visible = false;
clientId.visible = true;
}
Dynamic Options
Select control options (radios, check boxes, dropdowns, T/F) can be set dynamically
using rules rather than statically using the control's options property. However if the
control comes from an XSD schema data source rather than one of the standard palette
controls, then the designer must take care to not set the options to something outside
of what is valid for that schema element.
For example if your XSD has a string enumeration and list valid options as 'red',
'green', and 'blue', then you should not use a rule to dynamically set the options to
'small', 'medium', 'large'. If you do then your form will not work correctly in use mode.
If a user selects the option 'small' they will get a validation error on the form. This is
because 'small' is not one of the options allowed by your underlying XSD schema.
Triggers and Dynamic Options
This rule is executed when the user clicks the trigger controls with Name ''search''.
It then dynamically sets options on a dropdown list control with Name coffeeShopList.
if (search.clicked)
{
coffeeShopList.options = ['Koffee', 'Starbucks', 'Willoughbys', 'Dunkin
Donuts']; }
Now replace the hard coded list of coffee shops with a rule that invokes an http.get.
This must return an X-JSON header which containing a JSON object. The object is
Web Form Rules Examples C-13