1

ZK 8 Form Binding For List of Records

asked 2016-12-27 06:33:59 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

Hi

All the examples in ZK are showing with one record with add/edit/delete for Form Binding with middle Object. Do we have any examples how to handle Multiple records where the UI is in the editable listbox with components as textbox, drop down and check box .

For example , here is the sample UI which contains inline editing. So how to use Form Binding with middle object

https://www.zkoss.org/zkdemo/grid/inline_editing

delete flag offensive retag edit

Comments

"inline" is a property of an InputElement to change its appearance so it's irrelevant for using form binding.

cor3000 ( 2016-12-28 02:51:19 +0800 )edit

Again in order to help efficiently please provide a RUNNABLE example that shows your UI requirements. Since there are many ways to achieve this I would like to avoid spending time giving an example that doesn't help your case. For more specific questions I suggest contacting our customer support.

cor3000 ( 2016-12-28 02:55:51 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-01-29 23:05:57 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

I am not able to give runnable example. But here it the piece of code

<div>
        <tabbox id="hpitab">
            <tabs sclass="linktabs" id="maintabs"
                children="@bind(vm.encounterHeadingList)">
                <template name="children" var="item">
                    <tab label="@load(item.headingName)"
                        sclass="maintabtext2" />
                </template>
            </tabs>
            <tabpanels children="@bind(vm.encounterHeadingList)">
                <template name="children">
                    <tabpanel>
                        <div align="right">
                            <button
                                onClick="@command('onLoadNormalHeading',record=each)"
                                label="Load Normal Summary" sclass="mybtn">
                            </button>
                        </div>
                        <ckeditor vflex="1" height="350px"
                            value="@bind(each.headingSummary)"
                            customConfigurationsPath="@bind(vm.configPath)"
                            toolbar="MyToolbar" />
                    </tabpanel>
                </template>
            </tabpanels>
        </tabbox>
    </div>
link publish delete flag offensive edit
0

answered 2016-12-28 04:14:12 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2016-12-28 04:15:21 +0800

This smalltalk contains an example using a form proxy around a more complex Order-object that contains a Basket-object with a collection of BasketItems.

It is rendered in basket.zul. The collection of basketItems is wrapped into a live-ListModelList in the BasketViewModel. To enable simple adding/removing of items using the List add/remove functions and have automatic UI updates by using a ListModel implementation.

As mentioned before there multiple ways to implement such behavior so don't take this as the ONLY way to do this.

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

RSS

Stats

Asked: 2016-12-27 06:33:59 +0800

Seen: 44 times

Last updated: Jan 29 '18

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