ScrollPane in or after Container issure

4 messages - 881 views

Use the official demo, modify widgets.xml and add a container before the scrollpane like this:

<tabitem label="List" style="layout:borderlayout;">

<_enabled>@{bList}</_enabled>

                        <container><text>testtext-1<text><text>testtext-2</text></container>

<scrollPane>

<list>

<listitem>

<text>Stone</text>

<picture>stone.png</picture>

</listitem>

<listitem>

<text>Leaf</text>

</listitem>

<listitem>

<picture>scissors.png</picture>

<text>Scissors</text>

</listitem>

<listitem>

<textarea>A paragraph long enough to take up two lines</textarea>

</listitem>

</list>

</scrollPane>

</tabitem>

Run it. Only container part display and the scrollpane lost, in debug mode, the scrollpane is initialized but the doLayout method not invoked.

Modify the xml again and put the scrollpane in a container, the scrollpane is back, but if the listitems are more enough and go outside the screen, the scrollpane can not scroll with press the DOWN_KEY, but the listitems outside screen can be selected.

up

Is's a bug,I u like to fix it easily,modi scrollpane.java and set needToAutoScroll default value to true.

shappy1978 I changed needToAutoScroll value to true, but scrollpane still can not scroll if the listitems are more enough and go outside the screen. Following is my xml source:

<screen class="main" style="layout:borderlayout;align:center;padding:15 0 0 0;" shortcuts="right=goToSchedule|left=backToMenu" focusloop="true">
    <screenTopBar class="mainHeader">
        <picture src="logo.png" class="headerLogo" />
        <container style="layout:inlinelayout(true,fill);" class="headerText">
            <text class="red" style="align:center;">@{klass} </text>
            <text class="red" style="align:center;">%CLASS%</text>
        </container>
    </screenTopBar>
    <container style="layout:inlinelayout(false,fill);align:fill-top">
        <container class="titlebar" style="layout:gridlayout(2,1);align:fill-top">
            <text class="whiteTitle" style="align:left;font-size:small;">%SCHEDULE%</text>
            <text class="whiteTitle" style="align:right;font-size:small;">@{fullname}</text>
        </container>
          
        <scrollPane>
            <list>
                <_renderer>
                    <![CDATA[
                        <listItem class="listItems" onAction="goToSchedule">
                            <_onfocus>weekItemFocus(${id},${name},${date})</_onfocus>
                            <text class="listText">${date} - ${name}</text>
                            <picture class="listArrow" src="arrow.png" />
                        </listItem>
                    ]]>
                </_renderer>
                <_items>@{dayList}</_items>
            </list>
        </scrollPane>
    </container>

   
       
   
    <screenFirstMenu  onAction="goToSchedule">%SELECT%</screenFirstMenu>
    <screenSecondMenu  onAction="backToMenu">%BACK%</screenSecondMenu>

</screen>