Thanks.. That include once thing should work perfectly. I think it would be a nice addition to the contrib… but I’ll write my own for now.

 

As for my use of the link.. let me elaborate.. We have a model shared by our components (well.. bound in by the including component). When using a directlink that model has yet to be set in the component.. but other than that DirectLink is perfect. So essentially what we need is something that functions like directlink but that occurs with the usual rewinding, etc present in Action. Reason being, Action doesn’t let you specify parameters, which means that I can’t handle the refresh case very well.

 

Does this make sense? A problem with the IncludeOnce is that a hidden would be needed for each form.. but the include once would ensure that there is only one per page…

 

Any ideas? I get the feeling I am going about this all wrong..

 

Luke Galea

Software Development

BlueCat Networks

905-762-5225

 

-----Original Message-----
From: Mind Bridge [mailto:[EMAIL PROTECTED]]
Sent: November 7, 2002 10:37 AM
To: Tapestry Developer
Subject: Re: [Tapestry-developer] Writing a "SubmitLink" component

 

Hi,

Is there an easy way of ensuring that the parameter has been included within this form so I don’t have to worry about including it multiple times as additional SubmitLink components are added?

We have a component called IncludeOnce that includes what it wraps only once (as the name implies). It accepts a key as a parameter andcreates a RequestCycle attribute with that key before it renders the wrapped content. If the key already exists, it renders nothing. As a result, of all the IncludeOnce components with the same key, only the first one is rendered.

Wrapping the field in that component should do what you describe. (I should probably mention that such a component is also quite useful in quite a number of other situations, as well, such as inserting a script or a stylesheet only once. Should it be contributed -- are people interested in something like that? It is very simple on the other hand)

 

 

We are developing this component because we are in a situation where we need the functionality of an Action component but with DirectLink like “parameter” capabilities. The situation is that we have a page navigation bar (ie. Go to page 3, next page, prev page ) and we want it to behave appropriately upon refresh.. if the user hits refresh after hitting next we don’t want it to go next again. Is there another way to accomplish this? (ie. An action component with parameter capabilities?? ).. Perhaps encoding something into the URL (using a gesture)??

I am not sure your approach will achieve the goal. When a form is submitted, it is submitted to the URL defined in the form -- an href=""..."" would be ignored.

Sorry, I also cannot quite find the need for an Action. Are you trying to implement a wizard-like functionality and you have data that you need to submit?

In any case, if you do need a form, you have to store info in ahidden field and achieve functionality similar to Direct. Alternatively, you can store the info in the Visit, but that may create issues if the user makes use of the Back browser button.

-mb

 

 Luke Galea <[EMAIL PROTECTED]> wrote:

Hello,

         We are trying to write a component that duplicates the functionality of the Submit component but in the form of an A element with javascript that submits the form.

         I have a few questions about how to do this. In order to determine what was clicked, I need to include a hidden input and set it’s value before submitting. Is there an easy way of ensuring that the parameter has been included within this form so I don’t have to worry about including it multiple times as additional SubmitLink components are added?

 

We are developing this component because we are in a situation where we need the functionality of an Action component but with DirectLink like “parameter” capabilities. The situation is that we have a page navigation bar (ie. Go to page 3, next page, prev page ) and we want it to behave appropriately upon refresh.. if the user hits refresh after hitting next we don’t want it to go next again. Is there another way to accomplish this? (ie. An action component with parameter capabilities?? ).. Perhaps encoding something into the URL (using a gesture)??

 

Thanks

 

Luke Galea

Software Development

BlueCat Networks

905-762-5225

 

 


Do you Yahoo!?
U2 on LAUNCH - Exclusive medley & videos from Greatest Hits CD

Reply via email to