views:

239

answers:

0

I am just trying to make a simple web page using drag drop of primefaces but it's not working, i mean it's behaving strangely. I have two outputpanel side by side with droppable each containing one graphic image with draggable. Problem is :-

While dragging and dropping i want the photo should be laid side by side in outputpanel if it already contains a photo. But in this case even if the output panel contains 1 photo and if i drag another photo onto it, the photo does not lay side by side but instead it lays on top of 1st photo as if i have set's z-index property(so i can see only 1 photo on webpage). Is this a bug or what? or am i doing something wrong?What should i do to show them side by side?

This is my code. Please let me know if i am doing something wrong.

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"&gt;
    <h:head>
        <title>Facelet Title</title>
        <p:resources/>
    </h:head>
    <h:body>
        <h:form>
            <p:outputPanel style="width: 400px;height: 600px;display: inline-block">
                <p:droppable/>
                <p:graphicImage value="roger.jpg">
                    <p:draggable/>
                </p:graphicImage>
            </p:outputPanel>

            <p:outputPanel style="width: 300px;height: 600px;">
                <p:droppable/>
                <p:graphicImage value="roger.jpg">
                    <p:draggable/>
                </p:graphicImage>
            </p:outputPanel>
        </h:form>
    </h:body>
</html>