You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by CG <le...@gmail.com> on 2009/09/08 13:29:00 UTC

[T5] how to pass a component reference to another component ?

Hi all, I hv read through the wiki page on the passing parameter , and
try a few times of code but not luck.

I may hv the wrong concept , therefore, hopefully someone can help me
this newbie ..

My scenerio is like this

 I have a toolbar component , contain "Add", "Save" and "Delete" button.

and I have a form which contain in another component  , let's named it
as Viewer.

Both toolbar and Viewer are place on a Page

When the user click "Add" , "Save", the Viewer should be updated in AJAX way.

The "Add" , "Save" and "Delete" are ActionLink .

Therefore, I have a event handler as below


Object onActionFromToolbarAdd ()
    {
    	    	System.out.println("trigger in toolbar");
       return <viewer reference>;

    }

Is it correct ?


Thx ...

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


Re: [T5] how to pass a component reference to another component ?

Posted by CG <le...@gmail.com>.
hi Sebastian, thx for your reply.

Do you mean that I should pass in a block instead of a component reference ?



Is my code should be something like this ?

toolbar.java
===========
class Toolbar
{

@Parameter
Block block;



Object onActionFromToolbarAdd ()
   {
               System.out.println("trigger in toolbar");
      return block;

   }



}




template for my container

<t:toolbar  block="abc" />

<t:block t:id="abc">
    <t:viewer />
</t:block>




Rgds,
  CG

On Tue, Sep 8, 2009 at 7:44 PM, Sebastian
Hennebrueder<us...@laliluna.de> wrote:
> Have a look at zones. Your action method could return a block.
>
>
> --
> Best Regards / Viele Grüße
>
> Sebastian Hennebrueder
> -----
> Software Developer and Trainer for Hibernate / Java Persistence
> http://www.laliluna.de
>
>
> CG schrieb:
>>
>> Hi all, I hv read through the wiki page on the passing parameter , and
>> try a few times of code but not luck.
>>
>> I may hv the wrong concept , therefore, hopefully someone can help me
>> this newbie ..
>>
>> My scenerio is like this
>>
>>  I have a toolbar component , contain "Add", "Save" and "Delete" button.
>>
>> and I have a form which contain in another component  , let's named it
>> as Viewer.
>>
>> Both toolbar and Viewer are place on a Page
>>
>> When the user click "Add" , "Save", the Viewer should be updated in AJAX
>> way.
>>
>> The "Add" , "Save" and "Delete" are ActionLink .
>>
>> Therefore, I have a event handler as below
>>
>>
>> Object onActionFromToolbarAdd ()
>>    {
>>                System.out.println("trigger in toolbar");
>>       return <viewer reference>;
>>
>>    }
>>
>> Is it correct ?
>>
>>
>> Thx ...
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: [T5] how to pass a component reference to another component ?

Posted by Sebastian Hennebrueder <us...@laliluna.de>.
Have a look at zones. Your action method could return a block.


-- 
Best Regards / Viele Grüße

Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de


CG schrieb:
> Hi all, I hv read through the wiki page on the passing parameter , and
> try a few times of code but not luck.
> 
> I may hv the wrong concept , therefore, hopefully someone can help me
> this newbie ..
> 
> My scenerio is like this
> 
>  I have a toolbar component , contain "Add", "Save" and "Delete" button.
> 
> and I have a form which contain in another component  , let's named it
> as Viewer.
> 
> Both toolbar and Viewer are place on a Page
> 
> When the user click "Add" , "Save", the Viewer should be updated in AJAX way.
> 
> The "Add" , "Save" and "Delete" are ActionLink .
> 
> Therefore, I have a event handler as below
> 
> 
> Object onActionFromToolbarAdd ()
>     {
>     	    	System.out.println("trigger in toolbar");
>        return <viewer reference>;
> 
>     }
> 
> Is it correct ?
> 
> 
> Thx ...
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 




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