0

Problem with Listbox pagination

asked 2006-10-09 22:52:14 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3955045

By: ddbb88

I am trying to use the built-in pagination of Listbox but got the following error whenever a page link is clicked:

"The page or component you request is no longer available xxxx. This is normally caused by timeout, or opening too many Web pages. You have to reload the page and try again."

My code looks like this:

<listbox width="960px" mold="paging" pageSize="10">
<listitem forEach="${allProducts}">
<listcell label="${each.productName}"/>
</listitem>
</listbox>

I am using zk version 2.1.2 inside Spring Framework 1.2.6 along with Struts Tiles 1.2.7. I tried on both Firefox 1.5.0.7 and IE 6.0.2900 in Windows XP and had the same problem.

Please help!


delete flag offensive retag edit

22 Replies

Sort by ยป oldest newest

answered 2006-10-09 22:59:52 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3955050

By: ddbb88

BTW, I added the following lines in my page based on an answer to another thread but they didn't help.

<meta http-equiv="Cache-Control"
content="no-cache,no-store,must-revalidate,max-age=0"/>
<meta http-equiv="Pragma" content="no-cache,no-store"/>


link publish delete flag offensive edit

answered 2006-10-11 01:22:12 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3956879

By: henrichen

Can you provide the stack trace regarding this?

link publish delete flag offensive edit

answered 2006-10-23 18:00:52 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3976476

By: ddbb88

Sorry I didn't reply this in time. I was pulled to work on sth else and had come back to this just now.

I didn't see any error messages in the app server logs. Does ZK write stack trace somewhere else?

link publish delete flag offensive edit

answered 2006-10-24 01:59:09 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3976977

By: henrichen

It might has something to do with your environment. The message is really tell you that the requested object (resource) is no longer in the server for some reason. As for why it think so???

Can you try other component, e.g. button, and see if the same thing happens?

/henri

link publish delete flag offensive edit

answered 2006-10-24 17:37:19 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3977996

By: ddbb88

This happens with the paging function, so I tried it on Grid. It's giving the same error.
If this indicates that the object is not on the server side, that means during paging, the server should keep the Grid/Listbox in memory inside a session, right? Since I am using Spring, should I do extra session config in Spring?

Here is my zul code that's doing the paging:

with Grid:

<grid width="960px" mold="paging" pageSize="10">
<rows>
<row forEach="${dfllproducts}">
<image src="http://i.i.com.com/cnwk.1d/sc/%{each.productId}-2-60-0.gif"/>
<hbox>${each.productName}</hbox>
<hbox>${each.bottomLine7}</hbox>
</row>
</rows>
</grid>


with Listbox:

<listbox width="960px" mold="paging" pageSize="10">
<listitem forEach="${dfllproducts}">
<listcell>
<image src="http://i.i.com.com/cnwk.1d/sc/%{each.productId}-2-60-0.gif"/>
<hbox>${each.productName}</hbox>
<hbox>${each.bottomLine7}</hbox>
</listcell>
</listitem>
</listbox>

link publish delete flag offensive edit

answered 2006-10-24 18:44:06 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3978092

By: ddbb88

After digging into the source, I found the paging links are calling zkPg.go().
I am not sure if the URL this function is calling works. Here is more info on my config.

Everything with /dfll/ is mapped to servlet dfll which is essentially Spring's DispatcherServlet (http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web
/servlet/DispatcherServlet.html):

<servlet-mapping>
<servlet-name>dfll</servlet-name>
<url-pattern>/dfll/*</url-pattern>
</servlet-mapping>

Following is config for ZK:
<!-- ZK -->
<listener>
<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
</listener>
<servlet>
<description>ZK loader for evaluating ZK pages</description>
<servlet-name>zkLoader</servlet-name>
<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
<!-- Must. Specifies URI of the update engine
(DHtmlUpdateServlet). -->
<init-param>
<param-name>update-uri</param-name>
<param-value>/zkau</param-value>
</init-param>
<load-on-startup>1</load-on-startup><!-- MUST -->
</servlet>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.zul</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.zhtml</url-pattern>
</servlet-mapping>
<servlet>
<description>The asynchronous update engine for ZK</description>
<servlet-name>auEngine</servlet-name>
<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>auEngine</servlet-name>
<url-pattern>/zkau/*</url-pattern>
</servlet-mapping>


Any obvious mistakes?

link publish delete flag offensive edit

answered 2006-10-26 02:03:17 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3981283

By: henrichen

I doubt it is something with your configuration. Can you post your web.xml?

/henri

link publish delete flag offensive edit

answered 2006-10-26 03:03:16 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3981319

By: henrichen

Are you using Bea server? I remembered that someday ago, there was something similar to this. Bea server will change its HTTP session for each request that the information ZK stored in Http Session was lost. To solve this, see ZK How-Tos regarding Bea.

/henri

link publish delete flag offensive edit

answered 2006-10-26 16:15:36 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3982383

By: ddbb88

Here is my web.xml in full:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<!-- In this example all requests will be redirected to host:post/webapp-name/dfll/* -->
<!-- In the real webapps, the servlet-name "dfll" should be defined as such to match the webapp nanme -->
<servlet>
<servlet-name>dfll</servlet-name>
<servlet-class>cnwk.maverick.mvc.InstrumentedDispatcherServlet</servlet-
class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>dfll</servlet-name>
<url-pattern>/dfll/*</url-pattern>
</servlet-mapping>

<!-- ZK -->
<listener>
<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
</listener>
<servlet>
<description>ZK loader for evaluating ZK pages</description>
<servlet-name>zkLoader</servlet-name>
<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
<!-- Must. Specifies URI of the update engine(DHtmlUpdateServlet). -->
<init-param>
<param-name>update-uri</param-name>
<param-value>/dfll/zkau</param-value>
</init-param>
<load-on-startup>1</load-on-startup><!-- MUST -->
</servlet>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.zul</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.zhtml</url-pattern>
</servlet-mapping>
<servlet>
<description>The asynchronous update engine for ZK</description>
<servlet-name>auEngine</servlet-name>
<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>auEngine</servlet-name>
<url-pattern>/dfll/zkau/*</url-pattern>
</servlet-mapping>

<!-- required by ZK -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/dfll-servlet.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listen
er-class>
</listener>


<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter
-class>
</filter>

<filter>
<filter-name>addoid</filter-name>
<filter-class>cnwk.maverick.mvc.AddOidFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>addoid</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
</jsp-config>

<!-- Maverick init parameters -->
<context-param>
<param-name>cnet.common.cachenet</param-name>
<param-value>@cnet.common.cachenet@</param-value>
</context-param>
</web-app>

link publish delete flag offensive edit

answered 2006-10-26 16:56:55 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3982428

By: ddbb88

I am not using BEA. I am using Resin 3. Not sure how Resin handles session, but let me explain my page flow:

1. request comes in to an "outer" page - /dfll/4148-3118-0.html 2. web.xml maps this to a Spring dispatcher servlet, which in turn invokes a controller defined in dfll-servlet.xml 3. the controller does it's logic and create the lists and put them in session objects 4. the dispatcher then grabs the jsp and zul "inner" pages mapped to the outer page and renders the view

I tried changing the update-uri to /dfll/zkau which should go through the same flow and get the same session objects. But it didn't work.

After reading this wiki: http://en.wikibooks.org/wiki/ZK/How-Tos#Spring, I also tried moving the logic of creating the lists to a new DfllWindow and use that for my Window component and let the listboxes call ${dfllwindow.dfllProducts} and ${dfllwindow.dfllResult}. Didn't work either (same error).

I am stuck at this point. I must say that I like ZK a lot. You guys have created a product with so many neat features. But it seems that it's not a smooth integration with our current environment. I am really trying to push at least my group to use ZK in our future projects. It would definitely solve my biggest headache in my previous AJAX projects - debugging Javascripts! Just like your tag line:
Ajax but no Javascript.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-10-09 22:52:14 +0800

Seen: 512 times

Last updated: Nov 03 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More