• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dialog Boxes in Web Application

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I 'm developing a web application using Struts framework. I need to display alert messages or warning messages based on the input entered in a page.
currently I m implementing it using ActionMessages and I display the error message by forwarding the request to another jsp page and displaying it there but the problem is that I need to make it like a dialog box (alert,prompt) with the message and buttons in the same page where the input is entered. Can anyone suggest ideas.

Thanks in advance
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sanjeetha,
Welcome to the Ranch.

Your question would be more suited in the Struts forum.
CarefullyChooseOneForum
I have moved this thread there for you.

Also, please do take out time to read http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try opening this second page using javascript like below.

window.showModalDialog()

I found a related link here
http://www.java2s.com/Code/JavaScript/Javascript-Objects/ShowModalDialogwindowshowModalDialogURLmyArguments.htm
 
sanjeetha ashiqa
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

@Maneesh .. Sorry i was not aware of the forum categories as i am new and Thank you for the help .

@ Kiran.. Thanks for the reply . But it didnt solve my problem.
I will be accessing files respective of the input entered. So i m checking whether the file of the entered input is first existing or not , which i implemented in action.
If the file exists i forward the request to the page where i m going to read the file contents. else i need to display an alert message saying that the file of the chosen input does not exist , in the same page where i got the input. can this be implemented? any ideas?
 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Maneesh - I'd say this was more a HTML/Javascript question than anything else.

Sanjeetha,
What you are asking to be done can of course be done and if you are lucky there may be a taglib available which will help you implementing this.

Otherwise you will be left having to use javascript + ajax.

If you do end up going down that route I recommend using a javascript library such as jQuery to simplify the process.

Sean
 
sanjeetha ashiqa
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestion Sean
Will try it .
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jQuery UI provides easy-to-use dialogs.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sean Clark wrote:@Maneesh - I'd say this was more a HTML/Javascript question than anything else.



Yup. Even I though as much. However the OP mentioned using Struts. Unfortunately I do not work on struts and suspected it might have some custom mechanism for dialogs.
 
sanjeetha ashiqa
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is I don't know jQuery.
But I would like to learn and try it to implement for my requirement.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It only has something to do with Struts once Struts enters into the picture--if it's a general question about dialog boxes then it's an HTML/JavaScript question.

I'm moving it to HTML/JavaScript for now; Struts has no general mechanism for dialog boxes. If there's a Struts-specific question, start a new thread in the Struts forum.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to do this on your own better start boning up on CSS!
 
sanjeetha ashiqa
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the problem solved. I set a flag property for wrong entry of the filename in my action class and based on de property ,

i used <script> alert("Error " + <%= request.getAttribute("filename")%> + " is not available."); </script> in my jsp page inside <logic:equal property="flag" value="false">

Thanks guys!!

But <%= request.getAttribute("filename")%> returned null.
 
What's a year in metric? Do you know this metric stuff tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic