0

How to update a field

asked 2009-04-13 09:53:06 +0800

din gravatar image din
251 1 5

How can I update a field on my window?

delete flag offensive retag edit

11 Replies

Sort by ยป oldest newest

answered 2009-04-13 10:24:20 +0800

iantsai gravatar image iantsai
2755 1

What kind of fields you want update?

link publish delete flag offensive edit

answered 2009-04-13 10:58:36 +0800

din gravatar image din
251 1 5

I want to edit a field on my page but not getting how the flow works...I am getting a definition from my DB I want to update that....Please help

link publish delete flag offensive edit

answered 2009-04-13 11:20:09 +0800

robertpic71 gravatar image robertpic71
1275 1

How do you access you database? Plain JDBC with or w/o beans, hibernate?

Note: You can create a standard-CRUD with Zeta-Forms (a part of ZK Studio). This creates the bean, DAO and a standard GUI using JPA, Hibernate and Spring.

For a simple plain JDBC-Demo check out the JDBC example from like demo >> here <<<

/Robert

link publish delete flag offensive edit

answered 2009-04-13 11:30:43 +0800

din gravatar image din
251 1 5

This example shows the way I can do that for a single row but in case of multiple how does the program recognize which row needs to be updated?

link publish delete flag offensive edit

answered 2009-04-13 11:58:26 +0800

robertpic71 gravatar image robertpic71
1275 1

>> How do you access you database? Plain JDBC with or w/o beans, JPA/hibernate?

Please answer, for better help.

>> case of multiple
How should your program work?
1.) List all records of of file the user select the edit-record?
2.) The user enter an unique key and gets the editform?

However for plain-JDBC (in a webapplication) you perform an SQL like this:
update file set fielda=?, fieldb=? where uniquekey=?key

/Robert

link publish delete flag offensive edit

answered 2009-04-13 12:08:04 +0800

din gravatar image din
251 1 5

Thanks Robert for ur enthu....
It is not to add values in DB, I am displaying the definition from a field and want to update that using the UI, the updated value should get reflected in the DB.
I am using palin JDBC with beans.

link publish delete flag offensive edit

answered 2009-04-14 01:35:22 +0800

iantsai gravatar image iantsai
2755 1

I think you should give some example first, and how to change DB schema's column in SQL Query is not what ZK focused.

link publish delete flag offensive edit

answered 2009-04-15 05:31:55 +0800

din gravatar image din
251 1 5

For example I have 2 rows, in one i am showing name and in other surname.
I want to change the display name and surname on the run by providing the edit button.
If a user comes and edit the name then how the change takes place? How can I access the Ids of the button to recognize which field has been chage and now what changes I need to show?
Please Reply...

link publish delete flag offensive edit

answered 2009-04-15 08:36:16 +0800

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

@din


have a look at this thread and study the code. In it are a DialogWindow too
that handles all CRUD for two textboxes.
this

What you can see is:
-------------------------------
1. Listbox with Itemrenderer and sorting columns(comparator)
2. Event Handling in java code.
2.1 doubleClick on row opens a dialogWindow (remarked SingleRowClick or IconClick opens Dialog)
3. overhanded parameters from ListPage to DialogPage.
4. CRUD operations in the dialogWindow with readonly/edit modus.

The data comes from a table by a ServiceDAO. You must fill it by your own.

I have updated the sources (zk 3.5.2).

whishes Stephan
PS: Help to prevent the global warming by writing cool software.

link publish delete flag offensive edit

answered 2009-04-15 11:14:49 +0800

din gravatar image din
251 1 5

Thanks terry...
I have created an application but inspite having login.zul at the right place it is throwing error 404...
What could be the reason???any entry in web.xml or class path???

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: 2009-04-13 09:53:06 +0800

Seen: 330 times

Last updated: Apr 15 '09

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