0

Performance problem using ZK in JSP

asked 2010-04-19 10:02:45 +0800

mako gravatar image mako
60 1 2

updated 2010-04-19 10:12:51 +0800

Hi,

So I'm using ZK in JSP pages. The page I'm working on is made with both HTML and ZK tag (provided by Taglib). The page was created, and worked well, without ZK, and what I'm trying is just to use ZK's component, but keeping the structure of the page, made by HTML tag (based on tables).

The issue is that I've got performance troubles. My page currently has a portallayout, with 4 panels inside, and around 20 components (datebox, textbox and combobox filled with DataBase). And everything is really slow (collapsing panel, loading page, autocompleting, ...).

So I want to know what's the reason for that, and try to fix it. Is it possible that the mix between ZK and HTML's tag is at the bottom of the problems ? Or the fact that I am in a JSP page ?

Thanks.

Mako

Edit: IE 6
ZK 3.6.4
ZK JSPTag 1.4

delete flag offensive retag edit

12 Replies

Sort by ยป oldest newest

answered 2010-04-20 03:00:00 +0800

mako gravatar image mako
60 1 2

updated 2010-04-20 03:00:34 +0800

Another problem is that I have combobox filled with DataBase, and there are lot's of elements (up to 10.000). I think that I'm currently loading everything at the beginning, which would explain why that's so long...Could anyone help me on that ?

The code I use :


<zscript>
ArrayList listCdp = (ArrayList) session.getAttribute("listCdp");
</zscript>
...
<combobox model="@{listCdp}" autodrop="true" width="90%" tabindex="14">
     <comboitem self="@{each='cdp'}" label="@{cdp.label}" value="@{cdp.value}">
</combobox>

By the way, I can't find how the 'value' attribute of comboitem is renderer in the HTML page, does anyone know ?

Thanks.

Mako

link publish delete flag offensive edit

answered 2010-04-20 03:40:38 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

search for paging

link publish delete flag offensive edit

answered 2010-04-20 03:51:06 +0800

SimonPai gravatar image SimonPai
1696 1

Hi mako,

Here is a good reference on Handling huge data using ZK.

Regards,
Simon

link publish delete flag offensive edit

answered 2010-04-20 03:58:40 +0800

mako gravatar image mako
60 1 2

updated 2010-04-20 08:44:41 +0800

@terrytornado :
I've found that page : paging, this is definitely what I was looking for, but they are not using databinding, neither combobox, so I've got some difficulties to apply it to my case. Could you help me doing that ?

@SimonPai :
Once again, that's an example based on grid...Moreover, that's a little bit too complex for me. Do I have to create my own class ? I mean, there isn't any easy way to do that ?

Thanks both for your response.

Mako

link publish delete flag offensive edit

answered 2010-04-20 13:08:01 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-04-20 13:10:13 +0800

search for databinding and combobox. You will find some threads about that.

I prefer automatically databinding only for single properties of a bean!
For listbox, grid, combobox, all what uses a list/set/collection or what else i use the java code way.
Look at the sample page from Robert for databinding samples: http://www.pichelhofer.at/ZKDemo/

best
Stephan

link publish delete flag offensive edit

answered 2010-04-21 03:39:34 +0800

mako gravatar image mako
60 1 2

The problem I have is not for the databinding part, because that works well. But what I want, is loading only the elements displayed by the combobox, not all of them.
In the code I post above, listCdp is a list of LabelValueBean which are around 10.000. I just want to load the 10 or 20 items which are currently seen by the user. I have to add that I can't modify the way I'm working (using listCdp, etc.) because I'm working on an application which already exists, and is used.

Mako

link publish delete flag offensive edit

answered 2010-04-21 07:37:54 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-04-21 07:38:52 +0800

Hmmmmm, i use for such a case a bandbox with a paged listbox and a search field in it.

Have a look on the 'orders' menu point in the Zksample2. There is such a thing to search/select a customer from a list.
Can this help you?

best
Sephan

link publish delete flag offensive edit

answered 2010-04-21 08:04:59 +0800

mako gravatar image mako
60 1 2

I'm having a look at the sample, thanks.

Could you provide me an example of how to do it with bandbox/listbox please ? So I can see if it could fit for me.

Once again, thanks for helping me.

Mako

link publish delete flag offensive edit

answered 2010-04-21 09:23:04 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-04-21 09:23:41 +0800

You can checkout the project codes as runing eclipse projects.

controller: 'de.forsthaus.webui.order.OrderListCtrl.java'

component: Bandbox 'bandbox_OrderList_CustomerSearch'

zul: WEB-INF/pages/order/orderList.zul

best
Stephan

link publish delete flag offensive edit

answered 2010-04-22 07:47:07 +0800

mako gravatar image mako
60 1 2

updated 2010-04-22 07:47:35 +0800

I finally manage to run the example, so I could have a look at the bandbox your talking about. What's bothering me is that there's still a paging in your bandpopup (for the grid). Is it possible to make a listbox with a scroll bar, while still loading only the displayed elements ?

Mako

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: 2010-04-19 10:02:45 +0800

Seen: 2,885 times

Last updated: Apr 23 '10

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