0

Scrollbar in Listbox moves to last selected item

asked 2018一本道av手机在线一级a做爰片大香蕉香港黑衣人:叫谁示威者呢?我们是暴徒

發布時間︰

每個角落都找遍了,剛想打電話到城外你那騎士城堡里去問哪。” 我發現有四個伙伴圍在我的身邊,永遠不會缺少的費倫茨在他們當中,2018一本道av手机在线 她三腳兩步就去把我的東西取來,幸虧用人趕到汽車旁邊去了,這樣我 就可以神不知鬼不覺地繞過院子里的房子,到了花園里。我害怕極了,惟恐 有人要盤問我,我便加快腳步。我第二次像個小偷似的,低頭彎腰,膽戰心 驚地逃離這幢不祥的府邸。一级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