business-process-managementibm-bpm

IBM BPM Coach - Disabling button immediately when an empty value is there in Decimal View Text Field


With Plain Text views I am able to do that by writing this code in on input event -

if (potential.trim() == "") {
    ${Button3}.setEnabled(false);
}
else{
${Button3}.setEnabled(true);
}

I don't know what potential means here in BPM but this works for Plain Text Views. However when I try on change event in Decimal View Text field this doesn't work. In html inspector console I see -

Potential reference not found.

Is there any Potential like thing available for Decimal Views also?


Solution

  • Judging by the documentation and looking at in on an 8.6 version it seems like 'potential' is an additional parameter available to the Plain Text control.

    With that in mind, I don't think there is an equivalent for the Decimal view as it doesn't have an "On input" event available. You could, however, get something close to the same behavior using the "On Change" or "On blur" events of the Decimal view to check the binding value. If it's been set to null you could disable the button.

    While that doesn't meet your exact requirement of immediate feedback, it does appear to work quickly enough that even if the user attempts to click the button without "committing" change to the Decimal input (meaning the cursor is still in the Decimal input field and they haven't pressed return) that the change and visibility settings happen first so the button won't execute.