Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Opening more popups at the same time on the same level

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Java Spring for our web application and I am trying to make web application which uses spring for logic and jquery for displaying form data in popup. In addition I have a need to have popup in popup, and also have a need to have more than one popup opened in the same time.

For example I have a popup which prints HTML table lists all the users, and each user row in table has EDIT button. This EDIT button opens popup for editing user profile. I want to be able to open two EDIT user profile popups in the same time.

After trying with dinamic ID's and opening popups with different ID's, I still cannot do this. It seams that jquery is not functioning like that, so it is preventing more dialogs of the same level. I have also tried jquery lobibox library and some API's I have found online. None of them nas native support for this. I still could not find good solution for this.  I could also not find good example online to show me how others solved this. 

So far, I have no problem with one popup of the same level to be displayed at one time.  Can somebody shine some light on recommended solution/approach which can be used to display more popups of the same level at the same time?
 
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, first we need to get something straight: what is it you mean by "popup"? Usually the term is used to describe new windows that open via window.open() or a target attribute on a link.

However, from the context of your post, I'm actually thinking you are talking about something like jQuery UI Dialogs? Correct?

 
Bear Bibeault
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the answer is yes, then you should be able to open nested dialogs using jQuery UI Dialogs. For example, this jsFiddle shows an example of doing just that.
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I am thinking Jquery UI Dialog, is perhaps my best bet.

I used term popup as general term, because I tried many different ways to create window that poops up. But you are right to point that out.

So far I have tried window.open() but that is not what I want. The problem with window.open() is that I don't want to open a new browser window. Just a dialog window. Also I have tried some JavaScript approach but ended up running in the circles. At the end I could not use iframe, because with iframe I had problems to make lower level popup to be able to see the change I have made in upper level popup, in real time.
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Liutauras.

Bear Bibeault: Good point on nested dialogues, but I need 2 or more nested dialogues at the same time. I cannot achieve it with classic JavaScript or JQuery Ui Dialog. (Or at least I could not figure out how to do that)
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras, where did you move my post. Can you please give me an url?
 
Bear Bibeault
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. Have you tried specifying non-modal dialogs?

I know of no dialog subsystem that will allow simultaneously modal dialogs -- that kinda defies the very definition of modal.
 
Bear Bibeault
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Milan Strahinic wrote:Liutauras, where did you move my post. Can you please give me an url?



As you are replying in it, you seem to have found it.
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it seams I have the link, thank you

Well, I have tried window.open(), iframe, and Jquery UI. They are not that what I wanted. I know that there probably is nothing about making what I want by using JQuery, but just wanted to check. I also doubt that I can use Java Swing in Java web application. It is for Java Desktop, so I cannot use Swing elements.
 
Bear Bibeault
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using non-modal as suggested?
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried this.

http://jsfiddle.net/jc55a/53/

Is that what you mean ?
 
Bear Bibeault
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In theory, you should be able to open multiple non-modal dialogs -- but it's not something I've actually tried. What are the specific problems you are running into?
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I managed to open two non-modal Dialogs, but there is one problem left. I cannot use JQuery widget library. Widgets are interfering if I have two window Dialogs open. It seams that it needs to be done on some other way.
The main point of application is that Spring sends data to JSP, and JSP page has AJAX in those dialogue windows. Then I am sending request and receiving response. That is working fine if I have multiple windows open. The final problem is what to use instead of JQuery widgets?
 
Bear Bibeault
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:What are the specific problems you are running into?

 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exact problem is, if I use JQuery UI, for example $( "#radio" ).buttonset(); it will run each time I open a dialog window, and it will resize the elements of the previous dialog window. I tried to prevent it. It is possible to prevent JavaScript but these jquery UI seams to have something in it, that cannot be prevented. Since all dilogs belong to the home page it is even complicated.
My question is, is there some alternative to JQuery UI widgets?
 
Bear Bibeault
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds as if you are using id values incorrectly. Do you have multiple elements on the same page with the same id? And yes, dialog elements are all on the same page so id values must be unique across the whole page, including dialogs.

If so, this is not a problem with using jQuery UI -- it means your HTML is invalid and will cause problems regardless of what you use.
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I have checked and made my oven library to handle this. I am loading data into Dialog by giving it url of the page. Not using div or something else, to hold my web forms. So I have found one good API and change changed some things. The display of the data is working. Now AJAX needs to be organized so it receives data correctly.
The problem is we have for example 3 dialogs open. If I click SAVE button in second dialog it should save the second user data, but it saves all to first.
The solution I see is to catch all by dialog id and to be sure I am processing the data from the right dialog, in AJAX. I will test it and see if it is going well.
 
Milan Strahinic
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I have done it.

Since I have AJAX that needs to work with data in all opened non-modal Dialogs, I have made JavaScript code that determines to which Dialog my widget belongs to, by using unique ID's of dialogs. I am sending JSON to my Servlet Controller and then I have remade Servlet Controller to be able to handle request from multiple Dialogs by using id's of submitted users.
That was my approach.

Thanks for you help!
 
What are your superhero powers? Go ahead and try them on this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic