在 GXT 3.0 中将 bean 属性绑定到 TextField
我正在开发 ExtGWT 3.0(测试版)应用程序。
我有一个包含一个属性的简单 Java bean:
public class MyBean {
private String content;
// getter and setter here...
}
我想将该属性绑定到 TextField
。
我已经创建了一个界面:
interface MyBeanProperties extends PropertyAccess<MyBean> {
ValueProvider<MyBean, String> content();
}
但是下一步是什么?如何告诉 TextField
绑定到特定 MyBean
对象的特定属性?
I am working on a ExtGWT 3.0 (beta) application.
I have a simple Java bean containing one property:
public class MyBean {
private String content;
// getter and setter here...
}
I want to bind the property to a TextField
.
I have created an interface:
interface MyBeanProperties extends PropertyAccess<MyBean> {
ValueProvider<MyBean, String> content();
}
But what's next? How do I tell the TextField
to bind to that particular property of a particular MyBean
object?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PropertyAccess
用于一般引用对象属性,通常用于使用Store
(如网格或图表)的数据小部件。要将表单绑定到 Bean,请查看 GWT 的编辑器框架,网址为 http://code .google.com/webtoolkit/doc/latest/DevGuideUiEditors.html。在 http://www.sencha.com 上有一些 GXT 的示例/examples/#ExamplePlace:basicbinding%28uibinder%29粗略地说,您将构建一个包含您需要的所有属性的表单小部件,并为其创建一个编辑器驱动程序编辑器及其 bean:
PropertyAccess
is used to generically refer to an objects properties, often for data widgets that use aStore
like the grid or charts. For binding a form to a bean, check out GWT's editor framework at http://code.google.com/webtoolkit/doc/latest/DevGuideUiEditors.html. There are some examples for this with GXT at http://www.sencha.com/examples/#ExamplePlace:basicbinding%28uibinder%29Roughly, you'll build a form widget that wraps all the properties you need, and make an editor driver for that editor and its bean: