Hi Ross,

Before I respond to your question, I would like to point out that since 2.2 there is a Table component in the Contrib library that comes with Tapestry and performs pretty much what you seem to need as well as a few other things, such as pagination. It can probably save you a lot of time. You can get help on how to use it from:

http://www.geocities.com/mindbridgeweb/TapestryTable.html

Back to your question. Since 'column' and 'currentlySelectedColumn' are parameters, I assume that you are making a component to display the column header. Here is how I would do it (if the disabled parameter is to be used):

In the java bean:

// this could be done via OGNL as well, but in this case it is better to be done in the bean 
// since it is used multiple times
public boolean getIsCurrentlySelected() {
  // if the bindings are of type custom, rather than 'in',
  // use getColumnBinding().getObject() 
  // and getCurrentlySelectedBinding().getObject() instead
  return getColumn().equals(getCurrentlySelected()); 
}

In the JWC:

<component id=directColumn type="DirectLink">
    ....
    <binding expression="isCurrentlySelected" name="disabled">
</component>
<component id=condShowArrow type="Conditional">
    <binding expression="isCurrentlySelected" name="condition">
</component>

In the HTML template:

<A jwcid="directColumn">....</A>
<SPAN jwcid="condShowArrow">...</SPAN>

I hope this helps. There are a number of other ways to do it as well, but this one is the clearest I think. Please feel free to ask if you have further questions.

Best regards,

-mb

 Ross Baker <[EMAIL PROTECTED]> wrote:

Firstly, I'd like to compliment Howard and the rest of the contributors.
This is a wonderful framework!

I am trying to implement a link for sortable column headers. I declared
'column' and 'currentlySelectedColumn' as parameters in my .jwc. If the
two are equal, the link should be disabled and a down arrow should be
rendered next to the text. I did not declare a 'disabled' property,
because it is determined by the relationship between the other
parameters. For the component class, I extended DirectLink and overrode
the isDisabled() method in terms of the column parameters. Bug #629287
says this the wrong approach. What is the Right and Proper Tapestry
Way?

Thanks in advance,
Ross


-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer



Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

Reply via email to