Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RichFaces - listShuttle  RSS feed

 
Mylene Morato
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi everybody,

I'm trying to do a listShuttle. But when my code runs display just de component but both lists don't , inside de component and appear no errors.

I'd like a solution.

Below are my codes :





My Bean is :




Can anybody help me?
If someone has a little project with a example, it woud be great.
Thank you.

 
Jas Singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mylene,

Hope you must have sorted it by now. However I'm just posting the solution for future reference:

If you add the following code at lline 5 then it would list all the values from source list:


Hope it helps.

Cheers
JS
 
Sanjeevi Ms
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this way.....

XHTML Page:

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

<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>
</ui:composition>


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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!