Refreshing tapestry grid content from another component.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Refreshing tapestry grid content from another component.

abangkis
Hello, in tapestry 5.4 it's very easy to refresh the grid content using
ajax. You just set inplace field to true and you're done.  The grid
component handles everything.

Now I'm wondering if there's any way to trigger this behavior from another
component.

For example i have an UpEvent link that is inside the grid, that will move
the order of the content. When it's clicked the database will be update and
i expect the grid to be refreshed partially. I could create a zone that
wrap the grid and re-render it using ajax renderer. But I'm wondering if i
could just use the existing grid internal zone instead.

Thank you verymuch.

--
http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771
Reply | Threaded
Open this post in threaded view
|

Re: Refreshing tapestry grid content from another component.

Thiago H de Paula Figueiredo
On Sun, 22 Mar 2015 06:36:49 -0300, abangkis <[hidden email]> wrote:

> Now I'm wondering if there's any way to trigger this behavior from  
> another component.

Have you thought about wrapping it in a Zone?

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Refreshing tapestry grid content from another component.

abangkis
Hi Thiago, thanks for the reply. Yes, after a few try I finally just wrap
the whole grid component in a zone.

I tried
triggering resources.triggerEvent(InternalConstants.GRID_INPLACE_UPDATE,
null, null); from onUpEvent, that trigger from an event link inside the
grid. But that didn't seem to work :)



On Tue, Mar 31, 2015 at 1:58 AM, Thiago H de Paula Figueiredo <
[hidden email]> wrote:

> On Sun, 22 Mar 2015 06:36:49 -0300, abangkis <[hidden email]> wrote:
>
>  Now I'm wondering if there's any way to trigger this behavior from
>> another component.
>>
>
> Have you thought about wrapping it in a Zone?
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771
Reply | Threaded
Open this post in threaded view
|

Re: Refreshing tapestry grid content from another component.

Lance Java
> I tried triggering
resources.triggerEvent(InternalConstants.GRID_INPLACE_UPDATE,null, null);
from onUpEvent, that trigger from an event link inside the grid. But that
didn't seem to work

This is a common misconception. Your eventlink "inside" the grid is not a
child of the grid so the event won't bubble up to the grid. GridRows and
GridColumns are children of the grid component, blocks defined in your page
are not. This can be counterintuitive sometimes because the eventlink is a
child in the clientside dom/html but not in the serverside component model.
Reply | Threaded
Open this post in threaded view
|

Re: Refreshing tapestry grid content from another component.

abangkis
Hi Lance, thanks for the explanation :)

On Tue, Apr 7, 2015 at 2:47 PM, Lance Java <[hidden email]>
wrote:

> > I tried triggering
> resources.triggerEvent(InternalConstants.GRID_INPLACE_UPDATE,null, null);
> from onUpEvent, that trigger from an event link inside the grid. But that
> didn't seem to work
>
> This is a common misconception. Your eventlink "inside" the grid is not a
> child of the grid so the event won't bubble up to the grid. GridRows and
> GridColumns are children of the grid component, blocks defined in your page
> are not. This can be counterintuitive sometimes because the eventlink is a
> child in the clientside dom/html but not in the serverside component model.
>



--
http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771
Reply | Threaded
Open this post in threaded view
|

Re: Refreshing tapestry grid content from another component.

Thiago H de Paula Figueiredo
In reply to this post by Lance Java
Spot-on explanation, Lance. We could try to find some client-side  
JavaScript event that triggers that, but I'm in the middle of a work fire  
here . . . :(

On Tue, 07 Apr 2015 04:47:50 -0300, Lance Java <[hidden email]>  
wrote:

>> I tried triggering
> resources.triggerEvent(InternalConstants.GRID_INPLACE_UPDATE,null, null);
> from onUpEvent, that trigger from an event link inside the grid. But that
> didn't seem to work
>
> This is a common misconception. Your eventlink "inside" the grid is not a
> child of the grid so the event won't bubble up to the grid. GridRows and
> GridColumns are children of the grid component, blocks defined in your  
> page
> are not. This can be counterintuitive sometimes because the eventlink is  
> a
> child in the clientside dom/html but not in the serverside component  
> model.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]