Iterate tag update
Hi, I am using logic:iterate tag as follows to print a table with text boxes. logic:iterate id=product name=productSearchForm property=productList tr td align=left bean:write name=product property=productNumber filter=true/ /td td align=center html:text name=product property=quantity size=3/ /td /tr /logic:iterate I have a array of objets(Product) in productList. When I update the quantity and submit the page, it does not update the information into the productList. What might be the problem??? Vaibhav
Re: Iterate tag update
Do u have setter methods in the Product class like - setQuantity(int qty) ??? Also U need to have indexed iterate tag written by Dave Hey . So u can use html:text name=product property=quantity size=3 index= true/ Here is the ActionForm public Product [ ] getProductList( ) { return this.productList; } public setProductList(Product [ ] productList) { this.productList = productList ; } public Product getProductList(int index) { return (Product)productList[index]; } Remember have proper setter methods in the Product class like setQuantity int qty ) Suahs - Original Message - From: Vaibhav Patil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 1:02 PM Subject: Iterate tag update Hi, I am using logic:iterate tag as follows to print a table with text boxes. logic:iterate id=product name=productSearchForm property=productList tr td align=left bean:write name=product property=productNumber filter=true/ /td td align=center html:text name=product property=quantity size=3/ /td /tr /logic:iterate I have a array of objets(Product) in productList. When I update the quantity and submit the page, it does not update the information into the productList. What might be the problem??? Vaibhav
RE: Iterate tag update
When I give the index=true attribute, it gives me following error Attribute index invalid according to the specified TLD -Original Message- From: suhas [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 10:13 PM To: [EMAIL PROTECTED] Subject: Re: Iterate tag update Do u have setter methods in the Product class like - setQuantity(int qty) ??? Also U need to have indexed iterate tag written by Dave Hey . So u can use html:text name=product property=quantity size=3 index= true/ Here is the ActionForm public Product [ ] getProductList( ) { return this.productList; } public setProductList(Product [ ] productList) { this.productList = productList ; } public Product getProductList(int index) { return (Product)productList[index]; } Remember have proper setter methods in the Product class like setQuantity int qty ) Suahs - Original Message - From: Vaibhav Patil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 1:02 PM Subject: Iterate tag update Hi, I am using logic:iterate tag as follows to print a table with text boxes. logic:iterate id=product name=productSearchForm property=productList tr td align=left bean:write name=product property=productNumber filter=true/ /td td align=center html:text name=product property=quantity size=3/ /td /tr /logic:iterate I have a array of objets(Product) in productList. When I update the quantity and submit the page, it does not update the information into the productList. What might be the problem??? Vaibhav
Re: Iterate tag update
The problem is, the generated names of the HTML form elements do not correspond to the names of properties of your ActionForm. Here a sample, how this can be done: logic:iterate name=myForm property=elements id=element indexId=i type=de.grayman.test.struts.MyElement tr td html:checkbox property='%= element[ + i + ].member %' / html:hidden property='%= element[ + i + ].elementName %' / /td tdbean:write name=element property=elementName //td tdbean:write name=element property=elementDescription //td /tr /logic:iterate In the MyForm class, there have to be two properties (getter methods): 1) the collection elements 2) indexed property element private Vector elements; public Collection getElements() { return this.elements; } public MyElement getElement(int i) { while (getGroups().size() = i) { this.element.add(new MyElement()); } return (MyElement) this.elements.get(i); } Note: Class MyElement has read/write properties member, elementName, elementDescription, ... Note: The getElement(int i) fills the Vector with empty elements, if they do not exist. In this way, the form will be filled correcly from the submitted HTML-Form. Of course, you could use another approach, e.h. HashTable or an Array instead of Vector. -- gR - Original Message - From: Vaibhav Patil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 2:02 PM Subject: Iterate tag update Hi, I am using logic:iterate tag as follows to print a table with text boxes. logic:iterate id=product name=productSearchForm property=productList tr td align=left bean:write name=product property=productNumber filter=true/ /td td align=center html:text name=product property=quantity size=3/ /td /tr /logic:iterate I have a array of objets(Product) in productList. When I update the quantity and submit the page, it does not update the information into the productList. What might be the problem??? Vaibhav
RE: Iterate tag update
Where can i get indexed iterate tag written by Dave Hey??? thanks, Vaibhav -Original Message- From: suhas [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 10:13 PM To: [EMAIL PROTECTED] Subject: Re: Iterate tag update Do u have setter methods in the Product class like - setQuantity(int qty) ??? Also U need to have indexed iterate tag written by Dave Hey . So u can use html:text name=product property=quantity size=3 index= true/ Here is the ActionForm public Product [ ] getProductList( ) { return this.productList; } public setProductList(Product [ ] productList) { this.productList = productList ; } public Product getProductList(int index) { return (Product)productList[index]; } Remember have proper setter methods in the Product class like setQuantity int qty ) Suahs - Original Message - From: Vaibhav Patil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 1:02 PM Subject: Iterate tag update Hi, I am using logic:iterate tag as follows to print a table with text boxes. logic:iterate id=product name=productSearchForm property=productList tr td align=left bean:write name=product property=productNumber filter=true/ /td td align=center html:text name=product property=quantity size=3/ /td /tr /logic:iterate I have a array of objets(Product) in productList. When I update the quantity and submit the page, it does not update the information into the productList. What might be the problem??? Vaibhav
Re: Iterate tag update
take it from http://www.husted.com/about/struts Check for the extensions - Iterate tag - Original Message - From: Vaibhav Patil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 1:44 PM Subject: RE: Iterate tag update Where can i get indexed iterate tag written by Dave Hey??? thanks, Vaibhav -Original Message- From: suhas [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 10:13 PM To: [EMAIL PROTECTED] Subject: Re: Iterate tag update Do u have setter methods in the Product class like - setQuantity(int qty) ??? Also U need to have indexed iterate tag written by Dave Hey . So u can use html:text name=product property=quantity size=3 index= true/ Here is the ActionForm public Product [ ] getProductList( ) { return this.productList; } public setProductList(Product [ ] productList) { this.productList = productList ; } public Product getProductList(int index) { return (Product)productList[index]; } Remember have proper setter methods in the Product class like setQuantity int qty ) Suahs - Original Message - From: Vaibhav Patil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 1:02 PM Subject: Iterate tag update Hi, I am using logic:iterate tag as follows to print a table with text boxes. logic:iterate id=product name=productSearchForm property=productList tr td align=left bean:write name=product property=productNumber filter=true/ /td td align=center html:text name=product property=quantity size=3/ /td /tr /logic:iterate I have a array of objets(Product) in productList. When I update the quantity and submit the page, it does not update the information into the productList. What might be the problem??? Vaibhav
Re: Iterate tag update / expalin/why what form bean!!
Hi, i am currently reading up on delegating as much processing as possible to javabeans components hence i have come across various beans regarding html forms ie html:select,html:option, logic:iterate etc etc . Pls could anyone explain or advise were one can get an understanding on selection to the desired form bean. Cheers chuck Gregor Rayman wrote: The problem is, the generated names of the HTML form elements do not correspond to the names of properties of your ActionForm. Here a sample, how this can be done: logic:iterate name=myForm property=elements id=element indexId=i type=de.grayman.test.struts.MyElement tr td html:checkbox property='%= element[ + i + ].member %' / html:hidden property='%= element[ + i + ].elementName %' / /td tdbean:write name=element property=elementName //td tdbean:write name=element property=elementDescription //td /tr /logic:iterate In the MyForm class, there have to be two properties (getter methods): 1) the collection elements 2) indexed property element private Vector elements; public Collection getElements() { return this.elements; } public MyElement getElement(int i) { while (getGroups().size() = i) { this.element.add(new MyElement()); } return (MyElement) this.elements.get(i); } Note: Class MyElement has read/write properties member, elementName, elementDescription, ... Note: The getElement(int i) fills the Vector with empty elements, if they do not exist. In this way, the form will be filled correcly from the submitted HTML-Form. Of course, you could use another approach, e.h. HashTable or an Array instead of Vector. -- gR - Original Message - From: Vaibhav Patil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 2:02 PM Subject: Iterate tag update Hi, I am using logic:iterate tag as follows to print a table with text boxes. logic:iterate id=product name=productSearchForm property=productList tr td align=left bean:write name=product property=productNumber filter=true/ /td td align=center html:text name=product property=quantity size=3/ /td /tr /logic:iterate I have a array of objets(Product) in productList. When I update the quantity and submit the page, it does not update the information into the productList. What might be the problem??? Vaibhav -- The views expressed by the sender of this message don't necessarily represent those of Brecon Beacons National Park Authority. This message is intended for the addressee(s) only and is sent in confidence; if you receive it in error, please can you let us know (at [EMAIL PROTECTED]) and then destroy all copies. Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
Re: Iterate tag update?
* Martin Cooper [EMAIL PROTECTED] 2001-06-13 (21:42:47): I just checked in a change to the iterate tag which allows you to access the current index as a scripting variable. If you specify the 'indexId' attribute, a scripting variable with the specified name will contain the current index (as an Integer) on each iteration. This will be available in the 6/14 nightly build, and also in Struts 1.0. i think this is exactly what i needed recently..after all i cannot follow 100percently right now. would be great if you can post a snippet where you do such a iteration and use this feature. thx alot. - fw -- \|/ \|/ --([EMAIL PROTECTED])- @~/ ,. \~@ /_( \__/ )_\ waste of money, brains and time - wombat() \/ -
RE: Iterate tag update?
Martin, Could you please give an example of how it can be used? I just did the index naming the old fashioned way(i.e., adding index to the property string) and would like to replace it. Thanks. -Nimmi -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 13, 2001 11:43 PM To: [EMAIL PROTECTED] Subject: Re: Iterate tag update? I just checked in a change to the iterate tag which allows you to access the current index as a scripting variable. If you specify the 'indexId' attribute, a scripting variable with the specified name will contain the current index (as an Integer) on each iteration. This will be available in the 6/14 nightly build, and also in Struts 1.0. -- Martin Cooper - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 9:36 AM Subject: Iterate tag update? I have a question similar to Mark Kettner's. Could someone give an update on the iterate tag, and where it stands with the ability to get hold of the current index. I need to have each field in each table row with a different name (ie include the index in it) to reference particular one using javascript. do I need a custom tag for this, or is one available? thanks very much, Dave
Iterate tag update?
I have a question similar to Mark Kettner's. Could someone give an update on the iterate tag, and where it stands with the ability to get hold of the current index. I need to have each field in each table row with a different name (ie include the index in it) to reference particular one using javascript. do I need a custom tag for this, or is one available? thanks very much, Dave
Re: Iterate tag update?
I just checked in a change to the iterate tag which allows you to access the current index as a scripting variable. If you specify the 'indexId' attribute, a scripting variable with the specified name will contain the current index (as an Integer) on each iteration. This will be available in the 6/14 nightly build, and also in Struts 1.0. -- Martin Cooper - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 9:36 AM Subject: Iterate tag update? I have a question similar to Mark Kettner's. Could someone give an update on the iterate tag, and where it stands with the ability to get hold of the current index. I need to have each field in each table row with a different name (ie include the index in it) to reference particular one using javascript. do I need a custom tag for this, or is one available? thanks very much, Dave
Re: Iterate tag update?
Yee! : ^ } - Original Message - From: Martin Cooper [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 14, 2001 12:42 AM Subject: Re: Iterate tag update? I just checked in a change to the iterate tag which allows you to access the current index as a scripting variable. If you specify the 'indexId' attribute, a scripting variable with the specified name will contain the current index (as an Integer) on each iteration. This will be available in the 6/14 nightly build, and also in Struts 1.0. -- Martin Cooper - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 9:36 AM Subject: Iterate tag update? I have a question similar to Mark Kettner's. Could someone give an update on the iterate tag, and where it stands with the ability to get hold of the current index. I need to have each field in each table row with a different name (ie include the index in it) to reference particular one using javascript. do I need a custom tag for this, or is one available? thanks very much, Dave