button events in flexsim dashboard not working in Flexsim web server

button events in flexsim dashboard not working in Flexsim web server

vignesh_s
Not applicable
251 Views
8 Replies
Message 1 of 9

button events in flexsim dashboard not working in Flexsim web server

vignesh_s
Not applicable

[ FlexSim 21.2.3 ]

Flexsim software supports the dashboard button click events. But when using my flexsim model in Web server, the button click event in web server is not updating real time. Attached the demo video showing when using the button click from dashboards the web server doesn't reflect any changes but when reloading or coming back to same page shows the updated page. Since web pages needs a reload or ajax or jquery to accomplish the event reponse to get updated in the same page of button click what can be done to fix this in flexsim web server. please advice on this. close-current-dashboard-by-button_autosave.fsm

0 Likes
Accepted solutions (1)
252 Views
8 Replies
Replies (8)
Message 2 of 9

vignesh_s
Not applicable
Any updates on this would be really helpful please ?
0 Likes
Message 3 of 9

philboboADSK
Autodesk
Autodesk
Accepted solution

The FlexScript code you are firing on the button's press is closing the window on the server.

The view you are seeing in the browser is part of the client-side HTML. If you want to close that, you need to execute JavaScript on the client.

The client isn't going to get any updates about what has happened on the server unless you send it updates or refresh the page.

To close a dashboard view on the client-side, right-click it and select Close.

1639753771379.png

You can also undock it and push the X button:

1639753997193.png



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 4 of 9

vignesh_s
Not applicable

Thanks For the reply @Phil BoBo I understood that because of the client side its not reflecting. But, in the sample model i have given. I have added a button click in custom code in flexsim model to close the particular dashboard when clicked the button. But it doesn't close when i do in the client side when i click the button in flexsim web server view it stays until i refresh the page to see the changes. What can be done to fix this. Is there any sample model i can refer and get used for understanding please ? Attached screenshot1640020167040.png

0 Likes
Message 5 of 9

philboboADSK
Autodesk
Autodesk

"What can be done to fix this."

This is how the dashboard model control widgets work and how the defaultpage's views work. There's nothing to "fix."

If you want to make an HTML page that behaves differently, then you can write your own custom Web Page for your model that behaves differently. The defaultpage is behaving exactly as it is designed to behave.

The defaultpage returns an HTML page with JavaScript that allows the user to rearrange the interface locally without affecting the server. It is a RESTful API.

If you make changes to the interface on the server--as you are in your button's code--then you need to refresh the page to change the client's state to that of the server.

You can have multiple clients requesting status from the same server. It isn't some connected 1-to-1 relationship between the client and the server.

I understand what you want it to do. But what you want it to do doesn't make sense with the way the defaultpage is designed to work. If you want to close a tab on the client interface of the defaultpage, use the Close button on the client interface. Otherwise, you will need to make your own web page that behaves how you want it to behave instead of using the defaultpage.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 6 of 9

vignesh_s
Not applicable

@Phil BoBo Thanks for your inputs. If i'm trying to replace the defaultpage of the flexsim which shows the models and buttons to start the instances with my own custom page (I can do this part). But within the custom page i need to shows the default page as well. Means, within my custom page a part of my custom page should be the default page of the flexsim webserver. How can this be achieved ?


I use iframe as below currently to load the flexsim webserver to show it in the webpage. But when loading my custom page instead of the default page how can i bring the Flexsim webserver. Is there anything like iframe i can bring it into a frame.


< iframe id = "iframeid" src = "http://localhost:80/" title = "" ></ iframe >
0 Likes
Message 7 of 9

philboboADSK
Autodesk
Autodesk

Please read the documentation about how the web server works. Particularly the sections titled "Instance Queries" and "Default Page" in https://docs.flexsim.com/en/22.0/Reference/DeveloperAdvancedUser/Webserver/#custom

localhost:80 isn't the model's default page. It is how you access a web server that is running on your local machine on port 80.

As explained in the documentation above, the default page is the HTML returned when you query an instance of FlexSim using a URL such as

http://localhost/webserver.dll?queryinstance=MyModel&instancenum=1

Teaching you the basics of how web pages and servers work is beyond the scope of FlexSim technical support.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 8 of 9

connor_a
Not applicable

Hi @vigneshs, was Phil BoBo'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 unaccept and comment back to reopen your question.

0 Likes
Message 9 of 9

yjhung_mcae_fcu
Enthusiast
Enthusiast

Hi Vigneshs,

Did you use the Web page method to solve this question?

0 Likes