• Post Reply Bookmark Topic Watch Topic
  • New Topic

Modal form from Java code  RSS feed

 
Michael Piaser
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Knute Snortum
Sheriff
Posts: 3971
97
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Swing forum might be better for this. Moving.
 
Michael Piaser
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you know about dialogues? They tend to be modal unless you have told them otherwise.
 
Michael Piaser
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I have got confused; the link I gave you was to Swing dialogues. Don't know anything about XHTML.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!