2

I have a question about GWT UIBinder. I'd like to create a simple web-page which presents movies on my streamer. I would like to have a simple list of the movies - like on the right side of youtube.

Problem is, that program doesn't know how many movies are in my database, so I cannot just put (for example) 5 movie elements (and 2 arrows) in panel when making MoviesList.ui.xml. I would like this number to be assigned when creating list of the movies - and to scroll to left (or right) when user pressed each arrow.

Here is my list UiBinder xml:

<ui:UiBinder 
...
<g:HorizontalPanel ui:field="list">
    <f:LeftArrow ui:field="itemLeft" /> 
    <f:SamplesSmall ui:field="item1" />
    <f:Divider ui:field="div1" />
    <f:SamplesSmall ui:field="item2" />
    <f:Divider ui:field="div2" />
    <f:SamplesSmall ui:field="item3" />
    <f:Divider ui:field="div3" />
    <f:SamplesSmall ui:field="item4" />
    <f:Divider ui:field="div4" />
    <f:RightArrow ui:field="itemRight" />                               
</g:HorizontalPanel>
</ui:UiBinder> 

How should I create this file, so number of items will create on-the-fly?

best

Hilbrand Bouwkamp
  • 13,509
  • 1
  • 45
  • 52
Sobis
  • 1,385
  • 4
  • 20
  • 29
  • Does [this similar topic](http://stackoverflow.com/questions/3131141/gwt-uibinder-any-way-to-have-dynamic-list-of-widgets) help? – Tyler Holien Feb 03 '11 at 19:52
  • Do you really need to know the exact number of items to display? Why don't you create a left arrow, a container to hold say 5 elements and a right arrow. After a click say on the right arrow you check what 5 elements are to be displayed next, clear your container and generate the next 5 items. – z00bs Feb 03 '11 at 20:28

1 Answers1

0

Thanks a lot - both of you.

I found a way to do with FlexTable.

z00bs - it'a great idea, but I'd like to make movie items to slide. In that case I cannot clear container nad create new items. I'll try to find a way to implement jquery.scrollTo.js to UiBinder.

best

Sobis
  • 1,385
  • 4
  • 20
  • 29