0

Scrollbar in Listbox moves to last selected item

asked 曰本高清一本道无码av2018一本道av手机在线一级a做爰片中国海军第31批护航编队返回湛江军港(图)

發布時間︰

現在他干咳兩聲,開口說︰“少尉先生,”他的嗓子似乎生了銹,還一 直不听他的使喚,“我想術您幫我個大忙??我當然知道,我沒有權利麻煩 您,您幾乎還不怎麼認識我們??話說回來,您完全可以拒絕??不言而喻, 您可以拒絕??我這個說不定是非分之想,是強人所難,但是我從第一眼看 見您,我就信任您。誰都立刻感覺到,您心地善良,樂于助人。是的,是的, 是的。”我想必作了一個推辭的手勢——“您心地善良。您身上有一種東西, 使人心里踏實,有時候??我有一種感覺,仿佛您是派來幫助我的,是 被??”說到這里他打住了,我感覺到,他是想說“天主派來的”,只是沒 有勇氣說出來罷了一“派您到我這里來,讓我能和您說說心里話??話說回 來,我向您請求的東西並不多。??瞧我這樣一個勁他說啊說啊,也不問問 您是否願意傾听我的話。” 曰本高清一本道无码av 十八2018一本道av手机在线 “你想想看,爸爸,少尉先生今天還是第一次看見這個露台呢。” “可不是,這兒簡直美極了,”我便說道,可是立刻就很難堪地意識到, 那個“蒂羅爾酒家”是個舒適的小酒館,名聲不是太好,坐落在一條古 色古香的彎曲小巷里,地勢偏僻,屬于一家二三流旅館。這家旅館在我們軍 官這個圈子里特別受人稱贊,因為看門的寬厚健忘。雖然警察局有明文規定, 而客人向他要雙人房間時——哪怕是在青天白日——他總故意忘記讓客人填 寫來客登記單。對于或長或短的幽會時間還有一個保密的安全措施,誰要想 進到那些艷穴中去,用不著通過那扇惹人注意的大門(小城市里耳目眾多), 而是大大方方地從酒店的正廳,直接登上樓梯,就能達到那秘密的目的地。 這座酒家,固然名聲不是最好,然而在樓下酒店里賣的泰拉納酒和穆斯卡特 酒則相反,酒味濃烈,無可指摘。每天晚上,市民們圍坐在不鋪桌布的笨重 的木頭桌子旁邊,喝上幾杯燒酒,總要縱談天下國家乃至本城的大事,時而 激烈,時而溫和。這間長方形的房間布置得有點俗氣。這里進進出出的都是 些老老實實的酒客。他們在這里無非是喝喝酒,大家在一起很沉悶地坐一坐。 房間的四周比正廳高出一級,安置了一排所謂的“包廂”,各個包廂之間都 用相當厚的隔音木牆隔開,牆上還多此一舉地用幾幅烙鐵畫?和幼稚的祝酒辭 作為裝飾。八個小單間正對中間正廳的那一面都用厚厚的門簾遮得嚴嚴實 實,簡直可以稱為 Chambres s6par6es?,在某種程度上也是這種用處。如果 駐防地的軍官和服役一年的志願兵想和來自維也納的幾個姑娘玩一玩、樂一 樂而不讓人看見,就預先訂好這麼一個包廂,據說,連我們一向嚴格注意軍 風紀的上校對這項明智的措施也表示贊許,因為這一來,老百姓基本上不可 能了解他手下那些年輕小伙子花天酒地的情景。在這座酒家內部的規矩里, 保密也是至高無上的法則︰根據酒家老板費爾賴待納先生的嚴格指令,那些 身穿蒂羅爾地方民族服裝的女侍者如果事先不在門口大聲干咳幾聲,不得掀 開神聖的門簾或者以任何其他方式打擾軍官先生。除非他們打鈴明確招呼侍 者才得進入包廂。這樣,既維護了軍隊的尊嚴,也保障了軍官的娛樂,真是 配合默契,相得益彰。一级a做爰片 乎地來回直晃啊。大概彼得羅維契囑咐她,不得讓任何人進去。好吧——大 不了塞點小費給這頭膽小怕事的笨牛。)卡尼茲立刻裝出和藹可親的樣子, 用那種粗俗的維也納方言說道︰ 2019-07-29 16:02:29 +0800

anvibb gravatar image anvibb
3 1

Hi, guys! I have some trouble with scrollbar in the Listbox component - when I set the model to it and selecting several listitems, the scrollbar moves down to the last selected item, but I need to keep it on top. We've used simple zul as a view:

<zk>
<window xmlns="http: //www.zkoss.org/2005/zul" xmlns:xsi="http: //www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http: //www.zkoss.org/2005/zul http: //www.zkoss.org/2005/zul/zul.xsd"
        use="com.otr.sufd.zkossforms.table.SetDocColumnsView"
        closable="true" border="normal" title="Customize columns" ctrlKeys="" height="400px" width="300px">
    <borderlayout width="100%" height="100%">
        <center>
            <listbox id="table" checkmark="true" vflex="true" fixedLayout="true" multiple="true" width="100%">
                <listhead>
                    <listheader align="left">Column title</listheader>
                </listhead>
            </listbox>
        </center>

        <south size="36" autoscroll="true">
            <toolbar align="end">
                <button label="OK" id="okButton" height="24px" width="75px" mold="os"/>
                <button label="Reset" id="resetButton" height="24px" width="75px"/>
                <button label="Cancel" id="cancelButton" height="24px" width="75px" mold="os"/>
            </toolbar>
        </south>
    </borderlayout>
</window>

</zk>

In SetDocColumnsView I filled Listbox by model and make some AfterCompose actions:

public void configureView(List<? extends HeaderElement> columns, Set<String> hiddenIds) {
    setSizable(true);

    final ListModelList tableModel = new ListModelList(columns);
    tableModel.setMultiple(true);
    table.setModel(tableModel);
    table.renderAll();
    for (int i = 0; i < columns.size(); i++) {
        final HeaderElement column = columns.get(i);
        if (column != null) {
            final Listitem listitem = table.getItemAtIndex(i);
            listitem.setLabel(column.getLabel());
            final String columnId = column.getId();
            listitem.setValue(columnId);
            listitem.setSelected(!hiddenIds.contains(columnId));
        }
    }
}
@Override
public void afterCompose() {
    table = (Listbox) getFellow("table");
    final Button okButton = (Button) getFellow("okButton");
    //adds some listeners to buttons
    addForward(Events.ON_OK, okButton, Events.ON_CLICK);
    addForward(Events.ON_CANCEL, cancelButton, Events.ON_CLICK);
    okButton.setFocus(true);
}

And then I show the dialog window by this code:

final SetDocColumnsView dialog = UIUtils.loadComponent(SetDocColumnsView.getUrl());
dialog.configureView(columnList, hiddenIds);
dialog.setPage(getPage());
dialog.doHighlighted();

I've tried to use some advice given in other threads, such as:

Clients.scrollIntoView(table.getItemAtIndex(0))

or call JS function inside my configureView method:

Clients.evalJavaScript("zk.Widget.$('" + dialog.table.getUuid() + "')._scrollToIndex(0);")

or keep all listitems what I need to select in a different Set and post to setSelectedItems method of Listbox, but everything is without success. Also, I've tried to debug a JS function _doScroll in Listbox.js but I don't figure out from where it has been called :(

I will be very appreciated if someone can help me with this problem.

Best regards, Roman

delete flag offensive retag edit

Comments

if your example is simple, please paste it into http://zkfiddle.org/ so that anyone can have a look directly, this increases your chances of getting a response quickly

cor3000 ( 2019-07-29 18:30:05 +0800 )edit

Yeah, I made simple zkfiddle example - http://zkfiddle.org/sample/1a44bo/1-scrollbar-in-listbox-moves-to-last-selected-item which reproduces the problem

anvibb ( 2019-07-30 21:16:58 +0800 )edit

4 Answers

0

answered 2019-08-01 09:12:39 +0800

hawk gravatar image hawk
2415 1 5
http://hawkphoenix.blogsp... ZK Team

Thanks for the zkfiddle example. Remove renderAll() can solve scrolling position issue. Listbox by default will render necessary Listitem for visible range, you don't need to call renderAll() which will enforce rendering all Listitems which is unnecessary for most cases. Please refer to http://zkfiddle.org/sample/1a44bo/2-scrollbar-in-listbox-moves-to-last-selected-item#source-2

link publish delete flag offensive edit
0
link publish delete flag offensive edit
0

answered 2019-07-31 21:05:33 +0800

anvibb gravatar image anvibb
3 1

updated 2019-08-01 09:01:48 +0800

hawk gravatar image hawk
2415 1 5
http://hawkphoenix.blogsp... ZK Team

Thank you for the response, hawk!

I tried to change the selection of items as you advised, but it doesn't solve my problem - when I select several items via ListModeList.setSelection, the scrollbar moves down to the last item. I made an example of that behavior in zkfiddle - http://zkfiddle.org/sample/1a44bo/1-scrollbar-in-listbox-moves-to-last-selected-item

link publish delete flag offensive edit
0

answered 2019-08-01 17:45:43 +0800

anvibb gravatar image anvibb
3 1

Removing renderAll() is helped!

Thank you so much!

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2019-07-29 16:02:29 +0800

Seen: 12 times

Last updated: Aug 01

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More