我正在使用gwt 2.3.I在此使用UI绑定。我想通过使用UIBinder在此创建网格。为此我写了这段代码。如何动态使用UIBinder?
<g:Grid ui:field='mygrid' addStyleNames='{style.panel}'
cellSpacing='10'>
<g:row>
<g:customCell>
<g:Label text="11" styleName="{style.label}" />
</g:customCell>
<g:customCell>
<g:Label text="22" styleName="{style.label}" />
</g:customCell>
</g:row>
<g:row>
<g:customCell>
<g:Label text="33" styleName="{style.label}" />
</g:customCell>
<g:customCell>
<g:Label text="44" styleName="{style.label}" />
</g:customCell>
</g:row>
</g:Grid>
现在,这里我网的数据static.Now在情况下,如果根据这些数据我想创建一个使用UiBinder的网格我的数据来自服务器端&。这怎么可能?
另一种情况。有形式。其中来自数据库的数量来自数据库。 那么UIBider如何支持创建这种形式。因为每次控制的数量可能会有所不同
所以我想知道是否有可能使用UIBinder来创建用户界面,具体取决于运行时数据。
任何建议或例子表示赞赏。
“但是,您可能会在”后面的代码“中添加新的行。”这意味着首先根据数据定义ui.xml中的网格和gwt(.java)类中的行数? –
是的。我知道这不是最好的解决方案,但我仍然会使用UiBinder。添加样式和新窗口小部件(例如“标题标签”)可以让您的“表格设计”更轻松。 – Stefan