Revision history [back]

click to hide/show revision 1
initial version

asked 2021-06-02 11:38:38 +0800

Resull gravatar image Resull

[urgent!] Iframe drop problem

When I drag an item over the iframe, it is strange that I release the mouse but it is not released. The item stays over the iframe and will not disappear. At this time, when I move the mouse out of the iframe, I can drag without holding down the mouse.

Here's my zul and controller:

<zk xmlns:n="native">
    <window hflex="1" vflex="1" apply="org.example.MyController">
        <n:iframe vflex="1" hflex="1" id="iframe" src="iframe.zul"/>
        <div>
          <image height="150px" width="150px" src="/img/picture1.jpg" id="image"/>
        </div>
    </window>
</zk>

public class MyController extends SelectorComposer<Component> {

    private Iframe iframe;
    private Image image;

    @Override
    public void doAfterCompose(Component component) throws Exception {
        iframe = (Iframe) component.getFellow("iframe");
        image = (Image) component.getFellow("image");
        iframe.setSrc("iframe.zul");
        iframe.setDroppable("drop");
        image.setDraggable("drop");
    }
}

Here's my iframe.zul and iframeController:

<zk>
    <div hflex="1" vflex="1" apply="org.example.IframeController" id="iframe_div">
        Just throw in!
    </div>
</zk>

public class IframeController extends SelectorComposer<Component> implements EventListener<Event> {

    private Div div;

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        div = (Div) comp.getFellow("iframe_div");
        div.setDroppable("drop");
        div.addEventListener(Events.ON_DROP, this);
    }

    @Override
    public void onEvent(Event event) throws Exception {
        if (event.getName().equals(Events.ON_DROP)) {
            System.out.println("dropped");
        }
    }
}

By the way, I'm from China. I speak through translation software, so my expression is not very good. Please forgive me

[urgent!] Iframe drop problem

Hi

When I drag an item over the iframe, it is strange that I release the mouse but it is not released. The item stays over the iframe and will not disappear. At this time, when I move the mouse out of the iframe, I can drag without holding down the mouse.

Here's my zul and controller:

<zk xmlns:n="native">
    <window hflex="1" vflex="1" apply="org.example.MyController">
        <n:iframe <iframe vflex="1" hflex="1" id="iframe" src="iframe.zul"/>
        <div>
          <image height="150px" width="150px" src="/img/picture1.jpg" id="image"/>
        </div>
    </window>
</zk>

public class MyController extends SelectorComposer<Component> {

    private Iframe iframe;
    private Image image;

    @Override
    public void doAfterCompose(Component component) throws Exception {
        iframe = (Iframe) component.getFellow("iframe");
        image = (Image) component.getFellow("image");
        iframe.setSrc("iframe.zul");
        iframe.setDroppable("drop");
        image.setDraggable("drop");
    }
}

Here's my iframe.zul and iframeController:

<zk>
    <div hflex="1" vflex="1" apply="org.example.IframeController" id="iframe_div">
        Just throw in!
    </div>
</zk>

public class IframeController extends SelectorComposer<Component> implements EventListener<Event> {

    private Div div;

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        div = (Div) comp.getFellow("iframe_div");
        div.setDroppable("drop");
        div.addEventListener(Events.ON_DROP, this);
    }

    @Override
    public void onEvent(Event event) throws Exception {
        if (event.getName().equals(Events.ON_DROP)) {
            System.out.println("dropped");
        }
    }
}

By the way, I'm from China. I speak through translation software, so my expression is not very good. Please forgive meme.Anyway,thank your for help!

[urgent!] Iframe drop problem

Hi

When I drag an item over the iframe, it is strange that I release the mouse but it is not released. The item stays over the iframe and will not disappear. At this time, when I move the mouse out of the iframe, I can drag without holding down the mouse.

Here's my zul and controller:

<zk xmlns:n="native">
    <window hflex="1" vflex="1" apply="org.example.MyController">
        <iframe vflex="1" hflex="1" id="iframe" src="iframe.zul"/>
        <div>
          <image height="150px" width="150px" src="/img/picture1.jpg" id="image"/>
        </div>
    </window>
</zk>

public class MyController extends SelectorComposer<Component> {

    private Iframe iframe;
    private Image image;

    @Override
    public void doAfterCompose(Component component) throws Exception {
        iframe = (Iframe) component.getFellow("iframe");
        image = (Image) component.getFellow("image");
        iframe.setSrc("iframe.zul");
        iframe.setDroppable("drop");
        image.setDraggable("drop");
    }
}

Here's my iframe.zul and iframeController:

<zk>
    <div hflex="1" vflex="1" apply="org.example.IframeController" id="iframe_div">
        Just throw in!
    </div>
</zk>

public class IframeController extends SelectorComposer<Component> implements EventListener<Event> {

    private Div div;

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        div = (Div) comp.getFellow("iframe_div");
        div.setDroppable("drop");
        div.addEventListener(Events.ON_DROP, this);
    }

    @Override
    public void onEvent(Event event) throws Exception {
        if (event.getName().equals(Events.ON_DROP)) {
            System.out.println("dropped");
        }
    }
}

By the way, I'm from China. I speak through translation software, so my expression is not very good. Please forgive me.Anyway,thank your for help!

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More