You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Amol Yadwadkar <Am...@mphasis.com> on 2005/08/03 16:27:02 UTC

Html:link with DynaActionForm

Hi List,

I have a form where all the action are provided by link.

I am using DynaActionform so when I click on html:link .... I do not get
the Dynaform populated for the next page

But

If I use use html:submit then it happens as expected.

 

Can any one have solution for the above issue.

Thankx

best regds, 
AMOL 



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


Re: Html:link with DynaActionForm

Posted by Laurie Harper <la...@holoweb.net>.
Amol Yadwadkar wrote:
> Hi List,
> 
> I have a form where all the action are provided by link.
> 
> I am using DynaActionform so when I click on html:link .... I do not get
> the Dynaform populated for the next page
> 
> But
> 
> If I use use html:submit then it happens as expected.
> 
> Can any one have solution for the above issue.

 From Struts' point of view there's no difference between a request that 
comes from a link and one that comes from a form submit. Provided the 
action the request maps to has a from bean defined (via the 'name' 
attribute), it should be populated.

Perhaps you mean the form bean for the page *containing* the link isn't 
populated whereas it is if the page contains a form (i.e. you're talking 
about a form bean for the initial page, not the next page returned when the 
link / submit button is clicked?

In that case, it's the <html:form/> tag that causes the bean to be 
instantiated. If you don't either have a form tag on the page or a form 
bean declared on the action that front the page, Struts wont know to 
instantiate a form bean.

L.
-- 
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


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


Re: Html:link with DynaActionForm

Posted by Woodchuck <wo...@yahoo.com>.
hihi,

clicking on links (even on a page with a form) does *not* submit the
form at all.  do not confuse this with the common <input type='submit'>
or using javascript to submit forms via document.forms[0].submit().

when you click on a link such as 
<a href="http://www.mywebsite.com/myAction.do">Click this link!</a>
no extra information is submitted to that Action even if there's an
associated ActionForm.

if you want to populate the ActionForm associated to the Action that is
to be 'triggered' from a link you can use query string parameters.  not
very elegant but it works, and not recommended if you have a lot of
info to populate.  using this method your final renedered link should
look something like this:

<a
href="http://www.mywebsite.com/myAction.do?personId='12345'&firstName='John'&lastName='Smith'">Click
this link!</a>

how you create this link is another matter but when you click the above
link an attempt to populate personId, firstName, lastName values into
the corresponding ActionForm for myAction will be made (using the
JavaBean convention).

hth,
woodchuck


--- Amol Yadwadkar <Am...@mphasis.com> wrote:

> Hi List,
> 
> I have a form where all the action are provided by link.
> 
> I am using DynaActionform so when I click on html:link .... I do not
> get
> the Dynaform populated for the next page
> 
> But
> 
> If I use use html:submit then it happens as expected.
> 
>  
> 
> Can any one have solution for the above issue.
> 
> Thankx
> 
> best regds, 
> AMOL 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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