How to make a worklist payload field mandatory (required)
496350Nov 11 2008 — edited Nov 13 2008Hi,
I wasted already hours in making a worklist payload field mandatory.
In the generated simple form artefacts I can see the "onsubmit, pointing to validateData(this)" funciton on the form tag in my page-body.jsp:
<form id="PayloadJSPHTML" name="PayloadJSPHTML"
action="<%=Constants.UPDATE_SERVLET_NAME%>" method="post"
onsubmit="return validateData(this)">
The related js function can be found under <ORACLE_SOA_HOME>/bpel/samples/hw/worklistapp/js/wlFormValidate.js and looks as follows:
function validateData( aForm )
{
for( var i = 0; i < aForm.elements.length; i++ )
{
var name = trim(aForm.elements.name);
var value = trim(aForm.elements[i].value);
var type = trim(aForm.elements[i].dataType);
var required = trim(aForm.elements[i].required);
if (required && !value) {
alert("Required field: " + getReadableName(name));
return false;
}
if (type && name) {
if( ! validate(trim(value), trim(type)) )
{
alert("Invalid format: " + getReadableName(name));
return false;
}
}
}
return true;
}
So I set "required=true" by hand on my input field which should be mandatory.
Running the application ignores successfully my settings. I added alert messages into the validateForm function, which are not displayed.
I also tried to insert a myValidateData(this) function in the payload-body.jsp and assign it in the onsubmit function. Also this function seem not to be called.
In setting the xml schema attributes to minOccures="1" nillable="false" does not help eighter.
It seems that there is no support in making a workflow payload field mandatory. Or, I am already blind?
Please name me a working solution.
Thx & BR,
Peter