AnswerHub Upload Issue
Our AnswerHub community currently has a bug that prevents you from attaching your model or other files to your questions. AnswerHub is aware of this issue and they are working on a fix. Until we receive their patch, you can upload your models and other files to FlexSim's file share site. Include the file name in your question so that we know which upload to reference.

question

Anutt K avatar image
0 Likes"
Anutt K asked Anutt K commented

Use GUI for Create Flow Item by edit field Automatically.

Hello. I'm try to use GUI for create flow item by use edit field. I have question it can be possible to create item for Automatically.

Case 1 :

Type a text in edit field then press "Enter" key on keyboard. Then Flow Item will be create in Queue.

- Exam : Type "Box" in edit field and ENTER. A "Box" will be create in Queue.

Case 2 :

Type a text in edit field then time delay for 1-2 Second. Then Flow Item will be Create in Queue.

- Exam : Type "Box" in edit field then time delay for 1-2 Second. Then "Box" will be Create in Queue. (Automatically)

1659431677764.png


Thank You so much for help me and Knowledge Sharing.


FlexSim 22.1.1
guiflow items
1659431677764.png (263.2 KiB)
5 |100000

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

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Anutt K commented

Add the 'OnKeyDown' event to the edit field (Select 'All Attributes' in the attributes list on the bottom left to see it there). Then add the following code.

'lastkeydown()' returns the number code of the key that was pressed last (13 == "Enter", Lists of these codes can be easily found on the Internet). If that is the case, an item with the same name in the FlowItemBin as the entered text is created in the model and moved into Queue1.

1659439317201.png


1659439317201.png (30.5 KiB)
· 9
5 |100000

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

Thank You to reply me. I not found the Attribute "enterDown" and "evenfunction" like a picture.

1659668400442.png

But I found "OnKeyDown" and Add to lower of tool tip and test form yourcode and this error.

I think that because it don't have "enterDown" and "evenfunction".

1659668738309.png

It error when I,m try to type the item name such a Box.

1659668784572.png

1659668798960.png

0 Likes 0 ·
1659668400442.png (33.2 KiB)
1659668738309.png (819.4 KiB)
1659668784572.png (443.9 KiB)
1659668798960.png (716.5 KiB)
'enterDown' was a node I experimented with, you can ignore that. 'eventfunctions' also seems to be unnecessary, since the code is triggered for you.

The error tells you that the variable type 'String' is unknown. The correct type is 'string' with a small s (Note how the other variable types are bolded in the code, yet 'String' is not)

The case also matters for the Flow Item name you enter into the field. There is no item called 'box', only ' Box'.
0 Likes 0 ·
Anutt K avatar image Anutt K Felix Möhlmann ·

Excellent it work. Now I can create item by edit flow item name in field and press enter. Thank You very much.

1659715609914.png

And I have a few one more questions.

How can we text in edit field and wait for few second then item will create for automatically.

Exam. Type the "Box" in edit field >> Waiting for 3 second >> After 3 second box will created in Queue.

(I try to upload my model for share it but when I'm upload file it tell me something went wrong. try again)

0 Likes 0 ·
1659715609914.png (454.7 KiB)
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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