Gwyn, Thanks for the guidance! The DataProvider.iterator was being executed twice. I put a breakpoint in iterator() and it would pause when the page first started to load. Then I'd continue running the code, and the breakpoint was hit again. At that time, the full page was rendered except for some images on the page, and the browser was paused loading again because of the breakpoint. When I continued running the code, the page would finish loading.
The images that weren't loaded are URLs stored in my DB. I found that when I had image URLs in the DB, everything worked fine. But when I had NULL entries for the images, then I'd get this exception and the iterator would run twice. So when the iterator would run twice, the component hierarchy would change, causing the link URLs to no longer be valid. I'm still tracking it down to figure out exactly what is going on. But you got me on the right track. And now I'm thinking it is more of a problem in my application or database than in wicket itself. Which is what I was hoping was the case anyway! :) Tauren On Dec 20, 2007 7:43 AM, Gwyn Evans <[EMAIL PROTECTED]> wrote: > No real idea, but I'd be tempted to stick in some diagnostic logging > to log the calls to the DataProvider & the details of the lists it > returns, just to check there's nothing odd happening there... > > /Gwyn > > > On 20/12/2007, Tauren Mills <[EMAIL PROTECTED]> wrote: > > Thanks. I will try to put together a quickstart, but I'm not sure I > > can duplicate the problem in it. > > > > Tauren > > > > > > On Dec 19, 2007 3:23 PM, Matej Knopp <[EMAIL PROTECTED]> wrote: > > > This is definitely strange. However without posting more code (or > > > preferably a complete testcase to reproduce) I don't really know how > > > to help you with it. > > > > > > -Matej > > > > > > > > > On Dec 20, 2007 12:05 AM, Tauren Mills <[EMAIL PROTECTED]> wrote: > > > > Does anyone have any thoughts on this problem? I realize this it may > > > > seem unique and isolated, but are there any suggestions even on how to > > > > figure out what is wrong? How can I figure out why the component path > > > > in the URLs for the Links in the DataView are not matching the > > > > component hierarchy? These are the URLs output at initial page > > > > creation time: > > > > > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:1:actions:select::ILinkListener:: > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:2:actions:select::ILinkListener:: > > > > > > > > However, at the time that onClick is processed, the component > > > > hierarchy seems to have changed and now have the value of 3 and 4 > > > > instead of 1 and 2. The links above don't work, but the following > > > > links do if I manually enter them: > > > > > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:3:actions:select::ILinkListener:: > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:4:actions:select::ILinkListener:: > > > > > > > > Its almost as if a secondary page render has occurred. But I've added > > > > logging to my page and don't see any extra log output. > > > > > > > > My project is basically done and ready to launch, but this is holding > > > > it up. Any ideas or suggestions? > > > > > > > > Thanks! > > > > Tauren > > > > > > > > > > > > > > > > On Dec 18, 2007 11:21 PM, Tauren Mills <[EMAIL PROTECTED]> wrote: > > > > > I'm having an Exception that is happening before any of my > > > > > Link.onClick() code is executed, making me wonder if there is a wicket > > > > > bug of some sort. > > > > > > > > > > I have a DataView with an ActionPanel in each row that contains a > > > > > Link. There is no AJAX on this page. When I load the page with the > > > > > DataView for the first time, clicking the Link doesn't work and I get > > > > > an Exception (see below). But if I click the browser back button, > > > > > then click the same link, it works. However, this problem only occurs > > > > > for some of the data records, not all of them. But the same data > > > > > records always break. I thought it was a data problem because of > > > > > this, but tracing back into the wicket code seems to indicate > > > > > otherwise. Also, I'm running on the latest wicket trunk that I > > > > > updated to about 15 minutes ago. > > > > > > > > > > The URLs that are output for the Links in the dataview when the page > > > > > is first loaded is (dataview has only 2 data records): > > > > > > > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:1:actions:select::ILinkListener:: > > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:2:actions:select::ILinkListener:: > > > > > > > > > > When I hit the back button, the URLs for that same links are: > > > > > > > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:5:actions:select::ILinkListener:: > > > > > http://localhost:8082/db/app/?wicket:interface=:6:reports:reports:6:actions:select::ILinkListener:: > > > > > > > > > > The exception that is thrown is this (only when the first links are > > > > > clicked, not the links after hitting the back button): > > > > > > > > > > WicketMessage: component reports:reports:1:actions:select not found on > > > > > page > > > > > com.theseniorlist.database.web.page.site.service.ServiceDetailsPage[id > > > > > = 6], listener interface = [RequestListenerInterface > > > > > name=ILinkListener, method=public abstract void > > > > > org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] > > > > > > > > > > Root cause: > > > > > > > > > > org.apache.wicket.WicketRuntimeException: component > > > > > reports:reports:1:actions:select not found on page > > > > > com.theseniorlist.database.web.page.site.service.ServiceDetailsPage[id > > > > > = 6], listener interface = [RequestListenerInterface > > > > > name=ILinkListener, method=public abstract void > > > > > org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] > > > > > at > > > > > org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:411) > > > > > at > > > > > org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:456) > > > > > at > > > > > org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139) > > > > > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1152) > > > > > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245) > > > > > at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) > > > > > at > > > > > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) > > > > > at > > > > > org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121) > > > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > > > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > > > > at > > > > > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445) > > > > > at > > > > > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050) > > > > > at > > > > > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) > > > > > at > > > > > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) > > > > > at > > > > > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041) > > > > > at > > > > > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354) > > > > > at > > > > > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226) > > > > > at > > > > > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627) > > > > > at > > > > > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141) > > > > > at org.mortbay.jetty.Server.handle(Server.java:269) > > > > > at > > > > > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430) > > > > > at > > > > > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687) > > > > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492) > > > > > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199) > > > > > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339) > > > > > at > > > > > org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:208) > > > > > at > > > > > org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) > > > > > > > > > > Sure enough, when I trace the wicket code and examine the data in > > > > > memory, the first time the dataview page is loaded, the component path > > > > > to the actual components are values 3 and 4. In fact, if after I load > > > > > the page for the first time, I manually enter the following URLs, I > > > > > get the correct page without an exception: > > > > > > > > > > http://localhost:8082/db/app/?wicket:interface=:8:reports:reports:3:actions:select::ILinkListener:: > > > > > http://localhost:8082/db/app/?wicket:interface=:8:reports:reports:4:actions:select::ILinkListener:: > > > > > > > > > > Why would the URLs that are rendered the first time be wrong? Is > > > > > there something in my code that could cause this? > > > > > > > > > > Here is a trimmed down version of the code: > > > > > > > > > > public ReportListPanel(String id, final Service service) { > > > > > super(id); > > > > > > > > > > this.service = service; > > > > > > > > > > ReportsDataProvider dataProvider = new > > > > > ReportsDataProvider(dao); > > > > > Report filter = (Report) dataProvider.getFilterState(); > > > > > filter.setService(service); > > > > > dataProvider.setFilterState(filter); > > > > > > > > > > final DataView reports = new DataView("reports", > > > > > dataProvider) > > > > > { > > > > > @Override > > > > > protected void populateItem(final Item item) > > > > > { > > > > > Report report = (Report) > > > > > item.getModelObject(); > > > > > item.setModel(new > > > > > CompoundPropertyModel(report)); > > > > > item.add(new > > > > > ActionPanel(actions",item.getModel())); > > > > > }; > > > > > reports.setItemsPerPage(40); > > > > > add(reports); > > > > > } > > > > > > > > > > class ActionPanel extends Panel > > > > > { > > > > > public ActionPanel(String id, IModel model) > > > > > { > > > > > super(id, model); > > > > > setModel(model); > > > > > > > > > > Link link = new Link("select",model) { > > > > > @Override > > > > > public void onClick() { > > > > > setResponsePage(new > > > > > ReportDetailsPage(getPage(),(Report)getModelObject(),service));; > > > > > } > > > > > }; > > > > > link.add(new Label("summary")); > > > > > add(link); > > > > > } > > > > > } > > > > > > > > > > Any help would be appreciated! > > > > > > > > > > Thanks, > > > > > Tauren > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
