It's pretty easy to do :)
This example is a little out of context, but the columns="" statement
is evaluated by ognl, so I believe you can just call whatever method
you need to to format things...Like the startTime value below could
probably be replaced by a method call to your page to some
"formatFoo(Date value)" method via "!start:Start
Time:formatFoo(startTime)".
<fieldset>
<legend><span class="" jwcid="@Insert"
value="message:title.current.cases"/></legend>
<label>
<table jwcid="[EMAIL PROTECTED]:TableView" cellspacing="0"
class="searchTable"
source="ognl:cases"
columns="!name:Patient Name:caseName, !start:Start
Time:startTime, !active:Locked:locked(), !location:Location:location,
!region:Region:region" element="table">
<tr>
<span jwcid="tableColumns"/>
</tr>
<tr jwcid="[EMAIL PROTECTED]:TableRows" class="ognl:beans.evenOdd.next">
<td jwcid="[EMAIL PROTECTED]:TableValues"/>
</tr>
</table>
</label>
</fieldset>
You can also define the column model via code this way:
/**
* Get the column model for the search page.
* @return Column model
*/
public ITableColumnModel getColumnModel() {
try {
String[] colList = { "patient.name", "Name", "patient.name", "true",
"startTime", "Start", "startTime", "true",
"endTime", "End", "endTime", "true" };
ExpressionTableColumnModel colModel =
new ExpressionTableColumnModel(colList,
getExpressionEvaluator());
return colModel;
} catch (Throwable t) {
log.error("error", t);
return null;
}
}
Which may make it easier to see how these things get used.
jesse
On 11/22/05, Christian Mittendorf <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I've using a plain Table component from the contrib lib and I'd like
> to for format the date values of one column. How can I accomplish
> that? Does anybody have a nice example ready?
>
> Christian
>
> ---------------------------------------------------------------------
> 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]