• haritha gowrugari
    November 22, 2017 at 4:26 am #4815

    Hi All,

    I    have to set Maxlength to TextArea

    please provide a solution to this

    Ex: I have to  allow <=2000 chars

    on input  i am  using   return potential.length<=2000;

    but while copypaste more than 2000 chars  it has to trim extra chars s and allow 2000 chars .  for this scenario   return potential.length<=2000 not working


    Haritha Gowrugari.




    SPARK Support
    November 27, 2017 at 9:18 am #4823

    Hi Haritha,

    The return statement passes true or false back to the the On Input event handler.  If the return is false, then the value of the Text Area will not be set to the potential value.

    What you are looking to accomplish is to set the value of the Text Area to a substring of the potential when the length is greater than a certain number of characters.  For this, use me.setData():


    The reason that I use setData(“”) first is to clear and potential and current value from the state variables before setting the value to the substring of potential.  This way, the logic will evaluate the new potential if the user attempts to type or paste additional characters.


    Stephen P.

    Daniel Estrada
    May 29, 2018 at 12:01 pm #5167


    Dont know if this is solved or not.. but im posting an issue. I have tried the solution and it works Ok. The problem right now i think is that the “On Input” event of the text Area control is not working as expected. Im using BPM 8.6 with BPM UI 8.6 and i need to unfocus then focus and write for the script to execute.

    Anyone knows if this is the correct behavior?



    Daniel Estrada

    SPARK Support
    June 20, 2018 at 10:52 am #5197

    Hi Daniel,

    Try this example:

    1. Add a Text control and Output Text control to a CSHS

    2. Add this code to the On Input event: ${Output_Text1}.setData(potential.length);

    You should note that the Output Text will display the length without losing focus from the Text control.


    Stephen P.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search