question

Martin K5 avatar image
0 Likes"
Martin K5 asked Jeanette F commented

How to get inserted value in Edit box in Dashboard?

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

FlexSim 23.2.3
guieditinserted value
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

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 0 ·

1 Answer

Dhakshna avatar image
1 Like"
Dhakshna answered Logan Gold commented

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


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Martin K5 avatar image Martin K5 commented ·
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 0 ·
Logan Gold avatar image Logan Gold ♦♦ Martin K5 commented ·
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.
1 Like 1 ·