You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eaglei22 <jc...@gmail.com> on 2014/02/13 01:23:21 UTC

Error in Modal opening two diffrent instances of Wicket applicaiton.

Hello, I am having an issue when I have my application opened in two separate
tabs in IE or FireFox. 

Here is the problem:

I have a page called User, and in this page you can open a Modal window to
search for a user. Once a user is found, you select it, and the Modal window
closes, and that User object and its attributes is used and displayed to the
User page. 

The problem is if I have tab open on the User page and run a search in the
Modal window for another user, and while this is taking place, I open
another tab and goto another instance of the application and to the user
page, and then perform a search using the same scenerio.. The latest opened
instance of the application will return the search results to the page just
fine; and the first instance of the application and the running search will
close the page, and nothing will happen, or the page will reset itself
loading the defaulted information. This only happens when I open a new tab
and instance of the application while a current instance is already running
a search in the modal window of User page. If I open two different sessions
of the application before running any searches, then run a search in each
session everything is fine. 


Some background:
The modal class uses the PageReference passed in through its constructor. I
use this to interact with the calling pages variables. Once the modal window
closes using window.close(target);  the calling class will continue its page
update via:

modalReference.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback()
{
   public void onClose(AjaxRequestTarget target)
   {
       ..make changes to page here.




Here is what happens just before the modal window closes:

               public void onClick(AjaxRequestTarget target)
               {
                   setCurrentUserFromLite(item.getModelObject());
                   
((UserPage)modalWindowPage.getPage()).addUserInformation(selectedUser.getLastName(),
                    		selectedUser.getFirstName(),
selectedUser.getMiddleName(),     selectedUser.getBemsid(), "");
                    
((UserPage)modalWindowPage.getPage()).setFindUserFromModal(true);
                    
((UserPage)modalWindowPage.getPage()).setCurrentUser(selectedUser);
                    	window.close(target);
                    }



Any ideas what is happening? Or is there a way to maybe check to see if the
same functionality is being used in another instance and prevent the user
from running a search? 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error in Modal opening two diffrent instances of Wicket applicaiton.

Posted by eaglei22 <jc...@gmail.com>.
Here is some more information on my initializating of the modal window:


		add(userPageFindUserModal = new ModalWindow("findUserModalWindow"));

		userPageFindUserModal.setResizable(false);
		userPageFindUserModal.setInitialHeight(23);
		userPageFindUserModal.setInitialWidth(69);
		userPageFindUserModal.setWidthUnit("em");
		userPageFindUserModal.setHeightUnit("em");
		userPageFindUserModal.setUseInitialHeight(false);
		userPageFindUserModal.setCssClassName(ModalWindow.CSS_CLASS_GRAY);

		userPageFindUserModal.setPageCreator(new ModalWindow.PageCreator()
		{
			public Page createPage()
			{
				return new FindUserModal(UserPage.this.getPageReference(), 
						userPageFindUserModal, server);
			}
		});

		// on modal window close, this method will be called
		userPageFindUserModal.setCloseButtonCallback(new
ModalWindow.CloseButtonCallback()
		{
			public boolean onCloseButtonClicked(AjaxRequestTarget target)
			{
				return true;
			}
		});

		userPageFindUserModal.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback()
		{

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418p4664420.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error in Modal opening two diffrent instances of Wicket applicaiton.

Posted by eaglei22 <jc...@gmail.com>.
Thanks Paul, I am using new sessions and the problem seems to be okay
locally, but not on the server. So I noticed that on the server (through the
access portal we use) it forces a new session per tab. So the original issue
with the modal window I thought I have found the session issue to be the
culprit, but now even running locally I am getting page expirations when
running locally. This happens on a page that I redirect to using a
setResponsePage, and while this is up, and I open a new application instance
inside of a new browser tab, the original tab's page expires right away.
What should I be looking at to make sure this doesn't happen. I have been
searching all over and I can't seem to find any real solutions to this
issue. 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418p4664521.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error in Modal opening two diffrent instances of Wicket applicaiton.

Posted by Paul BorČ™ <pa...@bors.ws>.
I think you need to use multiple wicket sessions.

Have a great day,
    Paul Bors

> On Feb 13, 2014, at 10:45 AM, eaglei22 <jc...@gmail.com> wrote:
> 
> Okay, so I was able to try some more scenerios, and it looks like if I have
> one instance of the application open in one tab, and open a modal window and
> now do anything.. Then open another instance of the application but not even
> click on anything, and go back to the first intance and just hit cancel on
> the Modal which calls a window.close(target)  then I get a page expired
> error.. 
> 
> So, How do I keep the modal window from being affected by another instance
> of an application being opened?
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418p4664442.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error in Modal opening two diffrent instances of Wicket applicaiton.

Posted by eaglei22 <jc...@gmail.com>.
Okay, so I was able to try some more scenerios, and it looks like if I have
one instance of the application open in one tab, and open a modal window and
now do anything.. Then open another instance of the application but not even
click on anything, and go back to the first intance and just hit cancel on
the Modal which calls a window.close(target)  then I get a page expired
error.. 

So, How do I keep the modal window from being affected by another instance
of an application being opened?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418p4664442.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Error in Modal opening two diffrent instances of Wicket applicaiton.

Posted by eaglei22 <jc...@gmail.com>.
I have made a few changes to my original explanation:

Here is the edited version:
The problem is if I have tab open on the User page and run a search in the
Modal window for another user, and while this is taking place, I open
another tab and goto another instance of the application and to the user
page, and then perform a search using the same scenerio.. The latest opened
instance of the application will return the search results to the page just
fine; and the first instance of the application and the running search will
close the modal after its done processing, and nothing will happen to the
calling page, or the calling page will reset itself loading the defaulted
information. This only happens when I open a new tab and instance of the
application while a current instance is already running a search in the
modal window of User page. If I open two different sessions of the
application before running any searches, then run a search in each session
everything is fine. 




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-in-Modal-opening-two-diffrent-instances-of-Wicket-applicaiton-tp4664418p4664419.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org