I didn't know that contrib.:FormTable is to be deprecated.
I use the contrib.:FormTable extensively. 

Anyone know why it needs to be deprecated and where do I find out what
other components are headed this way? 
Thanks.

-----Original Message-----
From: seloha . [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 23, 2005 9:12 AM
To: [email protected]
Subject: Tap 4.0 Tables

I am using the new contrib:Table since I believe contrib:FormTable is to
de 
deprecated.

I think I have a very stupid mistake somewhere. I am trying to update
some 
fields, when I get the list of table data objects they still have the
old 
information prior to submission. If I put an invalid entry the form
fails 
validation an has the new data redisplayed with an error message, this 
indicates something is working!

I am using beta-5 which was checked-out from the cvs about a week ago.

Some of the code:

.page:

  <property name="priceCalcData"/>

  <component id="priceCalcTable" type="contrib:Table">
    <binding name="source" value="ognl:priceCalcData"/>
    <binding name="convertor" value="ognl:priceCalcDataItemConvertor"/>
    <binding name="columns"
        value="literal:
            airport,
            areaPostcode,
            noOfPeople,
            !price,
            !exclusivePrice,
            !onewayPrice,
            !onewayExclusivePrice"/>
    <binding name="rowsClass" value="ognl:'priceCalcRowbgcolor' + 
beans.evenOdd.next"/>
    <binding name="pageSize" value="literal:20"/>
    <binding name="row" value="ognl:rowObj"/>
    <binding name="persist" value="literal:session"/>
  </component>

example of one of the columns to update:

  <component id="priceColumnValue" type="Block"/>
  <component id="editablePrice" type="TextField">
    <binding name="displayName" value="literal:Price"/>
    <binding name="value" 
value="ognl:components.priceCalcTable.tableRow.price"/>
    <binding name="translator" value="translator:number,pattern=#.##"/>
    <binding name="validators" value="validators:required,min=0"/>
    <binding name="id" value="ognl:'price' + rowId"/>
  </component>

template:

          <table class="priceCalcTable" jwcid="priceCalcTable">
            <tr jwcid="airportColumnValue">
              <td jwcid="displayAirport" class="priceCalcRowColor"/>
            </tr>
            <tr jwcid="areaPostcodeColumnValue">
              <td jwcid="displayAreaPostcode"/>
            </tr>
            <tr jwcid="noOfPeopleColumnValue">
              <td jwcid="displayNoOfPeople" class="priceCalcRowColor"/>
            </tr>
            <tr jwcid="priceColumnValue">
              <td jwcid="editablePrice" class="priceCalcRowColor" 
align="right" size="8"/>
            </tr>
            <tr jwcid="exclusivePriceColumnValue">
              <td jwcid="editableExclusivePrice"
class="priceCalcRowColor" 
align="right" size="8"/>
            </tr>
            <tr jwcid="onewayPriceColumnValue">
              <td jwcid="editableOnewayPrice" class="priceCalcRowColor" 
align="right" size="8"/>
            </tr>
            <tr jwcid="onewayExclusivePriceColumnValue">
              <td jwcid="editableOnewayExclusivePrice" 
class="priceCalcRowColor" align="right" size="8"/>
            </tr>
          </table>

java in the form listener:

                if (validationDelegate.getHasErrors()) {
                    return;
                }

                List priceCalcData = getPriceCalcData();

this last line retrieves the original values prior to submission.

I probably haven't provided enough code or detail but maybe someone
could 
point me in the right direction. It almost works (funny), method 
getPriceCalcData() is declared as:

    public abstract List getPriceCalcData();

As previously stated the validation returns the page with the entered 
incorrect value. It is almost like I am reading the value at the wrong
time, 
but there is only one listener on the form?

Any help appreciated,

Paul



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to