Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4577028
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:17:20+00:00 2026-05-21T20:17:20+00:00

i’ve beeing playing with zk a while and now comes serious things. I’ve successfull

  • 0

i’ve beeing playing with zk a while and now comes serious things.
I’ve successfull integrated spring and zk and the routing
works as i use @controller annotation.so far so good

Now i needed to call a webservice which return a list of objects

 import org.springframework.ui.Model;
 //.....
@RequestMapping("/accounts/personal/list")
public String list(Model model){

    try { 

        ArrayOfAccount result = port.getAccounts( null, 0, 20);
          //i thought with this i can grab the result collection.
          List<IAccount> accounts = result.getIAccount();
        model.addAttribute("accounts", accounts);
    } catch (Exception ex) {
        // TODO handle custom exceptions here
    }

    return "accountslist";
}

the real problem is to get the object in the zul file.

<?xml version="1.0" encoding="UTF-8"?>
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/templates/mainlayout.zul"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<!--<?variable-resolver class="org.zkoss.spring.DelegatingVariableResolver"?>-->
<!--<?variable-resolver class="org.zkoss.spring.init.WebflowVariableResolver"?>-->
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>

 <zk xmlns="http://www.zkoss.org/2005/zul">
 <window self="@{define(content)}" id="pAccountWin">
 <label id="lblTest" value="click me" />
    <div>
        <listbox model="${c:l('accounts')}" id="lstAccount" multiple="true">
            <listhead>
                <listheader label="Account Name" />
                <listheader label="Account Type" />
                <listheader label="Mobile Phone" />
            </listhead>
            <listitem forEach="${c:l('accounts')}" value="${each}" >
                <listcell label="${each.getAccountName()}" />
                <listcell label="${each.getAccountType()}" />
                <listcell label="${each.getMobilePhone()}" />
        </listbox>
    </div>
  </window>  
</zk>

it’s not throwing an error but i feel like i’m not doing something right.And i also know that i can use GenrericForwardComposer to achieve the
same wihtout “hassle”(i believe).this confuses me about whether i’m doing the right thing.

question 1:
How can i achive what i was trying to do as in passing the accounts variable to the frontend?

question 2 :
What’s the best way using ZKspring(no webflows)? Spring Controller to do the routing and ForwardComposer to handle the ajax behaviors (ie events)? for example should a write the code to handle the ajax call when going solely the Spring MVC way?

question 3:
i’m using listbox in this but i would need to do things from context menu on selected object.do you thing grid is suitable for it?

thanks for reading this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T20:17:21+00:00Added an answer on May 21, 2026 at 8:17 pm

    Question 1 answer: ${c:l('accounts') will retrieve a label value with key accounts from i3label-properties file (normally used for internationalization in ZK). If you want to access a variable (normally a Java bean)
    1. declare variable resolver at the top of your page using <variable-resolver class="org.zkoss.spring.DelegatingVariableResolver"?> directive
    2. access Java bean in ZUML using EL expressions for. eg. ${accounts}

    Question 2 answer: I would recommend doing it ZK MVC way i.e extend you controllers from ZK GenericForwardComposer to handle events. You can always use spring to handle the lifecycle of these controller using Spring framework.

    Question 3 answer: I don’t think there is any advantage using grid over listbox in this scenario. In any case you can popup context menu on either grid row select event or listbox listitem select event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.