0

Scrollbar in Listbox moves to last selected item

asked 欧美黄片三级黄片黄片大全普京乘潜水器查看二战沉没苏联潜艇 向牺牲老兵致敬

發布時間︰

“萊奧波爾特或者萊默爾?卡尼茲如何變成開克斯法爾伐莊園的主人和 老爺的,這個故事是在從布達佩斯到維也納的一次客車里拉開的序幕。我們 的朋友盡管那年已經四十二歲,頭發也已經開始斑白,可是大部分時間還一 直是在旅途上度過的——生性慳吝的人連時間也是節省的,至于他毫無例外 地總是乘坐三等車廂,這點無需我再強調了。因為他長年累月僕僕風塵,早 已為夜間旅行給自己安排了一套技術。首先他在硬邦邦的木頭座位上鋪開一 條甦格蘭花格子呢的旅行毯子,這是他有一次在拍賣行里當便宜貨買來的。 然後他就把他那不可缺少的黑外套仔仔細細地掛在衣鉤上,免得弄皺,把金 絲邊眼鏡放進眼鏡盒,從麻布的旅行袋里(他從來舍不得用皮箱)取出一件 粗絨布的舊睡衣,最後緊接著把帽子低低地扣在臉上,免得燈光射進眼楮。 這樣,他就蜷縮在車廂的角落里,早已習慣于就是坐著也能打瞌睡。小萊默 爾還是個孩子的時候,就已經學會了夜里沒有床、不舒服也照樣睡覺。 他又把身子往後一靠,把眼楮閉上片刻。 “是的,要我這樣憑空解釋,她身上什麼東西變樣了,這很困難,因為欧美黄片 我怎麼能拒絕呢?我面前坐著一位眼淚汪汪的老人,等我說個“行”字 就像等待未日審判的號角聲一樣。不消說,我滿口答應。他猛地一下子向我 伸出雙臂。三级黄片 然??要不然我們走開這麼長時間,會引起艾迪特注意的。可惜對待她得無 比的小心謹慎;自從她生病以來,她??她不曉得怎麼搞的,感覺比別人敏 銳得多。她呆在自己的房里,足不出戶,可以知道家里發生的所有事情?? 你還沒有把話說出來,她就猜到了你的全部心思??到未了她會??所以我 想建議,趁她還沒有產生懷疑,我們就到那邊去吧。”黄片大全 她丈夫足足多活了三十五年。這老婆子脾氣像牛皮一樣富有韌性,像戴勝鳥 一樣乖張刻毒。自從她自己僅有的兩個孩子一夜之間雙雙死于白喉,她就打 整個心眼里仇恨莪羅斯伐爾家所有其他的人,因為他們比她兩個苦命的孩子 活得長。有人說,她只是因為惡毒成性,心里惱火,存心不讓她的急不可耐 的一批佷兒佷孫女繼承遺產,才活了八十四歲。我覺得這話確實可信。倘若 這些覬覦遺產的親戚當中有人登門求見,她拒不接待,即便是家里人寫來的 措辭最最親切動听的書信也都扔到桌子底下,從不回答。孩子和丈夫相繼死 去之後,她變得憤世嫉俗,怪僻乖張,每年在開克斯法爾伐莊園總是只住上 兩三個月,沒有一個人上門。其余的時間她到處旅行,足跡遍歷各國,在尼 斯和蒙特勒?住下來,排場奢華,不啻君王,衣衫一日幾換,雇人梳頭,修剪 指甲,涂脂抹粉,閱讀法文小說,購買大量的衣服,從一家店鋪進到另一家 店鋪,討價還價,罵罵咧咧,活像一個俄國市場上的女商販。不消說,她留 在身邊絕無僅有的那個人,她的伴娘,日子很不好過。這個可憐的、不聲不 響的女人每天得給三頭叫人惡心、愛叫愛鬧、長得跟狐狸一樣的小狗喂飯、 洗刷,帶出去散步,給這傻老婆子彈鋼琴,念小說,並且無緣無故地被她痛 罵。要是這位老夫人有時候多灌了幾杯燒酒或者伏特加,——這習慣她是從 烏克蘭帶來的——據可靠的傳說,那可憐的伴娘大概甚至還得忍受老婆子的 鞭打。在所有這些豪華場所,在尼斯和坎納,在埃克斯累班?和蒙特勒大家都 認識這個身軀肥胖的老太婆,長了一張上了油漆似的哈巴狗臉,染了頭發, 總是直著嗓子大聲嚷嚷,從來不管是不是有人听她說話,像個下級軍官一樣 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