0

Editable interface to add users

asked 2013-09-22 03:30:13 +0800

daovallec gravatar image daovallec
11 2

updated 2013-09-22 03:32:43 +0800

I am intenting do an interface like:

zkdemo/grid/inlinerowediting

But with Users from my database, the problem is that: i have my DAO and i have a method to find all Users, And when i do click in the edit Button i need 2 texboxes to password and retypePassword, and i need verify each texbox, to do the seim, and later save in my database.

I have:

  <template name="editable">
                <row>
                    <textbox 
                        value="@load(each.languageContribution.Name)
                    @save(each.languageContribution.Name, before='confirm')" />
                    <textbox 
                        value="@load(each.languageContribution.password)     
                 @save(each.languageContribution.password, before='confirm')" />

                value="@load(each.languageContribution.Repassword) 
                @save(each.languageContribution.Repassword, before='confirm')" />

                    <textbox 
                        value="@load(each.languageContribution.role)
                     @save(each.languageContribution.role, before='confirm')" />

                    <checkbox 
                        value="@load(each.languageContribution.enabled)     @save(each.languageContribution.enabled, before='confirm')" />

But i have errors because in my class User i do not have RePassword and if i created a model with List<users> users and List<string> Repasswords.

I do not know how i can load the Users with the passwords and Repasswords, and how can i Verify if the password is equal to Repassword.

Thanks

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0
link publish delete flag offensive edit
0

answered 2013-09-23 10:07:16 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2013-09-23 10:23:02 +0800

You can use form binding, and a form validator, to validate dependent attributes. If you don't want to add a Transient field to your Entity class, you can wrap the Entity by a Ui object (UiUser in the example below).

Please refer to this fiddle where I provide an example putting it all together.

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2013-09-22 03:30:13 +0800

Seen: 16 times

Last updated: Sep 23 '13

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