Thanks for the clarifications, Thiago. Helpful as always.

I didn't realize that event methods automatically bubbled up if void, false, or null were returned from a child component. As far as I can tell, this means I wouldn't need to use triggerEvent. I wrote an <a> with the href loading the URL from ComponentResources.createEventLink().

At first I didn't see a nice way of actually feeding the values from the HTML form back into the event method for the EventLink though. creatEventLink seems to assume I know my context from the Component class, but the context is only ever known to an HTML element after some Javascript has its way. But then I realized I can save the form input Element I made during rendering with the MarkupWriter (last concept you mentioned) with Persist. Then in the event method read the value attribute back.

Another corner turned, Tapestry keeps getting better.

Thanks again,
Rich

On 12/21/2010 07:26 PM, Thiago H. de Paula Figueiredo wrote:
On Tue, 21 Dec 2010 21:36:54 -0200, Rich M <rich...@moremagic.com> wrote:

writing it as a Component works. Not sure what the problem with the Page class was.

Most probably your div was generated before the HTML tag. Your scenario really needed to be implemented as a component.

Seem to have hit an additional complication. Since this component is generating everything with the MarkupWriter, I'm struggling to understand how I can feed values back to the Component into an Event method. Mailing list searches and documentation searching haven't turned up anything too promosing for me yet.

See method triggerEvent(String eventType, Object[] contextValues, ComponentEventCallback callback) in ComponentResources (inherited from ComponentResourcesCommon. Searching the mailing lists and JumpStart will probably give you some hints.

I haven't seen a way to write a Tapestry component like Form with the MarkupWriter, so I don't think I can use a Tapestry Form.

There's no way of doing it. You need to declare components (at least their t:id) in a template.

I'm not clear on how a plain HTML form can trigger a Component method,

Just use an URL created from ComponentResources.createEventLink() as the action.

is there a Tapestry Javascript method to leverage this?

No need of JavaScript for that (but you can use it if you want)

Alternately, is there a way to feed MarkupWriter content into a TML template, as in to write out HTML elements inside a <t:form> element?

MarkupWriter.element() inside a component render event method. You can also change what was already written manipulating the Element instances got from MarkupWriter.



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

Reply via email to