question

Hoang Nk avatar image
0 Likes"
Hoang Nk asked Hoang Nk commented

Problems with dashboard combobox options when using in webserver

Hello folks,

I'm having a bit of a problem when using GUI widgets in webserver.

Like the title, I'm using a combobox like this in a dashboard:1712243108114.png

The combobox options are like the following pic, the idea is that the combobox provides a list of location id which can be selected for the crane to travel to.

1712243170601.png

The OnSelect trigger for this combobox is set as the following code, which simply assert an option value into the label "GUI_loc" of the Crane16

/**Custom Code*/
int selNr = get(itemcurrent(c));
treenode link = node("..>objectfocus+", c);
double loc_id = items(c).subnodes[selNr].value;
TaskExecuter Crane = Model.find("Crane16");
Crane.labels["GUI_loc"].value = loc_id;

Everything works just fine when I tested it locally, selected the option and the crane's label was changed accordingly. However, when I run the model on webserver, an exception was thrown in when the combobox was selected.

1712243458467.png

Could anyone give me some ideas on the differences between using this feature on local drive and on webserver?

Much appreciate :)

Hoang

FlexSim 23.1.3
webservercombobox
1712243108114.png (3.5 KiB)
1712243170601.png (10.8 KiB)
1712243458467.png (20.7 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

·
Jacob Gillespie avatar image
0 Likes"
Jacob Gillespie answered Hoang Nk commented

@Hoang Nk

It's bug that we fixed in FlexSim 24.1, the changeValue code sets itemcurrent to the value instead of the selected index.

You probably will want to set the values of the combobox back to the default (1, 2, 3, ...) then in the OnSelect trigger translate that index into a value from another array or table.

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

Hoang Nk avatar image Hoang Nk commented ·
thank you for your help. As I'm not yet able to upgrade the system to 24.1 I will probably have to do as you suggested.
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.