Var dialog As New WebMessageDialog
dialog.Title = "Modal Header"
dialog.Explanation = "Some text in the modal."
dialog.CancelButton.Caption = "Close"
dialog.CancelButton.Visible = True
dialog.ActionButton.Visible = False
@Ricardo_Cruz_Fernandez nice catch.
but how do you get the button that is clicked if you have many ?
I mean , still creating the webmessagedialog on the fly like this, not creating a webdialog and embed it in a webpage.
I would still like to make it in html+java, because I would like to add some html in the explanation zone.
well, after a night of sleep (and thinkings) I really need to wait for the user to answer.
it’s a button, to delete a record
I ask the user “do you want to really delete this(these) record(s)”
and I have to wait for its answer to do it
how can I achieve that, in a simple “desktop” way , but with a webapp ?
if myConfirm("really delete the record(s)?") then
... user canceled ...
Operating modally as we understand from desktop is a bad idea in Web. The way to implement this is to cover the page with an element that behaves as a blocking mechanism to prevent the user from performing any actions until they have answered the modal message. When they click a button, you send the data back to the server then dismiss the dialog and blocking element.
some questions like “do you really want to delete xxx records” really needs the user to be focused on one task only … so I assume the modal behavior completely for this kind of task.
if we stay under bootstrap, there are classes already designed for a modal action
I just don’t know how to implement them in xojo …
Yes, it is possible in the way I describe above. I do it with GraffitiAlert and other specific implementations. The blocking element prevents the user from doing anything until they click a button, the data gets back to the server, and you do whatever needs to be done and dismiss the alert.
You should use the WebSDK as already directed by @Tim_Parnell above.