How to get inserted value in Edit box in Dashboard?

How to get inserted value in Edit box in Dashboard?

martin_k5
Not applicable
36 Views
4 Replies
Message 1 of 5

How to get inserted value in Edit box in Dashboard?

martin_k5
Not applicable

[ FlexSim 23.2.3 ]

Hi,

I would like to ask, how can I get the inserted value in Edit box in GUI. I know how it can be done in dashboard, but the same approach doesn't work in GUI.

I can get the edit boxe's reference and when using the "getviewtext()" function, an empty String/value is returned although the value is inserted.


Thank you

0 Likes
Accepted solutions (1)
37 Views
4 Replies
Replies (4)
Message 2 of 5

dhakshna9AYUP
Explorer
Explorer
Accepted solution

Hi @Martin K5, As you mentioned, using getviewtext() will return the value entered in the edit box. You have to pass the reference of the edit box as a parameter.

screenshot-2024-05-03-162700.png


Editbox.fsm

Message 3 of 5

martin_k5
Not applicable
Hi,


thank you for your replay. When I try to replicate this approach, only an empty string is returned. I also tried running your model and the same happens.


Does anyone know why is that?

Thank you.

0 Likes
Message 4 of 5

logan_gold
Community Manager
Community Manager
Hey @Martin K5, I was able to input text in the GUI of the example model and get that text returned in the Script window. After opening the example model, the GUI canvas did not open along with the GUI Builder Tools window. So I first had to open the canvas through the Toolbox by double clicking on "GUI 1".


Since the canvas opens in editing mode, I also had to click on it and push F5 on the keyboard to change it to the regular viewing mode. But once in viewing mode, I could type in any text in the edit field of the GUI and run the script to have that text returned.
Message 5 of 5

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Martin K5, was Dhakshna's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes