• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

RichFaces - listShuttle

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
<h:outputText 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
 
He's my best friend. Not yours. Mine. You can have this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic