You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by Vikram Natarajan <vn...@pogohealth.com> on 2008/11/11 23:33:00 UTC

Sortable Table issue

Hi,

The sortable column's data has some special characters (?, hyphens, 
commas etc) and the data is breaking the sortable feature of the table. 
I have pasted part of the stack trace from the issue we are having. Is 
there a work around? Thanks for your help in advance. We are still on 
Click 1.4

 org.apache.velocity.exception.MethodInvocationException: Invocation of 
method 'toString' in  class net.sf.click.control.Table threw exception 
java.lang.NumberFormatException: For input string: "-" @ 
/users/interviews/search-results.htm[9,42]
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:286)
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:448)
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
17:30:37,406 INFO  [STDOUT]     at 
org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194)

Thanks
Vikram Natarajan

Re: Sortable Table issue

Posted by PJ Pillai <pj...@gmail.com>.
This is what I was looking for. Thanks Bob. I am in love with Click.

On Tue, Nov 11, 2008 at 10:14 PM, Bob Schellink <sa...@gmail.com> wrote:

> Hi PJ,
>
> You could use a template engine (Velocity, Freemarker etc) to layout the
> markup and add placeholders which are filled at runtime.
>
> Here are some docs about the two approaches, template vs programmatic:
> http://click.sourceforge.net/docs/controls.html#layout
>
> And here is a Velocity example:
>
> http://www.avoka.com/click-examples/velocity/action-table.htm
>
> http://www.avoka.com/click-examples/source-viewer.htm?filename=/velocity/action-table.htm
>
> There are also a Velocity Dreamweaver plugin but not sure how well it
> works.
>
> Hope this helps.
>
> kind regards
>
> bob
>
>
> PJ Pillai wrote:
>
>> Hi Bob,
>>
>> I read about Click on www.therserverside.com <
>> http://www.therserverside.com/> and decided to look into it. I
>> have worked on JSF, Wicket and Tapestry. But I like the simplicity and
>> ease
>> of use.
>> At this point, I have a quick question. I looked at form examples. The
>> html
>> template shows just $form reference.
>> I would like to build my template using HTML authoring tool like
>> Dreamweaver, create form and its elements and location in Dreamweaver. And
>> at run time, I want Click to fill the values in the form element and show
>> it
>> user. I don't want to build the complete form into page class.
>> I work with HTML designer who designs the HTML based on customer
>> requirement.
>> Is it possible to do in Click?
>> Thanks,
>> PJP
>>
>
>

Re: Sortable Table issue

Posted by Bob Schellink <sa...@gmail.com>.
Hi PJ,

You could use a template engine (Velocity, Freemarker etc) to layout 
the markup and add placeholders which are filled at runtime.

Here are some docs about the two approaches, template vs programmatic:
http://click.sourceforge.net/docs/controls.html#layout

And here is a Velocity example:

http://www.avoka.com/click-examples/velocity/action-table.htm
http://www.avoka.com/click-examples/source-viewer.htm?filename=/velocity/action-table.htm

There are also a Velocity Dreamweaver plugin but not sure how well it 
works.

Hope this helps.

kind regards

bob


PJ Pillai wrote:
> Hi Bob,
> 
> I read about Click on www.therserverside.com 
> <http://www.therserverside.com/> and decided to look into it. I
> have worked on JSF, Wicket and Tapestry. But I like the simplicity and ease
> of use.
> At this point, I have a quick question. I looked at form examples. The html
> template shows just $form reference.
> I would like to build my template using HTML authoring tool like
> Dreamweaver, create form and its elements and location in Dreamweaver. And
> at run time, I want Click to fill the values in the form element and show it
> user. I don't want to build the complete form into page class.
> I work with HTML designer who designs the HTML based on customer
> requirement.
> Is it possible to do in Click?
> Thanks,
> PJP


Re: Sortable Table issue

Posted by PJ Pillai <pj...@gmail.com>.
Hi Bob,

I read about Click on www.therserverside.com and decided to look into it. I
have worked on JSF, Wicket and Tapestry. But I like the simplicity and ease
of use.
At this point, I have a quick question. I looked at form examples. The html
template shows just $form reference.
I would like to build my template using HTML authoring tool like
Dreamweaver, create form and its elements and location in Dreamweaver. And
at run time, I want Click to fill the values in the form element and show it
user. I don't want to build the complete form into page class.
I work with HTML designer who designs the HTML based on customer
requirement.
Is it possible to do in Click?
Thanks,
PJP

Re: Sortable Table issue

Posted by Bob Schellink <sa...@gmail.com>.
Hi Vikram,

I believe this has been fixed in 1.5: 
http://www.avoka.com/jira/browse/CLK-358

You might want to patch Column until you upgrade:
http://fisheye3.atlassian.com/browse/click/trunk/click/framework/src/net/sf/click/control/Column.java?r1=2703&r2=2847

Alternatively you could set your own Comparator.

Let us know if that resolves it for you.

kind regards

bob


Vikram Natarajan wrote:
> Hi,
> 
> The sortable column's data has some special characters (?, hyphens, 
> commas etc) and the data is breaking the sortable feature of the table. 
> I have pasted part of the stack trace from the issue we are having. Is 
> there a work around? Thanks for your help in advance. We are still on 
> Click 1.4
> 
> org.apache.velocity.exception.MethodInvocationException: Invocation of 
> method 'toString' in  class net.sf.click.control.Table threw exception 
> java.lang.NumberFormatException: For input string: "-" @ 
> /users/interviews/search-results.htm[9,42]
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:286) 
> 
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203) 
> 
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294) 
> 
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:448)
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170) 
> 
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318) 
> 
> 17:30:37,406 INFO  [STDOUT]     at 
> org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194) 
> 
> 
> Thanks
> Vikram Natarajan
>