You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Reddin <gr...@fnf.com> on 2003/12/04 08:46:56 UTC

Re: How do I combine tiles and pre-populated forms?

Jay,

Use the first action mapping, but do it like this:

      <action
          path="/ViewSystemProperties"
          type="com.nci.action.telco.ViewSystemProperties"
          scope="request"
          name="SystemProperties"
          validate="false">
          <forward name="success" path="telco.system_properties"/>
      </action>

Then in your ViewSystemProperties action do this:

      return mapping.findForward("success");

Greg

Glanville, Jay wrote:
> Hello All.
> 
> I'm a nubie and I'm having a little problem.  I need to combine an
> action mapping to pre-populate a form, with an action mapping for a tile
> definition.
> 
> Let me go into more detail ...
> 
> I have an action mapping that gets the information for a form, populates
> the form and then forwards on to the page containing the form.  The
> mapping looks like this:
>     <action
>         path="/ViewSystemProperties"
>         type="com.nci.action.telco.ViewSystemProperties"
>         scope="request"
>         name="SystemProperties"
>         parameter="/telco_edit_system_properties"
>         validate="false">
>     </action>
> The "name" attribute is a form bean I've defined in the <form-beans>
> section, which subclasses action form and does all the necessary
> validation of the form.  The "type" in the above action is a subclass of
> Action which goes to the database and gets the appropriate information,
> and then sets the form's properties.  The "type" class then uses the
> "parameter" attribute to forward on to our internal templating framework
> that we want to get rid of.
> 
> As we want to get rid of our internal templating framework and use
> tiles, I came up with the following action mapping:
>     <action
>         path="/ViewSystemProperties"
>         type="org.apache.struts.actions.ForwardAction"
>         parameter="telco.system_properties">
>     </action>
> The "parameter" attribute is a tile definition (from tiles-def.xml).
> The problem with this is that I can't do the necessary work with
> pre-populating the form.
> 
> With the first solution, I can pre-populate a form.  With the second
> solution, I can use the tiling framework.  Now the big question: how do
> I combine both solutions so that I can pre-populate my form and use the
> tiling framework?
> 
> Thanks in advance.
> 
> 
> 
> Jay Dickon Glanville
> 
> PS: If this email comes through as HTML or RTF, I apologize.  I BELIEVE
> I've setup this email for plain text, but I could be wrong.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


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