You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mayukha One <ma...@yahoo.com> on 2004/05/08 17:56:00 UTC
Submitting a form from a menu link
Hi,
I am having a drop down menu ( I will have to write a component) which contains various actions a user can perform on a page. The page itself has a form. Menu will contain page specific actions and other generic actions ( like logoff).
What is the best way to submit the form when a menu item is clicked. Should I embed the menu also in the form? or Can I simulate the form submit from outside of the form? Will I screw up the rewind process of the form if I hack it from the outside?
If my approach is fundamentally wrong, please provide some direction.
Thanks,
Jack.
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
Re: Submitting a form from a menu link
Posted by Luc Peerdeman <lj...@xs4all.nl>.
Hi,
Mayukha One wrote:
> Hi,
>
> I am having a drop down menu ( I will have to write a component)
Be sure to check out this page:
http://www.kryogenix.org/code/browser/aqlists/
It shows you how to use a simple unorderdered list (UL/LI tags) as a
menu by simply adding a class attribute and some JavaScript. I am trying
to make this into a proper component but so far only have a very simple
skeleton that can be used like so:
<menu jwcid="@MyMenu">
<ul class="menu">
list contents
</ul>
The component now only takes care of adding the JavaScript that will
render this list as a menu. Next steps: add the class attribute (have to
find out how, I am a Tapestry beginner) and then make a fully dynamic
one backed by something like a listmodel I reckon.
Cheers, Luc.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Submitting a form from a menu link
Posted by Mayukha One <ma...@yahoo.com>.
I thought of putting the menu outside of the form and accessing java script that calls form's submit. That means, at menu rendering time, the form's name might not be available ( Is that true?).
So, I am planning to address it this way.
< body jwcid=@Body >
< span jwcid=@MenuMaker >
< form jwcid=form1@Form >
< /form>
< /span>
< /body >
MenuMaker will first buffer the rendered output of its body in a nested writer, then renders the menu and flushes its body (like framework's body component).
This way menu can call a java script that sets hidden property on the form indicating an action and call submit on the form and I can call the script when menu item is clicked.
Does it sound like a tapestry kinda solution or it smells like jsp?
Please let me know.
Thanks,
Jack.
Mayukha One <ma...@yahoo.com> wrote:
Hi,
I am having a drop down menu ( I will have to write a component) which contains various actions a user can perform on a page. The page itself has a form. Menu will contain page specific actions and other generic actions ( like logoff).
What is the best way to submit the form when a menu item is clicked. Should I embed the menu also in the form? or Can I simulate the form submit from outside of the form? Will I screw up the rewind process of the form if I hack it from the outside?
If my approach is fundamentally wrong, please provide some direction.
Thanks,
Jack.
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs