[jboss-user] [JBoss Seam] - EL expression for accessing a set?
jamesjmp
do-not-reply at jboss.com
Wed Nov 21 08:27:11 EST 2007
Hi,
I wonder if there is an EL expression for accessing a set?
For instance, Iôve this objects:
| public class AssetType implements java.io.Serializable {
|
| private long idAsset;
| private String type;
|
| private Set<Instrument> instruments = new HashSet<Instrument>(0);
| ...
|
| public class Instrument implements java.io.Serializable {
|
| private String securityName;
| ..
|
In a xhtml I want to display the securityNameof the first item in the instruments set.
Something like this, but it doesnôt work
| #{assetType[0].internalOptionNumber}
|
In java, itôs easy, for instance to display all of them: (yeah, I know an iterator would be fine as well, this is just a sample way of accessing)
| public String getSecurityName() {
| System.out.println("getSecurityName - getInstruments size:"+instruments.size());
| String secName ="";
| for( Instrument ins : instruments ) {
| secName = ins.getSecurityName();
| System.out.println("SecurityName" + secName );
| }
| return secName;
| }
|
Any way to access a set from an EL expression?
thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106740#4106740
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106740
More information about the jboss-user
mailing list