Hi, it`s me again :)Ok here comes a little example that do not work for me and that i do not understand. (That it do not work)
Home.java------------------------------------------------------------------------ --------
package com.uwyn.rife.jumpstart.elements.pub;
import java.util.ArrayList;
import java.util.List;
import java.util.ListResourceBundle;
import com.uwyn.rife.engine.Element;
import com.uwyn.rife.site.ConstrainedProperty;
import com.uwyn.rife.template.Template;
public class Home extends Element {
public void processElement() {
Template mTemplate = getHtmlTemplate("pub.home");
List<Integer> userIds = new ArrayList<Integer>();
userIds.add(1);
userIds.add(2);
userIds.add(3);
mTemplate.getBeanHandler().getFormBuilder().generateField(mTemplate,
new
ConstrainedProperty("testuser").inList(userIds), null, null);
mTemplate.addResourceBundle(new ListResourceBundle() {
public Object[][] getContents() {
return new Object[][] { { "testuser:1", "username1" },
{ "testuser:2", "username2" },
{ "testuser:3", "username3" } };
}
});
print(mTemplate);
}
}
------------------------------------------------------------------------
--------
home.html------------------------------------------------------------------------ --------
${i common.blueprint/}
${i common.error_messages/}
${bv window_title}Home${/bv}
${bv stylesheets}
<link rel="stylesheet" type="text/css" href="style/home.css" />
${/bv}
${bv content}
<div>
<form action="${v SUBMISSION:FORM:testForm/}" method="post">
${v SUBMISSION:PARAMS:testForm /}
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
${v FORM:SELECT:testuser/}
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Submit"/></td>
</tr>
</table>
</div>
${/bv}
------------------------------------------------------------------------
--------
pub.xml------------------------------------------------------------------------ --------
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2004-2006 Geert Bevin <gbevin[remove] at uwyn dot com>
- Licensed under the Apache License, Version 2.0 (the "License");
-
- $Id: pub.xml 2923 2006-02-06 11:36:43Z gbevin $
-->
<!DOCTYPE site SYSTEM "/dtd/site.dtd">
<site>
<globalexit name="home" destid="Home"/>
<arrival destid="Home"/>
<element id="Home"
implementation="com.uwyn.rife.jumpstart.elements.pub.Home" url="/home">
<exit name="admin"/>
<submission name="testForm">
<param name="testuser"/>
</submission>
<flowlink srcexit="admin" destid="^Admin"/>
</element>
</site>
------------------------------------------------------------------------
--------
resulting html------------------------------------------------------------------------ --------
<form action="/" method="post">
<input name="submission" type="hidden" value="testForm" /><input
name="submissioncontext" type="hidden" value="LlB1YmxpYy4=" />
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<select name="testuser"><option value="1">1</option><option
value="2">2</option><option value="3">3</option></select>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
The Options should contain the usernames from the ListResourceBundle,
but that do not work for me.
Maybe someone see the part that i`m missing or making wrong.Best Regards, Odo
PGP.sig
Description: Signierter Teil der Nachricht
_______________________________________________ Rife-users mailing list [email protected] http://lists.uwyn.com/mailman/listinfo/rife-users
