The hash tag isn't supposed to be sent to the server, so it's curious that
it'd have an effect.

http://en.wikipedia.org/wiki/Fragment_identifier

"Clients are not supposed to send URI-fragments to servers when they
retrieve a document"

Although, when you say that you remove the hashtag, do you remove the whole
#business, or just the # and leave business?


On Tue, Jul 31, 2012 at 6:15 PM, George Ludwig <georgelud...@gmail.com>wrote:

> Josh,
>
> Thanks for the response. I do in fact have the onAddXXTerm implemented, and
> to make sure it works, I have another part of the TML with manually created
> eventlinks so I can test it.
>
> I figured out that outputraw wont work with eventlinks because Tapestry
> itself transforms and re-renders them. Outputraw bypasses this.
>
> My second approach that I posted:
>
> <table>
> <tr><td>#business</td><td><a href="
> /discoveryassistant/refine:addyesterm/#business<
> http://localhost:8082/discoveryassistant/refine:addyesterm/#business>
> ">yes</a></td><td><a
> href="/discoveryassistant/refine:addnoterm/#business<
> http://localhost:8082/discoveryassistant/refine:addnoterm/#business>
> ">no</a></td></tr>
> </table>
>
> ...actually kind of works. What is confusing tapestry is the hashtag. If I
> remove it, Tapestry works as expected. If I put it back in, then I get the
> exception saying I need to add a onAddXXTerm method.
>
> I also tried using the html code for the hashtag, however it still fails.
>
> For now, I'll just strip the hashtag from the rendering portion, and re-add
> it in the event handler.
>
> On Tue, Jul 31, 2012 at 6:07 PM, Josh Canfield <joshcanfi...@gmail.com
> >wrote:
>
> > You need to implement a handler in your component "Refine" for the event.
> >
> > public void onAddNoTerm() {
> > }
> >
> > for instance.
> >
> >
> > On Tue, Jul 31, 2012 at 6:04 PM, George Ludwig <georgelud...@gmail.com
> > >wrote:
> >
> > > Actually, this doesn't work either. I get this exception:
> > >
> > > org.apache.tapestry5.ioc.internal.util.TapestryException: Request event
> > > 'addnoterm' (on component discoveryassistant/Refine) was not handled;
> you
> > > must provide a matching event handler method in the component or in one
> > of
> > > its containers.
> > >
> > > at
> > >
> > >
> >
> org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(
> > > ComponentEventRequestHandlerImpl.java:85)
> > >
> > > at
> > >
> > >
> >
> org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(
> > > ImmediateActionRenderResponseFilter.java:42)
> > >
> > > at $ComponentEventRequestHandler_12a61376ef8749b9.handle(Unknown
> Source)
> > >
> > > at org.apache.tapestry5.internal.services.AjaxFilter.handle(
> > > AjaxFilter.java:42)
> > >
> > > at $ComponentEventRequestHandler_12a61376ef8749b9.handle(Unknown
> Source)
> > >
> > > at org.apache.tapestry5.services.TapestryModule$40.handle(
> > > TapestryModule.java:2458)...
> > >
> > > On Tue, Jul 31, 2012 at 5:59 PM, George Ludwig <georgelud...@gmail.com
> > > >wrote:
> > >
> > > > Nevermind I guess... I discovered I could just render like this:
> > > >
> > > > <table>
> > > > <tr><td>#business</td><td><a href="
> > > > /discoveryassistant/refine:addyesterm/#business<
> > > http://localhost:8082/discoveryassistant/refine:addyesterm/#business>
> > > > ">yes</a></td><td><a
> > > href="/discoveryassistant/refine:addnoterm/#business<
> > > http://localhost:8082/discoveryassistant/refine:addnoterm/#business>
> > > > ">no</a></td></tr>
> > > > </table>
> > > >
> > > > On Tue, Jul 31, 2012 at 5:43 PM, George Ludwig <
> georgelud...@gmail.com
> > > >wrote:
> > > >
> > > >> I'm trying to use outputraw to render eventlinks, however when I do
> > this
> > > >> tapestry does not appear to bind the event on the client to the
> event
> > on
> > > >> the server. Is there a way to make this work?
> > > >>
> > > >> I use outputraw because it would be unwieldy to use Tapestry's
> <t:if>
> > > >> construct to control the rendering. Here's a simplified example
> with a
> > > >> single row:
> > > >>
> > > >> <table>
> > > >> <tr><td>#business</td><td><a t:type="eventlink" t:event="addYesTerm"
> > > >> t:context="literal:#business" href="#">yes</a></td><td><a
> > > >> t:type="eventlink" t:event="addNoTerm" t:context="literal:#business"
> > > >> href="#">no</a></td></tr>
> > > >> </table>
> > > >>
> > > >> If I click on the "yes" eventlink, the table should re-render like
> > this:
> > > >>
> > > >> <table>
> > > >> <tr><td>#business</td><td>yes!</td><td><a t:type="eventlink"
> > > >> t:event="addNoTerm" t:context="literal:#business"
> > > href="#">no</a></td></tr>
> > > >> </table>
> > > >>
> > > >> If I then clicked on the "no" eventlink, the table should re-render
> > like
> > > >> this:
> > > >>
> > > >> <table>
> > > >> <tr><td>#business</td><td><a t:type="eventlink" t:event="addYesTerm"
> > > >> t:context="literal:#business" href="#">yes</a></td><td>no!</td></tr>
> > > >> </table>
> > > >>
> > > >> As I said, I think I can make this work with the <t:if> construct,
> but
> > > it
> > > >> would take a lot of extra coding!
> > > >>
> > > >
> > > >
> > >
> >
>

Reply via email to