• 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

How to view loading Image on click event by making full page dark?

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,

I have make one j2ee application which includes more than 200 pages. Now I want to show loading Image in the middle of page by making remaining page data dark.
I want to make it on click event.
How can I make it possible?

Regards,
Chauhan Sunil  
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe something like the Disabled Glass Pane is what you are looking for.

The current code only displays text, but you should be able to modify the code to display an Icon.
 
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
From a usability perspective, you should not forget to the give the user a 'Cancel' option in case the image retrieval get stuck e.g. network issues
 
SunilK Chauhan
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya it's true.

I am looking for such facilities in j2ee application actually.
In swing application I can do it using disabledglasspane. But how can I do the same thing for java Web application.

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Certainly not with Swing, then. You would want to use Javascript in the HTML -- that's the onClick event you are talking about, right?

Let me put the thread into a suitable forum.
 
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
To make sure I understand what you are after:
  • Upon an event, such as a button click, you want to display a pane that covers the window with a "loading" image or similar.
  • Presumably, at some point, the pane will be removed; such as at the end of an Ajax request.


  • Right so far?

    If so, here's the high level overview of how I'd handle it.

  • Create the pane and its contained image in the HTML.
  • Use CSS to make it absolutely positioned, with a high z-index, and hidden from display. A partial opacity and dark background may give you the "darkening" effect I think you are after.
  • Register an event handler for the button click.
  • In the event handler add a class (name of your choosing) to the body, or at any level higher than the modal pane.
  • Augment the CSS so that the pane is shown when it is a child of that class.
  • When it is time to remove the pane, simply remove the class from the body.


  • This makes everything pretty much declarative, except for the actions of adding and removing a class in the script.

    All of this would be much easier using jQuery versus raw JavaScript.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic