• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Modal form from Java code

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Sheriff
Posts: 7126
185
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Swing forum might be better for this. Moving.
 
Michael Piaser
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 82459
594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 82459
594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic