0

bind live data to grid from resultSet in JSP

asked 2008-06-24 16:31:29 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: cobetienca

I've already selected data in to a resultSet. Now I need to bind these records into the Grid, but i don't know how. I've walked through lots of small-talk, documentation but all I found is using List for ListBox or Combobox.

I've also try to retrieve data from resultSet, put to a List and bind to grid using EL expression but it's no use. Can anyone give me an example??

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2008-06-25 15:13:34 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: robertpic71

Here is an example for binding to grid:

<grid id="UserGrid" mold="paging">
<columns sizable="true">
<column label="Profil" width="80px" />
<column label="Description" />
..
</columns>
<rows id="personsGridRows">
<row forEach="${allUsers}">
<label value="${each.mprof}" />
<label value="${each.mname}" />
...
</row>
</rows>
</grid>

See also http://www.zkoss.org/doc/devguide/ch14s04s02.html
There is an example, binding JDBC to Listbox.

I prefer binding via annoations, check my homepage for examples:
http://www.pichelhofer.at/ZKDemo/

Note: You cannot bind a resultSet as model. You has to convert the resultset to domainclasses or a type of map - or use a OR-Mapper like Hibernate, iBatis...

I've written a JDBCModel (alphastatus, i don't want to post the code at this time).
But feel free to post, if you have questions about JDBC-Binding.

/Robert


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: 2008-06-24 16:31:29 +0800

Seen: 325 times

Last updated: Jun 25 '08

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