• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create a richshuttle in JSF  RSS feed

 
Sanjeevi Ms
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!,

I tried this following link to create a "listShuttle" in JSF,but result not yet get.

http://livedemo.exadel.com/richfaces-demo/richfaces/listShuttle.jsf?c=listShuttle&tab=usage

and

http://passionbytes.com:8080/passionbytes/richfaces/listShuttle.jsf;jsessionid=79DEC6EFA4C04C6241ABACB127C60600

Can anyone post me the source code with"web.xml,faces-config.xml, .java , .jsp and the lib" files
..

Thanks in Advance,

Sanjeevi M
 
Sanjeevi Ms
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,


I have done the "ListShuttle" Components.I have aatached the source codes.



.XHTML FILE


<?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">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="95%" border="0" cellspacing="0" cellpadding="0"
align="center">
<tr>
<td width="98%" align="left"><t:collapsiblePanel
id="pedDetails" value="false" title="testTitle"
var="test2collapsed">
<f:facet name="header">
<t:div styleClass="panelSection">
<table>
<tr>
<td class="panelTitle"><hutputText
value="PED Details" /></td>
<td class="panelImage"><t:headerLink immediate="true">
<h:graphicImage value="../../images/downarrow.gif"
alt="" rendered="#{test2collapsed}" />
<h:graphicImage value="../../images/uparrow.GIF"
alt="plusImage" rendered="#{!test2collapsed}" />
</t:headerLink></td>
</tr>
</table>
</t:div>
</f:facet>
<table border="0" width="100%" id="table2" cellspacing="1"
cellpadding="3" bordercolor="#ffffff"
style="border-collapse: collapse">
<tr>
<td>
<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>
<hutputText value="#{items}" />
</rich:column>
</rich:listShuttle></td>
</tr>



</table>
</fieldset>
</td>
</tr>
</table>
</t:collapsiblePanel></td>
</tr>
</table>
</td>
</tr>
</table>
</h:form>
</f:view>
</ui:composition>
</body>
</html>

.JAVA FILE


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;
}
}

FACES-CONFIG.XML

<managed-bean>


<managed-bean-name>pedBean</managed-bean-name>


<managed-bean-class>com.starhealth.common.PedBean</managed-bean-class>


<managed-bean-scope>request</managed-bean-scope>


</managed-bean>

Happy Coding...

Regards,

Sanjeevi M

Senior Software Developer

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!