cancel
Showing results for 
Search instead for 
Did you mean: 

Personas: HowTo: use a dynamic id of Text box?

Former Member
0 Kudos


Hi,

Normal way of write a msg to the Textbox using a script button would be:

   -> id-of-a-textbox

   Enter Value my-msg

Question:

If there are 2 text boxes, say Textbox1 and Textbox2. Would it be possible to write a msg to either Textbox1 or Textbox2 at the runtime?

Br,

Dong Zhu

Accepted Solutions (1)

Accepted Solutions (1)

chinthan_yajamaan
Active Contributor
0 Kudos

Hi Dong,

Can you explain a little bit about your requirement? Because as mentioned, you can do it with IF statements and since the ids are generated, it would not be easy to address these controls at runtime with ids.

Thanks

Chinthan

Former Member
0 Kudos

Hi,

What I meant is that when write a msg to a textbox in a Script Button, the id of the textbox can be represented by a variable so that at the runtime, whenever the value of the id variable changed, one can write msg to different target textbox using the same script.

-> changeable-id-of-a-textbox

   Enter Value my-msg

It seems that this is not possible so far. I was thinking to put the id into a textbox and read it there, but as long as the variable id is not allowed in script, there is no way to put different ids in the same script. Anyway, not a big deal.

Dong

Former Member
0 Kudos

The closest you can get right now is to store your own IDs for the text boxes in your variable and use IFs to write the the selected one:

IF args.textbox = "box1"

     Enter Value "message" "Personas/realid1"

IF args.textbox = "box2"

     Enter Value "message" "Personas/realid2"

and so on. Then change the value of your "textbox" variable to change where the message is written.

What you're asking for does make sense, and would be neater than this, but this at least lets you do what you're asking for.

As I keep saying a lot these days, you can do this properly in Personas v3.

Steve.

Former Member
0 Kudos

Thanks Steve. Seems it worthes updating to Personas v3. Close the discussion.

Br,


Dong

Answers (2)

Answers (2)

former_member189842
Participant
0 Kudos

This message was moderated.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can make a decision with using an IF condition which textbox to write the message into... but I'm sure you know this and I suspect you mean something different.

Maybe something like specifying the target textbox name with a variable? That's not possible as far as I'm aware.