-
1. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 14, 2008 4:01 PM (in response to fmarwede)Perhaps anyone else tried that...?
-
2. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 15, 2008 11:40 AM (in response to fmarwede)Still waiting for an answer...
-
3. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 17, 2008 7:02 AM (in response to fmarwede)up!
-
4. Re: scrollableDataTable and multiple drag & drop
ilya_shaikovsky Feb 17, 2008 9:15 AM (in response to fmarwede)Right now I could give you simple example which used simple selection management to perform Drag and drop of several columns.
<rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="400px" width="700px" id="carList" rows="40" columnClasses="col" value="#{dataTableScrollerBean.allCars}" var="category" sortMode="single" selection="#{dataTableScrollerBean.selection}"> <rich:column id="make"> <f:facet name="header"><h:outputText styleClass="headerText" value="Make" /></f:facet> <a4j:outputPanel> <rich:dragSupport dragType="selectionDrag" dragIndicator=":indicator"/> <h:outputText value="#{category.make}" /> </a4j:outputPanel> </rich:column> <rich:column id="model"> <f:facet name="header"><h:outputText styleClass="headerText" value="Model" /></f:facet> <h:outputText value="#{category.model}" /> </rich:column> <rich:column id="price"> <f:facet name="header"><h:outputText styleClass="headerText" value="Price" /></f:facet> <h:outputText value="#{category.price}" /> </rich:column> <rich:column id="mileage"> <f:facet name="header"><h:outputText styleClass="headerText" value="Mileage" /></f:facet> <h:outputText value="#{category.mileage}" /> </rich:column> <rich:column width="200px" id="vin"> <f:facet name="header"><h:outputText styleClass="headerText" value="VIN" /></f:facet> <h:outputText value="#{category.vin}" /> </rich:column> <rich:column id="stock"> <f:facet name="header"><h:outputText styleClass="headerText" value="Stock" /></f:facet> <h:outputText value="#{category.stock}" /> </rich:column> </rich:scrollableDataTable> <rich:spacer height="20px"/> <rich:panel style="width:300px; height:300px"> <f:facet name="header"> <h:outputText value="Drop Here"/> </f:facet> <rich:dropSupport acceptedTypes="selectionDrag" dropListener="#{dataTableScrollerBean.dropListener}" reRender="table"/> <rich:dataTable value="#{dataTableScrollerBean.droppedCars}" var="sel" id="table"> <rich:column> <f:facet name="header"><h:outputText value="Make" /></f:facet> <h:outputText value="#{sel.make}" /> </rich:column> <rich:column id="model"> <f:facet name="header"><h:outputText value="Model" /></f:facet> <h:outputText value="#{sel.model}" /> </rich:column> <rich:column id="price"> <f:facet name="header"><h:outputText value="Price" /></f:facet> <h:outputText value="#{sel.price}" /> </rich:column> <rich:column id="mileage"> <f:facet name="header"><h:outputText value="Mileage" /></f:facet> <h:outputText value="#{sel.mileage}" /> </rich:column> <rich:column id="stock"> <f:facet name="header"><h:outputText value="Stock" /></f:facet> <h:outputText value="#{sel.stock}" /> </rich:column> </rich:dataTable> </rich:panel>
this is the page from demosite and uses beans from demosite.
One method addedpublic void dropListener(DropEvent event) { System.out.println("Drop Listener Fired"); getDroppedCars().clear(); Iterator<SimpleRowKey> item = getSelection().getKeys(); while (item.hasNext()){ SimpleRowKey key = item.next(); getDroppedCars().add(getAllCars().get(key.intValue())); } }
There I store the dropped selection..
Let me know if this example is't enough. -
5. Re: scrollableDataTable and multiple drag & drop
ilya_shaikovsky Feb 17, 2008 9:18 AM (in response to fmarwede)sorry.. I means several rows dragging certainly not the columns ;)
-
6. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 18, 2008 3:30 AM (in response to fmarwede)Thank you very much. But I have some more question:
How can I show in the dragIndicator that multiple rows are dragged?
There you have inconsistency in developer guide and demo: In the guide there you read that one can define a facet "multy" and in the demo you read about a facet "multiple". But nowhere is explained how to use it.
Thanks again for your help, I hope you can help me solve this issue too. -
7. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 19, 2008 5:10 AM (in response to fmarwede)up
-
8. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 19, 2008 11:40 AM (in response to fmarwede)Sorry but this is at least a bug in documentation.
-
9. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 20, 2008 11:54 AM (in response to fmarwede)The truth is out there...
-
10. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 21, 2008 2:05 PM (in response to fmarwede)Problem is still up to date.
-
11. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 26, 2008 2:10 AM (in response to fmarwede)New week, new try.
-
12. Re: scrollableDataTable and multiple drag & drop
fmarwede Feb 28, 2008 6:18 AM (in response to fmarwede)up
-
13. Re: scrollableDataTable and multiple drag & drop
fmarwede Mar 3, 2008 5:11 AM (in response to fmarwede)Please...
-
14. Re: scrollableDataTable and multiple drag & drop
maksimkaszynski Mar 3, 2008 11:40 AM (in response to fmarwede)Hmm. Looks like its type 3 :)
Problem is that drag indicator is entirely formed on client, and scrollable data table maintains its selection on server, so we need to
a) either perform round-trip to server to find out how many lines are selected
b) or maintain selection on client as well.