1

私はGWTを初めて使用し、これに対する答えを見つけることができません:私はTextBox用の素敵なUIBinderを持っています.それは動作します.UIHandlerはそれで動作します. しかし、この TextBox の値を HTML 全体に表示したい場合はどうすればよいでしょうか。この値を HTML 全体で再利用するために 1 つの変数を宣言する方法はありますか、または 1 つの HTML ページに値を表示するたびに新しい ui:field 名で新しいラベルを宣言し、そのようなすべてのラベルに UIHandler を入力する必要があります (すぐにできますが、これは本当に退屈に思えます)?

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g="urn:import:com.google.gwt.user.client.ui">
<g:HTMLPanel>
    <g:TextBox  ui:field="myField"/><br/>        
    <div>            
        <p>                
            What do I need to put here if i want to see **myField.getValue()** in html, may be even multiple times? 
            And **here**?
            I want to avoid creation of new and new objects in back-end class for just one value, multiple labels here are ok. How to push one value in all of them, when myField content is changed?
        </p>            
    </div>
</g:HTMLPanel>

4

1 に答える 1