You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Joy <jo...@yahoo.com> on 2007/05/31 00:57:06 UTC

HTML Include? [T4]

Hi,
 
 I would like to include reusable HTML snippets which contain Tapestry code (jwcid) tags rather than build an actual component. There have been several posts that I searched through and the answer was to build a component, though I'm not sure if that will help in my case as I would like to keep the jwcid tags in place and NOT render them.
 
 Here is my situation, for example I have a sign up and edit info page. There is common Java code between the two and common HTML code as well. The Java code I can share by reusing the same base class. I would like to reuse the HTML code, such as below. Rather than copying and pasting, is there a way I can include common html code and componentize on that building one HTML page out of smaller common HTML pages? Thanks in advance.
 
 <tr>
     <td align="right" valign="top">
         Username :
     </td>
     <td align="left">
         <table cellspacing=0 cellpadding=0 class="xxsmall_bold_arial">                                                                                                                
         <tr>
             <td align="left">
             <span jwcid="@If" condition="ognl:userNameErr">
                 <input type="text" size="16" maxlength="16" jwcid="@TextField" value="prop:userName" class="backgroundinputfield_error" />
             </span>
             <span jwcid="@Else" >
                 <input type="text" size="16" maxlength="16" jwcid="@TextField" value="prop:userName" />
             </span>
             </td>
         </tr>
         <tr>
             <td align="left" valign="top">
                 <span class="xxsmall_grey_arial">no spaces please</span>
             </td>
         </tr>
         </table>
     </td>
 </tr>
 <tr>
     <td align="right">
          Password : 
     </td>
     <td align="left">
         <span jwcid="@If" condition="ognl:passWordErr">
             <input type="password" size="15" maxlength="15" jwcid="@TextField" hidden="true" value="prop:passWord" class="backgroundinputfield_error"></input>
         </span>    
         <span jwcid="@Else" >
             <input type="password" size="15" maxlength="15" jwcid="@TextField" hidden="true" value="prop:passWord" />
         </span>
     </td>
 </tr>
 
 
 
 
 Thanks,
 Josh
 

Re: HTML Include? [T4]

Posted by Alejandro Scandroli <al...@gmail.com>.
Hi Josh,

I've never used it with pages, but for reusing html templates with
components I use this:

	@Asset(value = "/org/trails/component/AssociationSelect.html")
	public abstract IAsset get$template();

or its xml version:

<asset name="$template" path="/org/trails/component/AssociationSelect.html"/>


Alejandro.

On 5/31/07, Josh Joy <jo...@yahoo.com> wrote:
> Hi,
>
>  I would like to include reusable HTML snippets which contain Tapestry code (jwcid) tags rather than build an actual component. There have been several posts that I searched through and the answer was to build a component, though I'm not sure if that will help in my case as I would like to keep the jwcid tags in place and NOT render them.
>
>  Here is my situation, for example I have a sign up and edit info page. There is common Java code between the two and common HTML code as well. The Java code I can share by reusing the same base class. I would like to reuse the HTML code, such as below. Rather than copying and pasting, is there a way I can include common html code and componentize on that building one HTML page out of smaller common HTML pages? Thanks in advance.
>
>  <tr>
>      <td align="right" valign="top">
>          Username :
>      </td>
>      <td align="left">
>          <table cellspacing=0 cellpadding=0 class="xxsmall_bold_arial">
>          <tr>
>              <td align="left">
>              <span jwcid="@If" condition="ognl:userNameErr">
>                  <input type="text" size="16" maxlength="16" jwcid="@TextField" value="prop:userName" class="backgroundinputfield_error" />
>              </span>
>              <span jwcid="@Else" >
>                  <input type="text" size="16" maxlength="16" jwcid="@TextField" value="prop:userName" />
>              </span>
>              </td>
>          </tr>
>          <tr>
>              <td align="left" valign="top">
>                  <span class="xxsmall_grey_arial">no spaces please</span>
>              </td>
>          </tr>
>          </table>
>      </td>
>  </tr>
>  <tr>
>      <td align="right">
>           Password :
>      </td>
>      <td align="left">
>          <span jwcid="@If" condition="ognl:passWordErr">
>              <input type="password" size="15" maxlength="15" jwcid="@TextField" hidden="true" value="prop:passWord" class="backgroundinputfield_error"></input>
>          </span>
>          <span jwcid="@Else" >
>              <input type="password" size="15" maxlength="15" jwcid="@TextField" hidden="true" value="prop:passWord" />
>          </span>
>      </td>
>  </tr>
>
>
>
>
>  Thanks,
>  Josh
>

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