0

Mixing template with form

asked 2012-03-29 23:57:14 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi *,

I have a case, where my "form" is dynamic generated from a list of pojos.
Something like this.

<grid model="@bind(vm.products)" form="id('fx') @load(vm.products) @save(vm.products, after='save')">
    <template name="model">
        <row>
            <label value="@bind(fx.acronym)"/>
            <intbox value="@bind(fx.price)"/> 
        </row>
    </template>
</grid>
<button label="save" onClick="@command('save')"/>

Is it possible? I mean, I don't think that ZK supports this kind of complexity, but is it possible if I implement/override some interfaces/classes?
If so could someone give me some hints on which classes/interfaces should I implement?

Thanks,
Madruga

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2012-04-03 00:50:32 +0800

samchuang gravatar image samchuang
4084 4

updated 2012-04-03 00:52:16 +0800

hi

from the doc, form object is create by ZK, and it's role is a Middle Object.

doc mentioned it only stores those properties which attributes are bound to

from the description, seems there's no need for developer to create their own form object, at least, I can't think of any reason.

Could you share your point, why you need create form object by yourself ?

link publish delete flag offensive edit

answered 2012-04-11 01:05:19 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

Hi Sam,

My case is that my middle object is a List<Object> products, and I want my Form to set/get values on my products list, something like this:
middleObjectSimulatingProducts.getAt(index).set/getValue().

Basically, the current forms gives me a middle object that mirrors a single bean, I want a form object which will mirror a list of beans for me.

Hope I made myself clear.

Thanks for the help,
Regards - Madruga

link publish delete flag offensive edit

answered 2012-04-18 01:19:36 +0800

samchuang gravatar image samchuang
4084 4

updated 2012-04-18 01:19:52 +0800

hi

the doc seems update, there's a section Initialize_with_Form_Object may help.

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: 2012-03-29 23:57:14 +0800

Seen: 237 times

Last updated: Apr 18 '12

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