Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE with listbox and listgroup with @ZKController #1

Open
GoogleCodeExporter opened this issue May 6, 2015 · 2 comments
Open

NPE with listbox and listgroup with @ZKController #1

GoogleCodeExporter opened this issue May 6, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
piece of ZUL:
<listbox id="deviceList" width="100%" checkmark="true"
    vflex="true" apply="${deviceMenuCtl.deviceListCtl}"
    selectedItem="@{deviceMenuCtl.selectedXmodData}"
    emptyMessage="${labels.menu.deviceList.emptyMessage}">
    <listhead sizable="true">
        <listheader id="supplier"
            label="${labels.supplier}" sort="db()" />
        <listheader id="model" label="${labels.model}"
            sort="db()" />
        <listheader id="protocol"
            label="${labels.protocol.$}" sort="db()" />
    </listhead>
        <listgroup label="test" />
    <listitem self="@{each=device}">
        <listcell label="@{device.supplier}" />
        <listcell label="@{device.model}" />
        <listcell label="@{device.protocol}" />
    </listitem>
</listbox>
<dlpaging apply="${deviceMenuCtl.deviceListCtl}"
    pageSize="15" /> 

piece of code:
// Controller per popolare l'accordion del menu dei device
@ZkController
DLListboxController<XmodData> deviceListCtl = new 
DLListboxCriteriaController<XmodData>(
        "DeviceList") {
    @Override
    protected DLResponse<XmodData> loadData(DLSearch<XmodData> search) {
        logger.debug("Ricerca dati xmod nel db");
        return xmodDataDAO.searchAndCount(search);
    }
};

What is the expected output? What do you see instead?
>>java.lang.NullPointerException
>>  at 
org.zkoss.zk.ui.AbstractComponent.checkParentChild(AbstractComponent.java:1064)
>>  at 
org.zkoss.zk.ui.AbstractComponent.insertBefore(AbstractComponent.java:1084)
>>  at org.zkoss.zk.ui.AbstractComponent.appendChild(AbstractComponent.java:1242)
>>  at 
cz.datalite.zk.components.list.controller.impl.DLListboxComponentControllerImpl.
fireOrderChanges(DLListboxComponentControllerImpl.java:225)
>>  at 
cz.datalite.zk.components.list.DLListboxGeneralController.onCreate(DLListboxGene
ralController.java:155)
>>  at 
cz.datalite.zk.components.list.controller.impl.DLListboxComponentControllerImpl.
onCreate(DLListboxComponentControllerImpl.java:160)
>>  at cz.datalite.zk.components.list.view.DLListbox.onCreate(DLListbox.java:31)

What version of the product are you using? On what operating system?
ZK 5.0.7.1
ZK-DL 1.1
Windows 7 x64
Jetty 7.5.1
JDK 1.6.0_27

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 30 Sep 2011 at 9:31

@GoogleCodeExporter
Copy link
Author

I think that the problem is that Listgroup implements Listitem, and in 
DLListboxComponentControllerImpl:244 you do:
renderTemplate = listbox.getItemAtIndex( 0 );
assuming the first item in a Listbox is a <listitem>, but in my case the first 
item is a <listgroup>. The fact that even Listgroup (as a class) is a Listitem 
generates this problem and even the other is issue 2 I created.

Original comment by [email protected] on 30 Sep 2011 at 9:55

@GoogleCodeExporter
Copy link
Author

Hello, I'm afraid that we do not support listgroups yet, but we will have a 
look and let you know soon.

Original comment by [email protected] on 7 Nov 2011 at 12:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant