question

Przemyslaw Pasich avatar image
0 Likes"
Przemyslaw Pasich asked Przemyslaw Pasich edited

Display the graphical part of a Time Table using code

I would like to create the effect of popping up the graphical Time Table to the user using code.

I manage to get the desired Time Table to open using:

treenode timetable = Model.find("Tools/TimeTables/TimeTable1");
treenode viewnode = createview("VIEW:/pages/tools/TimeTable Parameters", timetable.getPath(), timetable.getPath());

However, the Time Table opens with its first tab called "Members" active. I would like to activate the "Table" tab so that its contents are visible before I request the feedback of the user using msg.

Investigating the tree structure of the resulting view suggests that changing the active tab by clicking on the GUI changes the value of the subnode:

viewnode.find("/tabcontrol>itemcurrent").value = 3;

but doing so using code is not enough - I'm still missing some kind of a redraw instruction. I tried:

  1. running the code on OnSelect subnode as following:
nodefunction(viewnode.find("/tabcontrol>OnSelect"))
  1. looking for any subnode named "PageOnOpen" (which is referenced in the OnSelect code) for more clues - but I didn't manage to locate it.

I am attaching a dummy model that demonstrates the behavior I'm intending on creating. Could you please suggest how to have the Time Table open with the "Table" tab active?

Open a Time Table with table tab active.fsm

FlexSim 24.0.0
flexscripttime tablesview tree
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

·
Arun Kr avatar image
0 Likes"
Arun Kr answered Przemyslaw Pasich edited

refreshview() will work.

treenode timetable = Model.find("Tools/TimeTables/TimeTable1");
treenode view_node = createview("VIEW:/pages/tools/TimeTable Parameters", timetable.getPath(), timetable.getPath()
 view_node.find("/tabcontrol>itemcurrent").value = 3;
refreshview(view_node);

open-a-time-table-with-table-tab-active_1.fsm


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

Przemyslaw Pasich avatar image Przemyslaw Pasich commented ·

Thanks Arun! Works as intended. Appreciate the immediate response!

0 Likes 0 ·

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.