• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

ListShuttle in JSF 2.0

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI All,


I have done this "ListShuttle" component in JSF 2.0.

Try it..
The Sources are:

.xhtml



<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:c="http://java.sun.com/jstl/core">

<head>
<link href="../../css/main.css" rel="stylesheet" type="text/css" />
<style>
.pic {
margin-bottom: -4px;
margin-right: 2px;
}
</style>
</head>
<body class="contentBackground">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:c="http://java.sun.com/jstl/core">
<t:saveState value="#{collapsiblePanelBean}" />
<f:view>
<h:form id="createProposal">


<fieldset align="center">
<table width="100%">

<tr>
<td colspan="3"></td>
<td class="panelData" colspan="3"><rich:listShuttle
sourceValue="#{pedBean.lista1}" targetValue="#{pedBean.lista2}"
var="items" listsHeight="250" sourceListWidth="300"
targetListWidth="300" sourceCaptionLabel="List of PED"
targetCaptionLabel="Available PED">
<rich:column>
<h:outputText value="#{items}" />
</rich:column>
</rich:listShuttle></td>
</tr>


</table>
</h:form>
</f:view>
</ui:composition>
</body>
</html>

Bean:


package com.starhealth.common;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean(name = "pedBean")
@RequestScoped
public class PedBean {

private List<String> lista1;
private List<String> lista2;

/**
* Default Constructor
*/
public PedBean() {

lista1 = new ArrayList<String>();
lista2 = new ArrayList<String>();

lista1.add("Ischaemic Heart Disease");
lista1.add("Hypertension");
lista2.add("Diabetes Mellitus");
lista2.add("Eye Disorder");

}

public List<String> getLista1() {
return lista1;
}

public void setLista1(List<String> lista1) {
this.lista1 = lista1;
}

public List<String> getLista2() {
return lista2;
}

public void setLista2(List<String> lista2) {
this.lista2 = lista2;
}
}

Regards,

Sanjeevi M,

Senior Software Developer
 
Water proof donuts! Eat them while reading this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic