[Seasar-user:13533] 【teeda】selectタグのselectedについて
    [E-MAIL ADDRESS DELETED]
    [E-MAIL ADDRESS DELETED]
       
    2008年 4月  3日 (木) 08:31:09 JST
    
    
  
皆様おはようございます。
黒川と申します。
selectタグで動的に[selected]にするには、TeedaではPageクラスで
このように記述すると思います。
private List aaaItems;
public Class initialize()
{
        aaaItems = new ArrayList();
        Map mapEdiKubun1 = new HashMap();
        mapEdiKubun1.put("label", "1番目");
        mapEdiKubun1.put("value", new Integer(1));
        aaaItems.add(mapEdiKubun1);
        Map mapEdiKubun2 = new HashMap();
        mapEdiKubun2.put("label", "2番目");
        mapEdiKubun2.put("value", new Integer(2));
        aaaItems.add(mapEdiKubun2);
        Map mapEdiKubun3 = new HashMap();
        mapEdiKubun3.put("label", "3番目");
        mapEdiKubun3.put("value", new Integer(3));
        aaaItems.add(mapEdiKubun3);
}
一方Strutsでは、jspに記述すれば動的にselectedが生成されます。
(Actionクラスなどでロジックの記述必要無し)
<html:select name="aaa" property="aaa">
        <html:option value="1">1番目</html:option>
        <html:option value="2">2番目</html:option>
        <html:option value="3">3番目</html:option>
</html:select>
Teedaでは、HTMLに記述するだけで動的にselectedが付加される方法は
無いのでしょうか??
よろしければお教え頂けますでしょうか。
    
    
Seasar-user メーリングリストの案内