alritey, this is a bit of a tricky one

first some prologue

the ajax timing behaviors generate urls that only work if the page they are trying to access is the most recent page accessed in the pagemap - ie it is the page that the user is currently looking at. after all if you come to page A, start timing behaviors, navigate to page B - the timing behaviors fired while you are on page B should be ignored since A is no longer visible.

now lets take a look at your code

PopupSettings popupSettings = new PopupSettings(PageMap.forName("popuppagemap")).setHeight(500).setWidth(500);
item.add(new PageLink("detailsLink", new TapDetails(tap)).setPopupSettings(popupSettings));

popupsettings's pagemap parameter is a bit deceptive here.

a page's pagemap is assigned at the point of the page's creation. so when you did new TapDetails(tap) you just created a page that is in the same pagemap as the Index page because you did not use Page(PageMap) constructor.

so when the link is clicked and the window opens in the popup the TapDetails page is accessed - and since it is in the sme pagemap as the Index page it bumps it off the top. So now your self updating behaviors stop working because Index is not the last page accessed in its pagemap.

what the param in popupsettings will do is to set the default pagemap to the one you specified so pages created from that point on (after the popup has been opened) as the result of links in the popup page will be in that other pagemap - but by then its too late.

an immediate way to fix this is to create TapDetails(PageMap map, WaterTap tap) constructor and pass in the pagemap into that instead of popup settings - this will insure the tapdetails page is created in the right pagemap.

a cleaner way to fix it is to make tapdetails page bookmarkable and use a bookmarkable link in the listview and pass in the pagemap that way.

now another common mistake, although somewhat unrelated, i see is that you do new PageLink(id, new TapDetails(....)) - you just created all those page instances in the lsitview upfront, before the user even accessed any of them. if your listview had 10 taps you would create 10 page instances - and they would actually push the Index page out of the pagemap because i think by default we only keep 7 pages in the pagemap. that means any link clicked on the indexpage would result in a expired page error. so what you should do is create page instances lazily - like the way you did below in the commented out code:

//            item.add(new Link("detailsLink", item.getModel())
//            {
//                public void onClick()
//                {
//                    WaterTap tap = (WaterTap)getModelObject();
//                    setResponsePage(new TapDetails(tap));
//                }
//            });

this doesnt create the page instance until the link is clicked, and it only creates the page instance that the user will be navigating to.

-Igor


On 8/10/06, Per Ejeklint <[EMAIL PROTECTED]> wrote:
Sure Igor, here's a quickstart containing my troublesome pages and some mockup. Please be kind, I'm new to Wicket and it's a very quick prototype only... :-)

/Per



10 aug 2006 kl. 19.41 skrev Igor Vaynberg:

i havent seen this problem, perhaps you can create a quickstart that shows it. its hard to hypothesize as to why or when this might happen without something concrete to look at.

-Igor


On 8/10/06, Per Ejeklint < [EMAIL PROTECTED]> wrote:
OK, I will rephrase my questions, maybe someone then can give a hint on how I proceed...

It is so that a component with AjaxSelfUpdatingTimerBehaviour should stop self-updating when the containing page is not
in focus (topmost)? If yes, is there a way to change this so the page always self-updates?

/Per

9 aug 2006 kl. 21.07 skrev Per Ejeklint:

Folks,

I have an index page (listing a number of devices) with a self-updating table using AjaxSelfUpdatingTimerBehaviour like this:

WebMarkupContainer tblContainer = new WebMarkupContainer( "taptable");
tblContainer.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(4)));
tblContainer.setOutputMarkupId(true );
add(tblContainer);
// Table stuff follows...


It works just fine. But when I click on a link in the table witch creates a new popup page displaying details for a device, the self-updating of the index page stops and I have to refresh the index page to get the self-updating behaviour going again. Looking at the Wicket Ajax Debug I see this:

IERROR: malformed response envelope: could not find root <ajax-response> element
 INFO: invoking failure handler...
ERROR: error while processing response: TypeError: root has no properties.root has no properties
 INFO: invoking failure handler...

And then nothing more.

Am I missing something? Or is it a bug? Safari and Firefox behaves the same.

/Per

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Wicket-user mailing list


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Wicket-user mailing list


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to