0

Petshop Question

asked 2009-02-01 01:24:45 +0800

sreed gravatar image sreed
195 1 3 5

I am just learning about ZK and looking at the Petshop demo, catalog.zul,I do not understand how $(categories} is resolved to a value. I think it's using the getCategories() method of CatalogFacade but I don't see how/where that is specified. Any help would be much appreciated. Here's the code snippet:

<tabpanels>
  <tabpanel forEach="${categories}" height="380px" >
    <vbox>
    <zscript>
      import org.zkforge.petshop.model.CatalogFacade;
      List tmpproducts = new CatalogFacade().getProducts(each.categoryID);
    </zscript>
    <toolbarbutton forEach="${tmpproducts}" label="${each.name}" tooltiptext="${each.description}">
      <attribute name="onClick">{
        import org.zkforge.petshop.model.Item;
        String pID = self.getAttribute("productID");
        List items = catalogwin.getItems(pID);
        Item item = items.get(0);
        catalogwin.refreshThumbs(items);
        catalogwin.refreshItem(item);
      }</attribute>
      <custom-attributes productID = "${each.productID}"/>
    </toolbarbutton>
    </vbox>
  </tabpanel>
</tabpanels>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-02-01 18:18:33 +0800

sreed gravatar image sreed
195 1 3 5

updated 2009-02-01 18:19:52 +0800

I figured this out. In case someone else encounters this question, the catalog.zul window 'uses' CatalogWindow which defines the categories variable in its constructor and assigns it the result of CatalogFacade.getCategories().

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: 2009-02-01 01:24:45 +0800

Seen: 152 times

Last updated: Feb 01 '09

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