You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Keith Pemberton <kb...@cox.net> on 2003/06/09 00:14:15 UTC

Dispatch Action help...

Hi all,

    I have a webform that I am trying to create and I have run into a
huge problem.  So, at the top of the form I have the action specified
and underneath I have defined the inputs using the struts taglib.  Now,
I can submit the form to the Action just fine and all the ActionForm is
filled in with all the correct values.  I want to be able to include a
list of dynamic links with the form information.  I have a <html:select>
defined and above that to <html:text> input fields.  Also, I have two
buttons (Add and Remove) that I would like to specify the Actions on
those two buttons to add an entry to the <html:select> or remove a
selected value in the <html:select> field.  So, here is what I have
tried so far.  I started using JavaScript to dynamically add the content
from the two input fields to the <html:select> box.  When I submitted
the form, though, I would only get a String[] from the <html:select> box
that was the values of the entries (not the values and the labels).  Now
what I am trying to do is to use a DispatchAction class and specify a
<html:link> around each <html:button> that points to the DispatchAction
class with a parameter that says which action to perform.  When the
program goes to the DispatchAction class, the ActionForm that I
specified in the struts-config.xml file is not populated with the fields
from the webform.  I have tried also to figure out some way to add the
parameters onto the request line but the only way that I can do that is
using the onclick javascript method and specifing "document.location =
"'/admin/EditReference.do?action=addOption&refTitle=' + refTitle.value +
'&refLink=' + refLink.value".  Now, this works fine for add the stuff to
the <html:select> because I have a bean in the session scope that the
refTitle and refLink are being added to.  But, when the DispatchAction
returns to the webform the other values in the webform do not show
anymore.  What I figure is happening is that the webform is not getting
populated because I haven't actually submitted the form when doing the
Add and Remove actions, so therefore that information is not re-put into
the webform when the DispatchAction returns to the webform.  Anyone know
what else I can do?

Sorry if this was confusing.  I can submit code if it would make things
clearer.  Any help is very much appreciated!  Thanks in advance!

Keith
-- 
Keith Pemberton <kb...@cox.net>


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