9 Replies Latest reply: Feb 16, 2012 11:23 PM by sanjeevim RSS

List Shuttle Problem

P18Mar ch ;) Newbie

Hello illya Solve list shuttle problem

  • 2. Re: List Shuttle Problem
    Nick Belaevski Master

    Hi Pankaj,

     

    Can you please take a look: http://www.jboss.org/help/newforums/forumetiquette.html ?

  • 3. List Shuttle Problem
    P18Mar ch ;) Newbie

    thanks

  • 4. List Shuttle Problem
    P18Mar ch ;) Newbie

    But there is no any jsf /Xhtml file for listShuttle

    Please help me

  • 6. List Shuttle Problem
    P18Mar ch ;) Newbie

    Your solution not satisfied me.

    After applying hashcode and equal code in VO ,

    it give me errorr

    "Arraylist not writable"

  • 7. List Shuttle Problem
    P18Mar ch ;) Newbie

    http://livedemo.exadel.com/richfaces-demo/richfaces/listShuttle.jsf

    This link I have already got.

    But I think there is problem in my VO

  • 8. Re: List Shuttle Problem
    sanjeevim Newbie

    Hi All!

     

    Can u post the code for listshuttle with bean.class file..

    i don't have bean class file..

    can u tell me how to create a listshuffle in jsf ?

  • 9. Re: List Shuttle Problem
    sanjeevim Newbie

    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"><h:outputText

                                                                                                                                                                    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>

                                                                                                                                                                                                  <h:outputText 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