You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Cranford <ch...@tkdsoftware.com> on 2004/06/17 18:17:54 UTC

Forms/JSP

I have created a form hierarchy as follows:
  public class CheckboxPagedForm extends ActionForm
  public class MaintenanceForm extends CheckboxPagedForm

I did this because there are form-specific attributes for the maintenance form, but we have multiple forms which are going to need to leverage the paged checkbox form stuff.  In the maintenance.jsp I need to open a new window and work with only the data in the base class "CheckboxPagedForm".  

What I'd like to do is have this JSP common so that no matter what extended form calls it, it gets the data, permits the user to make changes to the data and then when the window is closed, the data gets sent back to the "maintenanceform" with a parameter that tells it to update itself,etc.

Right now I had to write my JSP so that I checks like:

<logic:present name="maintenanceForm">
  .. do maintenance form logic
</logic:present>
<logic:present name="searchForm">
  .. do search form logic
</logic:present>

Is there not a way that no matter what the extended form is, since both are "checkboxpageform", I can just reference that?

Thanks
Chris

Re: Forms/JSP

Posted by mike <mi...@michaelmcgrady.com>.
Hello, Chris,

I sent out a note some time back on this saying that I think we should all 
collaborate and build something this is new on this issue.  This is a major 
recurrent issue.  The current solutions all "suck" to some extent either in 
bloating the session and creating difficulty with multiple windows, or in 
requiring too much coding when the MVC structure, which I believe in "way 
deeply", is adhered to strictly.  I think something other than the normal 
scopes for retaining and accessing data is what is required, i.e. something 
out-of-the-present box.  I still think that this is necessary, and if there 
had been a response of any kind, I would have set about working 
collaboratively on it.  I guess this is a time to reassert the need and to 
ask if anyone on the list would like to collaborate.  I think that someone 
going off on their own, whjich I will do eventually if no one responds, is 
less advisable because the collective wisdom of the list is helpful.  This 
is a good issue, I think, for the dev list as well.

Specifically on your issue, there is a simple answer depending on what your 
question is.  You can always reference a super class from a subclass, if 
that is the question.  If the question is whether you can reference another 
instance of the superclass, the answer is that you can if you have parked 
it somewhere and have access to it.  Is this a fair answer, or am I 
misunderstanding you?

Michael

At 11:32 AM 6/17/2004, Chris Cranford wrote:
>Any thoughts anybody?
>
>----- Original Message -----
>From: "Chris Cranford" <ch...@tkdsoftware.com>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Sent: Thursday, June 17, 2004 12:17 PM
>Subject: Forms/JSP
>
>
>I have created a form hierarchy as follows:
>   public class CheckboxPagedForm extends ActionForm
>   public class MaintenanceForm extends CheckboxPagedForm
>
>I did this because there are form-specific attributes for the maintenance
>form, but we have multiple forms which are going to need to leverage the
>paged checkbox form stuff.  In the maintenance.jsp I need to open a new
>window and work with only the data in the base class "CheckboxPagedForm".
>
>What I'd like to do is have this JSP common so that no matter what extended
>form calls it, it gets the data, permits the user to make changes to the
>data and then when the window is closed, the data gets sent back to the
>"maintenanceform" with a parameter that tells it to update itself,etc.
>
>Right now I had to write my JSP so that I checks like:
>
><logic:present name="maintenanceForm">
>   .. do maintenance form logic
></logic:present>
><logic:present name="searchForm">
>   .. do search form logic
></logic:present>
>
>Is there not a way that no matter what the extended form is, since both are
>"checkboxpageform", I can just reference that?
>
>Thanks
>Chris
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org



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


Re: Forms/JSP

Posted by Chris Cranford <ch...@tkdsoftware.com>.
Any thoughts anybody?

----- Original Message -----
From: "Chris Cranford" <ch...@tkdsoftware.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, June 17, 2004 12:17 PM
Subject: Forms/JSP


I have created a form hierarchy as follows:
  public class CheckboxPagedForm extends ActionForm
  public class MaintenanceForm extends CheckboxPagedForm

I did this because there are form-specific attributes for the maintenance
form, but we have multiple forms which are going to need to leverage the
paged checkbox form stuff.  In the maintenance.jsp I need to open a new
window and work with only the data in the base class "CheckboxPagedForm".

What I'd like to do is have this JSP common so that no matter what extended
form calls it, it gets the data, permits the user to make changes to the
data and then when the window is closed, the data gets sent back to the
"maintenanceform" with a parameter that tells it to update itself,etc.

Right now I had to write my JSP so that I checks like:

<logic:present name="maintenanceForm">
  .. do maintenance form logic
</logic:present>
<logic:present name="searchForm">
  .. do search form logic
</logic:present>

Is there not a way that no matter what the extended form is, since both are
"checkboxpageform", I can just reference that?

Thanks
Chris




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