5 Replies Latest reply on May 21, 2008 3:29 AM by Fred Kalam

    code from developer guide

    Fred Kalam Newbie


      I'm trying without success to do a drag n drop very similar to the one presented in the developer's guide (small image onto a big picture):

      would it be possible to get the full code of the elements on figure 6.73


        • 1. Re: code from developer guide
          Ilya Shaikovsky Master

          may be just check out our livedemo sample? link in our wiki. You'll be able to play with full example code

          • 2. Re: code from developer guide
            Fred Kalam Newbie

            If you refer to the drag n drop example, it is showing how it works with a rich:panel (with a table inside).
            The developer's guide shows how to do it on a picture (using graphicImage i guess).
            I am not able to have my code dropping the item on the image and having it displayed (although my collection being updated correctly).

            • 3. Re: code from developer guide
              Ilya Shaikovsky Master

              please show us code snippets and loock through a4j:log in order to checl any client side update problem.

              • 4. Re: code from developer guide
                Fred Kalam Newbie

                Drag part (in a datatable)

                <a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
                <rich:dragSupport dragIndicator=":indicator"
                dragType="team" dragValue="#{fm}">
                <rich:dndParam name="label" value="#{fm.name}"/>
                <h:outputText value="#{fm.name}"></h:outputText>

                Drop part that works inside a datatable:

                <rich:dropSupport id="selectedPlayers" acceptedTypes="team"
                dropListener="#{playersInTeam.processDrop}" reRender="phptable, src">
                <h:dataTable id="phptables" columns="1" value="#{playersInTeam.players}" var="fm">
                <a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px"
                <h:outputText value="#{fm.name}"></h:outputText>

                Drop part that doesn't work on the image:

                <a4j:outputPanel layout="block" >
                <rich:dropSupport id="selectedPlayers2" acceptedTypes="team"
                dropListener="#{playersInTeam.processDrop}" reRender="phptable, src"
                value="#{playersInTeam.players}" var="fm">
                <h:graphicImage value="/img/field.gif" id="myPanem" />
                <h:outputText value="#{fm.name}"></h:outputText>

                • 5. Re: code from developer guide
                  Fred Kalam Newbie

                  Is it really possible to do it with current richFaces components or should I develop my own one?
                  Is there a work around using a background image in the "style" attribute of a4j:outputPanel?