Logic:iterate and logic:equalquestion

2004-01-26 Thread Marco Mistroni
Hi all,
I need to use the logic:equal inside a logic iterate..and I am
Having problems..
My case is that I hae in an ActionForm an HashMap property which
contains
Pairs of  String, MyObject.  My object has a Boolean property called
status

What I want to do is to loop thru all the objects in my hashmap and, if
the property status has a value of true I want to display button A,
while if it is false I want to display button B.

For testing purposes I am now displaying some text...


I tried with following loop, but seems that is not working properly

// Loop thru all the objects contained in the hashmap
logic:iterate id=element name=batchTaskForm property=tasks 
  tr class=workscreen
 td align=right class=workscreen

// Here I got myObject   , and its property 'type'

 bean:write name=element property=value.type/
 /td
 td align=left class=workscreen
   
// Now I should reuse MyObject herebut below code raises
// exception (obviously)

 logic:equal name=element property=status
value=trueActive/logic:equal
logic:equal name=element property=status
value=falseInactive/logic:equal
 
   /td
 /tr
/logic:iterate

I believe I should go for a bean:define  tag but I m not sure how to use
it

Anyone can help?

Thanx in advance and regards
marco




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



Re: Logic:iterate and logic:equalquestion

2004-01-26 Thread Nicolas De Loof
Solution 1 : 
bean:define id=myObject name=element property=value/
logic:equal name=myObject property=status value=trueActive/logic:equal
...

Solution 2 : 
logic:equal name=element property=value.status value=trueActive/logic:equal
...


Nico.


 Hi all,
 I need to use the logic:equal inside a logic iterate..and I am
 Having problems..
 My case is that I hae in an ActionForm an HashMap property which
 contains
 Pairs of  String, MyObject.  My object has a Boolean property called
 status
 
 What I want to do is to loop thru all the objects in my hashmap and, if
 the property status has a value of true I want to display button A,
 while if it is false I want to display button B.
 
 For testing purposes I am now displaying some text...
 
 
 I tried with following loop, but seems that is not working properly
 
 // Loop thru all the objects contained in the hashmap
 logic:iterate id=element name=batchTaskForm property=tasks 
   tr class=workscreen
  td align=right class=workscreen
 
 // Here I got myObject   , and its property 'type'
 
  bean:write name=element property=value.type/
  /td
  td align=left class=workscreen

 // Now I should reuse MyObject herebut below code raises
 // exception (obviously)
 
 logic:equal name=element property=status
 value=trueActive/logic:equal
 logic:equal name=element property=status
 value=falseInactive/logic:equal
  
/td
  /tr
 /logic:iterate
 
 I believe I should go for a bean:define  tag but I m not sure how to use
 it
 
 Anyone can help?
 
 Thanx in advance and regards
 marco
 
 
 
 
 -
 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]