Thanks for the tip.

Here's one more that is hopefully as easy.  I've switched to building
the ITableColumn[] dynamically through a method on my page class.  I'm
following the same pattern as the SimpleTableXXX classes, but I seem
to be missing something.  I now have proper sorting, naming, and form
submission when re-sorting the columns, but any attempts to use Blocks
to change the table values seems to be ignored.

Do I need to do something special in the ITableColumns to allow them
to be blocked?  Here's an example of how I'm building a column:

    private ITableColumn createColumn(String id, String displayName, 
            String expression) {

        SimpleTableColumn column = new SimpleTableColumn(id, displayName,
                new OgnlTableColumnEvaluator(expression), true);
        
        
column.setColumnRendererSource(SimpleTableColumn.FORM_COLUMN_RENDERER_SOURCE);
        
        return column;
    }

I'd like to be able to intercept these columns using something like
the following:

    <component id="lastPerfReview" type="TextField">
        <static-binding name="displayName">Last Perf Review</static-binding>
        <binding name="value"
expression="components.tableRows.tableRow.lastPerfReviewDate"/>
    </component>


then in the html as...

                    <span jwcid="scrolledTableRows">
                        <span jwcid="[EMAIL PROTECTED]">
                                        <span jwcid="lastPerfReview"/>
`                       </span>
                        <span jwcid="[EMAIL PROTECTED]:TableValues"/>
                    </span>

As long as I'm specifying the columns using a String in the component
spec, the Blocks occur just fine.  If I switch to building my own
instances of SimpleTableColumn, they do not.

Any idea what I'm doing wrong?

Regards,
-tim

On 5/2/05, Mind Bridge <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> That behaviour actually comes from column headers. They are provided from
> the columns themselves, and TableColumns simply enumerates the columns and
> renders their headers. You may have more than one TableColumns as a result
> if you wish.
> 
> I have to check the example, but as far as I remember, in it the columns
> were defined using a String.
> 
> Simply place '*' in front of that column definition string in TableView, and
> the column headers will automatically start submitting the form.
> 
> If you are interested in the code, placing the asterix in front causes the
> following to be invoked on the generated columns:
> 
> objColumn.setColumnRendererSource(SimpleTableColumn.FORM_COLUMN_RENDERER_SOU
> RCE);
> 
> Hope that helps...
> 
> -mb
> 
> ----- Original Message -----
> From: "Tim Downey" <[EMAIL PROTECTED]>
> To: "Tapestry users" <[email protected]>
> Sent: Monday, May 02, 2005 7:49 PM
> Subject: How to preserve form submit with custom TableColumns
> 
> Hi,
> 
> I'm working through the Tapestry Tables examples from John Reynolds
> and am stumped on how to preserve the FormTable semantics when
> overriding the TableColumns in a TableView component.
> 
> When the table is a FormTable, clicks on the column headers will use
> javascript to submit the form prior to sorting.  This behavior is
> necessary for a form table.  I'd like to override the
> TableColumns component, but preserve this submit behavior, but don't
> quite see how.
> 
> Here's the example:
> 
>    <table class="mytable" jwcid="tableView">
>   <span jwcid="tableColumns"/>
>   <span jwcid="tableRows">
>           <span jwcid="[EMAIL PROTECTED]">
>              <span jwcid="editableBirthDate"/>
>           </span>
>           <span jwcid="[EMAIL PROTECTED]">
>              <span jwcid="editableWeight"/>
>           </span>
>       <span jwcid="[EMAIL PROTECTED]:TableValues"/>
>       </span>
>       <tr>
>          <td colspan="7" class="tablepager">
>             <span jwcid="[EMAIL PROTECTED]:TableFormPages"/>
>          </td>
>       </tr>
>       </table>
> 
> where tableColumns is defined as:
> 
>     <component id="tableColumns" type="contrib:TableColumns">
>         <static-binding name="class" value="columnheader"/>
>     </component>
> 
> How do I specify tableColumns such that it will still perform the form
> submit javascript for me?  I didn't see anything like
> contrib:TableFormColumns.  Am I missing something?
> 
> Regards,
> -tim
> 
> ---------------------------------------------------------------------
> 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