You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Aslak Gronflaten <as...@gmail.com> on 2008/08/05 07:44:53 UTC

Block does not include javascripts

Hi,

I have a simple page, a form that upon submit replaces a Zone with the
content of a Block.
Works beautifully,  _except_ for the fact that the Block contains components
that rely on javascript and css
(using @IncludeJavascriptLibrary f.ex.). The page doesn't include the
javascripts, and thus when the block is rendered
the components don't work.

Simple example:

Testpage.tml:

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
 <body>
     <form t:type="form" zone="foo">
            Submit this: <input t:type="submit" value="Go..."/>
     </form>
     <hr/>

      <t:zone t:id="foo">
          Block will be drawn here.
      </t:zone>

      <t:block id="bar">
          <t:form>
            Here comes the datefield: <t:datefield value="mydate"/>
          </t:form>
      </t:block>
 </body>
</html>


Testpage.java:

public class TestPage {

    @Property
    private Date mydate;

    @Inject
    private Block bar;

    Block onSuccess() {
        return bar;
    }
}



------------------
Here, once you click the submit button, the datefield component will be
drawn below.
Alas, however, no calendar will pop up when clicking the icon, as the
javascripts are missing.
However, if you include a datefield in the first form, the scripts are
included, and the second form in the block works after the submit.

This makes the whole block / zone thing rather limited. So the question is ,
is there any workaround?

Appreciate any help,
  Aslak

Re: Block does not include javascripts

Posted by Aslak Gronflaten <as...@gmail.com>.
.... and the fix works beautifully!  Thanks, Howard :)

On Tue, Aug 5, 2008 at 1:56 PM, Aslak Gronflaten <as...@gmail.com> wrote:

> A bit more research and I found:
> https://issues.apache.org/jira/browse/TAPESTRY-2390
>
> Apparently fixed in the source repository...   I was using 5.0.13 , so I'll
> try the subversion build.
>
> Aslak
>
>
> On Tue, Aug 5, 2008 at 1:44 PM, Aslak Gronflaten <as...@gmail.com> wrote:
>
>> Hi,
>>
>> I have a simple page, a form that upon submit replaces a Zone with the
>> content of a Block.
>> Works beautifully,  _except_ for the fact that the Block contains
>> components that rely on javascript and css
>> (using @IncludeJavascriptLibrary f.ex.). The page doesn't include the
>> javascripts, and thus when the block is rendered
>> the components don't work.
>>
>> Simple example:
>>
>> Testpage.tml:
>>
>> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>  <body>
>>      <form t:type="form" zone="foo">
>>             Submit this: <input t:type="submit" value="Go..."/>
>>      </form>
>>      <hr/>
>>
>>       <t:zone t:id="foo">
>>           Block will be drawn here.
>>       </t:zone>
>>
>>       <t:block id="bar">
>>           <t:form>
>>             Here comes the datefield: <t:datefield value="mydate"/>
>>           </t:form>
>>       </t:block>
>>  </body>
>> </html>
>>
>>
>> Testpage.java:
>>
>> public class TestPage {
>>
>>     @Property
>>     private Date mydate;
>>
>>     @Inject
>>     private Block bar;
>>
>>     Block onSuccess() {
>>         return bar;
>>     }
>> }
>>
>>
>>
>> ------------------
>> Here, once you click the submit button, the datefield component will be
>> drawn below.
>> Alas, however, no calendar will pop up when clicking the icon, as the
>> javascripts are missing.
>> However, if you include a datefield in the first form, the scripts are
>> included, and the second form in the block works after the submit.
>>
>> This makes the whole block / zone thing rather limited. So the question is
>> , is there any workaround?
>>
>> Appreciate any help,
>>   Aslak
>>
>
>
>
> --
> Mvh Aslak
>



-- 
Mvh Aslak

Re: Block does not include javascripts

Posted by Aslak Gronflaten <as...@gmail.com>.
A bit more research and I found:
https://issues.apache.org/jira/browse/TAPESTRY-2390

Apparently fixed in the source repository...   I was using 5.0.13 , so I'll
try the subversion build.

Aslak

On Tue, Aug 5, 2008 at 1:44 PM, Aslak Gronflaten <as...@gmail.com> wrote:

> Hi,
>
> I have a simple page, a form that upon submit replaces a Zone with the
> content of a Block.
> Works beautifully,  _except_ for the fact that the Block contains
> components that rely on javascript and css
> (using @IncludeJavascriptLibrary f.ex.). The page doesn't include the
> javascripts, and thus when the block is rendered
> the components don't work.
>
> Simple example:
>
> Testpage.tml:
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>  <body>
>      <form t:type="form" zone="foo">
>             Submit this: <input t:type="submit" value="Go..."/>
>      </form>
>      <hr/>
>
>       <t:zone t:id="foo">
>           Block will be drawn here.
>       </t:zone>
>
>       <t:block id="bar">
>           <t:form>
>             Here comes the datefield: <t:datefield value="mydate"/>
>           </t:form>
>       </t:block>
>  </body>
> </html>
>
>
> Testpage.java:
>
> public class TestPage {
>
>     @Property
>     private Date mydate;
>
>     @Inject
>     private Block bar;
>
>     Block onSuccess() {
>         return bar;
>     }
> }
>
>
>
> ------------------
> Here, once you click the submit button, the datefield component will be
> drawn below.
> Alas, however, no calendar will pop up when clicking the icon, as the
> javascripts are missing.
> However, if you include a datefield in the first form, the scripts are
> included, and the second form in the block works after the submit.
>
> This makes the whole block / zone thing rather limited. So the question is
> , is there any workaround?
>
> Appreciate any help,
>   Aslak
>



-- 
Mvh Aslak