0

Can someone tell me how to determine the input of "model" ?

asked 2013-04-22 09:17:59 +0800

kimtch gravatar image kimtch
3 2

When I try to use the mvc and display something by LISTBOX,

I have to declare the model like

<listbox model="${sth.here}" ...............><="" p="">

sth should be the controller, and then what should I place for "here"?

In the documentation, I dont understand what it is about.

delete flag offensive retag edit

Comments

What you want to achieve here can you please explain briefly ?

sjoshi ( 2013-04-22 10:10:09 +0800 )edit

for example, the link from ZK demo http://www.zkoss.org/zkdemo/grid/load_on_demand (http://www.zkoss.org/zkdemo/grid/loadondemand)

in the "View" part, <div apply="demo.grid.loadondemand.LoadOnDemandController"> - To find the on_dem.... class <grid height="400px" model="${$composer.mailData}"> - how about this? where is the mailData?

kimtch ( 2013-04-23 02:38:37 +0800 )edit

Hi sjoshi, i would like to know why composer.mailData, this "mailData" never appear in model or controller.

kimtch ( 2013-04-23 07:50:53 +0800 )edit

See my edited answer

sjoshi ( 2013-04-23 08:07:14 +0800 )edit

Thanks, sjoshi. can I assume that ZK will do some auto databinding? and second another question in this example,

<template name ="model:group">

model should point to the grid model, then how about :group?

kimtch ( 2013-04-23 08:14:31 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-04-23 06:24:02 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

updated 2013-04-23 08:24:59 +0800

You can check in LoadOnDemandController.java class there is a method ..

public GroupsModel<Mail, Object, Object> getMailData() {
        return groupsModel;
    }

This will return the model data which required to show in the ZUl page and Data will be provided by MailModel.java class .

You know that in ZK every ZUL page varaible bind with java code get/set method so here in your ZUL page you have model="${$composer.mailData}" and in your java class you have getMailData() so its not matter here if you created a variable List mailData; or not in your java class and Java class take getMailData() as a simple method so it is working fine without any issue. For your grounpbox question see this Zk Groupbox fact

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-04-22 09:17:59 +0800

Seen: 28 times

Last updated: Apr 23 '13

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