You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Piero Sartini <li...@pierosartini.de> on 2009/06/16 01:07:25 UTC

Event bubbling question

Hello!

I have a problem with the event bubbling stuff. A form is located inside a 
component which in turn is embedded inside my page. Now I am trying to process 
the form in my page.

There is more than one component inside the page so there is the need to 
specify the component who triggers the event. Without this, everything works 
fine. (example: onSuccess() works, onSuccessFromComponent() and 
onSuccessFromForm() do not work.)

I would have expected that onSuccessFromComponent() works in this scenario.

Is this something that should work, do I miss something or is it a bug?

	Piero

-------8<------------------------------------------------------------------
public abstract class Page {

	/** This works fine!! */
	void onSuccess() {
	}

	/** these fail */
	public void onSuccessFromMyComponentId() {
	}
	public void onSuccessFromMyFormId() {
		// this was just a test... normally we don't know the ID
	}
}

Page.tml:
<t:MyComponent t:id="MyComponentId"/>
<t:MyComponent t:id="MyOtherComponentId"/>

MyComponent.tml:
<t:form t:id="MyFormId" ......
-------8<------------------------------------------------------------------


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


IE rendering the "any" component informal parameters on a XHR encoded....

Posted by Tom Zurkan <tz...@citizensportsinc.com>.
I have a form tied to a zone.  On FF everything works fine.  On initial 
render in IE everything renders fine.  However, after a form submit, the 
returned block which contains some anchors of type "any", renders its 
informal parameters encoded.

so, it looks like this before submission:

<a id="any-121e55b4424_0" onclick="initializeZone('79547656');CS.showHide('79547656');return 
false;" href="#">Comment</a>

and looks like this after submission:

<a id="any-121e55b4424_0" onclick="initializeZone(&apos;79547656&apos;);CS.showHide(&apos;79547656&apos;);return 
false;" href="#">Comment</a>

it replaces my single quotes with &apos;.  I assume it is in the partial 
render that this is happening.  I am just asking if anyone has seen 
anything like this before.  Or has any idea how to solve the problem.

IE complains that there are syntax errors....

Thanks!

Tom Zurkan

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


Re: Event bubbling question

Posted by Piero Sartini <li...@pierosartini.de>.
> 2) Normally, what I do in these situations, is to encapsulate the
> events with a custom event.  That hides the details of component from
> users of the component, so even if, eg, form component events change,
> or if I change the guts of the component to operate differently, I can
> still keep that "public" contract via the custom event.

I like this solution. Implemented it with custom events and everything works 
:-)  Thanks for the pointer!

	Piero

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


Re: Event bubbling question

Posted by Robert Zeigler <ro...@scazdl.org>.
Two comments:

1) onSuccessFromComponent, in theory, should work, but IFF "Component"  
doesn't also have its own onSuccess handler.
2) Normally, what I do in these situations, is to encapsulate the  
events with a custom event.  That hides the details of component from  
users of the component, so even if, eg, form component events change,  
or if I change the guts of the component to operate differently, I can  
still keep that "public" contract via the custom event.

Robert

On Jun 15, 2009, at 6/156:07 PM , Piero Sartini wrote:

> Hello!
>
> I have a problem with the event bubbling stuff. A form is located  
> inside a
> component which in turn is embedded inside my page. Now I am trying  
> to process
> the form in my page.
>
> There is more than one component inside the page so there is the  
> need to
> specify the component who triggers the event. Without this,  
> everything works
> fine. (example: onSuccess() works, onSuccessFromComponent() and
> onSuccessFromForm() do not work.)
>
> I would have expected that onSuccessFromComponent() works in this  
> scenario.
>
> Is this something that should work, do I miss something or is it a  
> bug?
>
> 	Piero
>
> -------8 
> <------------------------------------------------------------------
> public abstract class Page {
>
> 	/** This works fine!! */
> 	void onSuccess() {
> 	}
>
> 	/** these fail */
> 	public void onSuccessFromMyComponentId() {
> 	}
> 	public void onSuccessFromMyFormId() {
> 		// this was just a test... normally we don't know the ID
> 	}
> }
>
> Page.tml:
> <t:MyComponent t:id="MyComponentId"/>
> <t:MyComponent t:id="MyOtherComponentId"/>
>
> MyComponent.tml:
> <t:form t:id="MyFormId" ......
> -------8 
> <------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> 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