You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alan Chandler <al...@chandlerfamily.org.uk> on 2006/01/15 15:07:18 UTC

Adding anchor to a form submission

I have a form that when I hit the submit button, it will fire a listener.

That listener will then return a page that I want to go to.

I want to actually go to an anchor on that page rather than the head of the 
page.

In a @DirectLink you can add the anchor parameter to the url for the link 
(this convincing the browser to go to an achor that is eventually rendered by 
the result of the direct link)

@Form has no such parameter. Is there any other way to get an anchor rendered 
in the form response url?  
-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

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


Re: Adding anchor to a form submission

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Sunday 15 January 2006 16:50, Gregg Bolinger wrote:
> Do you have to use a submit button?  Why not just use a DirectLink?

I am not sure I understand you.  If I take what you say at face value, (ie I 
replace the submit button with a direct link) that will not work

The form is full of input fields, which get loaded into the object that is the 
subject of the form during the rewind cycle.

The Direct Link is produced during the initial render, so any parameters it 
may have will have the initial value of all the fields not the filled in 
ones. So even if I included my object as a parameter of the direct link, it 
would have the original values in it.  So no way to update the database!!



>
> Gregg
>
> On 1/15/06, Alan Chandler <al...@chandlerfamily.org.uk> wrote:
> > I have a form that when I hit the submit button, it will fire a listener.

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

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


Re: Adding anchor to a form submission

Posted by Gregg Bolinger <ta...@gmail.com>.
Do you have to use a submit button?  Why not just use a DirectLink?

Gregg


On 1/15/06, Alan Chandler <al...@chandlerfamily.org.uk> wrote:
>
> I have a form that when I hit the submit button, it will fire a listener.
>
> That listener will then return a page that I want to go to.
>
> I want to actually go to an anchor on that page rather than the head of
> the
> page.
>
> In a @DirectLink you can add the anchor parameter to the url for the link
> (this convincing the browser to go to an achor that is eventually rendered
> by
> the result of the direct link)
>
> @Form has no such parameter. Is there any other way to get an anchor
> rendered
> in the form response url?
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
> Open Source. It's the difference between trust and antitrust.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Adding anchor to a form submission

Posted by Kent Tong <ke...@cpttm.org.mo>.
Alan Chandler <alan <at> chandlerfamily.org.uk> writes:

> > Then I guess you may try to throw a RedirectException and put the
> > anchor into the URL.
> 
> How do you add the anchor?  The JavaDocs for PageRedirectException don't give 
> much of a clue

I mean RedirectException, not PageRedirectException. The former
accepts a URL.

--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)


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


Re: Adding anchor to a form submission

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Tuesday 17 January 2006 01:16, Kent Tong wrote:
> Alan Chandler <alan <at> chandlerfamily.org.uk> writes:
> > Unfortunately, konqueror doesn't actually jump to the correct place ( and
> > was true before) but much worse, firefox seems loop calling the server
> > for a new page.
>
> Then I guess you may try to throw a RedirectException and put the
> anchor into the URL.

How do you add the anchor?  The JavaDocs for PageRedirectException don't give 
much of a clue

[I am away on Business for a few days, and will not pick up any responses 
until I get back]

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

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


Re: Adding anchor to a form submission

Posted by Kent Tong <ke...@cpttm.org.mo>.
Alan Chandler <alan <at> chandlerfamily.org.uk> writes:

> Unfortunately, konqueror doesn't actually jump to the correct place ( and was 
> true before) but much worse, firefox seems loop calling the server for a new 
> page.

Then I guess you may try to throw a RedirectException and put the
anchor into the URL.

--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)



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


Re: Adding anchor to a form submission

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Monday 16 January 2006 23:36, Alan Chandler wrote:
> On Monday 16 January 2006 13:25, Kent Tong wrote:
> > Alan Chandler <alan <at> chandlerfamily.org.uk> writes:
> > > I want to actually go to an anchor on that page rather than the head of
> > > the page.
> >
> > In the response page, try including Script component to insert
> > a .script file like:
> >
> > <script>
> > <symbol key="anchor" class="java.lang.String" required="yes"/>
> > <initialization>
> >   window.location.hash="${anchor}";
> > </initialization>
> > </script>
>
> That looks a good idea, but a couple of things.
>
> I think that should be <input-symbol key="anchor" ...
>
> and I don't know whats wrong but I have put this in my page template
>
> <span jwcid="@Script" script="GoToAnchor.script" anchor="ognl:anchor"/>
>
> and then I get this error
>
> "Script symbol 'anchor' is required, but not specified".
>
> Since this looks exactly like other examples I have seen, I have no idea
> whats wrong.  Any ideas?

I took the required="yes" out and the page content produced looked good, so I 
don't know what the problem is.

Unfortunately, konqueror doesn't actually jump to the correct place ( and was 
true before) but much worse, firefox seems loop calling the server for a new 
page.

So it looks like I will have to give up on the idea

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

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


Re: Adding anchor to a form submission

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Monday 16 January 2006 13:25, Kent Tong wrote:
> Alan Chandler <alan <at> chandlerfamily.org.uk> writes:
> > I want to actually go to an anchor on that page rather than the head of
> > the page.
>
> In the response page, try including Script component to insert
> a .script file like:
>
> <script>
> <symbol key="anchor" class="java.lang.String" required="yes"/>
> <initialization>
>   window.location.hash="${anchor}";
> </initialization>
> </script>
>

That looks a good idea, but a couple of things.

I think that should be <input-symbol key="anchor" ...

and I don't know whats wrong but I have put this in my page template

<span jwcid="@Script" script="GoToAnchor.script" anchor="ognl:anchor"/>

and then I get this error

"Script symbol 'anchor' is required, but not specified".  

Since this looks exactly like other examples I have seen, I have no idea whats 
wrong.  Any ideas?

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

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


Re: Adding anchor to a form submission

Posted by Kent Tong <ke...@cpttm.org.mo>.
Alan Chandler <alan <at> chandlerfamily.org.uk> writes:

> I want to actually go to an anchor on that page rather than the head of the 
> page.

In the response page, try including Script component to insert 
a .script file like:

<script>
<symbol key="anchor" class="java.lang.String" required="yes"/>
<initialization>
  window.location.hash="${anchor}";
</initialization>
</script>

You may also want to encapsulate it into a GotoAnchor component.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


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