Re: Using the Indexed Attribute in the Scope of the Iterate Tag

2002-07-30 Thread dhay



If you search the archives you'll find some examples I posted a while back.  You
also need to make sure you are using Session scope for your beans, or recreating
them when you submit so Struts can populate them.

Cheers,

David





"Vijay Kumar" <[EMAIL PROTECTED]> on 07/30/2002
09:43:28 AM

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

To:   [EMAIL PROTECTED]
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Using the Indexed Attribute in the Scope of the Iterate Tag




Hi,
  My search displays a table of items. Each row will have edit button so
user can edit a particular row and save it. But problem i am unable to read
values of the row user edited.
JSP looks like this.





    


   


 
   


Any ideas or sample code.
Thanks in Advance.

Bye
vkvk

_
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


--
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]>




Using the Indexed Attribute in the Scope of the Iterate Tag

2002-07-30 Thread Vijay Kumar


Hi,
  My search displays a table of items. Each row will have edit button so 
user can edit a particular row and save it. But problem i am unable to read 
values of the row user edited.
JSP looks like this.





    


   


 
   


Any ideas or sample code.
Thanks in Advance.

Bye
vkvk

_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: Using the "Indexed" attribute.

2001-10-03 Thread Eric Mickelson
I work with a guy who has this same problem.  Maybe he can help you :-)


On Wednesday, October 3, 2001, at 03:50 PM, Matt Keveney wrote:

Which Struts release contains support for the "indexed" attribute (used in various HTML tags).  I discovered to my chagrin that this isn't supported in the 1.0 download.
 
Is there some clever way to achieve the same thing in 1.0? I can properly initialized my fields using the 'iterate' tag, but I want the parameter names to come back as "field01, field02, ..." or some-such.
 
TIA
 
-Matt

~Eric

Re: Using the "Indexed" attribute.

2001-10-03 Thread Matt Keveney

> Is there some clever way to achieve the same thing in 1.0? I can properly
initialized my fields using the
> 'iterate' tag, but I want the parameter names to come back as "field01,
field02, ..." or some-such.

All

I figured out a solution myself... though it may not conform with the
preferred Struts patterns.  Here's how I did it, for the archives:

In short, I render the HTML Input tag 'by hand' rather than using Struts
 tag.  Then I add code in the action class 'submit' case
to put the parameter values in the form.

Here's the JSP:



... other HTML, probably table rows & such ...


   checked
   

   name=checkedListItems type=checkbox value=>

... other HTML  ...



Notes:

* This accesses the collection, myform.mylist.

* The objects in that collection must have a "boolean getEnabled(int
  idx)" method.

* Notice that I'm rendering the same parameter name
  "checkedListItems" for each checkbox, but the value is set to the
  collection index.  If the 3rd and 5th items are checked, I'll get
  a request parameter like so:

"checkedListItems" = { "2", "4" }

* Alternately you could leave the value set to "true" or "1" and
  construct a fancy parameter name.  Then you'd get this in the
  request.

"checkedListItem[2]" = { "true" } "checkedListItem[4]" = {
"true" }

  This approach seems more like the documented "indexed" attribute.


-Have fun
-Matt.





Using the "Indexed" attribute.

2001-10-03 Thread Matt Keveney



Which Struts release contains support for 
the "indexed" attribute (used in various HTML tags).  I discovered to 
my chagrin that this isn't supported in the 1.0 download.
 
Is there some clever way to achieve the same 
thing in 1.0? I can properly initialized my fields using the 'iterate' tag, 
but I want the parameter names to come 
back as "field01, field02, ..." or some-such.
 
TIA
 
-Matt