Hello,
There was not the big problem, You just need to add ResourceBundle to
template before generating the form fields.
So the following code is working fine.
------------------------------------------------------
//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.addResourceBundle(new ListResourceBundle() {
public Object[][] getContents() {
return new Object[][] {
{ "testuser:1", "username1" },
{ "testuser:2", "username2" },
{ "testuser:3", "username3" } };
}
});
mTemplate.getBeanHandler().getFormBuilder().generateField(mTemplate,
new ConstrainedProperty("testuser").inList(userIds), null, null);
print(mTemplate);
}
}
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users