Monday, July 25, 2011

Re: Declare an array of panels in UiBinder

Sorry i haven't noticed vp is panel not list ;)
so in java you have sth like that:

List<FocusPanel> slots;
@UiField FlowPanel slotTargetPanel;

@UiFactory FocusPanel void addSlot() {
FocusPanel slot = new FocusPanel();
slots.add(slot);
return slot;
}

in ui.xml:

<!-- your root ui element -->
<g:HTMLPanel>
<div>
<p>Some sample html ...</p>

<g:FlowPanel ui:field="slotTargetPanel">
<g:FocusPanel/>
<g:FocusPanel/>
<g:FocusPanel/>
</g:FlowPanel>
<!-- slots will contain now 3 elements -->

<g:HTML>Some sample widget</g:HTML>
</div>
</g:HTMLPanel>


in fact slotTargetPanel is not needed for that - you could stick
Focuspanels anywhere in your ui file - as you have an uifactory method
for creatign FlowPanels.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate