You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lindsay Steele <ls...@iinet.net.au> on 2004/09/20 23:33:47 UTC

Column sorting in contrib:Table

Hi,
   I am having some minor hassles with the column sorting in the table.

 The problem is I have a duration field, this is an int for the number
of 
 seconds. I display from another method that shows the value formatted
in 
 minutes and seconds.

 I have looked for solutions in the archives and have come up with the
use of the
 an ExpressionTableColumn.   I am trying to have one of these returned
in the data
 object passed to the table - this is not working and I am unsure if I
am doing it correctly.

 Does anyone have any code examples or ideas on how I might implement
column sorting
 in the table ??
 
		<binding name="columns">
            '!select:select:select,' +
            'extensionNo:Extns:extensionNo,' +
            'username:Username:username,' +
      	'date:Date:dateFormatted,' +
            'time:Time:timeFormatted,' +
            'duration:Duration:durationFormatted,' +
            'numberCalled:Number Called:numberCalled,' +
		'pabxLocation:Location:pabxLocation,' +
		'departmentId:Department:department' 
	  	</binding>  

 Thanks,

        Lindsay



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Column sorting in contrib:Table

Posted by Jamie Orchard-Hays <ja...@dang.com>.
You're very welcome! Table is one of the most complicated components in the
framework, but very great once you get it.

Jamie


----- Original Message ----- 
From: "Lindsay Steele" <ls...@iinet.net.au>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Tuesday, September 21, 2004 6:13 PM
Subject: RE: Column sorting in contrib:Table


> Hey Jamie,
>             It WORKS !!!  It is displaying the formatted duration
> correctly and sorting
>  on the underlying int value.
>
>  I am using this line:
>
>    <binding name="value"
> expression="components.table.tableRow.durationFormatted"/>
>
>  Simple in the end like you said.
>
>  Thanks heaps again for all your help.
>
>  Lindsay
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 11:47 PM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> If it's displaying values and they're not from callReport, where are
> they coming from? table.currentRow.fooValue accesses a value from
> callReport cuz you passed that in.
>
> I've never used ExpressionTableColumn separately. Maybe someone else
> can help you with that. Or, just dig into the code and see how it's put
> together.
>
> Jamie
>
> On Sep 21, 2004, at 8:56 AM, Lindsay Steele wrote:
>
> > Hi Jamie,
> >          I like the formal style too - neater.  I mixed them up
> > because I had tried to get
> >  the select column going the formal way and had dramas.   I will use
> > the
> > examples you gave
> >  me to try and get it right this time.
> >
> >  It is now displaying values in the column ... But I can't get it to
> > display values from  the callReport object that is passed to the table
>
> > - which would solve my problem.
> >
> >  In the end .. When I have submitted this project I am told I am
> > allowed
> > to open source it,
> >  so it might be able to be an example that others can use (most likely
>
> > a
> > poor one .. But oh well)
> >
> >  I will play with it again tommorrow.
> >
> >  I am still curious about the ExpressionTableColumn, being able to
> > create that in code and pass it  back may simplify things.
> >
> >  Thanks heaps for your help.
> >
> >   Lindsay
> >
> > -----Original Message-----
> > From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> > Sent: Tuesday, 21 September 2004 2:56 PM
> > To: Tapestry users
> > Subject: Re: Column sorting in contrib:Table
> >
> >
> > OK, I see some problems.
> >
> > First, style. either use the informal or the formal style, but I
> > wouldn't mix them. Especially when learning. I like the formal style
> > (defining the components in the .page style). You've used formal for
> > the stuff we've been talking about up to now:
> >   <component id="DurationColumnValue" type="Block"/>
> >        <component id="formattedDuration" type="Insert">
> >        <binding name="value"
> > expression="table.currentRow.numberCalled"/>
> >      </component>
> >
> > Your problem is that you never reference "DurationColumnValue" or
> > "formattedDuration" in your HTML template!
> >
> >    <table align="center" width="99%" jwcid="table">
> >
> > <!-- YOU NEED THIS -->
> > <span jwcid="DurationColumnValue">
> > <span jwcid="formattedDuration"/>
> > </span>
> >
> > <!-- I'd make these formal and then reference them as above -->
> >        <span jwcid="selectColumnHeader@Block">Details</span>
> >        <span jwcid="selectColumnValue@Block">
> >        <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
> > parameters="ognl:components.table.tableRow.extensionNo">
> > select</a>
> >       </span>
> >    </table>
> >
> >
> >
> > Jamie
> > On Sep 21, 2004, at 12:31 AM, Lindsay Steele wrote:
> >
> >>
> >>  callReport is a list of "CallReport" objects passed to the table.
> >> The individual objects  do have a getNumberCalled() method.
> >>
> >>      public String getNumberCalled() {
> >>         return numberCalled;
> >>     }
> >>
> >>   That is why I was trying to pass it any kind of value - just to see
>
> >> if it was the value
> >>   displayed or the fact it would not go into the table.
> >>
> >>   This is the table code from HTML
> >>
> >>   <table align="center" width="99%" jwcid="table">
> >>       <span jwcid="selectColumnHeader@Block">Details</span>
> >>       <span jwcid="selectColumnValue@Block">
> >>       <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
> >> parameters="ognl:components.table.tableRow.extensionNo">
> >> select</a>
> >>      </span>
> >>   </table>
> >>
> >>
> >>
> >>
> >>
> >> -----Original Message-----
> >> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> >> Sent: Tuesday, 21 September 2004 1:16 PM
> >> To: Tapestry users
> >> Subject: Re: Column sorting in contrib:Table
> >>
> >>
> >> So, callReport has a public method "getNumberCalled()" right?
> >>
> >> Also, you're missing the comma after "select:select:select"
> >>
> >> Show me how you render the table in your HTML file.
> >>
> >> Jamie
> >> On Sep 20, 2004, at 10:42 PM, Lindsay Steele wrote:
> >>
> >>> Sorry to be a pain ....
> >>>
> >>>  Now I get the linkage, silly mistake there .. But it gives me a
> >>> blank
> >>
> >>> value.
> >>>
> >>>  I have tried lots of things to try and get the value.  It is
> >>> currently  looking like the following and in the column there is no
> >>> value shown.
> >>>
> >>>  I have tried lots and lots of different settings but nothing works.
> >>>
> >>>  I even got desperate and did something like:
> >>>
> >>>       <binding name="value" expression="'hello'"/>
> >>>
> >>>  Currently using ....
> >>>
> >>>
> >>>    <component id="table" type="contrib:Table">
> >>> <binding name="source" expression="callReport"/>
> >>> <static-binding name="columns">
> >>>               select:select:select
> >>>               extensionNo:Extns:extensionNo,
> >>>               username:Username:username,
> >>>   date:Date:dateFormatted,
> >>>               time:Time:timeFormatted,
> >>>               Duration:duration,
> >>>               numberCalled:Number Called:numberCalled,
> >>>   pabxLocation:Location:pabxLocation,
> >>>   departmentId:Department:department
> >>>   </static-binding>
> >>>         <binding name="pageSize" expression="500"/>
> >>>         <binding name="pagesDisplayed" expression="25"/>
> >>>         <binding name="rowClass" expression="next"/>
> >>>    </component>
> >>>
> >>>     <component id="DurationColumnValue" type="Block"/>
> >>>     <component id="formattedDuration" type="Insert">
> >>>       <binding name="value"
> >>> expression="table.currentRow.numberCalled"/>
> >>>     </component>
> >>>
> >>>  Thanks,
> >>>
> >>>         Lindsay
> >>>
> >>>
> >>>
> >>> -----Original Message-----
> >>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> >>> Sent: Tuesday, 21 September 2004 11:23 AM
> >>> To: Tapestry users
> >>> Subject: Re: Column sorting in contrib:Table
> >>>
> >>>
> >>> If you cut and paste this, then it is a spelling problem:
> >>>
> >>> "Duration" vs "durationColumnValue"
> >>>
> >>> The first is capitalized and the second isn't!
> >>>
> >>> Also, just for readability, if you use <static-binding> you won't
> >>> need
> >>
> >>> those single quotes and plus signs.
> >>>
> >>> Jamie
> >>>
> >>> On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:
> >>>
> >>>> I am sure I am missing something here ...
> >>>>
> >>>>  It is basically just ignoring the second block of code.  I also
> >>>> can't
> >>>
> >>>> really see the tie in between  the two.
> >>>>
> >>>> I have the following
> >>>>
> >>>>    <component id="table" type="contrib:Table">
> >>>> <binding name="source" expression="callReport"/>
> >>>> <binding name="columns">
> >>>>             '!select:select:select,' +
> >>>>             'extensionNo:Extns:extensionNo,' +
> >>>>             'username:Username:username,' +
> >>>> 'date:Date:dateFormatted,' +
> >>>>             'time:Time:timeFormatted,' +
> >>>>             'Duration:duration,' +
> >>>>             'numberCalled:Number Called:numberCalled,' +
> >>>> 'pabxLocation:Location:pabxLocation,' +
> >>>> 'departmentId:Department:department'
> >>>>   </binding>
> >>>>         <binding name="pageSize" expression="500"/>
> >>>>         <binding name="pagesDisplayed" expression="25"/>
> >>>>         <binding name="rowClass" expression="next"/>
> >>>>    </component>
> >>>>
> >>>>     <component id="durationColumnValue" type="Block"/>
> >>>>     <component id="formattedDuration" type="Insert">
> >>>>       <binding name="value" expression="table.currentRow.time"/>
> >>>>     </component>
> >>>>
> >>>>
> >>>>  Of course I am use the time as a value .. But this is just for a
> >>>> test. I have tried
> >>>>
> >>>>  <binding name="value"
> >>>> expression="table.currentRow.formattedDuration"/>
> >>>>
> >>>>  and even silly things that I know will return a value.   Nothing
> is
> >>>> ever seen in the table.
> >>>>
> >>>>   Any ideas ?
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> -----Original Message-----
> >>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> >>>> Sent: Tuesday, 21 September 2004 9:13 AM
> >>>> To: Tapestry users
> >>>> Subject: Re: Column sorting in contrib:Table
> >>>>
> >>>>
> >>>> You could insert any value you want into that blocked code. It
> >>>> doesn't
> >>>
> >>>> have to come from the jobOpsResultsTable even.
> >>>>
> >>>> Or, it could be a value combined from different properties of the
> >>>> row:
> >>>>
> >>>> <component id="formattedDuration" type="Insert">
> >>>>          <binding name="value
> >>>> expression="jobOpsResultsTable.currentRow.someValue+ ' ' +
> >>>> jobOpsResultsTable.someOtherValue"/>
> >>>>      </component>
> >>>>
> >>>>
> >>>>
> >>>> ----- Original Message -----
> >>>> From: "Lindsay Steele" <ls...@iinet.net.au>
> >>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> >>>> Sent: Monday, September 20, 2004 7:00 PM
> >>>> Subject: RE: Column sorting in contrib:Table
> >>>>
> >>>>
> >>>>> Hi Jamie,
> >>>>>          That is close - and as you say it is a very simple way of
>
> >>>>> doing things.
> >>>>>
> >>>>>   I am close to getting it running - the only problem is that I am
>
> >>>>> sorting on a  value that is quite different (munged) to the
> >>>>> displayed
> >>>
> >>>>> valued.  You are showing  a value that is a date and using the
> >>>>> date
> >
> >>>>> format.
> >>>>>
> >>>>>  Is there a way to just insert the value from elsewhere ?? .. Or
> >>>>> should I maybe convert  the int I have to a date and use a date
> >>>>> format
> >>>>
> >>>>> on that.
> >>>>>
> >>>>>   Thanks,
> >>>>>
> >>>>>         Lindsay
> >>>>>
> >>>>>
> >>>>> -----Original Message-----
> >>>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> >>>>> Sent: Tuesday, 21 September 2004 7:59 AM
> >>>>> To: Tapestry users
> >>>>> Subject: Re: Column sorting in contrib:Table
> >>>>>
> >>>>>
> >>>>> I think you're over-complicating this.
> >>>>>
> >>>>> Here's an example:
> >>>>>
> >>>>> <component id="jobOpsResultsTable" type="Table">
> >>>>>         <binding name="data" expression="job"/>
> >>>>>         <static-binding name="columns" value="!jobTitle:jobTitle,
> >>>>>                                               company
> >>>>>                                               duration:duration,
> >>>>>                                               resumeDueDate,
> >>>>>
> >>> opportunityExpiryDate"/>
> >>>>>     </component>
> >>>>>
> >>>>>
> >>>>>   <component id="durationColumnValue" type="Block"/>
> >>>>>     <component id="formattedDuration" type="Insert">
> >>>>>         <binding name="value"
> >>>>> expression="jobOpsResultsTable.currentRow.duration"/>
> >>>>>          <binding name="format"
> >>>>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
> >>>>>     </component>
> >>>>>
> >>>>> the first "duration" in the Table is the label for the top of the
> >>>>> column, the "duration" after the colon tells the Table what
> >>>>> property
> >>
> >>>>> to sort on. If it's left out and you have a block then it won't
> >>>>> sort.
> >>>
> >>>>> With it there, it will sort on that value even though the column
> >>>>> value
> >>>>
> >>>>> is intercepted by the block.
> >>>>>
> >>>>> Hope this helps,
> >>>>> Jamie
> >>>>>
> >>>>>
> >>>>> ----- Original Message -----
> >>>>> From: "Lindsay Steele" <ls...@iinet.net.au>
> >>>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> >>>>> Sent: Monday, September 20, 2004 5:33 PM
> >>>>> Subject: Column sorting in contrib:Table
> >>>>>
> >>>>>
> >>>>>> Hi,
> >>>>>>    I am having some minor hassles with the column sorting in the
> >>>>>> table.
> >>>>>>
> >>>>>>  The problem is I have a duration field, this is an int for the
> >>>>>> number
> >>>>>
> >>>>>> of  seconds. I display from another method that shows the value
> >>>>>> formatted in  minutes and seconds.
> >>>>>>
> >>>>>>  I have looked for solutions in the archives and have come up
> >>>>>> with
> >
> >>>>>> the
> >>>>>
> >>>>>> use of the
> >>>>>>  an ExpressionTableColumn.   I am trying to have one of these
> >>>> returned
> >>>>>> in the data
> >>>>>>  object passed to the table - this is not working and I am unsure
>
> >>>>>> if
> >>>>
> >>>>>> I
> >>>>>
> >>>>>> am doing it correctly.
> >>>>>>
> >>>>>>  Does anyone have any code examples or ideas on how I might
> >>>>>> implement column sorting  in the table ??
> >>>>>>
> >>>>>> <binding name="columns">
> >>>>>>             '!select:select:select,' +
> >>>>>>             'extensionNo:Extns:extensionNo,' +
> >>>>>>             'username:Username:username,' +
> >>>>>>       'date:Date:dateFormatted,' +
> >>>>>>             'time:Time:timeFormatted,' +
> >>>>>>             'duration:Duration:durationFormatted,' +
> >>>>>>             'numberCalled:Number Called:numberCalled,' +
> >>>>>> 'pabxLocation:Location:pabxLocation,' +
> >>>>>> 'departmentId:Department:department'
> >>>>>>   </binding>
> >>>>>>
> >>>>>>  Thanks,
> >>>>>>
> >>>>>>         Lindsay
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> -----------------------------------------------------------------
> >>>>>> -
> >>>>>> -
> >>>>>> -
> >>>>>> -
> >>>>>> To unsubscribe, e-mail:
> >> tapestry-user-unsubscribe@jakarta.apache.org
> >>>>>> For additional commands, e-mail:
> >>>> tapestry-user-help@jakarta.apache.org
> >>>>>>
> >>>>>
> >>>>>
> >>>>> ------------------------------------------------------------------
> >>>>> -
> >>>>> -
> >>>>> -
> >>>>> To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> >>>>> For additional commands, e-mail:
> >>>>> tapestry-user-help@jakarta.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> ------------------------------------------------------------------
> >>>>> -
> >>>>> -
> >>>>> -
> >>>>> To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> >>>>> For additional commands, e-mail:
> >>>>> tapestry-user-help@jakarta.apache.org
> >>>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> -
> >>>> -
> >>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail:
> >>>> tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------------------
> >>>> -
> >>>> -
> >>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail:
> >>>> tapestry-user-help@jakarta.apache.org
> >>>>
> >>>
> >>>
> >>> --------------------------------------------------------------------
> >>> -
> >>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
> >>> tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>> --------------------------------------------------------------------
> >>> -
> >>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
> >>> tapestry-user-help@jakarta.apache.org
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> tapestry-user-help@jakarta.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Column sorting in contrib:Table

Posted by Lindsay Steele <ls...@iinet.net.au>.
Hey Jamie,
            It WORKS !!!  It is displaying the formatted duration
correctly and sorting 
 on the underlying int value.

 I am using this line:

   <binding name="value"
expression="components.table.tableRow.durationFormatted"/>

 Simple in the end like you said.

 Thanks heaps again for all your help.

 Lindsay

-----Original Message-----
From: Jamie Orchard-Hays [mailto:jamie@dang.com] 
Sent: Tuesday, 21 September 2004 11:47 PM
To: Tapestry users
Subject: Re: Column sorting in contrib:Table


If it's displaying values and they're not from callReport, where are 
they coming from? table.currentRow.fooValue accesses a value from 
callReport cuz you passed that in.

I've never used ExpressionTableColumn separately. Maybe someone else 
can help you with that. Or, just dig into the code and see how it's put 
together.

Jamie

On Sep 21, 2004, at 8:56 AM, Lindsay Steele wrote:

> Hi Jamie,
>          I like the formal style too - neater.  I mixed them up 
> because I had tried to get
>  the select column going the formal way and had dramas.   I will use 
> the
> examples you gave
>  me to try and get it right this time.
>
>  It is now displaying values in the column ... But I can't get it to 
> display values from  the callReport object that is passed to the table

> - which would solve my problem.
>
>  In the end .. When I have submitted this project I am told I am
> allowed
> to open source it,
>  so it might be able to be an example that others can use (most likely

> a
> poor one .. But oh well)
>
>  I will play with it again tommorrow.
>
>  I am still curious about the ExpressionTableColumn, being able to 
> create that in code and pass it  back may simplify things.
>
>  Thanks heaps for your help.
>
>   Lindsay
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 2:56 PM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> OK, I see some problems.
>
> First, style. either use the informal or the formal style, but I 
> wouldn't mix them. Especially when learning. I like the formal style 
> (defining the components in the .page style). You've used formal for 
> the stuff we've been talking about up to now:
>   <component id="DurationColumnValue" type="Block"/>
>        <component id="formattedDuration" type="Insert">
>        <binding name="value" 
> expression="table.currentRow.numberCalled"/>
>      </component>
>
> Your problem is that you never reference "DurationColumnValue" or 
> "formattedDuration" in your HTML template!
>
>    <table align="center" width="99%" jwcid="table">
> 	
> 	<!-- YOU NEED THIS -->
> 	<span jwcid="DurationColumnValue">
> 		<span jwcid="formattedDuration"/>
> 	</span>
>
> 	<!-- I'd make these formal and then reference them as above -->
>        <span jwcid="selectColumnHeader@Block">Details</span>
>        <span jwcid="selectColumnValue@Block">
>        <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
> parameters="ognl:components.table.tableRow.extensionNo">
> select</a>
>       </span>
>    </table>
>
>
>
> Jamie
> On Sep 21, 2004, at 12:31 AM, Lindsay Steele wrote:
>
>>
>>  callReport is a list of "CallReport" objects passed to the table. 
>> The individual objects  do have a getNumberCalled() method.
>>
>>      public String getNumberCalled() {
>>         return numberCalled;
>>     }
>>
>>   That is why I was trying to pass it any kind of value - just to see

>> if it was the value
>>   displayed or the fact it would not go into the table.
>>
>>   This is the table code from HTML
>>
>>   <table align="center" width="99%" jwcid="table">
>>       <span jwcid="selectColumnHeader@Block">Details</span>
>>       <span jwcid="selectColumnValue@Block">
>>       <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
>> parameters="ognl:components.table.tableRow.extensionNo">
>> select</a>
>>      </span>
>>   </table>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 1:16 PM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> So, callReport has a public method "getNumberCalled()" right?
>>
>> Also, you're missing the comma after "select:select:select"
>>
>> Show me how you render the table in your HTML file.
>>
>> Jamie
>> On Sep 20, 2004, at 10:42 PM, Lindsay Steele wrote:
>>
>>> Sorry to be a pain ....
>>>
>>>  Now I get the linkage, silly mistake there .. But it gives me a 
>>> blank
>>
>>> value.
>>>
>>>  I have tried lots of things to try and get the value.  It is 
>>> currently  looking like the following and in the column there is no 
>>> value shown.
>>>
>>>  I have tried lots and lots of different settings but nothing works.
>>>
>>>  I even got desperate and did something like:
>>>
>>>       <binding name="value" expression="'hello'"/>
>>>
>>>  Currently using ....
>>>
>>>
>>>    <component id="table" type="contrib:Table">
>>> 		<binding name="source" expression="callReport"/>
>>> 		<static-binding name="columns">
>>>               select:select:select
>>>               extensionNo:Extns:extensionNo,
>>>               username:Username:username,
>>> 		  date:Date:dateFormatted,
>>>               time:Time:timeFormatted,
>>>               Duration:duration,
>>>               numberCalled:Number Called:numberCalled,
>>> 		  pabxLocation:Location:pabxLocation,
>>> 		  departmentId:Department:department
>>> 	  	</static-binding>
>>>         <binding name="pageSize" expression="500"/>
>>>         <binding name="pagesDisplayed" expression="25"/>
>>>         <binding name="rowClass" expression="next"/>
>>>    </component>
>>>
>>>     <component id="DurationColumnValue" type="Block"/>
>>>     <component id="formattedDuration" type="Insert">
>>>       <binding name="value" 
>>> expression="table.currentRow.numberCalled"/>
>>>     </component>
>>>
>>>  Thanks,
>>>
>>>         Lindsay
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>> Sent: Tuesday, 21 September 2004 11:23 AM
>>> To: Tapestry users
>>> Subject: Re: Column sorting in contrib:Table
>>>
>>>
>>> If you cut and paste this, then it is a spelling problem:
>>>
>>> "Duration" vs "durationColumnValue"
>>>
>>> The first is capitalized and the second isn't!
>>>
>>> Also, just for readability, if you use <static-binding> you won't 
>>> need
>>
>>> those single quotes and plus signs.
>>>
>>> Jamie
>>>
>>> On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:
>>>
>>>> I am sure I am missing something here ...
>>>>
>>>>  It is basically just ignoring the second block of code.  I also 
>>>> can't
>>>
>>>> really see the tie in between  the two.
>>>>
>>>> I have the following
>>>>
>>>>    <component id="table" type="contrib:Table">
>>>> 		<binding name="source" expression="callReport"/>
>>>> 		<binding name="columns">
>>>>             '!select:select:select,' +
>>>>             'extensionNo:Extns:extensionNo,' +
>>>>             'username:Username:username,' +
>>>> 		'date:Date:dateFormatted,' +
>>>>             'time:Time:timeFormatted,' +
>>>>             'Duration:duration,' +
>>>>             'numberCalled:Number Called:numberCalled,' +
>>>> 		'pabxLocation:Location:pabxLocation,' +
>>>> 		'departmentId:Department:department'
>>>> 	  	</binding>
>>>>         <binding name="pageSize" expression="500"/>
>>>>         <binding name="pagesDisplayed" expression="25"/>
>>>>         <binding name="rowClass" expression="next"/>
>>>>    </component>
>>>>
>>>>     <component id="durationColumnValue" type="Block"/>
>>>>     <component id="formattedDuration" type="Insert">
>>>>       <binding name="value" expression="table.currentRow.time"/>
>>>>     </component>
>>>>
>>>>
>>>>  Of course I am use the time as a value .. But this is just for a 
>>>> test. I have tried
>>>>
>>>>  <binding name="value" 
>>>> expression="table.currentRow.formattedDuration"/>
>>>>
>>>>  and even silly things that I know will return a value.   Nothing
is
>>>> ever seen in the table.
>>>>
>>>>   Any ideas ?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>>> Sent: Tuesday, 21 September 2004 9:13 AM
>>>> To: Tapestry users
>>>> Subject: Re: Column sorting in contrib:Table
>>>>
>>>>
>>>> You could insert any value you want into that blocked code. It 
>>>> doesn't
>>>
>>>> have to come from the jobOpsResultsTable even.
>>>>
>>>> Or, it could be a value combined from different properties of the
>>>> row:
>>>>
>>>> <component id="formattedDuration" type="Insert">
>>>>          <binding name="value 
>>>> expression="jobOpsResultsTable.currentRow.someValue+ ' ' + 
>>>> jobOpsResultsTable.someOtherValue"/>
>>>>      </component>
>>>>
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>>> Sent: Monday, September 20, 2004 7:00 PM
>>>> Subject: RE: Column sorting in contrib:Table
>>>>
>>>>
>>>>> Hi Jamie,
>>>>>          That is close - and as you say it is a very simple way of

>>>>> doing things.
>>>>>
>>>>>   I am close to getting it running - the only problem is that I am

>>>>> sorting on a  value that is quite different (munged) to the 
>>>>> displayed
>>>
>>>>> valued.  You are showing  a value that is a date and using the 
>>>>> date
>
>>>>> format.
>>>>>
>>>>>  Is there a way to just insert the value from elsewhere ?? .. Or 
>>>>> should I maybe convert  the int I have to a date and use a date 
>>>>> format
>>>>
>>>>> on that.
>>>>>
>>>>>   Thanks,
>>>>>
>>>>>         Lindsay
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>>>> Sent: Tuesday, 21 September 2004 7:59 AM
>>>>> To: Tapestry users
>>>>> Subject: Re: Column sorting in contrib:Table
>>>>>
>>>>>
>>>>> I think you're over-complicating this.
>>>>>
>>>>> Here's an example:
>>>>>
>>>>> <component id="jobOpsResultsTable" type="Table">
>>>>>         <binding name="data" expression="job"/>
>>>>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>>>>                                               company
>>>>>                                               duration:duration,
>>>>>                                               resumeDueDate,
>>>>>
>>> opportunityExpiryDate"/>
>>>>>     </component>
>>>>>
>>>>>
>>>>>   <component id="durationColumnValue" type="Block"/>
>>>>>     <component id="formattedDuration" type="Insert">
>>>>>         <binding name="value" 
>>>>> expression="jobOpsResultsTable.currentRow.duration"/>
>>>>>          <binding name="format" 
>>>>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>>>>     </component>
>>>>>
>>>>> the first "duration" in the Table is the label for the top of the 
>>>>> column, the "duration" after the colon tells the Table what 
>>>>> property
>>
>>>>> to sort on. If it's left out and you have a block then it won't 
>>>>> sort.
>>>
>>>>> With it there, it will sort on that value even though the column 
>>>>> value
>>>>
>>>>> is intercepted by the block.
>>>>>
>>>>> Hope this helps,
>>>>> Jamie
>>>>>
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>>>> Sent: Monday, September 20, 2004 5:33 PM
>>>>> Subject: Column sorting in contrib:Table
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>    I am having some minor hassles with the column sorting in the 
>>>>>> table.
>>>>>>
>>>>>>  The problem is I have a duration field, this is an int for the 
>>>>>> number
>>>>>
>>>>>> of  seconds. I display from another method that shows the value 
>>>>>> formatted in  minutes and seconds.
>>>>>>
>>>>>>  I have looked for solutions in the archives and have come up 
>>>>>> with
>
>>>>>> the
>>>>>
>>>>>> use of the
>>>>>>  an ExpressionTableColumn.   I am trying to have one of these
>>>> returned
>>>>>> in the data
>>>>>>  object passed to the table - this is not working and I am unsure

>>>>>> if
>>>>
>>>>>> I
>>>>>
>>>>>> am doing it correctly.
>>>>>>
>>>>>>  Does anyone have any code examples or ideas on how I might 
>>>>>> implement column sorting  in the table ??
>>>>>>
>>>>>> <binding name="columns">
>>>>>>             '!select:select:select,' +
>>>>>>             'extensionNo:Extns:extensionNo,' +
>>>>>>             'username:Username:username,' +
>>>>>>       'date:Date:dateFormatted,' +
>>>>>>             'time:Time:timeFormatted,' +
>>>>>>             'duration:Duration:durationFormatted,' +
>>>>>>             'numberCalled:Number Called:numberCalled,' + 
>>>>>> 'pabxLocation:Location:pabxLocation,' + 
>>>>>> 'departmentId:Department:department'
>>>>>>   </binding>
>>>>>>
>>>>>>  Thanks,
>>>>>>
>>>>>>         Lindsay
>>>>>>
>>>>>>
>>>>>>
>>>>>> -----------------------------------------------------------------
>>>>>> -
>>>>>> -
>>>>>> -
>>>>>> -
>>>>>> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>>>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> -
>>>>> -
>>>>> -
>>>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: 
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> -
>>>>> -
>>>>> -
>>>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: 
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> To unsubscribe, e-mail:
tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> To unsubscribe, e-mail:
tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Column sorting in contrib:Table

Posted by Jamie Orchard-Hays <ja...@dang.com>.
If it's displaying values and they're not from callReport, where are 
they coming from? table.currentRow.fooValue accesses a value from 
callReport cuz you passed that in.

I've never used ExpressionTableColumn separately. Maybe someone else 
can help you with that. Or, just dig into the code and see how it's put 
together.

Jamie

On Sep 21, 2004, at 8:56 AM, Lindsay Steele wrote:

> Hi Jamie,
>          I like the formal style too - neater.  I mixed them up because
> I had tried to get
>  the select column going the formal way and had dramas.   I will use 
> the
> examples you gave
>  me to try and get it right this time.
>
>  It is now displaying values in the column ... But I can't get it to
> display values from
>  the callReport object that is passed to the table - which would solve
> my problem.
>
>  In the end .. When I have submitted this project I am told I am 
> allowed
> to open source it,
>  so it might be able to be an example that others can use (most likely 
> a
> poor one .. But oh well)
>
>  I will play with it again tommorrow.
>
>  I am still curious about the ExpressionTableColumn, being able to
> create that in code and pass it
>  back may simplify things.
>
>  Thanks heaps for your help.
>
>   Lindsay
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 2:56 PM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> OK, I see some problems.
>
> First, style. either use the informal or the formal style, but I
> wouldn't mix them. Especially when learning. I like the formal style
> (defining the components in the .page style). You've used formal for
> the stuff we've been talking about up to now:
>   <component id="DurationColumnValue" type="Block"/>
>        <component id="formattedDuration" type="Insert">
>        <binding name="value"
> expression="table.currentRow.numberCalled"/>
>      </component>
>
> Your problem is that you never reference "DurationColumnValue" or
> "formattedDuration" in your HTML template!
>
>    <table align="center" width="99%" jwcid="table">
> 	
> 	<!-- YOU NEED THIS -->
> 	<span jwcid="DurationColumnValue">
> 		<span jwcid="formattedDuration"/>
> 	</span>
>
> 	<!-- I'd make these formal and then reference them as above -->
>        <span jwcid="selectColumnHeader@Block">Details</span>
>        <span jwcid="selectColumnValue@Block">
>        <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
> parameters="ognl:components.table.tableRow.extensionNo">
> select</a>
>       </span>
>    </table>
>
>
>
> Jamie
> On Sep 21, 2004, at 12:31 AM, Lindsay Steele wrote:
>
>>
>>  callReport is a list of "CallReport" objects passed to the table.
>> The individual objects  do have a getNumberCalled() method.
>>
>>      public String getNumberCalled() {
>>         return numberCalled;
>>     }
>>
>>   That is why I was trying to pass it any kind of value - just to see
>> if
>> it was the value
>>   displayed or the fact it would not go into the table.
>>
>>   This is the table code from HTML
>>
>>   <table align="center" width="99%" jwcid="table">
>>       <span jwcid="selectColumnHeader@Block">Details</span>
>>       <span jwcid="selectColumnValue@Block">
>>       <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
>> parameters="ognl:components.table.tableRow.extensionNo">
>> select</a>
>>      </span>
>>   </table>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 1:16 PM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> So, callReport has a public method "getNumberCalled()" right?
>>
>> Also, you're missing the comma after "select:select:select"
>>
>> Show me how you render the table in your HTML file.
>>
>> Jamie
>> On Sep 20, 2004, at 10:42 PM, Lindsay Steele wrote:
>>
>>> Sorry to be a pain ....
>>>
>>>  Now I get the linkage, silly mistake there .. But it gives me a
>>> blank
>>
>>> value.
>>>
>>>  I have tried lots of things to try and get the value.  It is
>>> currently  looking like the following and in the column there is no
>>> value shown.
>>>
>>>  I have tried lots and lots of different settings but nothing works.
>>>
>>>  I even got desperate and did something like:
>>>
>>>       <binding name="value" expression="'hello'"/>
>>>
>>>  Currently using ....
>>>
>>>
>>>    <component id="table" type="contrib:Table">
>>> 		<binding name="source" expression="callReport"/>
>>> 		<static-binding name="columns">
>>>               select:select:select
>>>               extensionNo:Extns:extensionNo,
>>>               username:Username:username,
>>> 		  date:Date:dateFormatted,
>>>               time:Time:timeFormatted,
>>>               Duration:duration,
>>>               numberCalled:Number Called:numberCalled,
>>> 		  pabxLocation:Location:pabxLocation,
>>> 		  departmentId:Department:department
>>> 	  	</static-binding>
>>>         <binding name="pageSize" expression="500"/>
>>>         <binding name="pagesDisplayed" expression="25"/>
>>>         <binding name="rowClass" expression="next"/>
>>>    </component>
>>>
>>>     <component id="DurationColumnValue" type="Block"/>
>>>     <component id="formattedDuration" type="Insert">
>>>       <binding name="value"
>>> expression="table.currentRow.numberCalled"/>
>>>     </component>
>>>
>>>  Thanks,
>>>
>>>         Lindsay
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>> Sent: Tuesday, 21 September 2004 11:23 AM
>>> To: Tapestry users
>>> Subject: Re: Column sorting in contrib:Table
>>>
>>>
>>> If you cut and paste this, then it is a spelling problem:
>>>
>>> "Duration" vs "durationColumnValue"
>>>
>>> The first is capitalized and the second isn't!
>>>
>>> Also, just for readability, if you use <static-binding> you won't
>>> need
>>
>>> those single quotes and plus signs.
>>>
>>> Jamie
>>>
>>> On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:
>>>
>>>> I am sure I am missing something here ...
>>>>
>>>>  It is basically just ignoring the second block of code.  I also
>>>> can't
>>>
>>>> really see the tie in between  the two.
>>>>
>>>> I have the following
>>>>
>>>>    <component id="table" type="contrib:Table">
>>>> 		<binding name="source" expression="callReport"/>
>>>> 		<binding name="columns">
>>>>             '!select:select:select,' +
>>>>             'extensionNo:Extns:extensionNo,' +
>>>>             'username:Username:username,' +
>>>> 		'date:Date:dateFormatted,' +
>>>>             'time:Time:timeFormatted,' +
>>>>             'Duration:duration,' +
>>>>             'numberCalled:Number Called:numberCalled,' +
>>>> 		'pabxLocation:Location:pabxLocation,' +
>>>> 		'departmentId:Department:department'
>>>> 	  	</binding>
>>>>         <binding name="pageSize" expression="500"/>
>>>>         <binding name="pagesDisplayed" expression="25"/>
>>>>         <binding name="rowClass" expression="next"/>
>>>>    </component>
>>>>
>>>>     <component id="durationColumnValue" type="Block"/>
>>>>     <component id="formattedDuration" type="Insert">
>>>>       <binding name="value" expression="table.currentRow.time"/>
>>>>     </component>
>>>>
>>>>
>>>>  Of course I am use the time as a value .. But this is just for a
>>>> test. I have tried
>>>>
>>>>  <binding name="value"
>>>> expression="table.currentRow.formattedDuration"/>
>>>>
>>>>  and even silly things that I know will return a value.   Nothing is
>>>> ever seen in the table.
>>>>
>>>>   Any ideas ?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>>> Sent: Tuesday, 21 September 2004 9:13 AM
>>>> To: Tapestry users
>>>> Subject: Re: Column sorting in contrib:Table
>>>>
>>>>
>>>> You could insert any value you want into that blocked code. It
>>>> doesn't
>>>
>>>> have to come from the jobOpsResultsTable even.
>>>>
>>>> Or, it could be a value combined from different properties of the
>>>> row:
>>>>
>>>> <component id="formattedDuration" type="Insert">
>>>>          <binding name="value
>>>> expression="jobOpsResultsTable.currentRow.someValue+ ' ' +
>>>> jobOpsResultsTable.someOtherValue"/>
>>>>      </component>
>>>>
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>>> Sent: Monday, September 20, 2004 7:00 PM
>>>> Subject: RE: Column sorting in contrib:Table
>>>>
>>>>
>>>>> Hi Jamie,
>>>>>          That is close - and as you say it is a very simple way of
>>>>> doing things.
>>>>>
>>>>>   I am close to getting it running - the only problem is that I am
>>>>> sorting on a  value that is quite different (munged) to the
>>>>> displayed
>>>
>>>>> valued.  You are showing  a value that is a date and using the date
>
>>>>> format.
>>>>>
>>>>>  Is there a way to just insert the value from elsewhere ?? .. Or
>>>>> should I maybe convert  the int I have to a date and use a date
>>>>> format
>>>>
>>>>> on that.
>>>>>
>>>>>   Thanks,
>>>>>
>>>>>         Lindsay
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>>>> Sent: Tuesday, 21 September 2004 7:59 AM
>>>>> To: Tapestry users
>>>>> Subject: Re: Column sorting in contrib:Table
>>>>>
>>>>>
>>>>> I think you're over-complicating this.
>>>>>
>>>>> Here's an example:
>>>>>
>>>>> <component id="jobOpsResultsTable" type="Table">
>>>>>         <binding name="data" expression="job"/>
>>>>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>>>>                                               company
>>>>>                                               duration:duration,
>>>>>                                               resumeDueDate,
>>>>>
>>> opportunityExpiryDate"/>
>>>>>     </component>
>>>>>
>>>>>
>>>>>   <component id="durationColumnValue" type="Block"/>
>>>>>     <component id="formattedDuration" type="Insert">
>>>>>         <binding name="value"
>>>>> expression="jobOpsResultsTable.currentRow.duration"/>
>>>>>          <binding name="format"
>>>>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>>>>     </component>
>>>>>
>>>>> the first "duration" in the Table is the label for the top of the
>>>>> column, the "duration" after the colon tells the Table what
>>>>> property
>>
>>>>> to sort on. If it's left out and you have a block then it won't
>>>>> sort.
>>>
>>>>> With it there, it will sort on that value even though the column
>>>>> value
>>>>
>>>>> is intercepted by the block.
>>>>>
>>>>> Hope this helps,
>>>>> Jamie
>>>>>
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>>>> Sent: Monday, September 20, 2004 5:33 PM
>>>>> Subject: Column sorting in contrib:Table
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>    I am having some minor hassles with the column sorting in the
>>>>>> table.
>>>>>>
>>>>>>  The problem is I have a duration field, this is an int for the
>>>>>> number
>>>>>
>>>>>> of  seconds. I display from another method that shows the value
>>>>>> formatted in  minutes and seconds.
>>>>>>
>>>>>>  I have looked for solutions in the archives and have come up with
>
>>>>>> the
>>>>>
>>>>>> use of the
>>>>>>  an ExpressionTableColumn.   I am trying to have one of these
>>>> returned
>>>>>> in the data
>>>>>>  object passed to the table - this is not working and I am unsure
>>>>>> if
>>>>
>>>>>> I
>>>>>
>>>>>> am doing it correctly.
>>>>>>
>>>>>>  Does anyone have any code examples or ideas on how I might
>>>>>> implement column sorting  in the table ??
>>>>>>
>>>>>> <binding name="columns">
>>>>>>             '!select:select:select,' +
>>>>>>             'extensionNo:Extns:extensionNo,' +
>>>>>>             'username:Username:username,' +
>>>>>>       'date:Date:dateFormatted,' +
>>>>>>             'time:Time:timeFormatted,' +
>>>>>>             'duration:Duration:durationFormatted,' +
>>>>>>             'numberCalled:Number Called:numberCalled,' +
>>>>>> 'pabxLocation:Location:pabxLocation,' +
>>>>>> 'departmentId:Department:department'
>>>>>>   </binding>
>>>>>>
>>>>>>  Thanks,
>>>>>>
>>>>>>         Lindsay
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------
>>>>>> -
>>>>>> -
>>>>>> -
>>>>>> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>>>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------
>>>>> -
>>>>> -
>>>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------
>>>>> -
>>>>> -
>>>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Column sorting in contrib:Table

Posted by Lindsay Steele <ls...@iinet.net.au>.
Hi Jamie,
         I like the formal style too - neater.  I mixed them up because
I had tried to get 
 the select column going the formal way and had dramas.   I will use the
examples you gave
 me to try and get it right this time.

 It is now displaying values in the column ... But I can't get it to
display values from
 the callReport object that is passed to the table - which would solve
my problem.

 In the end .. When I have submitted this project I am told I am allowed
to open source it, 
 so it might be able to be an example that others can use (most likely a
poor one .. But oh well)

 I will play with it again tommorrow.

 I am still curious about the ExpressionTableColumn, being able to
create that in code and pass it 
 back may simplify things.

 Thanks heaps for your help.

  Lindsay

-----Original Message-----
From: Jamie Orchard-Hays [mailto:jamie@dang.com] 
Sent: Tuesday, 21 September 2004 2:56 PM
To: Tapestry users
Subject: Re: Column sorting in contrib:Table


OK, I see some problems.

First, style. either use the informal or the formal style, but I 
wouldn't mix them. Especially when learning. I like the formal style 
(defining the components in the .page style). You've used formal for 
the stuff we've been talking about up to now:
  <component id="DurationColumnValue" type="Block"/>
       <component id="formattedDuration" type="Insert">
       <binding name="value"
expression="table.currentRow.numberCalled"/>
     </component>

Your problem is that you never reference "DurationColumnValue" or 
"formattedDuration" in your HTML template!

   <table align="center" width="99%" jwcid="table">
	
	<!-- YOU NEED THIS -->
	<span jwcid="DurationColumnValue">
		<span jwcid="formattedDuration"/>
	</span>

	<!-- I'd make these formal and then reference them as above -->
       <span jwcid="selectColumnHeader@Block">Details</span>
       <span jwcid="selectColumnValue@Block">
       <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
parameters="ognl:components.table.tableRow.extensionNo">
select</a>
      </span>
   </table>



Jamie
On Sep 21, 2004, at 12:31 AM, Lindsay Steele wrote:

>
>  callReport is a list of "CallReport" objects passed to the table.  
> The individual objects  do have a getNumberCalled() method.
>
>      public String getNumberCalled() {
>         return numberCalled;
>     }
>
>   That is why I was trying to pass it any kind of value - just to see
> if
> it was the value
>   displayed or the fact it would not go into the table.
>
>   This is the table code from HTML
>
>   <table align="center" width="99%" jwcid="table">
>       <span jwcid="selectColumnHeader@Block">Details</span>
>       <span jwcid="selectColumnValue@Block">
>       <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
> parameters="ognl:components.table.tableRow.extensionNo">
> select</a>
>      </span>
>   </table>
>
>
>
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 1:16 PM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> So, callReport has a public method "getNumberCalled()" right?
>
> Also, you're missing the comma after "select:select:select"
>
> Show me how you render the table in your HTML file.
>
> Jamie
> On Sep 20, 2004, at 10:42 PM, Lindsay Steele wrote:
>
>> Sorry to be a pain ....
>>
>>  Now I get the linkage, silly mistake there .. But it gives me a 
>> blank
>
>> value.
>>
>>  I have tried lots of things to try and get the value.  It is 
>> currently  looking like the following and in the column there is no 
>> value shown.
>>
>>  I have tried lots and lots of different settings but nothing works.
>>
>>  I even got desperate and did something like:
>>
>>       <binding name="value" expression="'hello'"/>
>>
>>  Currently using ....
>>
>>
>>    <component id="table" type="contrib:Table">
>> 		<binding name="source" expression="callReport"/>
>> 		<static-binding name="columns">
>>               select:select:select
>>               extensionNo:Extns:extensionNo,
>>               username:Username:username,
>> 		  date:Date:dateFormatted,
>>               time:Time:timeFormatted,
>>               Duration:duration,
>>               numberCalled:Number Called:numberCalled,
>> 		  pabxLocation:Location:pabxLocation,
>> 		  departmentId:Department:department
>> 	  	</static-binding>
>>         <binding name="pageSize" expression="500"/>
>>         <binding name="pagesDisplayed" expression="25"/>
>>         <binding name="rowClass" expression="next"/>
>>    </component>
>>
>>     <component id="DurationColumnValue" type="Block"/>
>>     <component id="formattedDuration" type="Insert">
>>       <binding name="value" 
>> expression="table.currentRow.numberCalled"/>
>>     </component>
>>
>>  Thanks,
>>
>>         Lindsay
>>
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 11:23 AM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> If you cut and paste this, then it is a spelling problem:
>>
>> "Duration" vs "durationColumnValue"
>>
>> The first is capitalized and the second isn't!
>>
>> Also, just for readability, if you use <static-binding> you won't 
>> need
>
>> those single quotes and plus signs.
>>
>> Jamie
>>
>> On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:
>>
>>> I am sure I am missing something here ...
>>>
>>>  It is basically just ignoring the second block of code.  I also 
>>> can't
>>
>>> really see the tie in between  the two.
>>>
>>> I have the following
>>>
>>>    <component id="table" type="contrib:Table">
>>> 		<binding name="source" expression="callReport"/>
>>> 		<binding name="columns">
>>>             '!select:select:select,' +
>>>             'extensionNo:Extns:extensionNo,' +
>>>             'username:Username:username,' +
>>> 		'date:Date:dateFormatted,' +
>>>             'time:Time:timeFormatted,' +
>>>             'Duration:duration,' +
>>>             'numberCalled:Number Called:numberCalled,' +
>>> 		'pabxLocation:Location:pabxLocation,' +
>>> 		'departmentId:Department:department'
>>> 	  	</binding>
>>>         <binding name="pageSize" expression="500"/>
>>>         <binding name="pagesDisplayed" expression="25"/>
>>>         <binding name="rowClass" expression="next"/>
>>>    </component>
>>>
>>>     <component id="durationColumnValue" type="Block"/>
>>>     <component id="formattedDuration" type="Insert">
>>>       <binding name="value" expression="table.currentRow.time"/>
>>>     </component>
>>>
>>>
>>>  Of course I am use the time as a value .. But this is just for a 
>>> test. I have tried
>>>
>>>  <binding name="value" 
>>> expression="table.currentRow.formattedDuration"/>
>>>
>>>  and even silly things that I know will return a value.   Nothing is
>>> ever seen in the table.
>>>
>>>   Any ideas ?
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>> Sent: Tuesday, 21 September 2004 9:13 AM
>>> To: Tapestry users
>>> Subject: Re: Column sorting in contrib:Table
>>>
>>>
>>> You could insert any value you want into that blocked code. It 
>>> doesn't
>>
>>> have to come from the jobOpsResultsTable even.
>>>
>>> Or, it could be a value combined from different properties of the
>>> row:
>>>
>>> <component id="formattedDuration" type="Insert">
>>>          <binding name="value 
>>> expression="jobOpsResultsTable.currentRow.someValue+ ' ' + 
>>> jobOpsResultsTable.someOtherValue"/>
>>>      </component>
>>>
>>>
>>>
>>> ----- Original Message -----
>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>> Sent: Monday, September 20, 2004 7:00 PM
>>> Subject: RE: Column sorting in contrib:Table
>>>
>>>
>>>> Hi Jamie,
>>>>          That is close - and as you say it is a very simple way of 
>>>> doing things.
>>>>
>>>>   I am close to getting it running - the only problem is that I am 
>>>> sorting on a  value that is quite different (munged) to the 
>>>> displayed
>>
>>>> valued.  You are showing  a value that is a date and using the date

>>>> format.
>>>>
>>>>  Is there a way to just insert the value from elsewhere ?? .. Or 
>>>> should I maybe convert  the int I have to a date and use a date 
>>>> format
>>>
>>>> on that.
>>>>
>>>>   Thanks,
>>>>
>>>>         Lindsay
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>>> Sent: Tuesday, 21 September 2004 7:59 AM
>>>> To: Tapestry users
>>>> Subject: Re: Column sorting in contrib:Table
>>>>
>>>>
>>>> I think you're over-complicating this.
>>>>
>>>> Here's an example:
>>>>
>>>> <component id="jobOpsResultsTable" type="Table">
>>>>         <binding name="data" expression="job"/>
>>>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>>>                                               company
>>>>                                               duration:duration,
>>>>                                               resumeDueDate,
>>>>
>> opportunityExpiryDate"/>
>>>>     </component>
>>>>
>>>>
>>>>   <component id="durationColumnValue" type="Block"/>
>>>>     <component id="formattedDuration" type="Insert">
>>>>         <binding name="value" 
>>>> expression="jobOpsResultsTable.currentRow.duration"/>
>>>>          <binding name="format" 
>>>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>>>     </component>
>>>>
>>>> the first "duration" in the Table is the label for the top of the 
>>>> column, the "duration" after the colon tells the Table what 
>>>> property
>
>>>> to sort on. If it's left out and you have a block then it won't 
>>>> sort.
>>
>>>> With it there, it will sort on that value even though the column 
>>>> value
>>>
>>>> is intercepted by the block.
>>>>
>>>> Hope this helps,
>>>> Jamie
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>>> Sent: Monday, September 20, 2004 5:33 PM
>>>> Subject: Column sorting in contrib:Table
>>>>
>>>>
>>>>> Hi,
>>>>>    I am having some minor hassles with the column sorting in the 
>>>>> table.
>>>>>
>>>>>  The problem is I have a duration field, this is an int for the 
>>>>> number
>>>>
>>>>> of  seconds. I display from another method that shows the value 
>>>>> formatted in  minutes and seconds.
>>>>>
>>>>>  I have looked for solutions in the archives and have come up with

>>>>> the
>>>>
>>>>> use of the
>>>>>  an ExpressionTableColumn.   I am trying to have one of these
>>> returned
>>>>> in the data
>>>>>  object passed to the table - this is not working and I am unsure 
>>>>> if
>>>
>>>>> I
>>>>
>>>>> am doing it correctly.
>>>>>
>>>>>  Does anyone have any code examples or ideas on how I might 
>>>>> implement column sorting  in the table ??
>>>>>
>>>>> <binding name="columns">
>>>>>             '!select:select:select,' +
>>>>>             'extensionNo:Extns:extensionNo,' +
>>>>>             'username:Username:username,' +
>>>>>       'date:Date:dateFormatted,' +
>>>>>             'time:Time:timeFormatted,' +
>>>>>             'duration:Duration:durationFormatted,' +
>>>>>             'numberCalled:Number Called:numberCalled,' + 
>>>>> 'pabxLocation:Location:pabxLocation,' + 
>>>>> 'departmentId:Department:department'
>>>>>   </binding>
>>>>>
>>>>>  Thanks,
>>>>>
>>>>>         Lindsay
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> -
>>>>> -
>>>>> -
>>>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> To unsubscribe, e-mail:
tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> To unsubscribe, e-mail:
tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Column sorting in contrib:Table

Posted by Jamie Orchard-Hays <ja...@dang.com>.
OK, I see some problems.

First, style. either use the informal or the formal style, but I 
wouldn't mix them. Especially when learning. I like the formal style 
(defining the components in the .page style). You've used formal for 
the stuff we've been talking about up to now:
  <component id="DurationColumnValue" type="Block"/>
       <component id="formattedDuration" type="Insert">
       <binding name="value" expression="table.currentRow.numberCalled"/>
     </component>

Your problem is that you never reference "DurationColumnValue" or 
"formattedDuration" in your HTML template!

   <table align="center" width="99%" jwcid="table">
	
	<!-- YOU NEED THIS -->
	<span jwcid="DurationColumnValue">
		<span jwcid="formattedDuration"/>
	</span>

	<!-- I'd make these formal and then reference them as above -->
       <span jwcid="selectColumnHeader@Block">Details</span>
       <span jwcid="selectColumnValue@Block">
       <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
parameters="ognl:components.table.tableRow.extensionNo">
select</a>
      </span>
   </table>



Jamie
On Sep 21, 2004, at 12:31 AM, Lindsay Steele wrote:

>
>  callReport is a list of "CallReport" objects passed to the table.  The
> individual objects
>  do have a getNumberCalled() method.
>
>      public String getNumberCalled() {
>         return numberCalled;
>     }
>
>   That is why I was trying to pass it any kind of value - just to see 
> if
> it was the value
>   displayed or the fact it would not go into the table.
>
>   This is the table code from HTML
>
>   <table align="center" width="99%" jwcid="table">
>       <span jwcid="selectColumnHeader@Block">Details</span>
>       <span jwcid="selectColumnValue@Block">
>       <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
> parameters="ognl:components.table.tableRow.extensionNo">
> select</a>
>      </span>
>   </table>
>
>
>
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 1:16 PM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> So, callReport has a public method "getNumberCalled()" right?
>
> Also, you're missing the comma after "select:select:select"
>
> Show me how you render the table in your HTML file.
>
> Jamie
> On Sep 20, 2004, at 10:42 PM, Lindsay Steele wrote:
>
>> Sorry to be a pain ....
>>
>>  Now I get the linkage, silly mistake there .. But it gives me a blank
>
>> value.
>>
>>  I have tried lots of things to try and get the value.  It is
>> currently  looking like the following and in the column there is no
>> value shown.
>>
>>  I have tried lots and lots of different settings but nothing works.
>>
>>  I even got desperate and did something like:
>>
>>       <binding name="value" expression="'hello'"/>
>>
>>  Currently using ....
>>
>>
>>    <component id="table" type="contrib:Table">
>> 		<binding name="source" expression="callReport"/>
>> 		<static-binding name="columns">
>>               select:select:select
>>               extensionNo:Extns:extensionNo,
>>               username:Username:username,
>> 		  date:Date:dateFormatted,
>>               time:Time:timeFormatted,
>>               Duration:duration,
>>               numberCalled:Number Called:numberCalled,
>> 		  pabxLocation:Location:pabxLocation,
>> 		  departmentId:Department:department
>> 	  	</static-binding>
>>         <binding name="pageSize" expression="500"/>
>>         <binding name="pagesDisplayed" expression="25"/>
>>         <binding name="rowClass" expression="next"/>
>>    </component>
>>
>>     <component id="DurationColumnValue" type="Block"/>
>>     <component id="formattedDuration" type="Insert">
>>       <binding name="value"
>> expression="table.currentRow.numberCalled"/>
>>     </component>
>>
>>  Thanks,
>>
>>         Lindsay
>>
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 11:23 AM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> If you cut and paste this, then it is a spelling problem:
>>
>> "Duration" vs "durationColumnValue"
>>
>> The first is capitalized and the second isn't!
>>
>> Also, just for readability, if you use <static-binding> you won't need
>
>> those single quotes and plus signs.
>>
>> Jamie
>>
>> On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:
>>
>>> I am sure I am missing something here ...
>>>
>>>  It is basically just ignoring the second block of code.  I also
>>> can't
>>
>>> really see the tie in between  the two.
>>>
>>> I have the following
>>>
>>>    <component id="table" type="contrib:Table">
>>> 		<binding name="source" expression="callReport"/>
>>> 		<binding name="columns">
>>>             '!select:select:select,' +
>>>             'extensionNo:Extns:extensionNo,' +
>>>             'username:Username:username,' +
>>> 		'date:Date:dateFormatted,' +
>>>             'time:Time:timeFormatted,' +
>>>             'Duration:duration,' +
>>>             'numberCalled:Number Called:numberCalled,' +
>>> 		'pabxLocation:Location:pabxLocation,' +
>>> 		'departmentId:Department:department'
>>> 	  	</binding>
>>>         <binding name="pageSize" expression="500"/>
>>>         <binding name="pagesDisplayed" expression="25"/>
>>>         <binding name="rowClass" expression="next"/>
>>>    </component>
>>>
>>>     <component id="durationColumnValue" type="Block"/>
>>>     <component id="formattedDuration" type="Insert">
>>>       <binding name="value" expression="table.currentRow.time"/>
>>>     </component>
>>>
>>>
>>>  Of course I am use the time as a value .. But this is just for a
>>> test. I have tried
>>>
>>>  <binding name="value"
>>> expression="table.currentRow.formattedDuration"/>
>>>
>>>  and even silly things that I know will return a value.   Nothing is
>>> ever seen in the table.
>>>
>>>   Any ideas ?
>>>
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>> Sent: Tuesday, 21 September 2004 9:13 AM
>>> To: Tapestry users
>>> Subject: Re: Column sorting in contrib:Table
>>>
>>>
>>> You could insert any value you want into that blocked code. It
>>> doesn't
>>
>>> have to come from the jobOpsResultsTable even.
>>>
>>> Or, it could be a value combined from different properties of the
>>> row:
>>>
>>> <component id="formattedDuration" type="Insert">
>>>          <binding name="value
>>> expression="jobOpsResultsTable.currentRow.someValue+ ' ' +
>>> jobOpsResultsTable.someOtherValue"/>
>>>      </component>
>>>
>>>
>>>
>>> ----- Original Message -----
>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>> Sent: Monday, September 20, 2004 7:00 PM
>>> Subject: RE: Column sorting in contrib:Table
>>>
>>>
>>>> Hi Jamie,
>>>>          That is close - and as you say it is a very simple way of
>>>> doing things.
>>>>
>>>>   I am close to getting it running - the only problem is that I am
>>>> sorting on a  value that is quite different (munged) to the
>>>> displayed
>>
>>>> valued.  You are showing  a value that is a date and using the date
>>>> format.
>>>>
>>>>  Is there a way to just insert the value from elsewhere ?? .. Or
>>>> should I maybe convert  the int I have to a date and use a date
>>>> format
>>>
>>>> on that.
>>>>
>>>>   Thanks,
>>>>
>>>>         Lindsay
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>>> Sent: Tuesday, 21 September 2004 7:59 AM
>>>> To: Tapestry users
>>>> Subject: Re: Column sorting in contrib:Table
>>>>
>>>>
>>>> I think you're over-complicating this.
>>>>
>>>> Here's an example:
>>>>
>>>> <component id="jobOpsResultsTable" type="Table">
>>>>         <binding name="data" expression="job"/>
>>>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>>>                                               company
>>>>                                               duration:duration,
>>>>                                               resumeDueDate,
>>>>
>> opportunityExpiryDate"/>
>>>>     </component>
>>>>
>>>>
>>>>   <component id="durationColumnValue" type="Block"/>
>>>>     <component id="formattedDuration" type="Insert">
>>>>         <binding name="value"
>>>> expression="jobOpsResultsTable.currentRow.duration"/>
>>>>          <binding name="format"
>>>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>>>     </component>
>>>>
>>>> the first "duration" in the Table is the label for the top of the
>>>> column, the "duration" after the colon tells the Table what property
>
>>>> to sort on. If it's left out and you have a block then it won't
>>>> sort.
>>
>>>> With it there, it will sort on that value even though the column
>>>> value
>>>
>>>> is intercepted by the block.
>>>>
>>>> Hope this helps,
>>>> Jamie
>>>>
>>>>
>>>> ----- Original Message -----
>>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>>> Sent: Monday, September 20, 2004 5:33 PM
>>>> Subject: Column sorting in contrib:Table
>>>>
>>>>
>>>>> Hi,
>>>>>    I am having some minor hassles with the column sorting in the
>>>>> table.
>>>>>
>>>>>  The problem is I have a duration field, this is an int for the
>>>>> number
>>>>
>>>>> of  seconds. I display from another method that shows the value
>>>>> formatted in  minutes and seconds.
>>>>>
>>>>>  I have looked for solutions in the archives and have come up with
>>>>> the
>>>>
>>>>> use of the
>>>>>  an ExpressionTableColumn.   I am trying to have one of these
>>> returned
>>>>> in the data
>>>>>  object passed to the table - this is not working and I am unsure
>>>>> if
>>>
>>>>> I
>>>>
>>>>> am doing it correctly.
>>>>>
>>>>>  Does anyone have any code examples or ideas on how I might
>>>>> implement column sorting  in the table ??
>>>>>
>>>>> <binding name="columns">
>>>>>             '!select:select:select,' +
>>>>>             'extensionNo:Extns:extensionNo,' +
>>>>>             'username:Username:username,' +
>>>>>       'date:Date:dateFormatted,' +
>>>>>             'time:Time:timeFormatted,' +
>>>>>             'duration:Duration:durationFormatted,' +
>>>>>             'numberCalled:Number Called:numberCalled,' +
>>>>> 'pabxLocation:Location:pabxLocation,' +
>>>>> 'departmentId:Department:department'
>>>>>   </binding>
>>>>>
>>>>>  Thanks,
>>>>>
>>>>>         Lindsay
>>>>>
>>>>>
>>>>>
>>>>> -------------------------------------------------------------------
>>>>> -
>>>>> -
>>>>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Column sorting in contrib:Table

Posted by Lindsay Steele <ls...@iinet.net.au>.
 callReport is a list of "CallReport" objects passed to the table.  The
individual objects
 do have a getNumberCalled() method.

     public String getNumberCalled() {
        return numberCalled;
    }

  That is why I was trying to pass it any kind of value - just to see if
it was the value
  displayed or the fact it would not go into the table.

  This is the table code from HTML

  <table align="center" width="99%" jwcid="table">
      <span jwcid="selectColumnHeader@Block">Details</span>
      <span jwcid="selectColumnValue@Block">
      <a jwcid="@DirectLink" listener="ognl:listeners.viewExtn"
parameters="ognl:components.table.tableRow.extensionNo">
select</a>
     </span>
  </table>

 
 


-----Original Message-----
From: Jamie Orchard-Hays [mailto:jamie@dang.com] 
Sent: Tuesday, 21 September 2004 1:16 PM
To: Tapestry users
Subject: Re: Column sorting in contrib:Table


So, callReport has a public method "getNumberCalled()" right?

Also, you're missing the comma after "select:select:select"

Show me how you render the table in your HTML file.

Jamie
On Sep 20, 2004, at 10:42 PM, Lindsay Steele wrote:

> Sorry to be a pain ....
>
>  Now I get the linkage, silly mistake there .. But it gives me a blank

> value.
>
>  I have tried lots of things to try and get the value.  It is 
> currently  looking like the following and in the column there is no 
> value shown.
>
>  I have tried lots and lots of different settings but nothing works.
>
>  I even got desperate and did something like:
>
>       <binding name="value" expression="'hello'"/>
>
>  Currently using ....
>
>
>    <component id="table" type="contrib:Table">
> 		<binding name="source" expression="callReport"/>
> 		<static-binding name="columns">
>               select:select:select
>               extensionNo:Extns:extensionNo,
>               username:Username:username,
> 		  date:Date:dateFormatted,
>               time:Time:timeFormatted,
>               Duration:duration,
>               numberCalled:Number Called:numberCalled,
> 		  pabxLocation:Location:pabxLocation,
> 		  departmentId:Department:department
> 	  	</static-binding>
>         <binding name="pageSize" expression="500"/>
>         <binding name="pagesDisplayed" expression="25"/>
>         <binding name="rowClass" expression="next"/>
>    </component>
>
>     <component id="DurationColumnValue" type="Block"/>
>     <component id="formattedDuration" type="Insert">
>       <binding name="value"
> expression="table.currentRow.numberCalled"/>
>     </component>
>
>  Thanks,
>
>         Lindsay
>
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 11:23 AM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> If you cut and paste this, then it is a spelling problem:
>
> "Duration" vs "durationColumnValue"
>
> The first is capitalized and the second isn't!
>
> Also, just for readability, if you use <static-binding> you won't need

> those single quotes and plus signs.
>
> Jamie
>
> On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:
>
>> I am sure I am missing something here ...
>>
>>  It is basically just ignoring the second block of code.  I also 
>> can't
>
>> really see the tie in between  the two.
>>
>> I have the following
>>
>>    <component id="table" type="contrib:Table">
>> 		<binding name="source" expression="callReport"/>
>> 		<binding name="columns">
>>             '!select:select:select,' +
>>             'extensionNo:Extns:extensionNo,' +
>>             'username:Username:username,' +
>> 		'date:Date:dateFormatted,' +
>>             'time:Time:timeFormatted,' +
>>             'Duration:duration,' +
>>             'numberCalled:Number Called:numberCalled,' +
>> 		'pabxLocation:Location:pabxLocation,' +
>> 		'departmentId:Department:department'
>> 	  	</binding>
>>         <binding name="pageSize" expression="500"/>
>>         <binding name="pagesDisplayed" expression="25"/>
>>         <binding name="rowClass" expression="next"/>
>>    </component>
>>
>>     <component id="durationColumnValue" type="Block"/>
>>     <component id="formattedDuration" type="Insert">
>>       <binding name="value" expression="table.currentRow.time"/>
>>     </component>
>>
>>
>>  Of course I am use the time as a value .. But this is just for a 
>> test. I have tried
>>
>>  <binding name="value" 
>> expression="table.currentRow.formattedDuration"/>
>>
>>  and even silly things that I know will return a value.   Nothing is
>> ever seen in the table.
>>
>>   Any ideas ?
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 9:13 AM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> You could insert any value you want into that blocked code. It 
>> doesn't
>
>> have to come from the jobOpsResultsTable even.
>>
>> Or, it could be a value combined from different properties of the 
>> row:
>>
>> <component id="formattedDuration" type="Insert">
>>          <binding name="value 
>> expression="jobOpsResultsTable.currentRow.someValue+ ' ' + 
>> jobOpsResultsTable.someOtherValue"/>
>>      </component>
>>
>>
>>
>> ----- Original Message -----
>> From: "Lindsay Steele" <ls...@iinet.net.au>
>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>> Sent: Monday, September 20, 2004 7:00 PM
>> Subject: RE: Column sorting in contrib:Table
>>
>>
>>> Hi Jamie,
>>>          That is close - and as you say it is a very simple way of 
>>> doing things.
>>>
>>>   I am close to getting it running - the only problem is that I am 
>>> sorting on a  value that is quite different (munged) to the 
>>> displayed
>
>>> valued.  You are showing  a value that is a date and using the date 
>>> format.
>>>
>>>  Is there a way to just insert the value from elsewhere ?? .. Or 
>>> should I maybe convert  the int I have to a date and use a date 
>>> format
>>
>>> on that.
>>>
>>>   Thanks,
>>>
>>>         Lindsay
>>>
>>>
>>> -----Original Message-----
>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>> Sent: Tuesday, 21 September 2004 7:59 AM
>>> To: Tapestry users
>>> Subject: Re: Column sorting in contrib:Table
>>>
>>>
>>> I think you're over-complicating this.
>>>
>>> Here's an example:
>>>
>>> <component id="jobOpsResultsTable" type="Table">
>>>         <binding name="data" expression="job"/>
>>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>>                                               company
>>>                                               duration:duration,
>>>                                               resumeDueDate,
>>>
> opportunityExpiryDate"/>
>>>     </component>
>>>
>>>
>>>   <component id="durationColumnValue" type="Block"/>
>>>     <component id="formattedDuration" type="Insert">
>>>         <binding name="value" 
>>> expression="jobOpsResultsTable.currentRow.duration"/>
>>>          <binding name="format" 
>>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>>     </component>
>>>
>>> the first "duration" in the Table is the label for the top of the 
>>> column, the "duration" after the colon tells the Table what property

>>> to sort on. If it's left out and you have a block then it won't 
>>> sort.
>
>>> With it there, it will sort on that value even though the column 
>>> value
>>
>>> is intercepted by the block.
>>>
>>> Hope this helps,
>>> Jamie
>>>
>>>
>>> ----- Original Message -----
>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>> Sent: Monday, September 20, 2004 5:33 PM
>>> Subject: Column sorting in contrib:Table
>>>
>>>
>>>> Hi,
>>>>    I am having some minor hassles with the column sorting in the 
>>>> table.
>>>>
>>>>  The problem is I have a duration field, this is an int for the 
>>>> number
>>>
>>>> of  seconds. I display from another method that shows the value 
>>>> formatted in  minutes and seconds.
>>>>
>>>>  I have looked for solutions in the archives and have come up with 
>>>> the
>>>
>>>> use of the
>>>>  an ExpressionTableColumn.   I am trying to have one of these
>> returned
>>>> in the data
>>>>  object passed to the table - this is not working and I am unsure 
>>>> if
>>
>>>> I
>>>
>>>> am doing it correctly.
>>>>
>>>>  Does anyone have any code examples or ideas on how I might 
>>>> implement column sorting  in the table ??
>>>>
>>>> <binding name="columns">
>>>>             '!select:select:select,' +
>>>>             'extensionNo:Extns:extensionNo,' +
>>>>             'username:Username:username,' +
>>>>       'date:Date:dateFormatted,' +
>>>>             'time:Time:timeFormatted,' +
>>>>             'duration:Duration:durationFormatted,' +
>>>>             'numberCalled:Number Called:numberCalled,' + 
>>>> 'pabxLocation:Location:pabxLocation,' + 
>>>> 'departmentId:Department:department'
>>>>   </binding>
>>>>
>>>>  Thanks,
>>>>
>>>>         Lindsay
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> To unsubscribe, e-mail:
tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Column sorting in contrib:Table

Posted by Jamie Orchard-Hays <ja...@dang.com>.
So, callReport has a public method "getNumberCalled()" right?

Also, you're missing the comma after "select:select:select"

Show me how you render the table in your HTML file.

Jamie
On Sep 20, 2004, at 10:42 PM, Lindsay Steele wrote:

> Sorry to be a pain ....
>
>  Now I get the linkage, silly mistake there .. But it gives me a blank
> value.
>
>  I have tried lots of things to try and get the value.  It is currently
>  looking like the following and in the column there is no value shown.
>
>  I have tried lots and lots of different settings but nothing works.
>
>  I even got desperate and did something like:
>
>       <binding name="value" expression="'hello'"/>
>
>  Currently using ....
>
>
>    <component id="table" type="contrib:Table">
> 		<binding name="source" expression="callReport"/>
> 		<static-binding name="columns">
>               select:select:select
>               extensionNo:Extns:extensionNo,
>               username:Username:username,
> 		  date:Date:dateFormatted,
>               time:Time:timeFormatted,
>               Duration:duration,
>               numberCalled:Number Called:numberCalled,
> 		  pabxLocation:Location:pabxLocation,
> 		  departmentId:Department:department
> 	  	</static-binding>
>         <binding name="pageSize" expression="500"/>
>         <binding name="pagesDisplayed" expression="25"/>
>         <binding name="rowClass" expression="next"/>
>    </component>
>
>     <component id="DurationColumnValue" type="Block"/>
>     <component id="formattedDuration" type="Insert">
>       <binding name="value" 
> expression="table.currentRow.numberCalled"/>
>     </component>
>
>  Thanks,
>
>         Lindsay
>
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 11:23 AM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> If you cut and paste this, then it is a spelling problem:
>
> "Duration" vs "durationColumnValue"
>
> The first is capitalized and the second isn't!
>
> Also, just for readability, if you use <static-binding> you won't need
> those single quotes and plus signs.
>
> Jamie
>
> On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:
>
>> I am sure I am missing something here ...
>>
>>  It is basically just ignoring the second block of code.  I also can't
>
>> really see the tie in between  the two.
>>
>> I have the following
>>
>>    <component id="table" type="contrib:Table">
>> 		<binding name="source" expression="callReport"/>
>> 		<binding name="columns">
>>             '!select:select:select,' +
>>             'extensionNo:Extns:extensionNo,' +
>>             'username:Username:username,' +
>> 		'date:Date:dateFormatted,' +
>>             'time:Time:timeFormatted,' +
>>             'Duration:duration,' +
>>             'numberCalled:Number Called:numberCalled,' +
>> 		'pabxLocation:Location:pabxLocation,' +
>> 		'departmentId:Department:department'
>> 	  	</binding>
>>         <binding name="pageSize" expression="500"/>
>>         <binding name="pagesDisplayed" expression="25"/>
>>         <binding name="rowClass" expression="next"/>
>>    </component>
>>
>>     <component id="durationColumnValue" type="Block"/>
>>     <component id="formattedDuration" type="Insert">
>>       <binding name="value" expression="table.currentRow.time"/>
>>     </component>
>>
>>
>>  Of course I am use the time as a value .. But this is just for a
>> test. I have tried
>>
>>  <binding name="value"
>> expression="table.currentRow.formattedDuration"/>
>>
>>  and even silly things that I know will return a value.   Nothing is
>> ever seen in the table.
>>
>>   Any ideas ?
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 9:13 AM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> You could insert any value you want into that blocked code. It doesn't
>
>> have to come from the jobOpsResultsTable even.
>>
>> Or, it could be a value combined from different properties of the row:
>>
>> <component id="formattedDuration" type="Insert">
>>          <binding name="value
>> expression="jobOpsResultsTable.currentRow.someValue+ ' ' +
>> jobOpsResultsTable.someOtherValue"/>
>>      </component>
>>
>>
>>
>> ----- Original Message -----
>> From: "Lindsay Steele" <ls...@iinet.net.au>
>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>> Sent: Monday, September 20, 2004 7:00 PM
>> Subject: RE: Column sorting in contrib:Table
>>
>>
>>> Hi Jamie,
>>>          That is close - and as you say it is a very simple way of
>>> doing things.
>>>
>>>   I am close to getting it running - the only problem is that I am
>>> sorting on a  value that is quite different (munged) to the displayed
>
>>> valued.  You are showing  a value that is a date and using the date
>>> format.
>>>
>>>  Is there a way to just insert the value from elsewhere ?? .. Or
>>> should I maybe convert  the int I have to a date and use a date
>>> format
>>
>>> on that.
>>>
>>>   Thanks,
>>>
>>>         Lindsay
>>>
>>>
>>> -----Original Message-----
>>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>>> Sent: Tuesday, 21 September 2004 7:59 AM
>>> To: Tapestry users
>>> Subject: Re: Column sorting in contrib:Table
>>>
>>>
>>> I think you're over-complicating this.
>>>
>>> Here's an example:
>>>
>>> <component id="jobOpsResultsTable" type="Table">
>>>         <binding name="data" expression="job"/>
>>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>>                                               company
>>>                                               duration:duration,
>>>                                               resumeDueDate,
>>>
> opportunityExpiryDate"/>
>>>     </component>
>>>
>>>
>>>   <component id="durationColumnValue" type="Block"/>
>>>     <component id="formattedDuration" type="Insert">
>>>         <binding name="value"
>>> expression="jobOpsResultsTable.currentRow.duration"/>
>>>          <binding name="format"
>>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>>     </component>
>>>
>>> the first "duration" in the Table is the label for the top of the
>>> column, the "duration" after the colon tells the Table what property
>>> to sort on. If it's left out and you have a block then it won't sort.
>
>>> With it there, it will sort on that value even though the column
>>> value
>>
>>> is intercepted by the block.
>>>
>>> Hope this helps,
>>> Jamie
>>>
>>>
>>> ----- Original Message -----
>>> From: "Lindsay Steele" <ls...@iinet.net.au>
>>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>>> Sent: Monday, September 20, 2004 5:33 PM
>>> Subject: Column sorting in contrib:Table
>>>
>>>
>>>> Hi,
>>>>    I am having some minor hassles with the column sorting in the
>>>> table.
>>>>
>>>>  The problem is I have a duration field, this is an int for the
>>>> number
>>>
>>>> of  seconds. I display from another method that shows the value
>>>> formatted in  minutes and seconds.
>>>>
>>>>  I have looked for solutions in the archives and have come up with
>>>> the
>>>
>>>> use of the
>>>>  an ExpressionTableColumn.   I am trying to have one of these
>> returned
>>>> in the data
>>>>  object passed to the table - this is not working and I am unsure if
>>
>>>> I
>>>
>>>> am doing it correctly.
>>>>
>>>>  Does anyone have any code examples or ideas on how I might
>>>> implement column sorting  in the table ??
>>>>
>>>> <binding name="columns">
>>>>             '!select:select:select,' +
>>>>             'extensionNo:Extns:extensionNo,' +
>>>>             'username:Username:username,' +
>>>>       'date:Date:dateFormatted,' +
>>>>             'time:Time:timeFormatted,' +
>>>>             'duration:Duration:durationFormatted,' +
>>>>             'numberCalled:Number Called:numberCalled,' +
>>>> 'pabxLocation:Location:pabxLocation,' +
>>>> 'departmentId:Department:department'
>>>>   </binding>
>>>>
>>>>  Thanks,
>>>>
>>>>         Lindsay
>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Column sorting in contrib:Table

Posted by Lindsay Steele <ls...@iinet.net.au>.
Sorry to be a pain ....

 Now I get the linkage, silly mistake there .. But it gives me a blank
value.

 I have tried lots of things to try and get the value.  It is currently
 looking like the following and in the column there is no value shown.

 I have tried lots and lots of different settings but nothing works.

 I even got desperate and did something like:

      <binding name="value" expression="'hello'"/>

 Currently using ....


   <component id="table" type="contrib:Table">
		<binding name="source" expression="callReport"/>
		<static-binding name="columns">
              select:select:select
              extensionNo:Extns:extensionNo,
              username:Username:username,
		  date:Date:dateFormatted,
              time:Time:timeFormatted,
              Duration:duration,
              numberCalled:Number Called:numberCalled,
		  pabxLocation:Location:pabxLocation,
		  departmentId:Department:department 
	  	</static-binding>             
        <binding name="pageSize" expression="500"/>
        <binding name="pagesDisplayed" expression="25"/>
        <binding name="rowClass" expression="next"/>
   </component>   

    <component id="DurationColumnValue" type="Block"/>
    <component id="formattedDuration" type="Insert">
      <binding name="value" expression="table.currentRow.numberCalled"/>
    </component>

 Thanks,

        Lindsay

  

-----Original Message-----
From: Jamie Orchard-Hays [mailto:jamie@dang.com] 
Sent: Tuesday, 21 September 2004 11:23 AM
To: Tapestry users
Subject: Re: Column sorting in contrib:Table


If you cut and paste this, then it is a spelling problem:

"Duration" vs "durationColumnValue"

The first is capitalized and the second isn't!

Also, just for readability, if you use <static-binding> you won't need 
those single quotes and plus signs.

Jamie

On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:

> I am sure I am missing something here ...
>
>  It is basically just ignoring the second block of code.  I also can't

> really see the tie in between  the two.
>
> I have the following
>
>    <component id="table" type="contrib:Table">
> 		<binding name="source" expression="callReport"/>
> 		<binding name="columns">
>             '!select:select:select,' +
>             'extensionNo:Extns:extensionNo,' +
>             'username:Username:username,' +
> 		'date:Date:dateFormatted,' +
>             'time:Time:timeFormatted,' +
>             'Duration:duration,' +
>             'numberCalled:Number Called:numberCalled,' +
> 		'pabxLocation:Location:pabxLocation,' +
> 		'departmentId:Department:department'
> 	  	</binding>
>         <binding name="pageSize" expression="500"/>
>         <binding name="pagesDisplayed" expression="25"/>
>         <binding name="rowClass" expression="next"/>
>    </component>
>
>     <component id="durationColumnValue" type="Block"/>
>     <component id="formattedDuration" type="Insert">
>       <binding name="value" expression="table.currentRow.time"/>
>     </component>
>
>
>  Of course I am use the time as a value .. But this is just for a 
> test. I have tried
>
>  <binding name="value"
> expression="table.currentRow.formattedDuration"/>
>
>  and even silly things that I know will return a value.   Nothing is
> ever seen in the table.
>
>   Any ideas ?
>
>
>
>
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 9:13 AM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> You could insert any value you want into that blocked code. It doesn't

> have to come from the jobOpsResultsTable even.
>
> Or, it could be a value combined from different properties of the row:
>
> <component id="formattedDuration" type="Insert">
>          <binding name="value 
> expression="jobOpsResultsTable.currentRow.someValue+ ' ' + 
> jobOpsResultsTable.someOtherValue"/>
>      </component>
>
>
>
> ----- Original Message -----
> From: "Lindsay Steele" <ls...@iinet.net.au>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Monday, September 20, 2004 7:00 PM
> Subject: RE: Column sorting in contrib:Table
>
>
>> Hi Jamie,
>>          That is close - and as you say it is a very simple way of 
>> doing things.
>>
>>   I am close to getting it running - the only problem is that I am 
>> sorting on a  value that is quite different (munged) to the displayed

>> valued.  You are showing  a value that is a date and using the date 
>> format.
>>
>>  Is there a way to just insert the value from elsewhere ?? .. Or 
>> should I maybe convert  the int I have to a date and use a date 
>> format
>
>> on that.
>>
>>   Thanks,
>>
>>         Lindsay
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 7:59 AM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> I think you're over-complicating this.
>>
>> Here's an example:
>>
>> <component id="jobOpsResultsTable" type="Table">
>>         <binding name="data" expression="job"/>
>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>                                               company
>>                                               duration:duration,
>>                                               resumeDueDate,
>>
opportunityExpiryDate"/>
>>     </component>
>>
>>
>>   <component id="durationColumnValue" type="Block"/>
>>     <component id="formattedDuration" type="Insert">
>>         <binding name="value" 
>> expression="jobOpsResultsTable.currentRow.duration"/>
>>          <binding name="format" 
>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>     </component>
>>
>> the first "duration" in the Table is the label for the top of the 
>> column, the "duration" after the colon tells the Table what property 
>> to sort on. If it's left out and you have a block then it won't sort.

>> With it there, it will sort on that value even though the column 
>> value
>
>> is intercepted by the block.
>>
>> Hope this helps,
>> Jamie
>>
>>
>> ----- Original Message -----
>> From: "Lindsay Steele" <ls...@iinet.net.au>
>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>> Sent: Monday, September 20, 2004 5:33 PM
>> Subject: Column sorting in contrib:Table
>>
>>
>>> Hi,
>>>    I am having some minor hassles with the column sorting in the 
>>> table.
>>>
>>>  The problem is I have a duration field, this is an int for the 
>>> number
>>
>>> of  seconds. I display from another method that shows the value 
>>> formatted in  minutes and seconds.
>>>
>>>  I have looked for solutions in the archives and have come up with 
>>> the
>>
>>> use of the
>>>  an ExpressionTableColumn.   I am trying to have one of these
> returned
>>> in the data
>>>  object passed to the table - this is not working and I am unsure if
>
>>> I
>>
>>> am doing it correctly.
>>>
>>>  Does anyone have any code examples or ideas on how I might 
>>> implement column sorting  in the table ??
>>>
>>> <binding name="columns">
>>>             '!select:select:select,' +
>>>             'extensionNo:Extns:extensionNo,' +
>>>             'username:Username:username,' +
>>>       'date:Date:dateFormatted,' +
>>>             'time:Time:timeFormatted,' +
>>>             'duration:Duration:durationFormatted,' +
>>>             'numberCalled:Number Called:numberCalled,' + 
>>> 'pabxLocation:Location:pabxLocation,' + 
>>> 'departmentId:Department:department'
>>>   </binding>
>>>
>>>  Thanks,
>>>
>>>         Lindsay
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: 
>> tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Column sorting in contrib:Table

Posted by Jamie Orchard-Hays <ja...@dang.com>.
If you cut and paste this, then it is a spelling problem:

"Duration" vs "durationColumnValue"

The first is capitalized and the second isn't!

Also, just for readability, if you use <static-binding> you won't need 
those single quotes and plus signs.

Jamie

On Sep 20, 2004, at 7:51 PM, Lindsay Steele wrote:

> I am sure I am missing something here ...
>
>  It is basically just ignoring the second block of code.  I also can't
> really see the tie in between
>  the two.
>
> I have the following
>
>    <component id="table" type="contrib:Table">
> 		<binding name="source" expression="callReport"/>
> 		<binding name="columns">
>             '!select:select:select,' +
>             'extensionNo:Extns:extensionNo,' +
>             'username:Username:username,' +
> 		'date:Date:dateFormatted,' +
>             'time:Time:timeFormatted,' +
>             'Duration:duration,' +
>             'numberCalled:Number Called:numberCalled,' +
> 		'pabxLocation:Location:pabxLocation,' +
> 		'departmentId:Department:department'
> 	  	</binding>
>         <binding name="pageSize" expression="500"/>
>         <binding name="pagesDisplayed" expression="25"/>
>         <binding name="rowClass" expression="next"/>
>    </component>
>
>     <component id="durationColumnValue" type="Block"/>
>     <component id="formattedDuration" type="Insert">
>       <binding name="value" expression="table.currentRow.time"/>
>     </component>
>
>
>  Of course I am use the time as a value .. But this is just for a test.
> I have tried
>
>  <binding name="value" 
> expression="table.currentRow.formattedDuration"/>
>
>  and even silly things that I know will return a value.   Nothing is
> ever seen in the table.
>
>   Any ideas ?
>
>
>
>
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 9:13 AM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> You could insert any value you want into that blocked code. It doesn't
> have to come from the jobOpsResultsTable even.
>
> Or, it could be a value combined from different properties of the row:
>
> <component id="formattedDuration" type="Insert">
>          <binding name="value
> expression="jobOpsResultsTable.currentRow.someValue+ ' ' +
> jobOpsResultsTable.someOtherValue"/>
>      </component>
>
>
>
> ----- Original Message -----
> From: "Lindsay Steele" <ls...@iinet.net.au>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Monday, September 20, 2004 7:00 PM
> Subject: RE: Column sorting in contrib:Table
>
>
>> Hi Jamie,
>>          That is close - and as you say it is a very simple way of
>> doing things.
>>
>>   I am close to getting it running - the only problem is that I am
>> sorting on a  value that is quite different (munged) to the displayed
>> valued.  You are showing
>>  a value that is a date and using the date format.
>>
>>  Is there a way to just insert the value from elsewhere ?? .. Or
>> should I maybe convert  the int I have to a date and use a date format
>
>> on that.
>>
>>   Thanks,
>>
>>         Lindsay
>>
>>
>> -----Original Message-----
>> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
>> Sent: Tuesday, 21 September 2004 7:59 AM
>> To: Tapestry users
>> Subject: Re: Column sorting in contrib:Table
>>
>>
>> I think you're over-complicating this.
>>
>> Here's an example:
>>
>> <component id="jobOpsResultsTable" type="Table">
>>         <binding name="data" expression="job"/>
>>         <static-binding name="columns" value="!jobTitle:jobTitle,
>>                                               company
>>                                               duration:duration,
>>                                               resumeDueDate,
>>                                               opportunityExpiryDate"/>
>>     </component>
>>
>>
>>   <component id="durationColumnValue" type="Block"/>
>>     <component id="formattedDuration" type="Insert">
>>         <binding name="value"
>> expression="jobOpsResultsTable.currentRow.duration"/>
>>          <binding name="format"
>> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>>     </component>
>>
>> the first "duration" in the Table is the label for the top of the
>> column, the "duration" after the colon tells the Table what property
>> to sort on. If it's left out and you have a block then it won't sort.
>> With it there, it will sort on that value even though the column value
>
>> is intercepted by the block.
>>
>> Hope this helps,
>> Jamie
>>
>>
>> ----- Original Message -----
>> From: "Lindsay Steele" <ls...@iinet.net.au>
>> To: "'Tapestry users'" <ta...@jakarta.apache.org>
>> Sent: Monday, September 20, 2004 5:33 PM
>> Subject: Column sorting in contrib:Table
>>
>>
>>> Hi,
>>>    I am having some minor hassles with the column sorting in the
>>> table.
>>>
>>>  The problem is I have a duration field, this is an int for the
>>> number
>>
>>> of  seconds. I display from another method that shows the value
>>> formatted in  minutes and seconds.
>>>
>>>  I have looked for solutions in the archives and have come up with
>>> the
>>
>>> use of the
>>>  an ExpressionTableColumn.   I am trying to have one of these
> returned
>>> in the data
>>>  object passed to the table - this is not working and I am unsure if
>
>>> I
>>
>>> am doing it correctly.
>>>
>>>  Does anyone have any code examples or ideas on how I might
>>> implement column sorting  in the table ??
>>>
>>> <binding name="columns">
>>>             '!select:select:select,' +
>>>             'extensionNo:Extns:extensionNo,' +
>>>             'username:Username:username,' +
>>>       'date:Date:dateFormatted,' +
>>>             'time:Time:timeFormatted,' +
>>>             'duration:Duration:durationFormatted,' +
>>>             'numberCalled:Number Called:numberCalled,' +
>>> 'pabxLocation:Location:pabxLocation,' +
>>> 'departmentId:Department:department'
>>>   </binding>
>>>
>>>  Thanks,
>>>
>>>         Lindsay
>>>
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Column sorting in contrib:Table

Posted by Lindsay Steele <ls...@iinet.net.au>.
I am sure I am missing something here ...

 It is basically just ignoring the second block of code.  I also can't
really see the tie in between 
 the two.

I have the following

   <component id="table" type="contrib:Table">
		<binding name="source" expression="callReport"/>
		<binding name="columns">
            '!select:select:select,' +
            'extensionNo:Extns:extensionNo,' +
            'username:Username:username,' +
		'date:Date:dateFormatted,' +
            'time:Time:timeFormatted,' +
            'Duration:duration,' +
            'numberCalled:Number Called:numberCalled,' +
		'pabxLocation:Location:pabxLocation,' +
		'departmentId:Department:department' 
	  	</binding>             
        <binding name="pageSize" expression="500"/>
        <binding name="pagesDisplayed" expression="25"/>
        <binding name="rowClass" expression="next"/>
   </component>   

    <component id="durationColumnValue" type="Block"/>
    <component id="formattedDuration" type="Insert">
      <binding name="value" expression="table.currentRow.time"/>
    </component>


 Of course I am use the time as a value .. But this is just for a test.
I have tried

 <binding name="value" expression="table.currentRow.formattedDuration"/>

 and even silly things that I know will return a value.   Nothing is
ever seen in the table.

  Any ideas ?






-----Original Message-----
From: Jamie Orchard-Hays [mailto:jamie@dang.com] 
Sent: Tuesday, 21 September 2004 9:13 AM
To: Tapestry users
Subject: Re: Column sorting in contrib:Table


You could insert any value you want into that blocked code. It doesn't
have to come from the jobOpsResultsTable even.

Or, it could be a value combined from different properties of the row:

<component id="formattedDuration" type="Insert">
         <binding name="value
expression="jobOpsResultsTable.currentRow.someValue+ ' ' +
jobOpsResultsTable.someOtherValue"/>
     </component>



----- Original Message ----- 
From: "Lindsay Steele" <ls...@iinet.net.au>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, September 20, 2004 7:00 PM
Subject: RE: Column sorting in contrib:Table


> Hi Jamie,
>          That is close - and as you say it is a very simple way of 
> doing things.
>
>   I am close to getting it running - the only problem is that I am 
> sorting on a  value that is quite different (munged) to the displayed 
> valued.  You are showing
>  a value that is a date and using the date format.
>
>  Is there a way to just insert the value from elsewhere ?? .. Or 
> should I maybe convert  the int I have to a date and use a date format

> on that.
>
>   Thanks,
>
>         Lindsay
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 7:59 AM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> I think you're over-complicating this.
>
> Here's an example:
>
> <component id="jobOpsResultsTable" type="Table">
>         <binding name="data" expression="job"/>
>         <static-binding name="columns" value="!jobTitle:jobTitle,
>                                               company
>                                               duration:duration,
>                                               resumeDueDate,
>                                               opportunityExpiryDate"/>
>     </component>
>
>
>   <component id="durationColumnValue" type="Block"/>
>     <component id="formattedDuration" type="Insert">
>         <binding name="value" 
> expression="jobOpsResultsTable.currentRow.duration"/>
>          <binding name="format" 
> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>     </component>
>
> the first "duration" in the Table is the label for the top of the 
> column, the "duration" after the colon tells the Table what property 
> to sort on. If it's left out and you have a block then it won't sort. 
> With it there, it will sort on that value even though the column value

> is intercepted by the block.
>
> Hope this helps,
> Jamie
>
>
> ----- Original Message -----
> From: "Lindsay Steele" <ls...@iinet.net.au>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Monday, September 20, 2004 5:33 PM
> Subject: Column sorting in contrib:Table
>
>
> > Hi,
> >    I am having some minor hassles with the column sorting in the 
> > table.
> >
> >  The problem is I have a duration field, this is an int for the 
> > number
>
> > of  seconds. I display from another method that shows the value 
> > formatted in  minutes and seconds.
> >
> >  I have looked for solutions in the archives and have come up with 
> > the
>
> > use of the
> >  an ExpressionTableColumn.   I am trying to have one of these
returned
> > in the data
> >  object passed to the table - this is not working and I am unsure if

> > I
>
> > am doing it correctly.
> >
> >  Does anyone have any code examples or ideas on how I might 
> > implement column sorting  in the table ??
> >
> > <binding name="columns">
> >             '!select:select:select,' +
> >             'extensionNo:Extns:extensionNo,' +
> >             'username:Username:username,' +
> >       'date:Date:dateFormatted,' +
> >             'time:Time:timeFormatted,' +
> >             'duration:Duration:durationFormatted,' +
> >             'numberCalled:Number Called:numberCalled,' + 
> > 'pabxLocation:Location:pabxLocation,' + 
> > 'departmentId:Department:department'
> >   </binding>
> >
> >  Thanks,
> >
> >         Lindsay
> >
> >
> >
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
tapestry-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Column sorting in contrib:Table

Posted by Jamie Orchard-Hays <ja...@dang.com>.
You could insert any value you want into that blocked code. It doesn't have
to come from the jobOpsResultsTable even.

Or, it could be a value combined from different properties of the row:

<component id="formattedDuration" type="Insert">
         <binding name="value
expression="jobOpsResultsTable.currentRow.someValue+ ' ' +
jobOpsResultsTable.someOtherValue"/>
     </component>



----- Original Message ----- 
From: "Lindsay Steele" <ls...@iinet.net.au>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, September 20, 2004 7:00 PM
Subject: RE: Column sorting in contrib:Table


> Hi Jamie,
>          That is close - and as you say it is a very simple way of doing
> things.
>
>   I am close to getting it running - the only problem is that I am
> sorting on a
>  value that is quite different (munged) to the displayed valued.  You
> are showing
>  a value that is a date and using the date format.
>
>  Is there a way to just insert the value from elsewhere ?? .. Or should
> I maybe convert
>  the int I have to a date and use a date format on that.
>
>   Thanks,
>
>         Lindsay
>
>
> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: Tuesday, 21 September 2004 7:59 AM
> To: Tapestry users
> Subject: Re: Column sorting in contrib:Table
>
>
> I think you're over-complicating this.
>
> Here's an example:
>
> <component id="jobOpsResultsTable" type="Table">
>         <binding name="data" expression="job"/>
>         <static-binding name="columns" value="!jobTitle:jobTitle,
>                                               company
>                                               duration:duration,
>                                               resumeDueDate,
>                                               opportunityExpiryDate"/>
>     </component>
>
>
>   <component id="durationColumnValue" type="Block"/>
>     <component id="formattedDuration" type="Insert">
>         <binding name="value"
> expression="jobOpsResultsTable.currentRow.duration"/>
>          <binding name="format"
> expression=":@some.package.SomeClass.@DATE_FORMAT"/>
>     </component>
>
> the first "duration" in the Table is the label for the top of the
> column, the "duration" after the colon tells the Table what property to
> sort on. If it's left out and you have a block then it won't sort. With
> it there, it will sort on that value even though the column value is
> intercepted by the block.
>
> Hope this helps,
> Jamie
>
>
> ----- Original Message ----- 
> From: "Lindsay Steele" <ls...@iinet.net.au>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Monday, September 20, 2004 5:33 PM
> Subject: Column sorting in contrib:Table
>
>
> > Hi,
> >    I am having some minor hassles with the column sorting in the
> > table.
> >
> >  The problem is I have a duration field, this is an int for the number
>
> > of  seconds. I display from another method that shows the value
> > formatted in
> >  minutes and seconds.
> >
> >  I have looked for solutions in the archives and have come up with the
>
> > use of the
> >  an ExpressionTableColumn.   I am trying to have one of these returned
> > in the data
> >  object passed to the table - this is not working and I am unsure if I
>
> > am doing it correctly.
> >
> >  Does anyone have any code examples or ideas on how I might implement
> > column sorting  in the table ??
> >
> > <binding name="columns">
> >             '!select:select:select,' +
> >             'extensionNo:Extns:extensionNo,' +
> >             'username:Username:username,' +
> >       'date:Date:dateFormatted,' +
> >             'time:Time:timeFormatted,' +
> >             'duration:Duration:durationFormatted,' +
> >             'numberCalled:Number Called:numberCalled,' +
> > 'pabxLocation:Location:pabxLocation,' +
> > 'departmentId:Department:department'
> >   </binding>
> >
> >  Thanks,
> >
> >         Lindsay
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Column sorting in contrib:Table

Posted by Lindsay Steele <ls...@iinet.net.au>.
Hi Jamie,
         That is close - and as you say it is a very simple way of doing
things.

  I am close to getting it running - the only problem is that I am
sorting on a 
 value that is quite different (munged) to the displayed valued.  You
are showing
 a value that is a date and using the date format.

 Is there a way to just insert the value from elsewhere ?? .. Or should
I maybe convert 
 the int I have to a date and use a date format on that.

  Thanks,

        Lindsay 


-----Original Message-----
From: Jamie Orchard-Hays [mailto:jamie@dang.com] 
Sent: Tuesday, 21 September 2004 7:59 AM
To: Tapestry users
Subject: Re: Column sorting in contrib:Table


I think you're over-complicating this.

Here's an example:

<component id="jobOpsResultsTable" type="Table">
        <binding name="data" expression="job"/>
        <static-binding name="columns" value="!jobTitle:jobTitle,
                                              company
                                              duration:duration,
                                              resumeDueDate,
                                              opportunityExpiryDate"/>
    </component>


  <component id="durationColumnValue" type="Block"/>
    <component id="formattedDuration" type="Insert">
        <binding name="value"
expression="jobOpsResultsTable.currentRow.duration"/>
         <binding name="format"
expression=":@some.package.SomeClass.@DATE_FORMAT"/>
    </component>

the first "duration" in the Table is the label for the top of the
column, the "duration" after the colon tells the Table what property to
sort on. If it's left out and you have a block then it won't sort. With
it there, it will sort on that value even though the column value is
intercepted by the block.

Hope this helps,
Jamie


----- Original Message ----- 
From: "Lindsay Steele" <ls...@iinet.net.au>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, September 20, 2004 5:33 PM
Subject: Column sorting in contrib:Table


> Hi,
>    I am having some minor hassles with the column sorting in the 
> table.
>
>  The problem is I have a duration field, this is an int for the number

> of  seconds. I display from another method that shows the value 
> formatted in
>  minutes and seconds.
>
>  I have looked for solutions in the archives and have come up with the

> use of the
>  an ExpressionTableColumn.   I am trying to have one of these returned
> in the data
>  object passed to the table - this is not working and I am unsure if I

> am doing it correctly.
>
>  Does anyone have any code examples or ideas on how I might implement 
> column sorting  in the table ??
>
> <binding name="columns">
>             '!select:select:select,' +
>             'extensionNo:Extns:extensionNo,' +
>             'username:Username:username,' +
>       'date:Date:dateFormatted,' +
>             'time:Time:timeFormatted,' +
>             'duration:Duration:durationFormatted,' +
>             'numberCalled:Number Called:numberCalled,' + 
> 'pabxLocation:Location:pabxLocation,' + 
> 'departmentId:Department:department'
>   </binding>
>
>  Thanks,
>
>         Lindsay
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Column sorting in contrib:Table

Posted by Jamie Orchard-Hays <ja...@dang.com>.
I think you're over-complicating this.

Here's an example:

<component id="jobOpsResultsTable" type="Table">
        <binding name="data" expression="job"/>
        <static-binding name="columns" value="!jobTitle:jobTitle,
                                              company
                                              duration:duration,
                                              resumeDueDate,
                                              opportunityExpiryDate"/>
    </component>


  <component id="durationColumnValue" type="Block"/>
    <component id="formattedDuration" type="Insert">
        <binding name="value"
expression="jobOpsResultsTable.currentRow.duration"/>
         <binding name="format"
expression=":@some.package.SomeClass.@DATE_FORMAT"/>
    </component>

the first "duration" in the Table is the label for the top of the column,
the "duration" after the colon tells the Table what property to sort on. If
it's left out and you have a block then it won't sort. With it there, it
will sort on that value even though the column value is intercepted by the
block.

Hope this helps,
Jamie


----- Original Message ----- 
From: "Lindsay Steele" <ls...@iinet.net.au>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, September 20, 2004 5:33 PM
Subject: Column sorting in contrib:Table


> Hi,
>    I am having some minor hassles with the column sorting in the table.
>
>  The problem is I have a duration field, this is an int for the number
> of
>  seconds. I display from another method that shows the value formatted
> in
>  minutes and seconds.
>
>  I have looked for solutions in the archives and have come up with the
> use of the
>  an ExpressionTableColumn.   I am trying to have one of these returned
> in the data
>  object passed to the table - this is not working and I am unsure if I
> am doing it correctly.
>
>  Does anyone have any code examples or ideas on how I might implement
> column sorting
>  in the table ??
>
> <binding name="columns">
>             '!select:select:select,' +
>             'extensionNo:Extns:extensionNo,' +
>             'username:Username:username,' +
>       'date:Date:dateFormatted,' +
>             'time:Time:timeFormatted,' +
>             'duration:Duration:durationFormatted,' +
>             'numberCalled:Number Called:numberCalled,' +
> 'pabxLocation:Location:pabxLocation,' +
> 'departmentId:Department:department'
>   </binding>
>
>  Thanks,
>
>         Lindsay
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org