RE: EL expression not getting evaluated

2005-06-29 Thread Pushkala_Iyer
 
1. Add the EL tag library descriptor to your web.xml.

taglib
taglib-uri/tags/struts-html-el/taglib-uri
taglib-location/WEB-INF/struts-html-el.tld/taglib-location
/taglib

2. Include the required jar files in WEB-INF/lib:
struts-el.jar, standard.jar

3. Import the tag library in your jsp and use the el tags:

%@ taglib uri=/tags/struts-html-el prefix=html-el %

tdhtml-el:text property=myFundingIndexed[${outerLoop.index * size +
innerLoop.index}]//td
...

Hope this helps,
Pushkala. 

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



FW: Expression evaluation with html-el tags?

2005-06-02 Thread Pushkala_Iyer
 


 
Is it possible to do more than just simple loop index evaluation with
html-el tags?

I iterate over 2 loops:

c:forEach var=outerMapEntry items=${outerMap}
varStatus=outerLoop
   trtdc:out value=${outerMapEntry.key}//td
   c:forEach var=innerMapEntry items=${outerMapEntry.value}
varStatus=innerLoop
  tdhtml-el:text
property=myIndexedProperty[${innerLoop.index}]//td   
   /c:forEach
   /tr
/c:forEach

However, within my inner loop, I want to calculate the index as follows:

outerLoop.Index * innerLoop.size + innerLoop.index

My questions are:

1) The following works for me, 

tdhtml-el:text
property=myIndexedProperty[${innerLoop.index}]//td,

But if I try to do any calculations like so, 

  tdhtml-el:text property=myIndexedProperty[${outerLoop.index} *
${innerLoop.index}]//td   

I get errors, saying that there is no such getter defined. 


2) Surely, it should be possible to use html-el to access map entries
directly? The form I have has a Map of Maps. I need to access the inner
map values, put them in a table, allow editing / submission of those
values. It seems to be excessively convoluted to put the map values in
an arraylist, just so I can access them using indexed properties. 

Thanks, 

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



RE: Expression evaluation with html-el tags?

2005-06-02 Thread Pushkala_Iyer

Yes, that was it. I just discovered that a couple minutes ago, too. 
Thanks for the help! 



-Original Message-
From: John Fitzpatrick [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 02, 2005 10:31 AM
To: Struts Users Mailing List
Subject: Re: Expression evaluation with html-el tags?

I've never had a need to do anything like what you're doing, but I can
tell you that ${} needs to contain the entire expression. Try this:

html-el:text property=myIndexedProperty[${outerLoop.index *
innerLoop.index}]//td





On 20050602 11:22 AM, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:

 
 
 
 
 Is it possible to do more than just simple loop index evaluation with 
 html-el tags?
 
 I iterate over 2 loops:
 
 c:forEach var=outerMapEntry items=${outerMap}
 varStatus=outerLoop
  trtdc:out value=${outerMapEntry.key}//td
  c:forEach var=innerMapEntry items=${outerMapEntry.value}
 varStatus=innerLoop
 tdhtml-el:text
 property=myIndexedProperty[${innerLoop.index}]//td
  /c:forEach
  /tr
 /c:forEach
 
 However, within my inner loop, I want to calculate the index as
follows:
 
 outerLoop.Index * innerLoop.size + innerLoop.index
 
 My questions are:
 
 1) The following works for me,
 
 tdhtml-el:text
 property=myIndexedProperty[${innerLoop.index}]//td,
 
 But if I try to do any calculations like so,
 
 tdhtml-el:text property=myIndexedProperty[${outerLoop.index} *

 ${innerLoop.index}]//td
 
 I get errors, saying that there is no such getter defined.
 
 
 2) Surely, it should be possible to use html-el to access map entries 
 directly? The form I have has a Map of Maps. I need to access the 
 inner map values, put them in a table, allow editing / submission of 
 those values. It seems to be excessively convoluted to put the map 
 values in an arraylist, just so I can access them using indexed
properties.
 
 Thanks,
 
 -
 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: logic:iterate multiple collections

2005-05-24 Thread Pushkala_Iyer
 
A related question, so I thought I'll post it to this thread.

The data structure I use is a HashMap, whose values are other HashMaps.
Like so:

OuterMap
OuterKey1: InnerMap1
   InnerKey11: Value11
   InnerKey12: Value12  
OuterKey2: InnerMap2
   InnerKey21: Value21
   InnerKey22: Value22  

I'm trying to nest two logic:iterate tags to print out the keys in the
outer map and the values in the inner Map. 

What I'm trying to do is something like this:

logic:iterate id=myOuterMap name=myForm property=myOuterMap
tr
   tdbean:write name=myOuterMap property=key//td
   logic:iterate id=myInnerMap name=myForm property=myInnerMap
tdbean:write name=myInnerMap property=value//td   
   /logic:iterate   
/tr
/logic:iterate

This has a problem, because, it needs the innerMap attribute set in the
request - however, this always gets the same value, probably because of
the way I'm setting it in my Action. 

1) I probably need a list of innerMaps in my form, but I'm not sure how
to do this.

2) If I try to print the value using the outerMap alone, like so,
   tdbean:write name=MyOuterMap property=value//td  I'm not
sure how I can format this in the way that only the values are seen. 

Does anyone have any pointers?

Thanks,
PS

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 23, 2005 6:42 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate multiple collections

From: Titus Barik [EMAIL PROTECTED]

 Let's say I have two collections, A, and B. Is there a way to iterate 
 over multiple collections with something like logic:iterate?


If you know they're the same size and in the same order, (should be the
case with List,) how about iterating over one with c:forEach
varStatus=status and using ${status.count} to address the second
List.

Can you change the design?  If the items in both collections really
belong together, try to store them together so you don't have to jump
through hoops like this.

--
Wendy Smoak



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



RE: logic:iterate multiple collections

2005-05-24 Thread Pushkala_Iyer

Thanks! That worked, and is also much easier to understand.

This is probably a newbie question: How / when does one choose between
using JSTL / Struts Tags? 
Is there any reason to choose Struts tags over JSTL?

Thanks,
PS

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 24, 2005 11:02 AM
To: Struts Users Mailing List
Subject: Re: logic:iterate multiple collections

From: [EMAIL PROTECTED]

 The data structure I use is a HashMap, whose values are other
HashMaps.

 I'm trying to nest two logic:iterate tags to print out the keys in the

 outer map and the values in the inner Map.

c:forEach var=outerMapEntry items=${outerMap}
c:out value=${outerMapEntry.key}/
c:forEach var=innerMapEntry items=${outerMapEntry.value} 
  c:out value=${innerMapEntry.value}/
/c:forEach
/c:forEach

See http://wiki.wendysmoak.com/cgi-bin/wiki.pl?JSTLNestedMapIterate for
test code.

--
Wendy Smoak




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