Hmm.. I guess what I don't get is how you can submit a form from a DirectLink component. Are you saying to move my form handling to within my border component and include it/exclude it based on current page? If my tabs all call a listener method via a DirectLink the request will be made without the form data included as that would be the same as just clicking a link as opposed to submitting a form.

Maybe it would be simpler to just call a javascript method from each tab ie:
<a href="#" onclick="function navigate(1); return false;">Tab 1</a>
... and implement the function on a page by page bases, either delegate to the form submit (if there is a form) or just navigate accordingly. Problem is that I then have to hack in the href from a PageLink or something to get the correct page url.

Or maybe I could send in a form name to the Border component as a parameter and if it isn't null, do some form processing .....

There are a thousand 'dirty' ways to do it, I'm hoping there is a relatively tidy 'Tapestry' way to do it......

suggestions welcome. paul.

Ben Acker wrote:
Cool. I would just handle all of it within a listener method. You could use
a direct link for your tabs and handle forms based upon which tab you're
currently using. If the content within the tab is defined within your page
anyway, you could just tack the listener method on the page and access it
that way.

Let me know if this doesn't help, I'm going to hit the hay right now, but
can look at it first thing in the morning too.

-Ben

On 5/22/07, Paul Stanton <[EMAIL PROTECTED]> wrote:

Basically I have a tab structure with 5 tabs, each is an individual
page. The tabs are contained within my border component, the content
with the tab is defined in the page template.

Now 2 of the pages have no form, and 3 of the pages have a form. The
behaviour of the tabs should be that clicking any tab while on a
non-form page simply redirects to the tab's page (ala PageLink) while
clicking the any tab while on a form page should submit/process the
form, then redirect to the tab's page.

That's the long and short of it.

Ben Acker wrote:
> Could you tell me more about the what the pages are and what the links
> would
> do on each of the pages? That may help with finding a solution to your
> problem!
>
> -Ben
>
>
> On 5/22/07, Paul Stanton <[EMAIL PROTECTED]> wrote:
>>
>> Actually, I think something is missing .. how do I tell the links that
I
>> want to submit a form if a form is present? ie, I can implement the
>> listener for each page, but in a couple of cases, this would mean the
>> listener would be called without the required form data on the request.
>>
>> I'll see what I can do but I'm sceptical about the form portion.
>>
>> Ben Acker wrote:
>> > I am using a similar approach to Phillip, but using the same method
>> > name for
>> > each page. We have the method implemented in a base page that is
>> > extended by
>> > the pages implementing the component. Anytime we need the method to
do
>> > something different, we just overwrite it in that page.
>> >
>> >
>> >
>> > On 5/14/07, Phillip Rhodes <[EMAIL PROTECTED]> wrote:
>> >>
>> >> You can you use IListener as a parameter.  On each page, you can
bind
>> >> your
>> >> component to the specific page listener that you want invoked.
>> >>
>> >> This works good, as I am using this approach myself.
>> >>
>> >>
>> >> ----- Original Message -----
>> >> From: "Paul Stanton" <[EMAIL PROTECTED]>
>> >> To: "Tapestry users" <users@tapestry.apache.org>
>> >> Sent: Monday, May 14, 2007 8:56:54 PM (GMT-0500) America/New_York
>> >> Subject: expert needed
>> >>
>> >> Tapestry 4.1
>> >>
>> >> I've got a set of anchors (<a>) which are common for a group of
pages
>> >> and are contained within a component, however on each page they
>> need to
>> >> do different things. Essentially they will either submit a form on
>> the
>> >> page with or without client side validation or perform a simple page
>> >> link.
>> >>
>> >> Can I achieve this with a common component with event handling
>> >> implemented on a page by page basis, or will I have to re-write the
>> >> links for each page?
>> >>
>> >> Thanks for any hints.
>> >>
>> >>
>> >>
---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >>
>> >>
---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to