javascript - IBM BPM how to handle keypress events in Coach Views -


i familiar html, css , javascript , have written small apps using angular , ionic.

now working ibm bpm coach views , tries make simple coach view input field (bound string variable) , button.

i have button disabled (in bpm language: read only) long field empty, when user starts type in field, button should become enabled. have bound visibility of button string variable.

i have searched around , seems cannot find simple examples of controlling visibility based on keypress events in bpm.

all have seen examples dojo components , dijit widgets , bit above head. expect there must (relatively) simple way of doing 20-40 lines of javascript in either “inline javascript” section or in 1 (or more) of “event handlers” on behavior tab in coach view designer in ibm bpm 8.5.6. (it opens in browser window because coach view runs in client side human service).

does have such simple example.

i suggest following approach.

  1. create 1 custom coach view (lets cv1).
  2. within cv1 drag ibm bpm provided input text cv (give control id name "inputtext").
  3. within cv1 drag ibm bpm provided button cv (give control id name "button").
  4. within inline js or load event of cv1 write following code.

    // input text elment var inputtext = dojo.query("data-viewid['inputtext']",this.context.element); var button = dojo.query("data-viewid['button']",this.context.element);  //make button disabled default  button.setattribute('disabled', true);   //key press event on input text  inputtext.on("keydown", function(event) { //write custom logic on key press button.setattribute('disabled', false); }); 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -