0

Can not render in bandbox

asked 2016-11-08 04:00:47 +0800

onsir gravatar image onsir
132 2

Hello,

i try render list to bandbox, but i get erorr

org.zkoss.zk.ui.UiException: At most one bandpopup is allowed, <bandbox hdeplv#bandreceiver="">

and this my code file Upload.zul

<?xml version="1.0" encoding="UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" root="./winUpload" ?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk xmlns="http://www.zkoss.org/2005/zul"
    xmlns:h="http://www.w3.org/1999/xhtml"
    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">
<window id="winUpload" width="650px"  border="normal"  apply="${UploadController},com.tech.view.UploadRenderer" >
<tabbox id="tb" height="300px">
<tabs id="tabs">
  <tab label="Upload files" />
</tabs>
<tabpanels>
  <tabpanel>
    <grid>
      <columns><column width="80px"/><column/></columns>
      <rows>
        <row>
          <div align="right">
              <label value="Description"/>
          </div>
          <textbox id="txtDescription" cols="60"/>
        </row>
        <row>
          <div align="right">
              <label value="To User"/>
          </div>
          <bandbox id="bandUser" cols="60"/>
        </row>
      </rows>
    </grid>
   </tabpanel>
 </tabpanels>
</tabbox>

</window> </zk>

UploadController.java

public class UploadController extends GenericForwardComposer {
private UploadRenderer uploadRenderer;
private Bandbox bandReceiver;

@Override
public void doAfterCompose(Component comp) throws Exception {

    uploadRenderer=new UploadRenderer();
    uploadRenderer.doAfterCompose(comp);

}

}

file UploadRenderer.java

public class UploadRenderer extends GenericForwardComposer {

@WireVariable private UserService userService;

private ListUserRenderer listUserRenderer;

private Bandpopup banpopReceiver;
private Listbox listboxReceiver;

@Wire private Bandbox bandReceiver;

@Override
public void doAfterCompose(Component comp) throws Exception {
       super.doAfterCompose(comp);

       userService=(UserService)SpringUtil.getBean("userService");

       listUserMsRenderer=new ListUserMsRenderer();

       banpopReceiver=new Bandpopup();
       listboxReceiver=new Listbox();

       bandReceiver.appendChild(banpopReceiver);
       banpopReceiver.appendChild(listboxReceiver);

       bandReceiver.addEventListener(Events.ON_OPEN, new EventListener() {
       @Override
       public void onEvent(Event event) throws Exception {
           ListModelList listModel=userService.getListUser();
           listboxReceiver.setModel(listModel); 
           listboxReceiver.setItemRenderer(listUserRenderer);
       }}); 

}

error [http-bio-8084-exec-1] INFO org.zkoss.util.resource.impl.LabelLoaderImpl - Loading labels for en_US [http-bio-8084-exec-1] INFO org.zkoss.util.resource.impl.LabelLoaderImpl - Loading labels for en org.zkoss.zk.ui.UiException: At most one bandpopup is allowed, <bandbox hdeplv#bandreceiver=""> at org.zkoss.zul.Bandbox.beforeChildAdded(Bandbox.java:186) at org.zkoss.zk.ui.AbstractComponent.insertBefore(AbstractComponent.java:1091) at org.zkoss.zk.ui.AbstractComponent.appendChild(AbstractComponent.java:1288) at com.tech.view.UploadController.doAfterCompose(UploadController.java:125) at org.zkoss.zk.ui.impl.MultiComposer.doAfterCompose(MultiComposer.java:117) at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:578) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:880) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:826) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:735) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:797) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:757) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:699) at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1080) at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:251)

thanks,

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-11-08 05:42:56 +0800

chillworld gravatar image chillworld flag of Belgium
5257 3 9
https://github.com/chillw...

updated 2016-11-08 11:00:40 +0800

The fault is pointing that there could be more then 1 bandpopup on the zul page. You are creating a new one in code, and I suspect that the bandbox automaticly creates also one.

link publish delete flag offensive edit
0

answered 2016-11-08 08:57:49 +0800

onsir gravatar image onsir
132 2

sorry, in zul page is

<bandbox id="bandReceiver" cols="60"/>

thanks

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: 2016-11-08 04:00:47 +0800

Seen: 28 times

Last updated: Nov 08 '16