Forum OpenACS Q&A: table_def no_sort error

Collapse
Posted by alex vorobiev on
adding no_sort flag to table columns causes an error.

code:
set table_def {
    {project_no "Project No"}
    {title "Project Title" {no_sort}}
}

error:
Database operation "select" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR:  Attribute "no_sort" not found

SQL:
    select project_id,
          project_no,
          title
      from spm_projects

order by no_sort
and etc.

seems like table procs interpreting my no_sort literally as a sort argument...  does this warrant a bug report, or am i doing something wrong?

btw, is there a way to search bugs on the openacs.org site?

thanks

Collapse
Posted by Jade Rubick on
You can search bugs by clicking on Bugs from the main openacs page.

I'm not totally sure what you're trying to do.

Can you explain it more?

Collapse
Posted by alex vorobiev on
jade, first of all, thanks for your response...

i would be happy to explain.  i am just going through the tutorials,
https://openacs.org/doc/openacs-4-6-3/tutorial-pages.html,
and as per the ad_table manual
https://openacs.org/api-doc/proc-view?proc=ad_table
i was adding the "no_sort" option to various fields.  by default, all database fields rendered in a table by ad_table are sortable (clickable links); if i don't want someone to sort by a particular field, i would just specify the "no_sort" field just as the manual instructs...  this is not working, however...

since the list_builder is a replacement for ad_table, should i just ignore this tutorial example altogether?

re: searching bugs: i am on the openacs.org bugs page.  there are options to view bugs, submit, filter, do patches, and enter a bug id...  i don't see a way to search bugs (only bugs, not the entire site) by keyword that would do lookups on bug text fields...  am i missing something?

thanks

Collapse
Posted by Jade Rubick on
I wouldn't ignore the tutorial example. It's a pretty good tutorial. Joel might want to update it, however.

ad_table works fine -- I don't think it's deprecated. List-builder is better, however. It's worth learning.

You're right, I don't believe you can search for bugs. You could look on Google, perhaps.

In response to your question, however, I don't remember much on ad_table. It looks like you're including no_sort in the SQL query, however, which would treat "no_sort" like a SQL column. That' wouldn't work.

If you look at the api-doc (under https://openacs.org/api-doc I believe) it will show you the correct format for ad_table. I imagine no-sort might be an option like -no_sort

Collapse
Posted by Jon Griffin on
You also should look at my pagintor.
http://jongriffin.com/static/openacs/paginate/
It elimanates the many paginator/ad_table problems.
Hopefully mine can merge with Lars, and have the best of both of ours.
Collapse
Posted by alex vorobiev on
jade: yeah, i used the no_sort in my .tcl code as an argument to a table element.  as per the ad_table docs, it should be rendered in such a way as to make that column unsortable, but for some reason it is passing no_sort literally to the query.

jon: thanks for the link to paginator.  for some reason, i thought the two had already been merged...  i recall you and lars discussing a possible merge a while ago. :)