2 Replies Latest reply on Jan 12, 2010 1:30 PM by boy18nj

    how to define page variables?

    vc5

      hihi all,

       

      i want to define a variable on my page that holds static lookup data and then be able to reference this variable from other components that require the data.  semantically, something like the following pseudo code:

       

      <ui:param name="countryListItems">
      <f:selectItem itemLabel="Italy" itemValue="it" />
      <f:selectItem itemLabel="Spain" itemValue="sp" />
      <f:selectItem itemLabel="France" itemValue="fr" />
      </ui:param>
      
      <h:selectOneMenu value="myBean.firstCountry">
      <f:selectItems value="#{countryListItems}" />
      </h:selectOneMenu>
      
      <h:selectOneMenu value="myBean.secondCountry">
      <f:selectItems value="#{countryListItems} />
      </h:selectOneMenu>
      
      

       

      i have been experimenting with a few things but still unsuccessful... is it possible?

       

      thanks!

      -v

        • 1. Re: how to define page variables?
          vc5

          hihi answering my own question here.

           

          because my page is organized by many layers of templates, i was able to use ui:define at the top level and trickle this down to where i needed to use the data.  the problem i had was not realizing ui:define does not work with ui:include... i had to change my templating to use s:decorate instead of ui:include

           

          hope this makes sense.

          • 2. Re: how to define page variables?
            boy18nj
            Can you please show your code, what exactly you try to mean?