question

vigneshs avatar image
0 Likes"
vigneshs asked 我才是馬邦德 edited

button events in flexsim dashboard not working in Flexsim web server

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

FlexSim 21.2.3
flexsim webserverweb server
· 3
5 |100000

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

vigneshs avatar image vigneshs commented ·
Any updates on this would be really helpful please ?
0 Likes 0 ·
Connor A avatar image Connor A commented ·

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 0 ·
我才是馬邦德 avatar image 我才是馬邦德 commented ·

Hi Vigneshs,

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

0 Likes 0 ·

1 Answer

·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered Phil BoBo edited

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


1639753771379.png (153.7 KiB)
1639753997193.png (75.2 KiB)
· 4
5 |100000

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

vigneshs avatar image vigneshs commented ·

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 0 ·
1640020167040.png (22.2 KiB)
Phil BoBo avatar image Phil BoBo ♦♦ vigneshs commented ·

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

0 Likes 0 ·
vigneshs avatar image vigneshs Phil BoBo ♦♦ commented ·

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