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 8060017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:51:04+00:00 2026-06-05T09:51:04+00:00

I have a page with two different View Models: <?page title=My page contentType=text/html;charset=UTF-8?> <div

  • 0

I have a page with two different View Models:

<?page title="My page" contentType="text/html;charset=UTF-8"?>
<div apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('com.mycompany.FirstViewModel')">
<!-- A lot of unimportant stuff -->
<tabbox>
    <tabs>
        <tab label="Tab1" ></tab>
                    <!-- Other unimportant tabs -->
    </tabs>
    <tabpanels>
        <tabpanel>
        <include src="inc/other.zul" p="@ref(vm.selected)" pid="@ref(vm.selected.id)" ></include>
        </tabpanel>
    </tabpanels>
</tabbox>
</div>

And the include is:

<window>
    <label id="sid" value="@load(pid)" />
    <div apply="org.zkoss.bind.BindComposer"
      viewModel="@id('vms') @init('com.mycompany.SecondViewModel')">
        <listbox model="@id('vars') @load(p.someList)"
            selectedItem="@bind(vms.selected)"
            emptyMessage="No data in list">
                    <!-- Template and stuff -->
        </listbox>
        <label id="sid1" value="@load(pid)" />
    </div>
</window>

The problem is that once I define the second viewModel, all the external references are inaccessible: I have a value for the first label, but I have no values for the listbox or the second label. Is there a way to do that? I tried with no success to do this:

<div apply="org.zkoss.bind.BindComposer"
viewModel="@id('vms') @init('com.mycompany.SecondViewModel')" list="@ref(p.someList)">
<listbox model="@id('vars') @load(list)"
    selectedItem="@bind(vms.selected)"
    emptyMessage="No data in list">

I could merge the second View Model in the first one, but that wouldn’t be very convenient! I am also open to other solutions which allow me to have a modular approach.

My version of ZK is 6.0.1

  • 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-06-05T09:51:07+00:00Added an answer on June 5, 2026 at 9:51 am

    It is (was) actually a bug in ZK, which has been fixed for a future version.

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

Sidebar

Related Questions

I have a page with two Listviews (with two different data sources). I have
I have a page that displays a table in two different modes. In each
I have a page with the following two divs: <div id=searchResults> </div> <div class=postSearchOptions
I'm trying to set up a view that displays two different models. For example,
I have a view, called a selector, which is essentially two pieces of text,
I have one (razor) page that contain 5 different partial views. Each partial view
I have a view with two different actions of the same model (An item
I have a page with two tabs that I want to be able to
I have a page with two buttons, one Button opens a popup window with
I have an ASPX page with two RequiredFieldValidator and a button to go to

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.