Forums Register Login

Modal form from Java code

+Pie Number of slices to send: Send
I need to add code when the SUBMIT button is clicked to bring up a modal form. The code which displays the button is:



this causes the following Java code to execute. the externalcontext.redirect brings up the termsAndConditionsDialogApproval.xhtml but I want it to come up as a modal form (on top of the form with the SUBMIT button) and it has to be addressed by the user.

+Pie Number of slices to send: Send
The Swing forum might be better for this. Moving.
+Pie Number of slices to send: Send
I can see how to do this in an .xhtml file (below) as there is another place where this modal box concept is already used.



I don't know how to make it conditional so when the user clicks the SUBMIT button, it would run my xhtml code. Hence the reason I'm trying to do it in the Java code with externalcontext - because I don't understand the .xhtml enough to know how to do it there.
+Pie Number of slices to send: Send
What do you know about dialogues? They tend to be modal unless you have told them otherwise.
+Pie Number of slices to send: Send
I don't know much about these xhtml dialogs. I don't know what they are called nor do I know where any documentation is concerning them. Is this part of JSF? Prime Faces? some other strange thing?

I am trying to maintain a very large system and I have figured much of it out in the last few months. But I don't know how these xhtml files really work. I can add buttons, links etc but this is more of a structural change.

There is a button on the screen called SUBMIT. Right now, when the user clicks SUBMIT, it does the submit function. I want to change the functionality so that when the SUBMIT button is pressed, another form pops up over the existing one and the user can then select YES or NO. If he selects YES, I want to send him to the submit function. If he clicks NO, I want to send him somewhere else.

The SUBMIT button executes Java code so if I could write Java code to bring up the "pop-up" I'd be golden. Right now I am using externalcontext.redirect to display the "popup" but it doesn't really popup - it replaces the existing page instead of popping up over it

I know this question got moved to the Swing forum, but I don't know what Swing is and I suspect this system doesn't use it.
+Pie Number of slices to send: Send
I think I have got confused; the link I gave you was to Swing dialogues. Don't know anything about XHTML.
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 673 times.
Similar Threads
JSF 2.0 , passing URL hidden parameters in ExternalContext.redirect() programmatically
How to handle login failure and 403 error programmatically?
How to send data to another site, get response, redirect and get new response
JSTL to retrieve and pass request objects - second attempt
JSF custom tag requirement
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:34:41.