You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hugo Palma <hp...@digitalis.pt> on 2005/01/11 16:48:36 UTC

Dynamic jwcid

I have a template where the choice of which component to insert is done 
at runtime. So the template would look something like this:

...........
<span jwcid="ognl:componentName"/>
..........

where "componentName" is a property of the current page.
Is there a way i can do this ?


Thanks

Hugo

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Dynamic jwcid

Posted by Hugo Palma <hp...@digitalis.pt>.
 From the example i think this is exactly what i need, i'll try it out 
right away.
Thanks for the help.

Hugo

Michael Henderson wrote:

> Try a DynamicBlock: 
> http://www.behindthesite.com/blog/C1931765677/E572405339/index.html
>
> One day I'll get around to documenting this and packaging it up. It 
> does have some limitations. You can't pass parameters to the block 
> content and since it creates Blocks on demand you may get 
> indeterminate behaviour in pageBegin/EndRender and other request cycle 
> listener methods you implement on your components which are placed 
> inside the DunamicBlock
>
> Mike
>
>
> Hugo Palma wrote:
>
>> But wouldn't that mean that if a menu was used in more than one page 
>> i would have to replicate the html for the menu across all the pages 
>> that used it ?
>>
>> Mind Bridge wrote:
>>
>>> Hi,
>>>  
>>> I would do it by having the page itself return Block that will be 
>>> used as a menu. In that way there is no need for a "global 
>>> knowledge" as to what the possible menues are and a page can control 
>>> its presentation without worrying if it will affect the others.
>>>  
>>>  
>>> A possible way to implement that is to have a parameter of type 
>>> Block in the Border component. If the parameter is not bound, then 
>>> Border renders the default menu. If it is bound, then it renders the 
>>> Block that is provided. It is a responsibility of the page to pass 
>>> the correct menu Block as an argument to Border.
>>>  
>>> This approach involves only local knowledge and makes pages 
>>> independent.
>>>  
>>> I hope it helps,
>>> -mb
>>>  
>>>
>>>     ----- Original Message -----
>>>     *From:* Hugo Palma <ma...@digitalis.pt>
>>>     *To:* Tapestry users <ma...@jakarta.apache.org>
>>>     *Sent:* Tuesday, January 11, 2005 6:50 PM
>>>     *Subject:* Re: Dynamic jwcid
>>>
>>>     Thanks, it works great.
>>>     But i'm still not sure this is the right solution for what i'm
>>>     trying to achieve.
>>>     What i want is actually quite simple and i'm sure other people
>>>     have come across this. I have an application that lets each page
>>>     define the corresponding menu that gets displayed along with it.
>>>     If none is defined then the default menu is displayed. I
>>>     implemented this as a persistent property of a base page class
>>>     that keeps the name of the menu component to display. Then the
>>>     Border component renders a generic Menu component that has all
>>>     the possible menus as blocks and the inserts the correct one
>>>     based on the page property.
>>>
>>>     Is there a better way to do this ?
>>>
>>>
>>>     Thanks.
>>>
>>>     Hugo
>>>
>>>     Mind Bridge wrote:
>>>
>>>> Hi,
>>>>
>>>> That is not possible the way you've described it, BUT you can use
>>>> Block/RenderBlock to achieve exactly the same effect.
>>>>
>>>>
>>>> Place the possible components into a number of Blocks (possibly 
>>>> even located
>>>> in different pages). In the place you've listed below place a 
>>>> RenderBlock
>>>> component and pass it the specific Block you want rendered. In 
>>>> other words,
>>>> you can choose which of the Blocks to pass at runtime and the page 
>>>> structure
>>>> becomes dynamic.
>>>>
>>>> I hope this helps.
>>>>
>>>> -mb
>>>>
>>>> ----- Original Message ----- From: "Hugo Palma" <hp...@digitalis.pt>
>>>> To: "Tapestry users" <ta...@jakarta.apache.org>
>>>> Sent: Tuesday, January 11, 2005 5:48 PM
>>>> Subject: Dynamic jwcid
>>>>
>>>>
>>>>  
>>>>
>>>>> I have a template where the choice of which component to insert is 
>>>>> done
>>>>> at runtime. So the template would look something like this:
>>>>>
>>>>> ...........
>>>>> <span jwcid="ognl:componentName"/>
>>>>> ..........
>>>>>
>>>>> where "componentName" is a property of the current page.
>>>>> Is there a way i can do this ?
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Hugo
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: 
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>> No virus found in this incoming message.
>>>>> Checked by AVG Anti-Virus.
>>>>> Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>>>>
>>>>>
>>>>>   
>>>>
>>>>
>>>>
>>>>
>>>>  
>>>>
>>>
>>>     --
>>>     Hugo Palma
>>>     Programador Sénior
>>>
>>>     *e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
>>>     *tel:*++351 938012004 *fax:*++351 214408999
>>>     *homepage:* www.digitalis.pt <http://www.digitalis.pt>
>>>
>>>     <http://www.digitalis.pt> <http://www.digitalis.pt>
>>>
>>>     
>>> ------------------------------------------------------------------------ 
>>>
>>>     No virus found in this incoming message.
>>>     Checked by AVG Anti-Virus.
>>>     Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 
>>> 1/10/2005
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> No virus found in this outgoing message.
>>> Checked by AVG Anti-Virus.
>>> Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>>
>>>  
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>
>> -- 
>>
>> Hugo Palma
>> Programador Sénior
>>
>> *e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
>> *tel:*++351 938012004 *fax:*++351 214408999
>> *homepage:* www.digitalis.pt <http://www.digitalis.pt>
>>
>> <http://www.digitalis.pt> <http://www.digitalis.pt>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

-- 

Hugo Palma
Programador Sénior

*e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
*tel:*++351 938012004 *fax:*++351 214408999
*homepage:* www.digitalis.pt <http://www.digitalis.pt>

<http://www.digitalis.pt> <http://www.digitalis.pt>


Re: Dynamic jwcid

Posted by Michael Henderson <mh...@mac.com>.
Try a DynamicBlock: 
http://www.behindthesite.com/blog/C1931765677/E572405339/index.html

One day I'll get around to documenting this and packaging it up. It does 
have some limitations. You can't pass parameters to the block content 
and since it creates Blocks on demand you may get indeterminate 
behaviour in pageBegin/EndRender and other request cycle listener 
methods you implement on your components which are placed inside the 
DunamicBlock

Mike


Hugo Palma wrote:

> But wouldn't that mean that if a menu was used in more than one page i 
> would have to replicate the html for the menu across all the pages 
> that used it ?
>
> Mind Bridge wrote:
>
>> Hi,
>>  
>> I would do it by having the page itself return Block that will be 
>> used as a menu. In that way there is no need for a "global knowledge" 
>> as to what the possible menues are and a page can control its 
>> presentation without worrying if it will affect the others.
>>  
>>  
>> A possible way to implement that is to have a parameter of type 
>> Block in the Border component. If the parameter is not bound, then 
>> Border renders the default menu. If it is bound, then it renders the 
>> Block that is provided. It is a responsibility of the page to pass 
>> the correct menu Block as an argument to Border.
>>  
>> This approach involves only local knowledge and makes pages independent.
>>  
>> I hope it helps,
>> -mb
>>  
>>
>>     ----- Original Message -----
>>     *From:* Hugo Palma <ma...@digitalis.pt>
>>     *To:* Tapestry users <ma...@jakarta.apache.org>
>>     *Sent:* Tuesday, January 11, 2005 6:50 PM
>>     *Subject:* Re: Dynamic jwcid
>>
>>     Thanks, it works great.
>>     But i'm still not sure this is the right solution for what i'm
>>     trying to achieve.
>>     What i want is actually quite simple and i'm sure other people
>>     have come across this. I have an application that lets each page
>>     define the corresponding menu that gets displayed along with it.
>>     If none is defined then the default menu is displayed. I
>>     implemented this as a persistent property of a base page class
>>     that keeps the name of the menu component to display. Then the
>>     Border component renders a generic Menu component that has all
>>     the possible menus as blocks and the inserts the correct one
>>     based on the page property.
>>
>>     Is there a better way to do this ?
>>
>>
>>     Thanks.
>>
>>     Hugo
>>
>>     Mind Bridge wrote:
>>
>>>Hi,
>>>
>>>That is not possible the way you've described it, BUT you can use
>>>Block/RenderBlock to achieve exactly the same effect.
>>>
>>>
>>>Place the possible components into a number of Blocks (possibly even located
>>>in different pages). In the place you've listed below place a RenderBlock
>>>component and pass it the specific Block you want rendered. In other words,
>>>you can choose which of the Blocks to pass at runtime and the page structure
>>>becomes dynamic.
>>>
>>>I hope this helps.
>>>
>>>-mb
>>>
>>>----- Original Message ----- 
>>>From: "Hugo Palma" <hp...@digitalis.pt>
>>>To: "Tapestry users" <ta...@jakarta.apache.org>
>>>Sent: Tuesday, January 11, 2005 5:48 PM
>>>Subject: Dynamic jwcid
>>>
>>>
>>>  
>>>
>>>>I have a template where the choice of which component to insert is done
>>>>at runtime. So the template would look something like this:
>>>>
>>>>...........
>>>><span jwcid="ognl:componentName"/>
>>>>..........
>>>>
>>>>where "componentName" is a property of the current page.
>>>>Is there a way i can do this ?
>>>>
>>>>
>>>>Thanks
>>>>
>>>>Hugo
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>-- 
>>>>No virus found in this incoming message.
>>>>Checked by AVG Anti-Virus.
>>>>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>>>
>>>>
>>>>    
>>>>
>>>
>>>
>>>
>>>  
>>>
>>
>>     -- 
>>
>>     Hugo Palma
>>     Programador Sénior
>>
>>     *e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
>>     *tel:*++351 938012004 *fax:*++351 214408999
>>     *homepage:* www.digitalis.pt <http://www.digitalis.pt>
>>
>>     <http://www.digitalis.pt> <http://www.digitalis.pt>
>>
>>     ------------------------------------------------------------------------
>>     No virus found in this incoming message.
>>     Checked by AVG Anti-Virus.
>>     Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>
>>------------------------------------------------------------------------
>>
>>No virus found in this outgoing message.
>>Checked by AVG Anti-Virus.
>>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>
>>  
>>
>>------------------------------------------------------------------------
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
> -- 
>
> Hugo Palma
> Programador Sénior
>
> *e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
> *tel:*++351 938012004 *fax:*++351 214408999
> *homepage:* www.digitalis.pt <http://www.digitalis.pt>
>
> <http://www.digitalis.pt> <http://www.digitalis.pt>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Dynamic jwcid

Posted by Hugo Palma <hp...@digitalis.pt>.
Thanks, but the DynamicBlock components really does satisfy all my needs.
Thanks for the help.

Hugo

Mind Bridge wrote:

> Not at all -- here is how to do it:
>  
> You can place a specific menu block in a separate page (say 
> 'MyMenuPage') within a block named MyMenuBlock. Then in every page 
> that uses that menu you can reference it by doing "ognl: 
> requestCycle.getPage('MyMenuPage').components.MyMenuBlock". In other 
> words you can pass the above to the Border parameter I mentioned earlier.
>  
> The names are tentitive of course -- no problem to change them to 
> whatever you feel makes sense.
>
>     ----- Original Message -----
>     *From:* Hugo Palma <ma...@digitalis.pt>
>     *To:* Tapestry users <ma...@jakarta.apache.org>
>     *Sent:* Tuesday, January 11, 2005 7:40 PM
>     *Subject:* Re: Dynamic jwcid
>
>     But wouldn't that mean that if a menu was used in more than one
>     page i would have to replicate the html for the menu across all
>     the pages that used it ?
>
>     Mind Bridge wrote:
>
>>     Hi,
>>      
>>     I would do it by having the page itself return Block that will be
>>     used as a menu. In that way there is no need for a "global
>>     knowledge" as to what the possible menues are and a page can
>>     control its presentation without worrying if it will affect the
>>     others.
>>      
>>      
>>     A possible way to implement that is to have a parameter of type
>>     Block in the Border component. If the parameter is not bound,
>>     then Border renders the default menu. If it is bound, then it
>>     renders the Block that is provided. It is a responsibility of the
>>     page to pass the correct menu Block as an argument to Border.
>>      
>>     This approach involves only local knowledge and makes pages
>>     independent.
>>      
>>     I hope it helps,
>>     -mb
>>      
>>
>>         ----- Original Message -----
>>         *From:* Hugo Palma <ma...@digitalis.pt>
>>         *To:* Tapestry users <ma...@jakarta.apache.org>
>>         *Sent:* Tuesday, January 11, 2005 6:50 PM
>>         *Subject:* Re: Dynamic jwcid
>>
>>         Thanks, it works great.
>>         But i'm still not sure this is the right solution for what
>>         i'm trying to achieve.
>>         What i want is actually quite simple and i'm sure other
>>         people have come across this. I have an application that lets
>>         each page define the corresponding menu that gets displayed
>>         along with it. If none is defined then the default menu is
>>         displayed. I implemented this as a persistent property of a
>>         base page class that keeps the name of the menu component to
>>         display. Then the Border component renders a generic Menu
>>         component that has all the possible menus as blocks and the
>>         inserts the correct one based on the page property.
>>
>>         Is there a better way to do this ?
>>
>>
>>         Thanks.
>>
>>         Hugo
>>
>>         Mind Bridge wrote:
>>
>>>Hi,
>>>
>>>That is not possible the way you've described it, BUT you can use
>>>Block/RenderBlock to achieve exactly the same effect.
>>>
>>>
>>>Place the possible components into a number of Blocks (possibly even located
>>>in different pages). In the place you've listed below place a RenderBlock
>>>component and pass it the specific Block you want rendered. In other words,
>>>you can choose which of the Blocks to pass at runtime and the page structure
>>>becomes dynamic.
>>>
>>>I hope this helps.
>>>
>>>-mb
>>>
>>>----- Original Message ----- 
>>>From: "Hugo Palma" <hp...@digitalis.pt>
>>>To: "Tapestry users" <ta...@jakarta.apache.org>
>>>Sent: Tuesday, January 11, 2005 5:48 PM
>>>Subject: Dynamic jwcid
>>>
>>>
>>>  
>>>
>>>>I have a template where the choice of which component to insert is done
>>>>at runtime. So the template would look something like this:
>>>>
>>>>...........
>>>><span jwcid="ognl:componentName"/>
>>>>..........
>>>>
>>>>where "componentName" is a property of the current page.
>>>>Is there a way i can do this ?
>>>>
>>>>
>>>>Thanks
>>>>
>>>>Hugo
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>-- 
>>>>No virus found in this incoming message.
>>>>Checked by AVG Anti-Virus.
>>>>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>>>
>>>>
>>>>    
>>>>
>>>
>>>
>>>
>>>  
>>>
>>
>>         -- 
>>
>>         Hugo Palma
>>         Programador Sénior
>>
>>         *e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
>>         *tel:*++351 938012004 *fax:*++351 214408999
>>         *homepage:* www.digitalis.pt <http://www.digitalis.pt>
>>
>>         <http://www.digitalis.pt> <http://www.digitalis.pt>
>>
>>         ------------------------------------------------------------------------
>>         No virus found in this incoming message.
>>         Checked by AVG Anti-Virus.
>>         Version: 7.0.300 / Virus Database: 265.6.10 - Release Date:
>>         1/10/2005
>>
>>------------------------------------------------------------------------
>>
>>No virus found in this outgoing message.
>>Checked by AVG Anti-Virus.
>>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>
>>  
>>
>>------------------------------------------------------------------------
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>     -- 
>
>     Hugo Palma
>     Programador Sénior
>
>     *e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
>     *tel:*++351 938012004 *fax:*++351 214408999
>     *homepage:* www.digitalis.pt <http://www.digitalis.pt>
>
>     <http://www.digitalis.pt> <http://www.digitalis.pt>
>
>     ------------------------------------------------------------------------
>     No virus found in this incoming message.
>     Checked by AVG Anti-Virus.
>     Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>
>------------------------------------------------------------------------
>
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>

Re: Dynamic jwcid

Posted by Mind Bridge <mi...@yahoo.com>.
Assinatura para e-mails DigitalisNot at all -- here is how to do it:

You can place a specific menu block in a separate page (say 'MyMenuPage') within a block named MyMenuBlock. Then in every page that uses that menu you can reference it by doing "ognl: requestCycle.getPage('MyMenuPage').components.MyMenuBlock". In other words you can pass the above to the Border parameter I mentioned earlier.

The names are tentitive of course -- no problem to change them to whatever you feel makes sense.
  ----- Original Message ----- 
  From: Hugo Palma 
  To: Tapestry users 
  Sent: Tuesday, January 11, 2005 7:40 PM
  Subject: Re: Dynamic jwcid


  But wouldn't that mean that if a menu was used in more than one page i would have to replicate the html for the menu across all the pages that used it ?

  Mind Bridge wrote: 
    Hi,

    I would do it by having the page itself return Block that will be used as a menu. In that way there is no need for a "global knowledge" as to what the possible menues are and a page can control its presentation without worrying if it will affect the others.


    A possible way to implement that is to have a parameter of type Block in the Border component. If the parameter is not bound, then Border renders the default menu. If it is bound, then it renders the Block that is provided. It is a responsibility of the page to pass the correct menu Block as an argument to Border.

    This approach involves only local knowledge and makes pages independent. 

    I hope it helps,
    -mb

      ----- Original Message ----- 
      From: Hugo Palma 
      To: Tapestry users 
      Sent: Tuesday, January 11, 2005 6:50 PM
      Subject: Re: Dynamic jwcid


      Thanks, it works great.
      But i'm still not sure this is the right solution for what i'm trying to achieve.
      What i want is actually quite simple and i'm sure other people have come across this. I have an application that lets each page define the corresponding menu that gets displayed along with it. If none is defined then the default menu is displayed. I implemented this as a persistent property of a base page class that keeps the name of the menu component to display. Then the Border component renders a generic Menu component that has all the possible menus as blocks and the inserts the correct one based on the page property.

      Is there a better way to do this ?


      Thanks.

      Hugo

      Mind Bridge wrote: 
Hi,

That is not possible the way you've described it, BUT you can use
Block/RenderBlock to achieve exactly the same effect.


Place the possible components into a number of Blocks (possibly even located
in different pages). In the place you've listed below place a RenderBlock
component and pass it the specific Block you want rendered. In other words,
you can choose which of the Blocks to pass at runtime and the page structure
becomes dynamic.

I hope this helps.

-mb

----- Original Message ----- 
From: "Hugo Palma" <hp...@digitalis.pt>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, January 11, 2005 5:48 PM
Subject: Dynamic jwcid


  I have a template where the choice of which component to insert is done
at runtime. So the template would look something like this:

...........
<span jwcid="ognl:componentName"/>
..........

where "componentName" is a property of the current page.
Is there a way i can do this ?


Thanks

Hugo

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005


    


  

      -- 

      Hugo Palma 
      Programador S�nior 

      e-mail:hpalma@digitalis.pt 
      tel:++351 938012004 fax:++351 214408999 
      homepage: www.digitalis.pt 

       



--------------------------------------------------------------------------
      No virus found in this incoming message.
      Checked by AVG Anti-Virus.
      Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005

----------------------------------------------------------------------------
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005

  ----------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

  -- 

  Hugo Palma 
  Programador S�nior 

  e-mail:hpalma@digitalis.pt 
  tel:++351 938012004 fax:++351 214408999 
  homepage: www.digitalis.pt 

   



------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG Anti-Virus.
  Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005

Re: Dynamic jwcid

Posted by Hugo Palma <hp...@digitalis.pt>.
But wouldn't that mean that if a menu was used in more than one page i 
would have to replicate the html for the menu across all the pages that 
used it ?

Mind Bridge wrote:

> Hi,
>  
> I would do it by having the page itself return Block that will be used 
> as a menu. In that way there is no need for a "global knowledge" as to 
> what the possible menues are and a page can control its presentation 
> without worrying if it will affect the others.
>  
>  
> A possible way to implement that is to have a parameter of type 
> Block in the Border component. If the parameter is not bound, then 
> Border renders the default menu. If it is bound, then it renders the 
> Block that is provided. It is a responsibility of the page to pass the 
> correct menu Block as an argument to Border.
>  
> This approach involves only local knowledge and makes pages independent.
>  
> I hope it helps,
> -mb
>  
>
>     ----- Original Message -----
>     *From:* Hugo Palma <ma...@digitalis.pt>
>     *To:* Tapestry users <ma...@jakarta.apache.org>
>     *Sent:* Tuesday, January 11, 2005 6:50 PM
>     *Subject:* Re: Dynamic jwcid
>
>     Thanks, it works great.
>     But i'm still not sure this is the right solution for what i'm
>     trying to achieve.
>     What i want is actually quite simple and i'm sure other people
>     have come across this. I have an application that lets each page
>     define the corresponding menu that gets displayed along with it.
>     If none is defined then the default menu is displayed. I
>     implemented this as a persistent property of a base page class
>     that keeps the name of the menu component to display. Then the
>     Border component renders a generic Menu component that has all the
>     possible menus as blocks and the inserts the correct one based on
>     the page property.
>
>     Is there a better way to do this ?
>
>
>     Thanks.
>
>     Hugo
>
>     Mind Bridge wrote:
>
>>Hi,
>>
>>That is not possible the way you've described it, BUT you can use
>>Block/RenderBlock to achieve exactly the same effect.
>>
>>
>>Place the possible components into a number of Blocks (possibly even located
>>in different pages). In the place you've listed below place a RenderBlock
>>component and pass it the specific Block you want rendered. In other words,
>>you can choose which of the Blocks to pass at runtime and the page structure
>>becomes dynamic.
>>
>>I hope this helps.
>>
>>-mb
>>
>>----- Original Message ----- 
>>From: "Hugo Palma" <hp...@digitalis.pt>
>>To: "Tapestry users" <ta...@jakarta.apache.org>
>>Sent: Tuesday, January 11, 2005 5:48 PM
>>Subject: Dynamic jwcid
>>
>>
>>  
>>
>>>I have a template where the choice of which component to insert is done
>>>at runtime. So the template would look something like this:
>>>
>>>...........
>>><span jwcid="ognl:componentName"/>
>>>..........
>>>
>>>where "componentName" is a property of the current page.
>>>Is there a way i can do this ?
>>>
>>>
>>>Thanks
>>>
>>>Hugo
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>-- 
>>>No virus found in this incoming message.
>>>Checked by AVG Anti-Virus.
>>>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>>
>>>
>>>    
>>>
>>
>>
>>
>>  
>>
>
>     -- 
>
>     Hugo Palma
>     Programador Sénior
>
>     *e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
>     *tel:*++351 938012004 *fax:*++351 214408999
>     *homepage:* www.digitalis.pt <http://www.digitalis.pt>
>
>     <http://www.digitalis.pt> <http://www.digitalis.pt>
>
>     ------------------------------------------------------------------------
>     No virus found in this incoming message.
>     Checked by AVG Anti-Virus.
>     Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>
>------------------------------------------------------------------------
>
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>

-- 

Hugo Palma
Programador Sénior

*e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
*tel:*++351 938012004 *fax:*++351 214408999
*homepage:* www.digitalis.pt <http://www.digitalis.pt>

<http://www.digitalis.pt> <http://www.digitalis.pt>


Re: Dynamic jwcid

Posted by Mind Bridge <mi...@yahoo.com>.
Assinatura para e-mails DigitalisHi,

I would do it by having the page itself return Block that will be used as a menu. In that way there is no need for a "global knowledge" as to what the possible menues are and a page can control its presentation without worrying if it will affect the others.


A possible way to implement that is to have a parameter of type Block in the Border component. If the parameter is not bound, then Border renders the default menu. If it is bound, then it renders the Block that is provided. It is a responsibility of the page to pass the correct menu Block as an argument to Border.

This approach involves only local knowledge and makes pages independent. 

I hope it helps,
-mb

  ----- Original Message ----- 
  From: Hugo Palma 
  To: Tapestry users 
  Sent: Tuesday, January 11, 2005 6:50 PM
  Subject: Re: Dynamic jwcid


  Thanks, it works great.
  But i'm still not sure this is the right solution for what i'm trying to achieve.
  What i want is actually quite simple and i'm sure other people have come across this. I have an application that lets each page define the corresponding menu that gets displayed along with it. If none is defined then the default menu is displayed. I implemented this as a persistent property of a base page class that keeps the name of the menu component to display. Then the Border component renders a generic Menu component that has all the possible menus as blocks and the inserts the correct one based on the page property.

  Is there a better way to do this ?


  Thanks.

  Hugo

  Mind Bridge wrote: 
Hi,

That is not possible the way you've described it, BUT you can use
Block/RenderBlock to achieve exactly the same effect.


Place the possible components into a number of Blocks (possibly even located
in different pages). In the place you've listed below place a RenderBlock
component and pass it the specific Block you want rendered. In other words,
you can choose which of the Blocks to pass at runtime and the page structure
becomes dynamic.

I hope this helps.

-mb

----- Original Message ----- 
From: "Hugo Palma" <hp...@digitalis.pt>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, January 11, 2005 5:48 PM
Subject: Dynamic jwcid


  I have a template where the choice of which component to insert is done
at runtime. So the template would look something like this:

...........
<span jwcid="ognl:componentName"/>
..........

where "componentName" is a property of the current page.
Is there a way i can do this ?


Thanks

Hugo

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005


    


  

  -- 

  Hugo Palma 
  Programador S�nior 

  e-mail:hpalma@digitalis.pt 
  tel:++351 938012004 fax:++351 214408999 
  homepage: www.digitalis.pt 

   



------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG Anti-Virus.
  Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005

Re: Dynamic jwcid

Posted by Hugo Palma <hp...@digitalis.pt>.
Thanks, it works great.
But i'm still not sure this is the right solution for what i'm trying to 
achieve.
What i want is actually quite simple and i'm sure other people have come 
across this. I have an application that lets each page define the 
corresponding menu that gets displayed along with it. If none is defined 
then the default menu is displayed. I implemented this as a persistent 
property of a base page class that keeps the name of the menu component 
to display. Then the Border component renders a generic Menu component 
that has all the possible menus as blocks and the inserts the correct 
one based on the page property.

Is there a better way to do this ?


Thanks.

Hugo

Mind Bridge wrote:

>Hi,
>
>That is not possible the way you've described it, BUT you can use
>Block/RenderBlock to achieve exactly the same effect.
>
>
>Place the possible components into a number of Blocks (possibly even located
>in different pages). In the place you've listed below place a RenderBlock
>component and pass it the specific Block you want rendered. In other words,
>you can choose which of the Blocks to pass at runtime and the page structure
>becomes dynamic.
>
>I hope this helps.
>
>-mb
>
>----- Original Message ----- 
>From: "Hugo Palma" <hp...@digitalis.pt>
>To: "Tapestry users" <ta...@jakarta.apache.org>
>Sent: Tuesday, January 11, 2005 5:48 PM
>Subject: Dynamic jwcid
>
>
>  
>
>>I have a template where the choice of which component to insert is done
>>at runtime. So the template would look something like this:
>>
>>...........
>><span jwcid="ognl:componentName"/>
>>..........
>>
>>where "componentName" is a property of the current page.
>>Is there a way i can do this ?
>>
>>
>>Thanks
>>
>>Hugo
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>-- 
>>No virus found in this incoming message.
>>Checked by AVG Anti-Virus.
>>Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>>
>>
>>    
>>
>
>
>
>  
>

-- 

Hugo Palma
Programador Sénior

*e-mail:*hpalma@digitalis.pt <ma...@digitalis.pt>
*tel:*++351 938012004 *fax:*++351 214408999
*homepage:* www.digitalis.pt <http://www.digitalis.pt>

<http://www.digitalis.pt> <http://www.digitalis.pt>


Re: Dynamic jwcid

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

That is not possible the way you've described it, BUT you can use
Block/RenderBlock to achieve exactly the same effect.


Place the possible components into a number of Blocks (possibly even located
in different pages). In the place you've listed below place a RenderBlock
component and pass it the specific Block you want rendered. In other words,
you can choose which of the Blocks to pass at runtime and the page structure
becomes dynamic.

I hope this helps.

-mb

----- Original Message ----- 
From: "Hugo Palma" <hp...@digitalis.pt>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Tuesday, January 11, 2005 5:48 PM
Subject: Dynamic jwcid


> I have a template where the choice of which component to insert is done
> at runtime. So the template would look something like this:
>
> ...........
> <span jwcid="ognl:componentName"/>
> ..........
>
> where "componentName" is a property of the current page.
> Is there a way i can do this ?
>
>
> Thanks
>
> Hugo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 1/10/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org