RE: Form Question

2003-10-21 Thread Shane Mingins
Here are my thoughts ---

It sounds like a wizard type interaction where each 'next' step does
something until the final result is achieved.  So I would probably have a
session scope action form collecting the cumulative inputs.

The action form could also then provide the state info to your jsp.  Logic
tags could query the state of each input field to decide if it should be
displayed or not.

Any one else?

Shane


> -Original Message-
> From: Shishir K. Singh [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 21 October 2003 2:46 p.m.
> To: Struts Users Mailing List
> Subject: Form Question
> 
> Hello,
> 
> I am new to struts and kind of working on my first struts project. One
> of my requirement is that based on a user input on a user form, the same
> form is displayed but with additional/different input field.
> 
> These input fields are kind of conditional fields. Based on the value of
> the previous displayed field, the next appropriate field should be
> displayed and so on till the list of the conditional attributes are
> exhausted (I already have a list of these conditional attributes, their
> count and type can vary based on a configurable XML file). The User just
> clicks  continue/continue on the form to get to these new fields. I am
> not sure how to implement this. Do I create different forms for the
> different clicks (but then I loose the dynamic way of adding input
> fields to the form). Is this at all doable with the same form.
> 
> Any input would be appreciated.
> 
> TIA
> Shishir
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Form Question

2003-10-20 Thread hgosper
You could do this using JavaScript using the same form...

I used the "display" property of form elements (set to 'none' they 
disappear, or set to '' they reappear) in the onChange handler of a select 
box, that worked fine. You could put one in the onClick of your submit 
button if you have to do it like that.

Hope that helps.




Hello, 

I am new to struts and kind of working on my first struts project. One
of my requirement is that based on a user input on a user form, the same
form is displayed but with additional/different input field. 

These input fields are kind of conditional fields. Based on the value of
the previous displayed field, the next appropriate field should be
displayed and so on till the list of the conditional attributes are
exhausted (I already have a list of these conditional attributes, their
count and type can vary based on a configurable XML file). The User just
clicks  continue/continue on the form to get to these new fields. I am
not sure how to implement this. Do I create different forms for the
different clicks (but then I loose the dynamic way of adding input
fields to the form). Is this at all doable with the same form.

Any input would be appreciated. 

TIA 
Shishir

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Form Question

2003-10-20 Thread Shishir K. Singh
Hello, 

I am new to struts and kind of working on my first struts project. One
of my requirement is that based on a user input on a user form, the same
form is displayed but with additional/different input field. 

These input fields are kind of conditional fields. Based on the value of
the previous displayed field, the next appropriate field should be
displayed and so on till the list of the conditional attributes are
exhausted (I already have a list of these conditional attributes, their
count and type can vary based on a configurable XML file). The User just
clicks  continue/continue on the form to get to these new fields. I am
not sure how to implement this. Do I create different forms for the
different clicks (but then I loose the dynamic way of adding input
fields to the form). Is this at all doable with the same form.

Any input would be appreciated. 

TIA 
Shishir

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



html form question

2003-02-24 Thread Jobe, Mike [EESUS]
Can anyone help me get started witht this?

I need to create a form that is going to retrieve a persons project by their
ID. I also need to create and action class that will pass the ID to the
Project class.

Thanks in advance!

Mike


Struts form question

2003-02-20 Thread Peng Tuck Kwok
I have a login page which has form called logonForm which will be 
validated, I need this form data to presist and the traditional way 
would be to put into the session. In the struts-config I set the scope 
of the form to session but that actually results in the form not being 
able to validate properly , regardless of whether the form on the page 
was filled out. With this I keep getting validation errors and the 
errors would snowball on the page. If I set the scope in the 
struts-config to request then things are ok. Can anyone help ?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ReadOnly data in a Form question

2002-04-10 Thread Chappell, Simon P

Yeah, I could. Let me throw a little more light on the situation.

My intention is to have a multi line table of line items for the shipment info and 
then a single data item at the bottom (perhaps top) of the form for the single data 
item to be entered. The data item can be a String. The line items for the shipment 
would be an ArrayList of LineItem objects.

I want to have struts handle the auto loading/extracting of the String field and I 
want to use the  tag to display the line items myself. This is not 
wildly different to the registration.jsp, except that I don't really want to pass the 
extra data in through the session.

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Java Programming Specialist  www.landsend.com
Lands' End, Inc.   (608) 935-4526


>-Original Message-
>From: Brian Holzer [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, April 10, 2002 10:27 AM
>To: [EMAIL PROTECTED]
>Subject: Re: ReadOnly data in a Form question
>
>
>I'm not sure what exactly you are trying to do, but you can 
>put that extra data into your form, and then define the fields 
>in your JSP as this  size="20" readonly="true" />.
>
>Brian
>
>>>> "Chappell, Simon P" <[EMAIL PROTECTED]> 04/10/02 
>07:40am >>>
>I have no problem with getting data to and from a JSP in a 
>Form object. But if I want to send extra read-only 
>(display-only?) data to a JSP, can I put it in the Form object 
>and read it from there? If I don't have a JSP field with that 
>name (e.g.ReadOnlyData) would that work?
>
>The reason that I ask, is that for the situation I am thinking 
>of, I want to have a bunch of computed read-only data on a 
>form and then a single field to accept data and I would rather 
>not dump a potentially large amount of data into the session.
>
>All suggestions appreciated (especially from Mark! :-)
>
>Simon
>
>-
>Simon P. Chappell [EMAIL PROTECTED] 
>Java Programming Specialist  www.landsend.com 
>Lands' End, Inc.   (608) 935-4526
>
>
>--
>To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: ReadOnly data in a Form question

2002-04-10 Thread Brian Holzer

I'm not sure what exactly you are trying to do, but you can put that extra data into 
your form, and then define the fields in your JSP as this  .

Brian

>>> "Chappell, Simon P" <[EMAIL PROTECTED]> 04/10/02 07:40am >>>
I have no problem with getting data to and from a JSP in a Form object. But if I want 
to send extra read-only (display-only?) data to a JSP, can I put it in the Form object 
and read it from there? If I don't have a JSP field with that name (e.g.ReadOnlyData) 
would that work?

The reason that I ask, is that for the situation I am thinking of, I want to have a 
bunch of computed read-only data on a form and then a single field to accept data and 
I would rather not dump a potentially large amount of data into the session.

All suggestions appreciated (especially from Mark! :-)

Simon

-
Simon P. Chappell [EMAIL PROTECTED] 
Java Programming Specialist  www.landsend.com 
Lands' End, Inc.   (608) 935-4526


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




ReadOnly data in a Form question

2002-04-10 Thread Chappell, Simon P

I have no problem with getting data to and from a JSP in a Form object. But if I want 
to send extra read-only (display-only?) data to a JSP, can I put it in the Form object 
and read it from there? If I don't have a JSP field with that name (e.g.ReadOnlyData) 
would that work?

The reason that I ask, is that for the situation I am thinking of, I want to have a 
bunch of computed read-only data on a form and then a single field to accept data and 
I would rather not dump a potentially large amount of data into the session.

All suggestions appreciated (especially from Mark! :-)

Simon

-
Simon P. Chappell [EMAIL PROTECTED]
Java Programming Specialist  www.landsend.com
Lands' End, Inc.   (608) 935-4526

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Nested Dynamic Form Question

2002-04-09 Thread Manie Coetzee

Hi

I was wondering if one can nest Dynamic forms.
If I have the following:


  
  



  
  
  


I want to specify that the 'subjectForm' is a property of
'courseForm' and accesible via form-property 'subjects'


Thank you in advance
Manie Coetzee




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: RE [2]: Form Question - Dynamic number of checkboxes - Multibox ?

2002-03-22 Thread Gaulin . David

As far as I can see your code looks Ok.

>From the code of the tag, this exception is throw when the value object is
null.  
Can your sb.getCheckBoxName return null?

That is all I can think of.


-Original Message-
From: Mattos, John [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 12:48 PM
To: 'Struts Users Mailing List'
Subject: RE [2]: Form Question - Dynamic number of checkboxes - Multibox
?


Okay, so now I have the following:


  

<%=sb.getProductName()%> 
 
 


 
   


and I have an int[] field on my bean called "assetId"

and it's telling me 

"You must specify the value attribute or nested tag content"

I thought that's what I was doing when I specified
value="<%=sb.getCheckBoxName()%>" in the multiBox.

the getcheckboxName, by the way, returns the assetId, so I hope to end
upwith an array of these things in the bean

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:42 AM
To: [EMAIL PROTECTED]
Subject: RE: Form Question - Dynamic number of checkboxes


Look at the multibox tag.  Add an attribute to your form called product (I
think it has to be an a String array) and when you read.  It will populate
the array with the product selected.

David



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:32 AM
To: Struts Users Mailing List
Subject: Re: Form Question - Dynamic number of checkboxes




why don't you use indexed=true on the checkboxes and it will create indexed
names for them.  Have to use nightly build or new 1.1 beta.

Cheers,
Dave




"Mattos, John" <[EMAIL PROTECTED]> on 03/22/2002
11:13:16 AM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'[EMAIL PROTECTED]'"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Form Question - Dynamic number of checkboxes



Hi there all

I'm generating a form that can have dynamic checkboxes depending on
information retrieved from my database. I basically retrieve a bunch or rows
and for each one, I want to create a checkbox.

Than, in the Action class handling the form submission, I plan to loop
through the checkboxes, and build an array of those that were selected, and
do something to them.

The problem is that I am tying to name the checkboxes for the ID of the
row... here is a JSP snippet:


  
<%=sb.getProductName()%> 
  
  




the getCheckBoxName() comes from the database, and it correcponds to the
"Product" in this row, and it's dynamic.

Struts complains with the following error message

 No getter method for property 4363 of bean
org.apache.struts.taglib.html.BEAN

Essentially, I'm trying to create the following
 and struts can't find get4363() in the
bean. No surprise there, I can't create getters for all the possibilities. I
just planned to loop through the submitted form fields to get the ids
checked.

Is there any way that Struts can not care that the setters don't exist?

Does this make sense?


John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE [2]: Form Question - Dynamic number of checkboxes - Multibox ?

2002-03-22 Thread Mattos, John

Okay, so now I have the following:


  

<%=sb.getProductName()%> 
 
 


 
   


and I have an int[] field on my bean called "assetId"

and it's telling me 

"You must specify the value attribute or nested tag content"

I thought that's what I was doing when I specified
value="<%=sb.getCheckBoxName()%>" in the multiBox.

the getcheckboxName, by the way, returns the assetId, so I hope to end
upwith an array of these things in the bean

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:42 AM
To: [EMAIL PROTECTED]
Subject: RE: Form Question - Dynamic number of checkboxes


Look at the multibox tag.  Add an attribute to your form called product (I
think it has to be an a String array) and when you read.  It will populate
the array with the product selected.

David



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:32 AM
To: Struts Users Mailing List
Subject: Re: Form Question - Dynamic number of checkboxes




why don't you use indexed=true on the checkboxes and it will create indexed
names for them.  Have to use nightly build or new 1.1 beta.

Cheers,
Dave




"Mattos, John" <[EMAIL PROTECTED]> on 03/22/2002
11:13:16 AM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'[EMAIL PROTECTED]'"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Form Question - Dynamic number of checkboxes



Hi there all

I'm generating a form that can have dynamic checkboxes depending on
information retrieved from my database. I basically retrieve a bunch or rows
and for each one, I want to create a checkbox.

Than, in the Action class handling the form submission, I plan to loop
through the checkboxes, and build an array of those that were selected, and
do something to them.

The problem is that I am tying to name the checkboxes for the ID of the
row... here is a JSP snippet:


  
<%=sb.getProductName()%> 
  
  




the getCheckBoxName() comes from the database, and it correcponds to the
"Product" in this row, and it's dynamic.

Struts complains with the following error message

 No getter method for property 4363 of bean
org.apache.struts.taglib.html.BEAN

Essentially, I'm trying to create the following
 and struts can't find get4363() in the
bean. No surprise there, I can't create getters for all the possibilities. I
just planned to loop through the submitted form fields to get the ids
checked.

Is there any way that Struts can not care that the setters don't exist?

Does this make sense?


John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Form Question - Dynamic number of checkboxes

2002-03-22 Thread Gaulin . David

Look at the multibox tag.  Add an attribute to your form called product (I
think it has to be an a String array) and when you read.  It will populate
the array with the product selected.

David



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:32 AM
To: Struts Users Mailing List
Subject: Re: Form Question - Dynamic number of checkboxes




why don't you use indexed=true on the checkboxes and it will create indexed
names for them.  Have to use nightly build or new 1.1 beta.

Cheers,
Dave




"Mattos, John" <[EMAIL PROTECTED]> on 03/22/2002
11:13:16 AM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'[EMAIL PROTECTED]'"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Form Question - Dynamic number of checkboxes



Hi there all

I'm generating a form that can have dynamic checkboxes depending on
information retrieved from my database. I basically retrieve a bunch or rows
and for each one, I want to create a checkbox.

Than, in the Action class handling the form submission, I plan to loop
through the checkboxes, and build an array of those that were selected, and
do something to them.

The problem is that I am tying to name the checkboxes for the ID of the
row... here is a JSP snippet:


  
<%=sb.getProductName()%> 
  
  




the getCheckBoxName() comes from the database, and it correcponds to the
"Product" in this row, and it's dynamic.

Struts complains with the following error message

 No getter method for property 4363 of bean
org.apache.struts.taglib.html.BEAN

Essentially, I'm trying to create the following
 and struts can't find get4363() in the
bean. No surprise there, I can't create getters for all the possibilities. I
just planned to loop through the submitted form fields to get the ids
checked.

Is there any way that Struts can not care that the setters don't exist?

Does this make sense?


John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Form Question - Dynamic number of checkboxes

2002-03-22 Thread dhay



why don't you use indexed=true on the checkboxes and it will create indexed
names for them.  Have to use nightly build or new 1.1 beta.

Cheers,
Dave




"Mattos, John" <[EMAIL PROTECTED]> on 03/22/2002
11:13:16 AM

Please respond to "Struts Users Mailing List"
  <[EMAIL PROTECTED]>

To:   "'[EMAIL PROTECTED]'"
  <[EMAIL PROTECTED]>
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Form Question - Dynamic number of checkboxes



Hi there all

I'm generating a form that can have dynamic checkboxes depending on
information retrieved from my database. I basically retrieve a bunch or rows
and for each one, I want to create a checkbox.

Than, in the Action class handling the form submission, I plan to loop
through the checkboxes, and build an array of those that were selected, and
do something to them.

The problem is that I am tying to name the checkboxes for the ID of the
row... here is a JSP snippet:


  
<%=sb.getProductName()%> 
  
  




the getCheckBoxName() comes from the database, and it correcponds to the
"Product" in this row, and it's dynamic.

Struts complains with the following error message

 No getter method for property 4363 of bean
org.apache.struts.taglib.html.BEAN

Essentially, I'm trying to create the following
 and struts can't find get4363() in the
bean. No surprise there, I can't create getters for all the possibilities. I
just planned to loop through the submitted form fields to get the ids
checked.

Is there any way that Struts can not care that the setters don't exist?

Does this make sense?


John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Form Question - Dynamic number of checkboxes

2002-03-22 Thread Mattos, John

Hi there all

I'm generating a form that can have dynamic checkboxes depending on
information retrieved from my database. I basically retrieve a bunch or rows
and for each one, I want to create a checkbox.

Than, in the Action class handling the form submission, I plan to loop
through the checkboxes, and build an array of those that were selected, and
do something to them.

The problem is that I am tying to name the checkboxes for the ID of the
row... here is a JSP snippet:


  
<%=sb.getProductName()%> 
 
   




the getCheckBoxName() comes from the database, and it correcponds to the
"Product" in this row, and it's dynamic.

Struts complains with the following error message

No getter method for property 4363 of bean
org.apache.struts.taglib.html.BEAN 

Essentially, I'm trying to create the following
 and struts can't find get4363() in the
bean. No surprise there, I can't create getters for all the possibilities. I
just planned to loop through the submitted form fields to get the ids
checked.

Is there any way that Struts can not care that the setters don't exist?

Does this make sense?


John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: WebShpere 4 with Struts - Sample form question

2002-03-18 Thread Jay sissom

Here is a web page that documents how we generate an EAR file for 
WebSphere 4.x.

http://www.indiana.edu/~sit/J2EE/WebSpherePackaging.htm

It assumes that you have already created a WAR file that works.  We use 
JBuilder 6 so some steps assume you are using JBuilder, but it really 
shouldn't matter what tool you are using.

As for the question about html forms, look at the documentation on the web 
site for the html tag library.  There are tags you can use to help you 
build a form, but Struts isn't going to build your pages by itself - at 
least not yet, maybe in 1.1. :)  (before we get lots of email asking when 
Struts will write an application for you --- this is a joke!)

http://jakarta.apache.org/struts/doc-1.0.2/api/org/apache/struts/taglib/html/package-summary.html#package_description

Jay

On Mon, 18 Mar 2002, K J wrote:

> I want to deploy strut's example as an EAR file on
> WebSphere 4.01 App server(AIX). Can someone tell me
> how to create that EAR file? 
> 
> Thanks,
> 
> Also, does struts create html forms for you? If so,
> which class is responsible for doing this?
> 
> __
> Do You Yahoo!?
> Yahoo! Sports - live college hoops coverage
> http://sports.yahoo.com/
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




WebShpere 4 with Struts - Sample form question

2002-03-18 Thread K J

I want to deploy strut's example as an EAR file on
WebSphere 4.01 App server(AIX). Can someone tell me
how to create that EAR file? 

Thanks,

Also, does struts create html forms for you? If so,
which class is responsible for doing this?

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator: Form question

2002-03-18 Thread @Basebeans.com

Subject: Re: Struts Validator: Form question
From: "Arthur Frankel" <[EMAIL PROTECTED]>
 ===
Actually I got #1 working by using the ValidatorActionForm instead of
ValidatorForm...I'm getting some javascript error though, but my main
concern is resolved.

"Arthur Frankel" <[EMAIL PROTECTED]> wrote in message
news:a753nd$erg$[EMAIL PROTECTED]...
> I have a simple form question based on an application using 1 jsp to get
the
> input key, the 2nd jsp to return (and then update) the object.
>
> Using the Struts Validator, I have 2 simple jsp pages.  The first takes in
a
> value that is my key.  The second displays the result (object/data).   I
> have validation on the first page for the input value and validation on
the
> second page for the resulting object since I have the ability to update
this
> object's information.
>
> It looks like I have 2 choices:
> 1) use the same Form for both pages, but the problem here is that when I
> submit the first page it tells me I have a validation error related to the
> fields that I not currently on that page (i.e., the second page).
> 2) use different Forms for each page, but the problem here is that when my
> action kicks off and loads the data for the result, I somehow need to load
> the second form???
>
>
>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Staging Pages/Action form question.

2001-08-08 Thread Martin Cooper

The Struts answer to both of these questions is "use an Action". The Action
classes are where the various pieces come together.

In the first case, your action will invoke methods on business-logic objects
and populate the form with the results. Then it will forward to the
appropriate JSP page to display those results.

In the second case, the search criteria will be presented to an action as a
form bean. The action will then pass this data to business-logic objects,
which will perform the search and return the results. After performing any
transformations necessary to make the results more easily digested by a JSP
page, the action once again forwards to an appropriate JSP to display them.

Take a good look at the example application that comes with Struts, and Ted
Husted's "Strut by Strut" article at:

http://www.husted.com/about/struts/strutByStrut.htm

for more details on how it all works.

--
Martin Cooper


- Original Message -
From: "Prior, Simon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 06, 2001 2:02 AM
Subject: Staging Pages/Action form question.


> Hi Guys,
>
> I have the following scenarios and to design for and wanted to know how
you
> approached the following problems:
>
> 1.  I have a page that will have dynamically generated menus populated
with
> entries from a database.  My first question is how do you stage the
pages? -
> can you use the action form to retrieve the information to populate the
> menus from the database ?  I was thinking of using the action forms
> constructor to call an ejb to ultimately retrieve the information but
didn't
> know whether this was the best way of approaching the problem.
>
> Do you guys have any suggestions?
>
> 2.  I also have a search page where the user enters the search criteria
and
> then submits the query, at this point I was going to put the search
criteria
> on the session and have the results page pick up the search criteria,
carry
> out the search and then display the results.  How do you guys do this?  If
I
> was to use an action form for this in a manner similar to the above
scenario
> the constructor would retrieve the search criteria from the session and
> execute the query thus 'staging' the page.  Can the action form access the
> session?  If not, how do you guys do it?
>
> Any help would be most appreciated.
>
> Thanks in advance,
>
> Simon.
> For optimum solutions that save you time, visit www.ds-s.com.
>





Staging Pages/Action form question.

2001-08-06 Thread Prior, Simon

Hi Guys,

I have the following scenarios and to design for and wanted to know how you
approached the following problems:

1.  I have a page that will have dynamically generated menus populated with
entries from a database.  My first question is how do you stage the pages? -
can you use the action form to retrieve the information to populate the
menus from the database ?  I was thinking of using the action forms
constructor to call an ejb to ultimately retrieve the information but didn't
know whether this was the best way of approaching the problem.

Do you guys have any suggestions?

2.  I also have a search page where the user enters the search criteria and
then submits the query, at this point I was going to put the search criteria
on the session and have the results page pick up the search criteria, carry
out the search and then display the results.  How do you guys do this?  If I
was to use an action form for this in a manner similar to the above scenario
the constructor would retrieve the search criteria from the session and
execute the query thus 'staging' the page.  Can the action form access the
session?  If not, how do you guys do it?

Any help would be most appreciated.

Thanks in advance,

Simon.
For optimum solutions that save you time, visit www.ds-s.com.



Re: newbie Form Question(checkboxes)

2001-04-01 Thread Incze Lajos

On Sun, Apr 01, 2001 at 05:55:34PM +1000, JOEL VOGT wrote:
> Hi,
> 
> I have in my jsp an iterate tag that includes checkboxes.
> My form contains an array of boolean values which are supposed to 
> correspond to the values on the jsp.
> When I submit the form only the checkboxes that equate to 'true' are 
> being added to the array.
> I read that you have to reset the checkbox values in the reset method to 
> recognise false values. But at this time my array of checkbox values is 
> at length 0?
> Any ideas how to get these false values in the array?
> 
> Thanks, Joel.
> 
If I understand right what happens then the general recipe is:

Don't submit directly to a jsp. Submit to an action that can
inittialize your form bean (and with the reset method your
checkboxes) and forward to the to the jsp you want to see.
Hope not stated just the obvious.  incze



newbie Form Question(checkboxes)

2001-03-31 Thread JOEL VOGT

Hi,

I have in my jsp an iterate tag that includes checkboxes.
My form contains an array of boolean values which are supposed to 
correspond to the values on the jsp.
When I submit the form only the checkboxes that equate to 'true' are 
being added to the array.
I read that you have to reset the checkbox values in the reset method to 
recognise false values. But at this time my array of checkbox values is 
at length 0?
Any ideas how to get these false values in the array?

Thanks, Joel.




Form question

2001-03-31 Thread JOEL VOGT

Hi all,

I need help in how to write a form bean. I have the following problems:

I have a jsp, with something like the following: It has to allow the 
user to change any number of fields. After submit is clicked, all these 
fields should be sent to a form before being processed.



  <% i=0; %>
  

  <% i++; %>
  




in my bean, I have:
item[] item;
item[] getItem()
item getItem(int id)
void setItem()
void setItem(int id, item item)

in my perform action,
I use form.getItem() to get the items out of the form, and then I 
perform some operations on them.
The question is, how do I write the form? Btw, is there a better struts 
way to do this whole thing?

Thanks, Joel.




RE: form question

2001-03-25 Thread Niall Pemberton

I have the same problem - form fields embedded in an iterate tag.

Would it be possible to change tags such as CheckboxTag and BaseFieldTag so
that they detect when they are embedded in the "iterate" tag and format the
name attribute appropriately.

I tried changing these two tags replacing the following line in the the
doStartTag() method:

results.append(property);

With the following code and it worked well, automatically populating my
collection objects:

results.append(decideName());

/**
 * Determine the name attribute
 */
private String decideName() {

  // Check if this Tag is embedded in an Iterator Tag
  Tag tag = findAncestorWithClass(this, IterateTag.class);

  // No iterator, use the property as the name
  if (tag == null)
return this.property;

  IterateTag iterator = (IterateTag)tag;
  int index = iterator.getLengthCount()-1;

  return iterator.getProperty()+"["+index+"]."+this.property;

}

Niall

P.S. thanks for Struts - great framework.

> -Original Message-
> From: Uwe Pleyer [mailto:[EMAIL PROTECTED]]
> Sent: 25 March 2001 07:24
> To: [EMAIL PROTECTED]
> Subject: Re: form question
>
>
> Hey,
>
> I had some hard nights fighting with exactly this problem and got
> a solution
> wich is not very elegant but works...
>
>
> 
> 
> // some headings for the table
>   <% int i = 0; %>
>   
>   
> 
>   
> 
> 
> $
> 
> 
> 
> 
> 
>  
>  <% i++; %>
>   
>   
>
> 
>
> As you see, you use the collektion of your formbean directly. The
> Bean needs
> properties, getter and setter Methods according to the Javabean-Spec whats
> the reason to change BeanItems to beanItems!
>
> private Collection beanItems;
> public Item getBeanItems(int index)
> public void setBeanItems(int index, Item item)
> public Item[] getBeanItems()
> public void setBeanItems(Item[] items)
>
> It's also important to configure your formbean with scope="session" in
> Struts-config and never to destroy your Collection in the
> reset-Method! The
> HTML for the input field will show like this:  name="beanItems[0].amount" value="123">
>
> After submit Struts uses the following setter Method:
> Bean.getBeanItems(0).setAmount("123"); As struts use the getBeanItems(i)
> Method to get yor Item-Objects, there is no chance to create them in the
> request-scope. There must be held from the moment you establish your
> beanItems-Collection for output till the submit of the user in
> session-scope.
>
> Hope that helps
>
> Uwe
>
>
> JOEL VOGT schrieb:
>
> > Hi all,
> >
> > I have a html form on a jsp page. This form has a table generated by the
> > logic iterate tag.
> > In each table row, there are two fields, one a checkbox and the other a
> > text field.
> > What I want is when the user clicks 'submit' all the values are sent to
> > an action form for storing and then to my servlet for processing.
> > How do I make a form that will automatically be populated by all these
> > values? In other words I'm stuffed please help ;)
> >
> > Thanks, Joel.
> >
> > Sample jsp:
> >
> > 
> > 
> > // some headings for the table
> >   
> >   
> > 
> >   
> > 
> > 
> > $
> > 
> > 
> > 
> > 
> > 
> >  
> >   
> >   
> >
> > 
> >
> > How do I get these values into a form then servlet then database?
>
>




Re: form question

2001-03-24 Thread Uwe Pleyer

Hey,

I had some hard nights fighting with exactly this problem and got a solution
wich is not very elegant but works...




// some headings for the table
  <% int i = 0; %>
  
  

  


$





 
 <% i++; %>
  
  
   


As you see, you use the collektion of your formbean directly. The Bean needs
properties, getter and setter Methods according to the Javabean-Spec whats
the reason to change BeanItems to beanItems!

private Collection beanItems;
public Item getBeanItems(int index)
public void setBeanItems(int index, Item item)
public Item[] getBeanItems()
public void setBeanItems(Item[] items)

It's also important to configure your formbean with scope="session" in
Struts-config and never to destroy your Collection in the reset-Method! The
HTML for the input field will show like this: 

After submit Struts uses the following setter Method:
Bean.getBeanItems(0).setAmount("123"); As struts use the getBeanItems(i)
Method to get yor Item-Objects, there is no chance to create them in the
request-scope. There must be held from the moment you establish your
beanItems-Collection for output till the submit of the user in
session-scope.

Hope that helps

Uwe


JOEL VOGT schrieb:

> Hi all,
>
> I have a html form on a jsp page. This form has a table generated by the
> logic iterate tag.
> In each table row, there are two fields, one a checkbox and the other a
> text field.
> What I want is when the user clicks 'submit' all the values are sent to
> an action form for storing and then to my servlet for processing.
> How do I make a form that will automatically be populated by all these
> values? In other words I'm stuffed please help ;)
>
> Thanks, Joel.
>
> Sample jsp:
>
> 
> 
> // some headings for the table
>   
>   
> 
>   
> 
> 
> $
> 
> 
> 
> 
> 
>  
>   
>   
>
> 
>
> How do I get these values into a form then servlet then database?




form question

2001-03-24 Thread JOEL VOGT

Hi all,

I have a html form on a jsp page. This form has a table generated by the 
logic iterate tag.
In each table row, there are two fields, one a checkbox and the other a 
text field.
What I want is when the user clicks 'submit' all the values are sent to 
an action form for storing and then to my servlet for processing.
How do I make a form that will automatically be populated by all these 
values? In other words I'm stuffed please help ;)

Thanks, Joel.

Sample jsp:



// some headings for the table
  
  

  
 

$





 
  
  
   


How do I get these values into a form then servlet then database?