You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John Gordon <jo...@gmail.com> on 2005/02/08 07:04:08 UTC

@Body Doesn't Render Scripts?

Hi All,

I'm trying to use a datepicker component but the page is not
outputting the required javascript code to make it work.  I'm using
the @Shell and @Body in an enclosing component (it's nearly an exact
duplicate of the demo hangman's "Border" component) so I should think
the @Body component should spit out the required javascript, but it's
not.  I discovered in my debugging that putting the @Body tag directly
in the page that contains the datepicker causes the javascript to
output correctly.  Anyone know what I'm missing?

Here's my Border component template:

<html jwcid="@Shell" title="My App" stylesheet='ognl:assets.stylesheet'>

<body jwcid='@Body'>
	<div id="pageheader">
    <div id="welcome">Welcome [user name]</div>
    <div id="navmain">
        <ul>
            <li><a href="#" jwcid="home@ExternalLink" page="Home" >Home</a></li>
        </ul>
    </div>
</div>
	<span jwcid="@RenderBody" >Page body here.</span>
	
	
</body>


</html>


And here's how I'm calling the component in my page:

<html>
<head >
<title>My App</title>
<link rel="STYLESHEET" type="text/css" href="../ui/main.css" />
</head>
<body jwcid="$content$" >

<span jwcid="@Border"></span>
<span jwcid="$remove$">
<div id="pageheader">
<div id="welcome">Welcome [User Name]</div>
<div id="navmain"><!-- insert navigation stuff here --></div>
</div>
</span>
<div id="main" >
<h1>Wamu Online Agility Manager</h1>
<p>Welcome to the Online Agility Management system. You may use
this program to manage:
<ul>
	<li>Project Members</li>
	<li>Project Backlogs</li>
	<li>Project Sprints</li>
</ul>

<div class="portlet">
	<form jwcid="@Form" listener="ognl:listeners.formSubmit" >
		<p>Select a project: <input jwcid="selectProject"/>
		or <a href="#" jwcid="newProject@DirectLink"
listener="ognl:listeners.newProject"  >Create a new Project</a>.
		<br/>
		Pick Date:  <span jwcid="@DatePicker" value="ognl:testDate"/>
		</p>
	</form>
</div>


</div>

</body>
</html>


Thanks in advance!

John

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


Re: @Body Doesn't Render Scripts?

Posted by Howard Lewis Ship <hl...@gmail.com>.
<span jwcid="@Border"></span>

The <span> for the Border must enclose the rest of the page content.


On Mon, 7 Feb 2005 22:04:08 -0800, John Gordon <jo...@gmail.com> wrote:
> Hi All,
> 
> I'm trying to use a datepicker component but the page is not
> outputting the required javascript code to make it work.  I'm using
> the @Shell and @Body in an enclosing component (it's nearly an exact
> duplicate of the demo hangman's "Border" component) so I should think
> the @Body component should spit out the required javascript, but it's
> not.  I discovered in my debugging that putting the @Body tag directly
> in the page that contains the datepicker causes the javascript to
> output correctly.  Anyone know what I'm missing?
> 
> Here's my Border component template:
> 
> <html jwcid="@Shell" title="My App" stylesheet='ognl:assets.stylesheet'>
> 
> <body jwcid='@Body'>
>         <div id="pageheader">
>     <div id="welcome">Welcome [user name]</div>
>     <div id="navmain">
>         <ul>
>             <li><a href="#" jwcid="home@ExternalLink" page="Home" >Home</a></li>
>         </ul>
>     </div>
> </div>
>         <span jwcid="@RenderBody" >Page body here.</span>
> 
> </body>
> 
> </html>
> 
> And here's how I'm calling the component in my page:
> 
> <html>
> <head >
> <title>My App</title>
> <link rel="STYLESHEET" type="text/css" href="../ui/main.css" />
> </head>
> <body jwcid="$content$" >
> 
> <span jwcid="@Border"></span>
> <span jwcid="$remove$">
> <div id="pageheader">
> <div id="welcome">Welcome [User Name]</div>
> <div id="navmain"><!-- insert navigation stuff here --></div>
> </div>
> </span>
> <div id="main" >
> <h1>Wamu Online Agility Manager</h1>
> <p>Welcome to the Online Agility Management system. You may use
> this program to manage:
> <ul>
>         <li>Project Members</li>
>         <li>Project Backlogs</li>
>         <li>Project Sprints</li>
> </ul>
> 
> <div class="portlet">
>         <form jwcid="@Form" listener="ognl:listeners.formSubmit" >
>                 <p>Select a project: <input jwcid="selectProject"/>
>                 or <a href="#" jwcid="newProject@DirectLink"
> listener="ognl:listeners.newProject"  >Create a new Project</a>.
>                 <br/>
>                 Pick Date:  <span jwcid="@DatePicker" value="ognl:testDate"/>
>                 </p>
>         </form>
> </div>
> 
> </div>
> 
> </body>
> </html>
> 
> Thanks in advance!
> 
> John
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: @Body Doesn't Render Scripts? Solution

Posted by John Gordon <jo...@gmail.com>.
All,

After much hair pulling, I've found the solution.  For posterity's
sake:  the <span /> I was using to house the the @Border component I
wrote (e.g <span jwcid="@Border" ></span>) had an empty body.  Being
new to Tapestry, I didn't realize that you have to put all of your
page's content within the enclosing component.  To illustrate:

<span jwcid="@Border"></span>
<table>....etc.</body> <-- WRONG!!

<span jwcid="@Border">
  <table>....etc.
   </body>
</span>  <-- RIGHT!

Cripes.  Chalk up another hour of frustration :-).




On Mon, 7 Feb 2005 22:04:08 -0800, John Gordon <jo...@gmail.com> wrote:
> Hi All,
> 
> I'm trying to use a datepicker component but the page is not
> outputting the required javascript code to make it work.  I'm using
> the @Shell and @Body in an enclosing component (it's nearly an exact
> duplicate of the demo hangman's "Border" component) so I should think
> the @Body component should spit out the required javascript, but it's
> not.  I discovered in my debugging that putting the @Body tag directly
> in the page that contains the datepicker causes the javascript to
> output correctly.  Anyone know what I'm missing?
> 
> Here's my Border component template:
> 
> <html jwcid="@Shell" title="My App" stylesheet='ognl:assets.stylesheet'>
> 
> <body jwcid='@Body'>
>         <div id="pageheader">
>     <div id="welcome">Welcome [user name]</div>
>     <div id="navmain">
>         <ul>
>             <li><a href="#" jwcid="home@ExternalLink" page="Home" >Home</a></li>
>         </ul>
>     </div>
> </div>
>         <span jwcid="@RenderBody" >Page body here.</span>
> 
> </body>
> 
> </html>
> 
> And here's how I'm calling the component in my page:
> 
> <html>
> <head >
> <title>My App</title>
> <link rel="STYLESHEET" type="text/css" href="../ui/main.css" />
> </head>
> <body jwcid="$content$" >
> 
> <span jwcid="@Border"></span>
> <span jwcid="$remove$">
> <div id="pageheader">
> <div id="welcome">Welcome [User Name]</div>
> <div id="navmain"><!-- insert navigation stuff here --></div>
> </div>
> </span>
> <div id="main" >
> <h1>Wamu Online Agility Manager</h1>
> <p>Welcome to the Online Agility Management system. You may use
> this program to manage:
> <ul>
>         <li>Project Members</li>
>         <li>Project Backlogs</li>
>         <li>Project Sprints</li>
> </ul>
> 
> <div class="portlet">
>         <form jwcid="@Form" listener="ognl:listeners.formSubmit" >
>                 <p>Select a project: <input jwcid="selectProject"/>
>                 or <a href="#" jwcid="newProject@DirectLink"
> listener="ognl:listeners.newProject"  >Create a new Project</a>.
>                 <br/>
>                 Pick Date:  <span jwcid="@DatePicker" value="ognl:testDate"/>
>                 </p>
>         </form>
> </div>
> 
> </div>
> 
> </body>
> </html>
> 
> Thanks in advance!
> 
> John
> 


-- 
------------------------------------------------------------------
john.gordon@gmail.com
(m)415.515.3549

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