RE: Indexed Properties with nested Tags

2007-01-29 Thread Raghu
Hi Nagesh,

Actionform design will not change when using nested tags or logic tags.

When using nested tags PROPERLY then data will be be set automatically by
struts framework.
If you read line by line below and undertstand the code from struts
userguide/API then then you an easily catch the logic behind.

Feel free to write for any doubt..

Raghuveer


-Original Message-
From: nagesh.kumar [mailto:[EMAIL PROTECTED]
Sent: Monday, January 29, 2007 2:57 PM
To: [EMAIL PROTECTED]
Subject: RE: Indexed Properties with nested Tags


Hi raghu,

Iam also using the same issue ..

nested:text  name=Result property=description /

Ho u r cacthing the data in the Action from the form after submitting

Please forward that peace of code to me
Thanks in Advance

Nagesh


-Original Message-
From: Adam K [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 22, 2006 10:10 PM
To: [EMAIL PROTECTED]
Cc: Struts Users Mailing List
Subject: Re: Indexed Properties with nested Tags

Thanks for the lengthy example, but there is one part that I am completly
lost on.  I thought that the following occurred:
Click link to open page, formbean is reset aciton poppulates formbean jsp
retrieves values from the formbean.  User sees the screen prepopulated.
User modifies the information and clicks on submit.  The bean is again reset
the action is called to put information in the formbean (this is the part I
have no data) the jsp then pulls the data from the formbean.

What is the purpose of the System.out.println that you have at the end of
your action ?

thanks again,
Adam

On 11/21/06, Raghuveer [EMAIL PROTECTED] wrote:

  Hi Adam,

 Use the sample code as requested by you.
 You can ask me any help with nested Tags and from advanced struts




 *JSP*


 nested:notEmpty name=ProdSelectionForm property=results
 nested:iterate name=ProdSelectionForm property=results
 id=Result type=com.test.javabeans.TestObject
   tr
 tdnested:text  name=Result property=description /
 /td
   /tr
 /nested:iterate
 /nested:notEmpty

 *ActionForm*
 **
 public class ProdSelectionForm extends ActionForm { Collection
 arlResults=null; //can be arrayalist

 /**
   * @return Returns the arlResults.
   */
  public Collection getResults() {
   return arlResults;
  }
  /**
   * @param arlResultsThe arlResultsto set.
   */
  public void setResults(Collection arlResults) {
   this.arlResults= arlResults;
  }

  /**
  *
  * toString representation of object
  * @return  An instance of StringBuffer with Struts Action Form
 properties
  *
  */
   public String toString() {

StringBuffer sbTemp = new StringBuffer();
sbTemp.append({);

sbTemp.append(arlResults= );
sbTemp.append(arlResults);
sbTemp.append(});
return sbTemp.toString();

   }//end of toString
 }//end Actionform

 *TestObject  Java Bean*

 import java.io.Serializable;

 public class TestObject implements Serializable

 String description =null;
 int numProducts =0;
 /**
  * @return Returns the description.
  */
 public String getDescription() {
  return description;
 }
 /**
  * @param description The description to set.
  */
 public void setDescription(String description) {  this.description =
 description; }
 /**
  * @return Returns the numProducts.
  */
 public int getNumProducts() {
  return numProducts;
 }
 /**
  * @param numProducts The numProducts to set.
  */
 public void setNumProducts(int numProducts) {  this.numProducts =
 numProducts; }

 }//end object
 **

 *Action Class (loading the page)*
 **
 **
 ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;
 com.test.javabeans.TestObject obj1=new com.test.javabeans.TestObject
 (); obj1.setDescription(desc1); obj1.setNumProducts (1);

  com.test.javabeans.TestObject obj2=new com.test.javabeans.TestObject
 (); obj1.setDescription(desc2); obj1.setNumProducts (2);

 ArrayList arlResults=new ArrayList (); arlResults.add(obj1);
 arlResults.add(obj2);

 prodSelectionForm.setResults(arlResults);

 *Action Class (Submitting the page)*

 When you submit the page just print the actionform you wouyld see the
 updated results of description ,numproducts in action

 ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;

 System.out.println(prodSelectionForm=+prodSelectionForm);



 Regards
 Raghu

 -Original Message-
 *From:* Adam K [mailto:[EMAIL PROTECTED]
 *Sent:* Wednesday, November 22, 2006 3:06 AM
 *To:* [EMAIL PROTECTED]
 *Cc:* Struts Users Mailing List
 *Subject:* Re: Indexed Properties

 If you might be able to provide a sample I would be very greatful.
 As it stands I have come up with the following :
 changing the JSP to :

 logic:notEmpty name=ProdSelectionForm property=results
 logic:iterate name=ProdSelectionForm property=results
 id=Result
   tr
 tdhtml:text  name=Result property=description
 indexed=true / /td
   /tr
 /logic:iterate
 /logic:notEmpty

 Result seemed more natural as it is a single element

Re: Indexed Properties with nested Tags

2006-11-22 Thread Adam K

Thanks for the lengthy example, but there is one part that I am completly
lost on.  I thought that the following occurred:
Click link to open page, formbean is reset aciton poppulates formbean jsp
retrieves values from the formbean.  User sees the screen prepopulated.
User modifies the information and clicks on submit.  The bean is again reset
the action is called to put information in the formbean (this is the part I
have no data) the jsp then pulls the data from the formbean.

What is the purpose of the System.out.println that you have at the end of
your action ?

thanks again,
Adam

On 11/21/06, Raghuveer [EMAIL PROTECTED] wrote:


 Hi Adam,

Use the sample code as requested by you.
You can ask me any help with nested Tags and from advanced struts




*JSP*


nested:notEmpty name=ProdSelectionForm property=results
nested:iterate name=ProdSelectionForm property=results
id=Result type=com.test.javabeans.TestObject
  tr
tdnested:text  name=Result property=description /
/td
  /tr
/nested:iterate
/nested:notEmpty

*ActionForm*
**
public class ProdSelectionForm extends ActionForm
{
Collection arlResults=null; //can be arrayalist

/**
  * @return Returns the arlResults.
  */
 public Collection getResults() {
  return arlResults;
 }
 /**
  * @param arlResultsThe arlResultsto set.
  */
 public void setResults(Collection arlResults) {
  this.arlResults= arlResults;
 }

 /**
 *
 * toString representation of object
 * @return  An instance of StringBuffer with Struts Action Form
properties
 *
 */
  public String toString() {

   StringBuffer sbTemp = new StringBuffer();
   sbTemp.append({);

   sbTemp.append(arlResults= );
   sbTemp.append(arlResults);
   sbTemp.append(});
   return sbTemp.toString();

  }//end of toString
}//end Actionform

*TestObject  Java Bean*

import java.io.Serializable;

public class TestObject implements Serializable

String description =null;
int numProducts =0;
/**
 * @return Returns the description.
 */
public String getDescription() {
 return description;
}
/**
 * @param description The description to set.
 */
public void setDescription(String description) {
 this.description = description;
}
/**
 * @return Returns the numProducts.
 */
public int getNumProducts() {
 return numProducts;
}
/**
 * @param numProducts The numProducts to set.
 */
public void setNumProducts(int numProducts) {
 this.numProducts = numProducts;
}

}//end object
**

*Action Class (loading the page)*
**
**
ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;
com.test.javabeans.TestObject obj1=new com.test.javabeans.TestObject ();
obj1.setDescription(desc1);
obj1.setNumProducts (1);

 com.test.javabeans.TestObject obj2=new com.test.javabeans.TestObject ();
obj1.setDescription(desc2);
obj1.setNumProducts (2);

ArrayList arlResults=new ArrayList ();
arlResults.add(obj1);
arlResults.add(obj2);

prodSelectionForm.setResults(arlResults);

*Action Class (Submitting the page)*

When you submit the page just print the actionform you wouyld see the
updated results of description ,numproducts in action

ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;

System.out.println(prodSelectionForm=+prodSelectionForm);



Regards
Raghu

-Original Message-
*From:* Adam K [mailto:[EMAIL PROTECTED]
*Sent:* Wednesday, November 22, 2006 3:06 AM
*To:* [EMAIL PROTECTED]
*Cc:* Struts Users Mailing List
*Subject:* Re: Indexed Properties

If you might be able to provide a sample I would be very greatful.
As it stands I have come up with the following :
changing the JSP to :

logic:notEmpty name=ProdSelectionForm property=results
logic:iterate name=ProdSelectionForm property=results
id=Result
  tr
tdhtml:text  name=Result property=description
indexed=true / /td
  /tr
/logic:iterate
/logic:notEmpty

Result seemed more natural as it is a single element of the results.
All I want to be able to do is pull 3 things out of an object, display
them in a scope of request, and allow the user to update the list and submit
the form and have the changes be picked up - who would have thought that
would be so incredibly complex ?
*Note*  The part that leads me to believe it's a misunderstanding of the
tags involved is that I can get a single textfield to work perfectly, with
all the requirements (other than it being an object with multiple
properties).


On 11/21/06, Raghuveer [EMAIL PROTECTED] wrote:

 hi Adam,

 I understand description,numProducts are properties in User defined
 Object/java bean in results(getResults(),setResults(..)) Collection in
 your
 actionForm.

 For this kind of requirments there will not be any change in actionform
 even
 though ,complixety increases in nesting..

 Solution is to use Nested Tags.

 Nested tags are used for nesting a object inside the other.

 In your requirment results is a nested property in your actionform.
 results collection  has a collection of objects.

 I have used Nested tags for most complex 

Re: Indexed Properties with nested Tags

2006-11-22 Thread Adam K

I should also like to say that the one part that seems to be giving me the
most problem is the setting of the variables in action when it is
submitted.
The other thing I am curious about is if what I am doing is incorrect.  I am
using one action for both the submit as well as the prepopulate based on a
url parameter.

thanks once again.
Adam

On 11/22/06, Adam K [EMAIL PROTECTED] wrote:


Thanks for the lengthy example, but there is one part that I am completly
lost on.  I thought that the following occurred:
Click link to open page, formbean is reset aciton poppulates formbean jsp
retrieves values from the formbean.  User sees the screen prepopulated.
User modifies the information and clicks on submit.  The bean is again
reset the action is called to put information in the formbean (this is the
part I have no data) the jsp then pulls the data from the formbean.

What is the purpose of the System.out.println that you have at the end of
your action ?

thanks again,
Adam

On 11/21/06, Raghuveer [EMAIL PROTECTED] wrote:

  Hi Adam,

 Use the sample code as requested by you.
 You can ask me any help with nested Tags and from advanced struts




 *JSP*


 nested:notEmpty name=ProdSelectionForm property=results
 nested:iterate name=ProdSelectionForm property=results
 id=Result type=com.test.javabeans.TestObject
   tr
 tdnested:text  name=Result property=description /
 /td
   /tr
 /nested:iterate
 /nested:notEmpty

 *ActionForm*
 **
 public class ProdSelectionForm extends ActionForm
 {
 Collection arlResults=null; //can be arrayalist

 /**
   * @return Returns the arlResults.
   */
  public Collection getResults() {
   return arlResults;
  }
  /**
   * @param arlResultsThe arlResultsto set.
   */
  public void setResults(Collection arlResults) {
   this.arlResults= arlResults;
  }

  /**
  *
  * toString representation of object
  * @return  An instance of StringBuffer with Struts Action Form
 properties
  *
  */
   public String toString() {

StringBuffer sbTemp = new StringBuffer();
sbTemp.append({);

sbTemp.append(arlResults= );
sbTemp.append(arlResults);
sbTemp.append(});
return sbTemp.toString();

   }//end of toString
 }//end Actionform

 *TestObject  Java Bean*

 import java.io.Serializable;

 public class TestObject implements Serializable

 String description =null;
 int numProducts =0;
 /**
  * @return Returns the description.
  */
 public String getDescription() {
  return description;
 }
 /**
  * @param description The description to set.
  */
 public void setDescription(String description) {
  this.description = description;
 }
 /**
  * @return Returns the numProducts.
  */
 public int getNumProducts() {
  return numProducts;
 }
 /**
  * @param numProducts The numProducts to set.
  */
 public void setNumProducts(int numProducts) {
  this.numProducts = numProducts;
 }

 }//end object
 **

 *Action Class (loading the page)*
 **
 **
 ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;
 com.test.javabeans.TestObject obj1=new com.test.javabeans.TestObject ();
 obj1.setDescription(desc1);
 obj1.setNumProducts (1);

  com.test.javabeans.TestObject obj2=new com.test.javabeans.TestObject();
 obj1.setDescription(desc2);
 obj1.setNumProducts (2);

 ArrayList arlResults=new ArrayList ();
 arlResults.add(obj1);
 arlResults.add(obj2);

 prodSelectionForm.setResults(arlResults);

 *Action Class (Submitting the page)*

 When you submit the page just print the actionform you wouyld see the
 updated results of description ,numproducts in action

 ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;

 System.out.println(prodSelectionForm=+prodSelectionForm);



 Regards
 Raghu

 -Original Message-
 *From:* Adam K [mailto:[EMAIL PROTECTED]
 *Sent:* Wednesday, November 22, 2006 3:06 AM
 *To:* [EMAIL PROTECTED]
 *Cc:* Struts Users Mailing List
 *Subject:* Re: Indexed Properties

 If you might be able to provide a sample I would be very greatful.
 As it stands I have come up with the following :
 changing the JSP to :

 logic:notEmpty name=ProdSelectionForm property=results
 logic:iterate name=ProdSelectionForm property=results
 id=Result
   tr
 tdhtml:text  name=Result property=description
 indexed=true / /td
   /tr
 /logic:iterate
 /logic:notEmpty

 Result seemed more natural as it is a single element of the results.
 All I want to be able to do is pull 3 things out of an object, display
 them in a scope of request, and allow the user to update the list and submit
 the form and have the changes be picked up - who would have thought that
 would be so incredibly complex ?
 *Note*  The part that leads me to believe it's a misunderstanding of the
 tags involved is that I can get a single textfield to work perfectly, with
 all the requirements (other than it being an object with multiple
 properties).


 On 11/21/06, Raghuveer [EMAIL PROTECTED]  wrote:
 
  hi Adam,
 
  I understand 

RE: Indexed Properties with nested Tags

2006-11-22 Thread Dave Newton
From: Adam K [mailto:[EMAIL PROTECTED]
 What is the purpose of the System.out.println that you have at the end
 of your action ?

Debugging?

Dave

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



Re: Indexed Properties with nested Tags

2006-11-22 Thread Adam K

Alright, I guess I should have thought that.  I was worried that my
fundamental understanding for this was wrong.  For debugging I am putting my
information into a String which is not being iterated (it for some reason
always works, but those that are iterated over don't for some reason.
I have no problem prepopulating, and no problem showing the form again, it's
only when I try to have what the user inputs get placed into the form that
is where I am lost.


thanks once again for all the help everyone, sorry if I sound like a broken
record.

On 11/22/06, Dave Newton [EMAIL PROTECTED] wrote:


From: Adam K [mailto:[EMAIL PROTECTED]
 What is the purpose of the System.out.println that you have at the end
 of your action ?

Debugging?

Dave

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




RE: Indexed Properties with nested Tags

2006-11-22 Thread Raghu
I am 100% sure.
I have extensively used these futures and successful.

Using Nested Tags will decrease the Lines of Code,Easy Maintenance..

Nested tags will take care of setting the latest values to form bean .There
will not be any change in ActionForm/Action class.

Framework will take care of setting the data to actionform for nested
properties from nested tags.

Form bean may have getters and setter of scalar types(string,int...) or
nested types(user defined object,collection...).

If you have done every thing as below,Your latest values from jsp will be
set to form bean when JSP page is Submitted.



Clarification 1

Add below method in TestObject  Java Bean also.This will help you understand
the Object Content/Data during population and submit.

public String toString() {

   StringBuffer sbTemp = new StringBuffer();
   sbTemp.append({);

   sbTemp.append(description= );
   sbTemp.append(description);
sbTemp.append(numProducts = );
   sbTemp.append(numProducts );


   sbTemp.append(});
   return sbTemp.toString();

  }//end of toString

Clarification 2

System .out.println is added in order to make you understand that when JSP
is submitted you will have latest data in arlResults collection in
actionform.


Regards,
Raghu



  -Original Message-
  From: Adam K [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, November 22, 2006 10:16 PM
  To: [EMAIL PROTECTED]
  Cc: Struts Users Mailing List
  Subject: Re: Indexed Properties with nested Tags


  I should also like to say that the one part that seems to be giving me the
most problem is the setting of the variables in action when it is submitted.
  The other thing I am curious about is if what I am doing is incorrect.  I
am using one action for both the submit as well as the prepopulate based on
a url parameter.

  thanks once again.
  Adam


  On 11/22/06, Adam K [EMAIL PROTECTED] wrote:
Thanks for the lengthy example, but there is one part that I am
completly lost on.  I thought that the following occurred:
Click link to open page, formbean is reset aciton poppulates formbean
jsp retrieves values from the formbean.  User sees the screen prepopulated.
User modifies the information and clicks on submit.  The bean is again
reset the action is called to put information in the formbean (this is the
part I have no data) the jsp then pulls the data from the formbean.

What is the purpose of the System.out.println that you have at the end
of your action ?

thanks again,
Adam



On 11/21/06, Raghuveer  [EMAIL PROTECTED] wrote:
  Hi Adam,

  Use the sample code as requested by you.
  You can ask me any help with nested Tags and from advanced struts




  JSP


  nested:notEmpty name=ProdSelectionForm property=results
  nested:iterate name=ProdSelectionForm property=results
id=Result type=com.test.javabeans.TestObject
tr
  tdnested:text  name=Result property=description /
/td
/tr
  /nested:iterate
  /nested:notEmpty

  ActionForm

  public class ProdSelectionForm extends ActionForm
  {
  Collection arlResults=null; //can be arrayalist

  /**
* @return Returns the arlResults.
*/
   public Collection getResults() {
return arlResults;
   }
   /**
* @param arlResultsThe arlResultsto set.
*/
   public void setResults(Collection arlResults) {
this.arlResults= arlResults;
   }

   /**
   *
   * toString representation of object
   * @return  An instance of StringBuffer with Struts Action
Form properties
   *
   */
public String toString() {

 StringBuffer sbTemp = new StringBuffer();
 sbTemp.append({);

 sbTemp.append(arlResults= );
 sbTemp.append(arlResults);
 sbTemp.append(});
 return sbTemp.toString();

}//end of toString
  }//end Actionform

  TestObject  Java Bean

  import java.io.Serializable;

  public class TestObject implements Serializable

  String description =null;
  int numProducts =0;
  /**
   * @return Returns the description.
   */
  public String getDescription() {
   return description;
  }
  /**
   * @param description The description to set.
   */
  public void setDescription(String description) {
   this.description = description;
  }
  /**
   * @return Returns the numProducts.
   */
  public int getNumProducts() {
   return numProducts;
  }
  /**
   * @param numProducts The numProducts to set.
   */
  public void setNumProducts(int numProducts) {
   this.numProducts = numProducts;
  }

  }//end object


  Action Class (loading the page)


  ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;

  com.test.javabeans.TestObject obj1=new com.test.javabeans.TestObject
();
  obj1.setDescription

RE: Indexed Properties with nested Tags

2006-11-22 Thread Raghu

In JSP make sure you add taglib directive

%@ taglib uri=/tags/struts-nested prefix=nested %

or

%@ taglib uri=/WEB-INF/struts-nested prefix=nested %

  -Original Message-
  From: Raghu [mailto:[EMAIL PROTECTED]
  Sent: Thursday, November 23, 2006 9:47 AM
  To: 'Adam K'
  Cc: 'Struts Users Mailing List'
  Subject: RE: Indexed Properties with nested Tags


  I am 100% sure.
  I have extensively used these futures and successful.

  Using Nested Tags will decrease the Lines of Code,Easy Maintenance..

  Nested tags will take care of setting the latest values to form bean
.There will not be any change in ActionForm/Action class.

  Framework will take care of setting the data to actionform for nested
properties from nested tags.

  Form bean may have getters and setter of scalar types(string,int...) or
nested types(user defined object,collection...).

  If you have done every thing as below,Your latest values from jsp will be
set to form bean when JSP page is Submitted.



  Clarification 1

  Add below method in TestObject  Java Bean also.This will help you
understand the Object Content/Data during population and submit.

  public String toString() {

 StringBuffer sbTemp = new StringBuffer();
 sbTemp.append({);

 sbTemp.append(description= );
 sbTemp.append(description);
  sbTemp.append(numProducts = );
 sbTemp.append(numProducts );


 sbTemp.append(});
 return sbTemp.toString();

}//end of toString

  Clarification 2

  System .out.println is added in order to make you understand that when JSP
is submitted you will have latest data in arlResults collection in
actionform.


  Regards,
  Raghu



-Original Message-
From: Adam K [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 22, 2006 10:16 PM
To: [EMAIL PROTECTED]
Cc: Struts Users Mailing List
Subject: Re: Indexed Properties with nested Tags


I should also like to say that the one part that seems to be giving me
the most problem is the setting of the variables in action when it is
submitted.
The other thing I am curious about is if what I am doing is incorrect.
I am using one action for both the submit as well as the prepopulate based
on a url parameter.

thanks once again.
Adam


On 11/22/06, Adam K [EMAIL PROTECTED] wrote:
  Thanks for the lengthy example, but there is one part that I am
completly lost on.  I thought that the following occurred:
  Click link to open page, formbean is reset aciton poppulates formbean
jsp retrieves values from the formbean.  User sees the screen prepopulated.
  User modifies the information and clicks on submit.  The bean is again
reset the action is called to put information in the formbean (this is the
part I have no data) the jsp then pulls the data from the formbean.

  What is the purpose of the System.out.println that you have at the end
of your action ?

  thanks again,
  Adam



  On 11/21/06, Raghuveer  [EMAIL PROTECTED] wrote:
Hi Adam,

Use the sample code as requested by you.
You can ask me any help with nested Tags and from advanced struts




JSP


nested:notEmpty name=ProdSelectionForm property=results
nested:iterate name=ProdSelectionForm property=results
id=Result type=com.test.javabeans.TestObject
  tr
tdnested:text  name=Result property=description
/ /td
  /tr
/nested:iterate
/nested:notEmpty

ActionForm

public class ProdSelectionForm extends ActionForm
{
Collection arlResults=null; //can be arrayalist

/**
  * @return Returns the arlResults.
  */
 public Collection getResults() {
  return arlResults;
 }
 /**
  * @param arlResultsThe arlResultsto set.
  */
 public void setResults(Collection arlResults) {
  this.arlResults= arlResults;
 }

 /**
 *
 * toString representation of object
 * @return  An instance of StringBuffer with Struts Action
Form properties
 *
 */
  public String toString() {

   StringBuffer sbTemp = new StringBuffer();
   sbTemp.append({);

   sbTemp.append(arlResults= );
   sbTemp.append(arlResults);
   sbTemp.append(});
   return sbTemp.toString();

  }//end of toString
}//end Actionform

TestObject  Java Bean

import java.io.Serializable;

public class TestObject implements Serializable

String description =null;
int numProducts =0;
/**
 * @return Returns the description.
 */
public String getDescription() {
 return description;
}
/**
 * @param description The description to set.
 */
public void setDescription(String description) {
 this.description

RE: Indexed Properties with nested Tags

2006-11-21 Thread Raghuveer
Hi Adam,

Use the sample code as requested by you.
You can ask me any help with nested Tags and from advanced struts




JSP


nested:notEmpty name=ProdSelectionForm property=results
nested:iterate name=ProdSelectionForm property=results id=Result
type=com.test.javabeans.TestObject
  tr
tdnested:text  name=Result property=description /
/td
  /tr
/nested:iterate
/nested:notEmpty

ActionForm

public class ProdSelectionForm extends ActionForm
{
Collection arlResults=null; //can be arrayalist

/**
  * @return Returns the arlResults.
  */
 public Collection getResults() {
  return arlResults;
 }
 /**
  * @param arlResultsThe arlResultsto set.
  */
 public void setResults(Collection arlResults) {
  this.arlResults= arlResults;
 }

 /**
 *
 * toString representation of object
 * @return  An instance of StringBuffer with Struts Action Form
properties
 *
 */
  public String toString() {

   StringBuffer sbTemp = new StringBuffer();
   sbTemp.append({);

   sbTemp.append(arlResults= );
   sbTemp.append(arlResults);
   sbTemp.append(});
   return sbTemp.toString();

  }//end of toString
}//end Actionform

TestObject  Java Bean

import java.io.Serializable;

public class TestObject implements Serializable

String description =null;
int numProducts =0;
/**
 * @return Returns the description.
 */
public String getDescription() {
 return description;
}
/**
 * @param description The description to set.
 */
public void setDescription(String description) {
 this.description = description;
}
/**
 * @return Returns the numProducts.
 */
public int getNumProducts() {
 return numProducts;
}
/**
 * @param numProducts The numProducts to set.
 */
public void setNumProducts(int numProducts) {
 this.numProducts = numProducts;
}

}//end object


Action Class (loading the page)


ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;

com.test.javabeans.TestObject obj1=new com.test.javabeans.TestObject ();
obj1.setDescription(desc1);
obj1.setNumProducts (1);

com.test.javabeans.TestObject obj2=new com.test.javabeans.TestObject ();
obj1.setDescription(desc2);
obj1.setNumProducts (2);

ArrayList arlResults=new ArrayList ();
arlResults.add(obj1);
arlResults.add(obj2);

prodSelectionForm.setResults(arlResults);

Action Class (Submitting the page)

When you submit the page just print the actionform you wouyld see the
updated results of description ,numproducts in action

ProdSelectionForm prodSelectionForm= (ProdSelectionForm) form;

System.out.println(prodSelectionForm=+prodSelectionForm);



Regards
Raghu
  -Original Message-
  From: Adam K [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, November 22, 2006 3:06 AM
  To: [EMAIL PROTECTED]
  Cc: Struts Users Mailing List
  Subject: Re: Indexed Properties


  If you might be able to provide a sample I would be very greatful.
  As it stands I have come up with the following :
  changing the JSP to :

  logic:notEmpty name=ProdSelectionForm property=results
  logic:iterate name=ProdSelectionForm property=results
id=Result
tr
  tdhtml:text  name=Result property=description
indexed=true / /td
/tr
  /logic:iterate
  /logic:notEmpty

  Result seemed more natural as it is a single element of the results.
  All I want to be able to do is pull 3 things out of an object, display
them in a scope of request, and allow the user to update the list and submit
the form and have the changes be picked up - who would have thought that
would be so incredibly complex ?
  *Note*  The part that leads me to believe it's a misunderstanding of the
tags involved is that I can get a single textfield to work perfectly, with
all the requirements (other than it being an object with multiple
properties).



  On 11/21/06, Raghuveer [EMAIL PROTECTED] wrote:
hi Adam,

I understand description,numProducts are properties in User defined
Object/java bean in results(getResults(),setResults(..)) Collection in
your
actionForm.

For this kind of requirments there will not be any change in actionform
even
though ,complixety increases in nesting..

Solution is to use Nested Tags.

Nested tags are used for nesting a object inside the other.

In your requirment results is a nested property in your actionform.
results collection  has a collection of objects.

I have used Nested tags for most complex requirments and succeeded.

Nested Tags is the real power of Struts...


Regards
Raghu





-Original Message-
From: Adam K [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 18, 2006 2:55 AM
To: Struts Users Mailing List
Subject: Re: Indexed Properties


Thanks for the suggestion I'll keep trying things and see what I can get
from it.


On 11/17/06, Hubert Rabago [EMAIL PROTECTED] wrote:

 Lots of people have done it.  Search the archives [1]. Search for
 indexed and lazyList.   I've done it with both ActionForm and