I have a class consisting of mostly String
s and a few Double
s which I have a BeanEditor
for.
However, I wish to add another field to this class, and the type of that field is my custom class, let's call it Bar
.
public class Foo {
private String myString;
private Double myDouble;
private Bar bar;
// getters and setters
...
}
The allowed values for that field are pulled from a database and should appear as a select control.
However, when I try to do this in my page, it's like the myBar
doesn't exist in my Foo
class.
<beaneditor>
<p:bar>
<div class="t-beaneditor-row">
<label>Bar</label>
<t:select t:id="barSelecter" t:model="barModel" t:value="foo.bar" t:encoder="barEncoder"/>
</div>
</p:bar>
</beaneditor>
How do I accomplish the desired effect?
You'll have to add the bar property to the model.
Eg <beaneditor add="bar"... >