You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Riccardo Ruffilli <ri...@mapsengineering.com> on 2008/03/05 12:02:28 UTC

t5: bubble up question

Hi Everybody,

Like I read in the t5 doc
"The event will bubble up the hierarchy, until it is aborted. The event is
aborted when an event handler method returns a non-null value."

I've got a toolbar inside my t5 grid column component built with action link
components.
Something like that

<thead xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <tr>
    	<th t:id="gtb" 
		 	t:type="MyGridToolbar"
		 	t:source="prop:toolbarModel"
		 />
    </tr>
    
    <tr>
        <th t:type="Loop" source="columnNames" value="columnName"
volatile="true" class="prop:headerClass"
            index="columnIndex">
             ${columnModel.label} 
            <t:if test="columnModel.sortable">
                 
                     ${icon} 
                 
            </t:if>
        </th>
    </tr>
</thead>

I use this component inside a component which extends the Grid component
everithing
inside a normal t5 page.

<table t:type="mygrid" 
				           t:source="puntiVenditaDataGrid.listaPdvCen" 
				           t:rowsPerPage="literal:4" 
				           t:gridModel="puntiVenditaDataGrid.model"
				           t:row="puntiVenditaDataGrid.row"
				           t:id="puntiVenditaDataGrid"
				           border="0"
				           width="100%"
				       />


I've noticed this kind of behaviour in events generated by t5,
I'd like to have an event handler method inside mygrid component,
but I've notice that I can catch only the grid column component event and
not
my nested toolbar action link event.

So I can obtain all my information in mygrid component inside the
onActionFromColumn method 
but I can't reach anything in the onActionFromMyLink method just I aspected.

This means that I can obtain the event of the contained component in the
container component
but if I have 2 levels of nested component in A contains B contains C in the
component A
I can't capture che action event generated from component C with an
onActionFromC but only whith 
onActionFromB.

Did I miss something ?

Thanks.

-Rick







-- 
View this message in context: http://www.nabble.com/t5%3A-bubble-up-question-tp15847763p15847763.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: bubble up question

Posted by Howard Lewis Ship <hl...@gmail.com>.
No you didn't.  Events are allowed to bubble up, but they appear to
originate in the intervening container components.  This is
deliberate, as the page should not depend on the structure (i.e.,
component ids, etc.) of the embedded components of a container
component.  It can change at any time.  Event names are a bit more
stable than component ids.  Generally, the container component should
provide a handler method for most events are re-fire new and
well-defined events.

On Wed, Mar 5, 2008 at 3:02 AM, Riccardo Ruffilli
<ri...@mapsengineering.com> wrote:
>
>  Hi Everybody,
>
>  Like I read in the t5 doc
>  "The event will bubble up the hierarchy, until it is aborted. The event is
>  aborted when an event handler method returns a non-null value."
>
>  I've got a toolbar inside my t5 grid column component built with action link
>  components.
>  Something like that
>
>  <thead xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>     <tr>
>         <th t:id="gtb"
>                         t:type="MyGridToolbar"
>                         t:source="prop:toolbarModel"
>                  />
>     </tr>
>
>     <tr>
>         <th t:type="Loop" source="columnNames" value="columnName"
>  volatile="true" class="prop:headerClass"
>             index="columnIndex">
>              ${columnModel.label}
>             <t:if test="columnModel.sortable">
>
>                      ${icon}
>
>             </t:if>
>         </th>
>     </tr>
>  </thead>
>
>  I use this component inside a component which extends the Grid component
>  everithing
>  inside a normal t5 page.
>
>  <table t:type="mygrid"
>                                            t:source="puntiVenditaDataGrid.listaPdvCen"
>                                            t:rowsPerPage="literal:4"
>                                            t:gridModel="puntiVenditaDataGrid.model"
>                                            t:row="puntiVenditaDataGrid.row"
>                                            t:id="puntiVenditaDataGrid"
>                                            border="0"
>                                            width="100%"
>                                        />
>
>
>  I've noticed this kind of behaviour in events generated by t5,
>  I'd like to have an event handler method inside mygrid component,
>  but I've notice that I can catch only the grid column component event and
>  not
>  my nested toolbar action link event.
>
>  So I can obtain all my information in mygrid component inside the
>  onActionFromColumn method
>  but I can't reach anything in the onActionFromMyLink method just I aspected.
>
>  This means that I can obtain the event of the contained component in the
>  container component
>  but if I have 2 levels of nested component in A contains B contains C in the
>  component A
>  I can't capture che action event generated from component C with an
>  onActionFromC but only whith
>  onActionFromB.
>
>  Did I miss something ?
>
>  Thanks.
>
>  -Rick
>
>
>
>
>
>
>
>  --
>  View this message in context: http://www.nabble.com/t5%3A-bubble-up-question-tp15847763p15847763.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
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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