HTML and CSS Reference
In-Depth Information
<h:dataTable id="germanyPlaces" columns="1"
value="#{rightCountry.germanyPlaces}"
var="place" footerClass="footerClass">
<h:column>
<h:outputText value="#{place.name}"></h:outputText>
</h:column>
</h:dataTable>
</rich:panel>
<rich:panel styleClass="dropTargetPanel">
<f:facet name="header">
<h:outputText value="Brazil" />
</f:facet>
<rich:dropTarget acceptedTypes="Brazil" dropValue="Brazil"
dropListener="#{rightCountry.processDrop}"
render="places, egyptPlaces, germanyPlaces, brazilPlaces"/>
<h:dataTable id="brazilPlaces" columns="1"
value="#{rightCountry.brazilPlaces}"
var="place" footerClass="footerClass">
<h:column>
<h:outputText value="#{place.name}"></h:outputText>
</h:column>
</h:dataTable>
</rich:panel>
</h:panelGrid>
<rich:notifyMessages stayTime="2000" nonblocking="true" />
</h:form>
</h:body>
</html>
RightCountry managed bean contains the four lists which are binded with the drag source and the four drop
targets. Listing 9-14 shows the complete RightCountry managed bean code.
Listing 9-14. RightCountry Managed Bean
package com.jsfprohtml5.rightcountry.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.richfaces.event.DropEvent;
public class RightCountry implements Serializable {
private List<Place> places;
private List<Place> egyptPlaces;
private List<Place> germanyPlaces;
private List<Place> brazilPlaces;
 
Search WWH ::




Custom Search