0

Scrollbar in Listbox moves to last selected item

asked 超碰免费视频c oponav97zyz超碰在线视频百度大香蕉超碰人妻5段话读懂华为开发者大会第一天

發布時間︰

實是個暴發戶,並非真正出身世家望族。他原本是個農家子弟,出身貧賤, 做過小伙計,當過經紀人,放過高利貸,通過不甚光彩的手段發家致富,雖 然後來改名換姓,甚至取得貴族稱號,但是這段不體面的歷史和卑微的出身 依然像個陰影似的籠罩在他頭上。尤其嚴重的是,他還是猶太血統,這就更 加為人所不齒。作者把這個故事發生的地點放在第一次世界大戰前的奧匈帝 國。在這個行將崩潰的龐大帝國里,封建的門第觀念,潛在的排猶勢力十分 強大,難以抵擋。而軍官階層,尤其是騎兵軍官,卻被視為社會的精華、帝 國的支柱,地位優越,盛氣凌人,成為人們艷羨和尊敬的對象。他們自己也 目空一切,自以為高人一等。于是在艾迪特和霍夫米勒之間便出現了一條奇 怪的簡直難以逾越的門第懸殊的鴻溝。在艾迪特家里,一些年輕人無拘無束, 感情交融,互相愛慕,這是個與世隔絕、自成天地,具有牧歌情調的理想世 界;而在霍夫米勒的軍營里,在他團隊的伙伴中間,卻是個講門第、論出身 的現實世界。在這里,一位名叫巴林凱的退職軍官流落他鄉,落魄潦倒,最 後和一位富孀結婚,卻被人斥為“賣身”,軍官階層的傲慢偏激可見一斑。 霍夫米勒周旋于這兩個截然不同的世界里,也就分裂成兩個自我,在內心深 處爭斗不已,誠如歌德老人在《浮士德》里說的︰“兩個靈魂,唉!寓于我 的胸中。” 他這樣誤解我,我心頭不由得升起一股怒火。我生氣的是,這個從根本 上說來頗為好心的頑固腦瓜完全是想給我個台階下下,到末了他認為,我是 因為膽怯才來拉住他的袖口,求他把我救出絕境。真見鬼,為什麼他根本不 願理解我的行為是何等可恥!于是我振作起來︰超碰免费视频c oponav   藍波和寧嘉來錢快,花錢更快,吃喝嫖賭抽一身壞毛病。尤其藍波喜歡賭博,前些日子,他被人下套,輸掉八十多萬。賭金是從金潤投資公司借的高利貸,藍波被抓去暴打一頓,限一個月內還錢。兩個人正走投無路的時候,恰巧看到了報紙上的婚禮消息,于是決定干一票,解決自己的麻煩。97zyz超碰在线视频百度   嗯,近期和大家報備的事情很簡單,就是我換筆名啦!以後“藍帽會系列”會一直用原曉這個筆名,櫻桃芭蕉從此變身原曉了。咦,有同學覺得新名字听起來有點耳熟?對的,我一直用這個筆名在別家雜志挖坑。本著為讀者服務的心態,我決定把手下的坑都統一成一個筆名,方便大家日後組團毆打我。微博ID︰愛吃肉的原曉,求圍觀求摸頭> <   謝謝秋秋在這一個半月的付出,我們和影迷都相信,如此精心塑造的角色,一定會成為熒幕上的又一經典!大香蕉超碰人妻   我沒吭聲,也假裝沒看見藍波使眼色制止女朋友。 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