You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by vl...@spamcop.net on 2004/01/22 18:27:58 UTC

Getting more info to a border page

Is there a way to pass a string back to the Border page from the page that is
being redendered?

I have a border that's used across many pages.  I'd like to set some text for
each page, but that text appears outside of the RenderBody block.  I’m not
seeing how to get that text is supposed to be passed across pages.

Below is an example.  I'd like to replace the ***message goes here*** with some
text that I define in the rendered page's .page file (or in code) so that each
rendered page can place its own message there.  But I can't figure out how the
border would gain access to the info of the page that it wraps.

Thanks in advance,

Vladimir


Border.html
---------------------------------
<html jwcid="@Shell" title="RenderBody Example">
  <body jwcid="@Body">

<table width="100%" cellspacing="0" border="0">
  <tr>
    <td valign="top" height="28" colspan="2">***message goes here***</td>
  </tr>
  <tr>
    <td valign="top" height="21" colspan="2" style="text-align:justify;"> <span
jwcid="@RenderBody">Page
      content goes here.</span> </td>
  </tr>
  <tr>
    <td width="995" height="77" valign="bottom">
      <table width="100%" cellspacing="0" border="0">
        <tr>
          <td align="center"> <a href="http://jakarta.apache.org/tapestry">
             <img src="images/poweredbyTapestry.gif" width="79" height="33"
border="0" alt="Tapestry"></a>
            <br/><br/>
          </td>
        </tr>
      </table>
    </td>
    <td width="4"></td>
  </tr>
  <tr>
    <td height="175"></td>
    <td></td>
  </tr>
</table>
  </body>
</html>



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


Re: Getting more info to a border page

Posted by Harish Krishnaswamy <hk...@comcast.net>.
In your Home.page pass the string to the parameter of the Border component.

Home.page
...
<component id="..." type="Border">
...
<static-binding name="message" value="what ever message you want to pass 
in" />
...
</component>
...

That's it, you don't have to provide any getMessage() or setMessage() 
methods in your Border component. Tapestry will automatically enhance 
the class and create these for you. If you want the message to be a 
dynamic message you can change the binding to a dynamic binding...

<binding name="message" expression="message" />

... now you can pass the message to Border via a getMessage() method in 
the Home.java.

Hope this clarifies.

-Harish

vladd@spamcop.net wrote:

>I'm still missing something here.  How does that parameter get filled in?  I
>added a getMessage method to the Home.class (whose page is wrapped by the
>border).  But that doesn't seem to do anything.  I'm not really sure how
>parameters do their thing.
>
>Thanks again,
>
>Vladimir
>
>Quoting Harish Krishnaswamy <hk...@comcast.net>:
>
>  
>
>>Border.html
>>...
>><td valign="top" height="28" colspan="2"><span jwcid="@Insert"
>>value="ognl:message" /></td>
>>...
>>
>>Border.jwc
>>...
>><parameter name="message" type="java.lang.String" direction="in" />
>>...
>>
>>-Harish
>>
>>vladd@spamcop.net wrote:
>>
>>    
>>
>>>Is there a way to pass a string back to the Border page from the page that
>>>      
>>>
>>is
>>    
>>
>>>being redendered?
>>>
>>>I have a border that's used across many pages.  I'd like to set some text
>>>      
>>>
>>for
>>    
>>
>>>each page, but that text appears outside of the RenderBody block.  I’m not
>>>seeing how to get that text is supposed to be passed across pages.
>>>
>>>Below is an example.  I'd like to replace the ***message goes here*** with
>>>      
>>>
>>some
>>    
>>
>>>text that I define in the rendered page's .page file (or in code) so that
>>>      
>>>
>>each
>>    
>>
>>>rendered page can place its own message there.  But I can't figure out how
>>>      
>>>
>>the
>>    
>>
>>>border would gain access to the info of the page that it wraps.
>>>
>>>Thanks in advance,
>>>
>>>Vladimir
>>>
>>>
>>>Border.html
>>>---------------------------------
>>><html jwcid="@Shell" title="RenderBody Example">
>>> <body jwcid="@Body">
>>>
>>><table width="100%" cellspacing="0" border="0">
>>> <tr>
>>>   <td valign="top" height="28" colspan="2">***message goes here***</td>
>>> </tr>
>>> <tr>
>>>   <td valign="top" height="21" colspan="2" style="text-align:justify;">
>>>      
>>>
>><span
>>    
>>
>>>jwcid="@RenderBody">Page
>>>     content goes here.</span> </td>
>>> </tr>
>>> <tr>
>>>   <td width="995" height="77" valign="bottom">
>>>     <table width="100%" cellspacing="0" border="0">
>>>       <tr>
>>>         <td align="center"> <a href="http://jakarta.apache.org/tapestry">
>>>            <img src="images/poweredbyTapestry.gif" width="79" height="33"
>>>border="0" alt="Tapestry"></a>
>>>           <br/><br/>
>>>         </td>
>>>       </tr>
>>>     </table>
>>>   </td>
>>>   <td width="4"></td>
>>> </tr>
>>> <tr>
>>>   <td height="175"></td>
>>>   <td></td>
>>> </tr>
>>></table>
>>> </body>
>>></html>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>


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


Re: Getting more info to a border page

Posted by vl...@spamcop.net.
I'm still missing something here.  How does that parameter get filled in?  I
added a getMessage method to the Home.class (whose page is wrapped by the
border).  But that doesn't seem to do anything.  I'm not really sure how
parameters do their thing.

Thanks again,

Vladimir

Quoting Harish Krishnaswamy <hk...@comcast.net>:

> Border.html
> ...
> <td valign="top" height="28" colspan="2"><span jwcid="@Insert"
> value="ognl:message" /></td>
> ...
>
> Border.jwc
> ...
> <parameter name="message" type="java.lang.String" direction="in" />
> ...
>
> -Harish
>
> vladd@spamcop.net wrote:
>
> >Is there a way to pass a string back to the Border page from the page that
> is
> >being redendered?
> >
> >I have a border that's used across many pages.  I'd like to set some text
> for
> >each page, but that text appears outside of the RenderBody block.  I’m not
> >seeing how to get that text is supposed to be passed across pages.
> >
> >Below is an example.  I'd like to replace the ***message goes here*** with
> some
> >text that I define in the rendered page's .page file (or in code) so that
> each
> >rendered page can place its own message there.  But I can't figure out how
> the
> >border would gain access to the info of the page that it wraps.
> >
> >Thanks in advance,
> >
> >Vladimir
> >
> >
> >Border.html
> >---------------------------------
> ><html jwcid="@Shell" title="RenderBody Example">
> >  <body jwcid="@Body">
> >
> ><table width="100%" cellspacing="0" border="0">
> >  <tr>
> >    <td valign="top" height="28" colspan="2">***message goes here***</td>
> >  </tr>
> >  <tr>
> >    <td valign="top" height="21" colspan="2" style="text-align:justify;">
> <span
> >jwcid="@RenderBody">Page
> >      content goes here.</span> </td>
> >  </tr>
> >  <tr>
> >    <td width="995" height="77" valign="bottom">
> >      <table width="100%" cellspacing="0" border="0">
> >        <tr>
> >          <td align="center"> <a href="http://jakarta.apache.org/tapestry">
> >             <img src="images/poweredbyTapestry.gif" width="79" height="33"
> >border="0" alt="Tapestry"></a>
> >            <br/><br/>
> >          </td>
> >        </tr>
> >      </table>
> >    </td>
> >    <td width="4"></td>
> >  </tr>
> >  <tr>
> >    <td height="175"></td>
> >    <td></td>
> >  </tr>
> ></table>
> >  </body>
> ></html>
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

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


Re: Getting more info to a border page

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Border.html
...
<td valign="top" height="28" colspan="2"><span jwcid="@Insert" 
value="ognl:message" /></td>
...

Border.jwc
...
<parameter name="message" type="java.lang.String" direction="in" />
...

-Harish

vladd@spamcop.net wrote:

>Is there a way to pass a string back to the Border page from the page that is
>being redendered?
>
>I have a border that's used across many pages.  I'd like to set some text for
>each page, but that text appears outside of the RenderBody block.  I’m not
>seeing how to get that text is supposed to be passed across pages.
>
>Below is an example.  I'd like to replace the ***message goes here*** with some
>text that I define in the rendered page's .page file (or in code) so that each
>rendered page can place its own message there.  But I can't figure out how the
>border would gain access to the info of the page that it wraps.
>
>Thanks in advance,
>
>Vladimir
>
>
>Border.html
>---------------------------------
><html jwcid="@Shell" title="RenderBody Example">
>  <body jwcid="@Body">
>
><table width="100%" cellspacing="0" border="0">
>  <tr>
>    <td valign="top" height="28" colspan="2">***message goes here***</td>
>  </tr>
>  <tr>
>    <td valign="top" height="21" colspan="2" style="text-align:justify;"> <span
>jwcid="@RenderBody">Page
>      content goes here.</span> </td>
>  </tr>
>  <tr>
>    <td width="995" height="77" valign="bottom">
>      <table width="100%" cellspacing="0" border="0">
>        <tr>
>          <td align="center"> <a href="http://jakarta.apache.org/tapestry">
>             <img src="images/poweredbyTapestry.gif" width="79" height="33"
>border="0" alt="Tapestry"></a>
>            <br/><br/>
>          </td>
>        </tr>
>      </table>
>    </td>
>    <td width="4"></td>
>  </tr>
>  <tr>
>    <td height="175"></td>
>    <td></td>
>  </tr>
></table>
>  </body>
></html>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>


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