开发者

GWT - Replace <g:center> of DockLayoutPanel in UiBinder dynamically

开发者 https://www.devze.com 2023-02-17 22:01 出处:网络
I have this simple UiBinder template: <!DOCTYPE ui:UiBinder SYSTEM \"http://dl.google.com/gwt/DTD/xhtml.ent\">

I have this simple UiBinder template:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <ui:style>

    </ui:style>
  <g:DockLayoutPanel unit="EM">
    <g:north size="10">
      <g:Label>Header</g:Label>
    </g:north>

    <g:center>
      <g:Label ui:field="placeholder"></g:Label>
    </g:center>

    <g:south size="2.5">
      <g:Label>Footer</g:Label开发者_运维百科>
    </g:south>
  </g:DockLayoutPanel>
</ui:UiBinder>

What I would like to do is dynamically replace content in <g:center> when application state changes. The problem is, which type of field should I use as a placeholder?


I usually use a SimplePanel, then when the state changes, I clear the simple panel and put the new component / widget into it. The new widget can be anything from HTML Panel to a simple Label to any of the more complex layout panels with content.

0

精彩评论

暂无评论...
验证码 换一张
取 消