Re: Index properties (once again)

2003-10-28 Thread Mark Lowe
That's okay Rajat as I said I know what its like to up against the 
wire..

I've found ArrayList works better in dynaActionForms especially if 
you're dynamically generating forms. I think this because its a big fat 
pain in the arse to create new dynabeans (have a play with bean utils 
for a day and you find this out).

When setting the size dynamically you need to scope the form to session.

action path=/myaction scope=session ..

I use arraylist as the form property type, i don't think that arrays 
work but i could be wrong

form-property name=myprop type=java.util.ArrayList /
[notice you dont set the size]
then in your action when your loading the form

ArrayList list = ...

theForm.set(myprop,list);

and also (I guess this shouldn't be required but it is)...

request.setAttribute(myprop,list);

then

logic:iterate id=prop name=myForm property=myprop
html:text name=prop property=foo indexed=true /
/logic:iterate
I guess you could apply the same principles using non dynamic action 
form. I imagine that using an array rather than arrayList should work 
too.

Cheers Mark

On Tuesday, October 28, 2003, at 02:31 AM, Rajat Pandit wrote:

Hello all,
I finally managed to solve the problem, and now that I know it all 
seems
so damn awfully simple!!! , I wish the docs had explained it in a much
simpler manner. But I guess it was more about the form and ActionForm
thing than about the indexed properties. I am writing a HOWTO on all
possible variations of indexed properties now. Shall post it on the
mailing list for your review.
Thanks a lot nick, for the pointers, it was a great help.

Just one more question, it works just fine if I define it as an
ArrayList, but in case I want to use it as an array, how do I 
workaround
for the size. One way is to assume a higest upper limit. (which I think
is lame) Is there someone I can inform the actionForm about the last
value of the index of the logic:iterate.. Tag ... I mean this could
sound rather silly...but just to know is there a possibility?

Thanks again for all ur time. And yes mark! Thanks for all the kick in
the butt!! Helped me think rationally :D
-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: Index properties (once again)
Hello sorry for posting the same question again and again. But I seem 
to
have gained something on this. Now I have a few (more) questions. Maybe
someone could help me figure out what or where I am getting it wrong.

This is the case. I have a product, with different states(checbox) and
each state has to have a bidAmount (text area) and a transaction
type(radio button). I want the form to be generated such that for
validation.
a. I can check If the checkbox(for the state) has been checked the
bidAmount and transaction type has been selected.
Now my question is,
a. in the action form. Do I need to defind the bidAmount as an array
b. I didn't know about this until know, but are only String type 
allowed
in actionform ( ihavent read about this anywhere except on one of the
posts in this mailing list) c. I have set the setter and getter for
(lets take the example of bidAmount only) like this.

public String getBidAmount(int index) {
String tmp = new String();
System.err.println(Value of index:  + index);
try {
tmp = bidAmount[index];
} catch (Exception e) {
System.err.println(Error:  + e.getMessage());
}
return tmp;
}

public void setBidAmount(int index, String value) {
System.err.println(index:  + index);
System.err.println(Value:  + value);
System.err.println(--);
this.bidAmount[index] = value;
}


And the corresponding jsp tags as follows.

logic:iterate id=state name=STATES indexId=currIdx

tr bgcolor=#F8F8F8
  td align=left valign=top
html:multibox property=stateId styleClass=flat
bean:write name=state property=id /
/html:multibox bean:write name=state property=name 
/
  /td
  td 
html:text name=bidForm
property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  
/
  /td

  td align=center
BC html:radio name=bidForm property=mode value=2
titleKey=app.bcall  indexed=true styleClass=flat /
| SC html:radio name=bidForm property=mode value=1
titleKey=app.scall  indexed=true  styleClass=flat /
  /td
  td align=right
bean:write name=state property=buyingCall 
ignore=true
/
  /td
  td align=right
bean:write name=state property=sellingCall
ignore=true /
   /td

/tr
/logic:iterate


I know the the inline scriptlet is very ugly, but this was the only way
I could get it to call the index number in the getter method. However
the desperate attempt (try and catch) makes the form work (not much 

RE: Index properties (once again)

2003-10-28 Thread Rajat Pandit
I guess its time to learn struts-el, JSTL (remove inline scripting) and
dynaforms!!! Man!! This just never seems to end. The next up challenege
to get the damn checkbox retain their states!!. Using array for checkbox
to retain an ID
Something like this
input type=checkbox value=6name=stateId[0] /
input type=checkbox value=7name=stateId[1] /
input type=checkbox value=8name=stateId[2] /

So which ever checkbox s checked its value is set.
Any clues?

-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 28, 2003 1:09 AM
To: Struts Users Mailing List
Subject: Re: Index properties (once again)


That's okay Rajat as I said I know what its like to up against the 
wire..

I've found ArrayList works better in dynaActionForms especially if 
you're dynamically generating forms. I think this because its a big fat 
pain in the arse to create new dynabeans (have a play with bean utils 
for a day and you find this out).

When setting the size dynamically you need to scope the form to session.

action path=/myaction scope=session ..

I use arraylist as the form property type, i don't think that arrays 
work but i could be wrong

form-property name=myprop type=java.util.ArrayList / [notice you
dont set the size]

then in your action when your loading the form

ArrayList list = ...

theForm.set(myprop,list);

and also (I guess this shouldn't be required but it is)...

request.setAttribute(myprop,list);

then

logic:iterate id=prop name=myForm property=myprop
html:text name=prop property=foo indexed=true /
/logic:iterate

I guess you could apply the same principles using non dynamic action 
form. I imagine that using an array rather than arrayList should work 
too.

Cheers Mark


On Tuesday, October 28, 2003, at 02:31 AM, Rajat Pandit wrote:

 Hello all,
 I finally managed to solve the problem, and now that I know it all
 seems
 so damn awfully simple!!! , I wish the docs had explained it in a much
 simpler manner. But I guess it was more about the form and ActionForm
 thing than about the indexed properties. I am writing a HOWTO on all
 possible variations of indexed properties now. Shall post it on the
 mailing list for your review.
 Thanks a lot nick, for the pointers, it was a great help.

 Just one more question, it works just fine if I define it as an 
 ArrayList, but in case I want to use it as an array, how do I 
 workaround for the size. One way is to assume a higest upper limit. 
 (which I think is lame) Is there someone I can inform the actionForm 
 about the last value of the index of the logic:iterate.. Tag ... I 
 mean this could sound rather silly...but just to know is there a 
 possibility?

 Thanks again for all ur time. And yes mark! Thanks for all the kick in

 the butt!! Helped me think rationally :D


 -Original Message-
 From: Rajat Pandit [mailto:[EMAIL PROTECTED]
 Sent: Sunday, October 26, 2003 9:39 PM
 To: [EMAIL PROTECTED]
 Subject: Index properties (once again)


 Hello sorry for posting the same question again and again. But I seem
 to
 have gained something on this. Now I have a few (more) questions.
Maybe
 someone could help me figure out what or where I am getting it wrong.


 This is the case. I have a product, with different states(checbox) and

 each state has to have a bidAmount (text area) and a transaction 
 type(radio button). I want the form to be generated such that for 
 validation.

 a. I can check If the checkbox(for the state) has been checked the 
 bidAmount and transaction type has been selected.

 Now my question is,
 a. in the action form. Do I need to defind the bidAmount as an array 
 b. I didn't know about this until know, but are only String type 
 allowed in actionform ( ihavent read about this anywhere except on one

 of the posts in this mailing list) c. I have set the setter and getter

 for (lets take the example of bidAmount only) like this.

 public String getBidAmount(int index) {
 String tmp = new String();
 System.err.println(Value of index:  + index);
 try {
 tmp = bidAmount[index];
 } catch (Exception e) {
 System.err.println(Error:  + e.getMessage());
 }
 return tmp;

 }

 public void setBidAmount(int index, String value) {
 System.err.println(index:  + index);
 System.err.println(Value:  + value);
 System.err.println(--);
 this.bidAmount[index] = value;
 }



 And the corresponding jsp tags as follows.

 logic:iterate id=state name=STATES indexId=currIdx

 tr bgcolor=#F8F8F8
   td align=left valign=top
 html:multibox property=stateId styleClass=flat 
 bean:write name=state property=id /
 /html:multibox bean:write name=state property=name
 /
   /td
   td 
 html:text name=bidForm
 property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  
 /
   /td

RE: Index properties (once again)

2003-10-28 Thread Nicholas L Mohler





Hi Rajat,

You could use an Array.  If your form is in the session, as opposed to the
request, the array will never go away, so the array will retain its size.
I can't do that in our app as our UI presents a spreadsheet and allows
the user to add and remove rows.  For that reason, I use an ArrayList since
I can easily resize it on the fly.

As far as creating an Array with the correct size, I don't believe that we
have any control over the sequence in which Struts populates the
ActionForm.  So we couldn't submit the array size from the browser.

Glad that you found the referenced threads useful :-)
Nick





   

  Rajat Pandit   

  [EMAIL PROTECTED]To:   'Struts Users Mailing 
List' [EMAIL PROTECTED]
  upinc.com   cc: 

   Subject:  RE: Index properties (once 
again) 
  10/27/2003 09:31 

  PM   

  Please respond to

  Struts Users

  Mailing List

   

   





Hello all,
I finally managed to solve the problem, and now that I know it all seems
so damn awfully simple!!! , I wish the docs had explained it in a much
simpler manner. But I guess it was more about the form and ActionForm
thing than about the indexed properties. I am writing a HOWTO on all
possible variations of indexed properties now. Shall post it on the
mailing list for your review.
Thanks a lot nick, for the pointers, it was a great help.

Just one more question, it works just fine if I define it as an
ArrayList, but in case I want to use it as an array, how do I workaround
for the size. One way is to assume a higest upper limit. (which I think
is lame) Is there someone I can inform the actionForm about the last
value of the index of the logic:iterate.. Tag ... I mean this could
sound rather silly...but just to know is there a possibility?

Thanks again for all ur time. And yes mark! Thanks for all the kick in
the butt!! Helped me think rationally :D


-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: Index properties (once again)


Hello sorry for posting the same question again and again. But I seem to
have gained something on this. Now I have a few (more) questions. Maybe
someone could help me figure out what or where I am getting it wrong.


This is the case. I have a product, with different states(checbox) and
each state has to have a bidAmount (text area) and a transaction
type(radio button). I want the form to be generated such that for
validation.

a. I can check If the checkbox(for the state) has been checked the
bidAmount and transaction type has been selected.

Now my question is,
a. in the action form. Do I need to defind the bidAmount as an array
b. I didn't know about this until know, but are only String type allowed
in actionform ( ihavent read about this anywhere except on one of the
posts in this mailing list) c. I have set the setter and getter for
(lets take the example of bidAmount only) like this.

public String getBidAmount(int index) {
String tmp = new String();
System.err.println(Value of index:  + index);
try {
tmp = bidAmount[index];
} catch (Exception e) {
System.err.println(Error:  + e.getMessage());
}
return tmp;

}

public void setBidAmount(int index, String value) {
System.err.println(index:  + index);
System.err.println(Value:  + value);
System.err.println(--);
this.bidAmount[index] = value;
}



And the corresponding jsp tags as follows.

logic:iterate id=state name=STATES indexId=currIdx

tr

RE: Index properties (once again)

2003-10-28 Thread Lynn Guy
multibox tag

--- Rajat Pandit [EMAIL PROTECTED] wrote:
 I guess its time to learn struts-el, JSTL (remove
 inline scripting) and
 dynaforms!!! Man!! This just never seems to end. The
 next up challenege
 to get the damn checkbox retain their states!!.
 Using array for checkbox
 to retain an ID
 Something like this
 input type=checkbox value=6name=stateId[0] /
 input type=checkbox value=7name=stateId[1] /
 input type=checkbox value=8name=stateId[2] /
 
 So which ever checkbox s checked its value is set.
 Any clues?
 
 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, October 28, 2003 1:09 AM
 To: Struts Users Mailing List
 Subject: Re: Index properties (once again)
 
 
 That's okay Rajat as I said I know what its like to
 up against the 
 wire..
 
 I've found ArrayList works better in dynaActionForms
 especially if 
 you're dynamically generating forms. I think this
 because its a big fat 
 pain in the arse to create new dynabeans (have a
 play with bean utils 
 for a day and you find this out).
 
 When setting the size dynamically you need to scope
 the form to session.
 
 action path=/myaction scope=session ..
 
 I use arraylist as the form property type, i don't
 think that arrays 
 work but i could be wrong
 
 form-property name=myprop
 type=java.util.ArrayList / [notice you
 dont set the size]
 
 then in your action when your loading the form
 
 ArrayList list = ...
 
 theForm.set(myprop,list);
 
 and also (I guess this shouldn't be required but it
 is)...
 
 request.setAttribute(myprop,list);
 
 then
 
 logic:iterate id=prop name=myForm
 property=myprop
   html:text name=prop property=foo
 indexed=true /
 /logic:iterate
 
 I guess you could apply the same principles using
 non dynamic action 
 form. I imagine that using an array rather than
 arrayList should work 
 too.
 
 Cheers Mark
 
 
 On Tuesday, October 28, 2003, at 02:31 AM, Rajat
 Pandit wrote:
 
  Hello all,
  I finally managed to solve the problem, and now
 that I know it all
  seems
  so damn awfully simple!!! , I wish the docs had
 explained it in a much
  simpler manner. But I guess it was more about the
 form and ActionForm
  thing than about the indexed properties. I am
 writing a HOWTO on all
  possible variations of indexed properties now.
 Shall post it on the
  mailing list for your review.
  Thanks a lot nick, for the pointers, it was a
 great help.
 
  Just one more question, it works just fine if I
 define it as an 
  ArrayList, but in case I want to use it as an
 array, how do I 
  workaround for the size. One way is to assume a
 higest upper limit. 
  (which I think is lame) Is there someone I can
 inform the actionForm 
  about the last value of the index of the
 logic:iterate.. Tag ... I 
  mean this could sound rather silly...but just to
 know is there a 
  possibility?
 
  Thanks again for all ur time. And yes mark! Thanks
 for all the kick in
 
  the butt!! Helped me think rationally :D
 
 
  -Original Message-
  From: Rajat Pandit
 [mailto:[EMAIL PROTECTED]
  Sent: Sunday, October 26, 2003 9:39 PM
  To: [EMAIL PROTECTED]
  Subject: Index properties (once again)
 
 
  Hello sorry for posting the same question again
 and again. But I seem
  to
  have gained something on this. Now I have a few
 (more) questions.
 Maybe
  someone could help me figure out what or where I
 am getting it wrong.
 
 
  This is the case. I have a product, with different
 states(checbox) and
 
  each state has to have a bidAmount (text area) and
 a transaction 
  type(radio button). I want the form to be
 generated such that for 
  validation.
 
  a. I can check If the checkbox(for the state) has
 been checked the 
  bidAmount and transaction type has been selected.
 
  Now my question is,
  a. in the action form. Do I need to defind the
 bidAmount as an array 
  b. I didn't know about this until know, but are
 only String type 
  allowed in actionform ( ihavent read about this
 anywhere except on one
 
  of the posts in this mailing list) c. I have set
 the setter and getter
 
  for (lets take the example of bidAmount only) like
 this.
 
  public String getBidAmount(int index) {
  String tmp = new String();
  System.err.println(Value of index: 
 + index);
  try {
  tmp = bidAmount[index];
  } catch (Exception e) {
  System.err.println(Error:  +
 e.getMessage());
  }
  return tmp;
 
  }
 
  public void setBidAmount(int index, String
 value) {
  System.err.println(index:  + index);
  System.err.println(Value:  + value);
  System.err.println(--);
  this.bidAmount[index] = value;
  }
 
 
 
  And the corresponding jsp tags as follows.
 
  logic:iterate id=state name=STATES
 indexId=currIdx
 
  tr bgcolor=#F8F8F8
td align=left valign=top
  html:multibox property=stateId
 styleClass=flat 
  bean:write

Re: Index properties (once again)

2003-10-27 Thread Mark Lowe
Forget indexed properties, all that stuff..

Does each state have many bids, modes and/or calls?

If you're not clear about this in the first place then you'll be in 
trouble. Until you stop spamming the list and think about what you're 
doing then you wont get anywhere.

On Monday, October 27, 2003, at 05:38 AM, Rajat Pandit wrote:

Hello sorry for posting the same question again and again. But I seem 
to
have gained something on this. Now I have a few (more) questions. Maybe
someone could help me figure out what or where I am getting it wrong.

This is the case. I have a product, with different states(checbox) and
each state has to have a bidAmount (text area) and a transaction
type(radio button). I want the form to be generated such that for
validation.
a. I can check If the checkbox(for the state) has been checked the
bidAmount and transaction type has been selected.
Now my question is,
a. in the action form. Do I need to defind the bidAmount as an array
b. I didn't know about this until know, but are only String type 
allowed
in actionform ( ihavent read about this anywhere except on one of the
posts in this mailing list)
c. I have set the setter and getter for (lets take the example of
bidAmount only) like this.

public String getBidAmount(int index) {
String tmp = new String();
System.err.println(Value of index:  + index);
try {
tmp = bidAmount[index];
} catch (Exception e) {
System.err.println(Error:  + e.getMessage());
}
return tmp;
}

public void setBidAmount(int index, String value) {
System.err.println(index:  + index);
System.err.println(Value:  + value);
System.err.println(--);
this.bidAmount[index] = value;
}


And the corresponding jsp tags as follows.

logic:iterate id=state name=STATES indexId=currIdx

tr bgcolor=#F8F8F8
  td align=left valign=top
html:multibox property=stateId styleClass=flat
bean:write name=state property=id /
/html:multibox bean:write name=state property=name 
/
  /td
  td 
html:text name=bidForm
property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  
/
  /td

  td align=center
BC html:radio name=bidForm property=mode value=2
titleKey=app.bcall  indexed=true styleClass=flat /
| SC html:radio name=bidForm property=mode value=1
titleKey=app.scall  indexed=true  styleClass=flat /
  /td
  td align=right
bean:write name=state property=buyingCall 
ignore=true
/
  /td
  td align=right
bean:write name=state property=sellingCall
ignore=true /
   /td

/tr
/logic:iterate


I know the the inline scriptlet is very ugly, but this was the only way
I could get it to call the index number in the getter method. However
the desperate attempt (try and catch) makes the form work (not much 
use)
I cant get the the setter to set the values in the individual array, 
and
get a stack trace error instead.

I am not really sure where Is wrong and non or the documentataion 
define
things very clearly (or maybe I am poor in comprehension)
Apologies again to people who think I am bothering them by posting 
again
and again, but this is my last hope!!

Hope someone helps!
(ps: once I am through with this, I shall write my own HOW TO for the
indexed properties and its use)
Rajat Pandit | [EMAIL PROTECTED]
+91 612 3117606
[ Developer and Part Time Human Being]
-
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: Index properties (once again)

2003-10-27 Thread Nicholas L Mohler





Hi Ranjat,

Take a look at the mail archive.  There are at least two threads that I
have posted to that discuss indexed properties.  I think that you'll find
just about everything you need in those threads.  There is info about (1)
building your page with indexed properties and (2) getting the indexed data
back into the form.

http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]by=threadfrom=471600

http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]by=threadfrom=216908

Take a look at these threads.  If you can't find what you need there,
please repost.
Nick



   

  Rajat Pandit   

  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]  

  upinc.com   cc: 

   Subject:  Index properties (once again) 

  10/27/2003 12:38 

  AM   

  Please respond to

  Struts Users

  Mailing List

   

   





Hello sorry for posting the same question again and again. But I seem to
have gained something on this. Now I have a few (more) questions. Maybe
someone could help me figure out what or where I am getting it wrong.


This is the case. I have a product, with different states(checbox) and
each state has to have a bidAmount (text area) and a transaction
type(radio button). I want the form to be generated such that for
validation.

a. I can check If the checkbox(for the state) has been checked the
bidAmount and transaction type has been selected.

Now my question is,
a. in the action form. Do I need to defind the bidAmount as an array
b. I didn't know about this until know, but are only String type allowed
in actionform ( ihavent read about this anywhere except on one of the
posts in this mailing list)
c. I have set the setter and getter for (lets take the example of
bidAmount only) like this.

public String getBidAmount(int index) {
String tmp = new String();
System.err.println(Value of index:  + index);
try {
tmp = bidAmount[index];
} catch (Exception e) {
System.err.println(Error:  + e.getMessage());
}
return tmp;

}

public void setBidAmount(int index, String value) {
System.err.println(index:  + index);
System.err.println(Value:  + value);
System.err.println(--);
this.bidAmount[index] = value;
}



And the corresponding jsp tags as follows.

logic:iterate id=state name=STATES indexId=currIdx

tr bgcolor=#F8F8F8
  td align=left valign=top
html:multibox property=stateId styleClass=flat
bean:write name=state property=id /
/html:multibox bean:write name=state property=name /
  /td
  td 
html:text name=bidForm
property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  /
  /td

  td align=center
BC html:radio name=bidForm property=mode value=2
titleKey=app.bcall  indexed=true styleClass=flat /
| SC html:radio name=bidForm property=mode value=1
titleKey=app.scall  indexed=true  styleClass=flat /
  /td

  td align=right
bean:write name=state property=buyingCall ignore=true
/
  /td
  td align=right
bean:write name=state property=sellingCall
ignore=true /
   /td

/tr
/logic:iterate



I know the the inline scriptlet is very ugly, but this was the only way
I could get it to call the index number in the getter method. However
the desperate attempt (try and catch) makes the form work (not much use)
I cant get the the setter to set the values in the individual array, and
get a stack trace error 

Re: Index properties (once again)

2003-10-27 Thread Vic Cekvenich


Mark Lowe wrote:
 Until you stop spamming the list and think about what you're
doing then you wont get anywhere.

+1

.V



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


RE: Index properties (once again)

2003-10-27 Thread Rajat Pandit
Hello all,
I finally managed to solve the problem, and now that I know it all seems
so damn awfully simple!!! , I wish the docs had explained it in a much
simpler manner. But I guess it was more about the form and ActionForm
thing than about the indexed properties. I am writing a HOWTO on all
possible variations of indexed properties now. Shall post it on the
mailing list for your review.
Thanks a lot nick, for the pointers, it was a great help.

Just one more question, it works just fine if I define it as an
ArrayList, but in case I want to use it as an array, how do I workaround
for the size. One way is to assume a higest upper limit. (which I think
is lame) Is there someone I can inform the actionForm about the last
value of the index of the logic:iterate.. Tag ... I mean this could
sound rather silly...but just to know is there a possibility?

Thanks again for all ur time. And yes mark! Thanks for all the kick in
the butt!! Helped me think rationally :D


-Original Message-
From: Rajat Pandit [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 26, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: Index properties (once again)


Hello sorry for posting the same question again and again. But I seem to
have gained something on this. Now I have a few (more) questions. Maybe
someone could help me figure out what or where I am getting it wrong. 


This is the case. I have a product, with different states(checbox) and
each state has to have a bidAmount (text area) and a transaction
type(radio button). I want the form to be generated such that for
validation.

a. I can check If the checkbox(for the state) has been checked the
bidAmount and transaction type has been selected.

Now my question is, 
a. in the action form. Do I need to defind the bidAmount as an array 
b. I didn't know about this until know, but are only String type allowed
in actionform ( ihavent read about this anywhere except on one of the
posts in this mailing list) c. I have set the setter and getter for
(lets take the example of bidAmount only) like this.

public String getBidAmount(int index) {
String tmp = new String();
System.err.println(Value of index:  + index);
try {
tmp = bidAmount[index];
} catch (Exception e) {
System.err.println(Error:  + e.getMessage());
}
return tmp;

}

public void setBidAmount(int index, String value) {
System.err.println(index:  + index);
System.err.println(Value:  + value);
System.err.println(--);
this.bidAmount[index] = value;
}



And the corresponding jsp tags as follows.

logic:iterate id=state name=STATES indexId=currIdx

tr bgcolor=#F8F8F8
  td align=left valign=top
html:multibox property=stateId styleClass=flat
bean:write name=state property=id /
/html:multibox bean:write name=state property=name /
  /td
  td 
html:text name=bidForm
property='%=bidAmount[+currIdx+]%'  styleClass=flat size=3  /
  /td

  td align=center
BC html:radio name=bidForm property=mode value=2
titleKey=app.bcall  indexed=true styleClass=flat /
| SC html:radio name=bidForm property=mode value=1
titleKey=app.scall  indexed=true  styleClass=flat /
  /td

  td align=right
bean:write name=state property=buyingCall ignore=true
/
  /td
  td align=right
bean:write name=state property=sellingCall
ignore=true /
   /td

/tr
/logic:iterate



I know the the inline scriptlet is very ugly, but this was the only way
I could get it to call the index number in the getter method. However
the desperate attempt (try and catch) makes the form work (not much use)
I cant get the the setter to set the values in the individual array, and
get a stack trace error instead.

I am not really sure where Is wrong and non or the documentataion define
things very clearly (or maybe I am poor in comprehension) Apologies
again to people who think I am bothering them by posting again and
again, but this is my last hope!!

Hope someone helps!
(ps: once I am through with this, I shall write my own HOW TO for the
indexed properties and its use)

Rajat Pandit | [EMAIL PROTECTED]
+91 612 3117606
[ Developer and Part Time Human Being]


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