myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mohamed Boujabed" <mohamed.bouja...@esribelux.com>
Subject DataTable Problem : Urgent
Date Wed, 25 Jan 2006 10:47:07 GMT
Hi,

 

I want use de t:Datatable but I have a problem:

In my DataTable , I want have sometimes a InputText en sometimes a
SelectOneMenu.

But there a problem : In my function getColumnValue,if I debug : it
traverses the function on a line whereas this one had traversed, you can see
in attachment what I receive.

 

        <t:dataTable id="data" styleClass="standardTable"

            headerClass="standardTable_Header"

            footerClass="standardTable_Header"

            rowClasses="standardTable_Row1,standardTable_Row2"

            columnClasses="standardTable_Column" var="country"
value="#{crossDataTableBis.countryDataModel}" preserveDataModel="false">

            <h:column>

                <f:facet name="header">

                    <h:outputText
value="#{example_messages['label_country_name']}" />

                </f:facet>

                <h:outputText value="#{country.id}" />

            </h:column>

 

            <t:columns value="#{crossDataTableBis.columnDataModel}"
var="column">

                <f:facet name="header">

                    <h:panelGroup>

                        <h:outputText value="#{column} " />

                        <h:commandLink
action="#{crossDataTableBis.removeColumn}">

                            <h:outputText value="-"
title="#{example_messages['crosstable_remove_column']}" />

                        </h:commandLink>

                    </h:panelGroup>

                </f:facet>

                <h:inputText rendered="#{!crossDataTableBis.editValues}"
value="#{crossDataTableBis.columnValue}" />

                 <h:selectOneMenu rendered="#{crossDataTableBis.editValues}"
value="#{crossDataTableBis.indexTest}">

                    <f:selectItems
value="#{crossDataTableBis.columnValue}"/>

                </h:selectOneMenu>

 

            </t:columns>

 

        </t:dataTable>

 

  public Object getColumnValue()

    {

        DataModel countryDataModel = getCountryDataModel();

        if(countryDataModel.isRowAvailable())

        {

            Personne row = (Personne)countryDataModel.getRowData();

            DataModel columnDataModel = getColumnDataModel();

            if(columnDataModel.isRowAvailable())

            {

                Object column = columnDataModel.getRowData();

                Object key = new RowColumnKey(new Long(row.getId()),
column);

                if(!mValueMap.containsKey(key))

                {

                    String randomValue="";

                    if(column.toString().compareTo("Nom")==0){

                        saveValues();

                        randomValue = row.getNom();

                        mValueMap.put(key, randomValue);

                        return mValueMap.get(key);

                        

                    }

                    if(column.toString().compareTo("List")==0){

  editValues();

                          valueList = row.getPermis();

                          mValueMap.put(key, valueList);   

                          return (List)mValueMap.get(key);

                    }

                }else{

                    return mValueMap.get(key);

                }

                

            }

        }

        return null;        

    }

 

    public boolean isEditValues()

    {

        return mEditValues;

    }

 

    public String editValues()

    {

        mEditValues = true;

        return null;

    }

 

    public String saveValues()

    {

        mEditValues = false;

        return null;

    }

public DataModel getColumnDataModel()

    {

        if(mColumns == null)

        {

            String result[] = {"Nom","List"};

            

            mColumns = new ListDataModel(new
ArrayList(Arrays.asList(result)));

        }

        return mColumns;

    }

 

Thank you for your future answer.

 

Mohamed.

 

GIS programmer - ESRI BeLux
Nervierslaan 54
B-1780 WEMMEL
tel +32 (0)2 460 74 80
fax +32 (0)2 460 45 39
mohamed.boujabed@esribelux.com
Visit our website :  <http://www.esribelux.com/> www.esribelux.com

In case this message should contain prices, they only become valid after
confirmation by letter.
The content of this message does not commit ESRI BeLux in any way and
remains therefore only informal until confirmation by letter.

 


Mime
View raw message