Accessing Spring Bean in the ZUML page

From Documentation
Revision as of 06:03, 19 July 2010 by Char (talk | contribs) (Created page with '{{ZKDevelopersGuidePageHeader}} Simply declare the <tt>variable-resolver</tt> for <tt>org.zkoss.zkplus.spring.DelegatingVariableResolver</tt> on top of your ZUML page, then, in …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Accessing Spring Bean in the ZUML page


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


Simply declare the variable-resolver for org.zkoss.zkplus.spring.DelegatingVariableResolver on top of your ZUML page, then, in the rest of your page, you can access any Spring-Managed beans directly using its bean-id.

<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
  <window>
  <grid>
    <rows>
     <row forEach="${DataSource.elementsList}">
       <label value="${each}"/>
     </row>
    </rows>
  </grid>
 </window>

variable-resolver will look-up the bean named DataSource automatically for you, and returned a list to the forEach loop.



Last Update : 2010/07/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.