You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by nicholas Krul <ni...@gmail.com> on 2008/05/07 20:54:52 UTC

Re: T5 PopUp Windows & JavaScrip

Hi... Sorry it took so long, tonight is the first free (ish) nigh I've had
for a while.

for point 4... try this:


@Environmental
    private PageRenderSupport pageRenderSupport;

    @Inject
    @Path("tiny_mce/tiny_mce.js") //CLASSPATH ref (relative for me)
    private Asset mceEditor;


void setupRender() {
        pageRenderSupport.addScriptLink(mceEditor);
    }




the script is only included once, and is handled in the component (where it
should be), not the wrapper.

--nK

On Tue, May 6, 2008 at 3:26 PM, maxthesecond <ma...@yahoo.com> wrote:

>
> I reply to myself for if someone needs to do the same....
>
>
>
> >
> > 1) Is this pattern feasible?
> > 2) Shall I use the mixins aproach for doing this?
> > 3) where can I found information to build up my javascript functions to
> > embed the pagelink path?
> > 4) how can I avoid the replication of javascript code that the loop
> > produces. Something like embeding the script tag within <final></final>?
> >
> >
>
> 1) yes it is
> 2) not at all
> 3) still not sure....here and there
> 4) place the javascript in the container loop component instead of the
> component although this migh look as to break encapsulation (your
> component
> code is spread in two files) in fact you should think the container and
> the
> contained components as a whole logical domain.
>
> So in the container component:
>
>  <script type="text/javascript" language="JavaScript">
>         function pDetail(id) {
>
>
> newwindow=window.open("${asset:context:}ProductDetail/"+id,"name","height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
>              newwindow.moveTo(150,150);
>              newwindow.focus();
>                      return false;
>           }
>  </script>
>
> and the component template:
>
> <div class="pDiv">
>     #
>        PRODUCT DIV TEST
>        <div><strong><em>${atext}</em></strong></div>
>         ${asset:context:}images/cmi/${sourceimg}
>        END PRODUCT DIV TEST
>
>
> </div>
>
>
>
> The only thing that I found misterious was when training to get out the
> context path to the page, I finally find out the ${asset:contex}, but I
> feel
> it strange it's not an asset, I generally find difficult to get
> comprehensive information on what how and where I can acces relevant
> information when I writting a page or component. Any way solved
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/T5-PopUp-Windows---JavaScript-tp17070425p17083883.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5 PopUp Windows & JavaScrip

Posted by Chris Lewis <ch...@bellsouth.net>.
Sorry, I only saw the messages that mentioned tinyMCE and assumed you
were looking for an editor component.

chris

maxthesecond wrote:
> Well, I can't see the relation but anyway thanks!
>
>
> Chris Lewis-5 wrote:
>   
>> I missed the rest of this thread, but if you're looking for an editor
>> component t5components provides one (based on FCK):
>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html
>>
>> maxthesecond wrote:
>>     
>>> Thanks nicholas I'll give it a try...any way I'm not very disconforted
>>> with
>>> the script being in the parent after all parent and childs they form the
>>> whole component, but I'm glad to see there's a general solution. Thanks
>>>
>>>
>>>
>>> nicholas Krul wrote:
>>>   
>>>       
>>>> Hi... Sorry it took so long, tonight is the first free (ish) nigh I've
>>>> had
>>>> for a while.
>>>>
>>>> for point 4... try this:
>>>>
>>>>
>>>> @Environmental
>>>>     private PageRenderSupport pageRenderSupport;
>>>>
>>>>     @Inject
>>>>     @Path("tiny_mce/tiny_mce.js") //CLASSPATH ref (relative for me)
>>>>     private Asset mceEditor;
>>>>
>>>>
>>>> void setupRender() {
>>>>         pageRenderSupport.addScriptLink(mceEditor);
>>>>     }
>>>>
>>>>
>>>>
>>>>
>>>> the script is only included once, and is handled in the component (where
>>>> it
>>>> should be), not the wrapper.
>>>>
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> -- 
>> http://thegodcode.net
>>
>>
>>
>>     
>
>   

-- 
http://thegodcode.net


Re: T5 PopUp Windows & JavaScrip

Posted by maxthesecond <ma...@yahoo.com>.
Well, I can't see the relation but anyway thanks!


Chris Lewis-5 wrote:
> 
> I missed the rest of this thread, but if you're looking for an editor
> component t5components provides one (based on FCK):
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html
> 
> maxthesecond wrote:
>> Thanks nicholas I'll give it a try...any way I'm not very disconforted
>> with
>> the script being in the parent after all parent and childs they form the
>> whole component, but I'm glad to see there's a general solution. Thanks
>>
>>
>>
>> nicholas Krul wrote:
>>   
>>> Hi... Sorry it took so long, tonight is the first free (ish) nigh I've
>>> had
>>> for a while.
>>>
>>> for point 4... try this:
>>>
>>>
>>> @Environmental
>>>     private PageRenderSupport pageRenderSupport;
>>>
>>>     @Inject
>>>     @Path("tiny_mce/tiny_mce.js") //CLASSPATH ref (relative for me)
>>>     private Asset mceEditor;
>>>
>>>
>>> void setupRender() {
>>>         pageRenderSupport.addScriptLink(mceEditor);
>>>     }
>>>
>>>
>>>
>>>
>>> the script is only included once, and is handled in the component (where
>>> it
>>> should be), not the wrapper.
>>>
>>>
>>>
>>>     
>>
>>   
> 
> -- 
> http://thegodcode.net
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-PopUp-Windows---JavaScript-tp17070425p17124267.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5 PopUp Windows & JavaScrip

Posted by Chris Lewis <ch...@bellsouth.net>.
I missed the rest of this thread, but if you're looking for an editor
component t5components provides one (based on FCK):
http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Editor.html

maxthesecond wrote:
> Thanks nicholas I'll give it a try...any way I'm not very disconforted with
> the script being in the parent after all parent and childs they form the
> whole component, but I'm glad to see there's a general solution. Thanks
>
>
>
> nicholas Krul wrote:
>   
>> Hi... Sorry it took so long, tonight is the first free (ish) nigh I've had
>> for a while.
>>
>> for point 4... try this:
>>
>>
>> @Environmental
>>     private PageRenderSupport pageRenderSupport;
>>
>>     @Inject
>>     @Path("tiny_mce/tiny_mce.js") //CLASSPATH ref (relative for me)
>>     private Asset mceEditor;
>>
>>
>> void setupRender() {
>>         pageRenderSupport.addScriptLink(mceEditor);
>>     }
>>
>>
>>
>>
>> the script is only included once, and is handled in the component (where
>> it
>> should be), not the wrapper.
>>
>>
>>
>>     
>
>   

-- 
http://thegodcode.net


Re: T5 PopUp Windows & JavaScrip

Posted by maxthesecond <ma...@yahoo.com>.
Thanks nicholas I'll give it a try...any way I'm not very disconforted with
the script being in the parent after all parent and childs they form the
whole component, but I'm glad to see there's a general solution. Thanks



nicholas Krul wrote:
> 
> Hi... Sorry it took so long, tonight is the first free (ish) nigh I've had
> for a while.
> 
> for point 4... try this:
> 
> 
> @Environmental
>     private PageRenderSupport pageRenderSupport;
> 
>     @Inject
>     @Path("tiny_mce/tiny_mce.js") //CLASSPATH ref (relative for me)
>     private Asset mceEditor;
> 
> 
> void setupRender() {
>         pageRenderSupport.addScriptLink(mceEditor);
>     }
> 
> 
> 
> 
> the script is only included once, and is handled in the component (where
> it
> should be), not the wrapper.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-PopUp-Windows---JavaScript-tp17070425p17123618.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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