PDA

View Full Version : DA Sort


xag
06-02-2009, 11:42 AM
Hello

I'm stuck making the column headers as links to pass the parameter to sort. In the DA Sort function I have the trigger being cStr(Request.QueryString("SortColumn")). I created SortColumn in the Binding panel. Next I have in the Sorting Area as my column with cStr(Request.QueryString("SortColumn")) and Sort order as Ascending.

Now here is where I get stuck. The table is currently only showing the first 15 records. When I go to make the table header a link i first put the filename i am working on then click in Parameters and click the dynamic pan in name... what should be the name and what should be the value? and how can I still make it work with the filtered querystring.

Thanks for yo help

Ray Borduin
06-02-2009, 12:20 PM
I think the name should be: SortColumn and the value should be the column name.

xag
06-02-2009, 12:33 PM
This is the SQL error I get
--[Microsoft][SQL Server Native Client 10.0][SQL Server]A column has been specified more than once in the order by list. Columns in the order by list must be unique.

Ray Borduin
06-02-2009, 12:43 PM
Do you already have an Order By you have added to the recordset? Remove that one and just use the server behavior.

xag
06-02-2009, 12:56 PM
No I don't I tried to follow the soulution receipe but he never said anything if you have a recordset paging. I keep getting an error. I have my trigger as SortColumn is it suppose to be my Binding Sort or the filtered QueryString? Then in my sorting area is it suppose to be my Sort Binding ? Or am I suppose to be putting the column name?

xag
06-02-2009, 12:59 PM
This is what the link I have in the header

<th class="WADAResultsTableHeader"><a href="/ControlPanel2s.asp?<%=cStr(Request.QueryString("Sort"))%>=USER_ID">USER_ID:</a></th>


Then my trigger is cStr(Request.QueryString("Sort")) and in my sorting area I have cStr(Request.QueryString("Sort")) as the column and Ascending as the order. When I save and test the page the sort link is not going anything and only returning this .asp?=USER_ID

Ray Borduin
06-02-2009, 01:00 PM
What is the default query on the recordset? Do you maybe have the sort server behavior applied more than once? It is hard to guess what is wrong without looking at the code.

Ray Borduin
06-02-2009, 01:01 PM
It should probably be:

<th class="WADAResultsTableHeader"><a href="/ControlPanel2s.asp?Sort=USER_ID">USER_ID:</a></th>

xag
06-02-2009, 01:05 PM
Yup thats what I thought so I manually changed it with no avail. Also the default query is with no sort. and no sever behavior on the whole page. Also the sort is not respecting the page offset when recordset navigation button is pressed.

Ray Borduin
06-02-2009, 01:21 PM
Have you read the help documentation on the feature? There is another part you need to add to your <a> tag to maintain the other url parameters.

Maybe ignore the fact that navigation doesn't work so you can concentrate on one thing at a time. There is functionality included to solve that problem, but concentrate on one thing at a time.

Once it is sorting we should be able to get it maintaining the url parameters so that navigation will work.

xag
06-03-2009, 11:47 AM
Hi Ray,

I've been taking my time with this and have a very simple page that just dumbs all of 5 records on a page. i've been trying to do this URL paramater with the header and it's not passing a value in the URL

Here is my header

<a href="/SortTest.asp?LOG_KEY=<%=cStr(Request.QueryString("ColumnSort"))%>">
LOG_KEY</a>


LOG_KEY is the header to my first column that is unsorted.

Attach is a screen shot of the Sort feature from DA.

thanks

xag
06-03-2009, 12:48 PM
Wow so i figured that i'm just a huge retard and re read all the post... Thanks for your help Ray I need to learn how to read and follow instructions.

xag
06-03-2009, 01:32 PM
ok Ray now that I got part one figured out I need part two. How do I "appended to the URL used to trigger the sort, and works in conjunction with the paging functions available in the Dreamweaver Recordset Navigation Bar"

Ray Borduin
06-03-2009, 03:05 PM
OK, on the bindings panel, click the plus button and go to "Querystring bindings".

Then in the filtered URL parameters enter the value of your url parameter like: LOG_KEY

Now click the help button... there is a bug that you need to blur the final field you input and this is the only way to do it in an interface with only one field... you can close the help window.

Then click OK.

Now update your url to:
<a href="/SortTest.asp?LOG_KEY=ColumnName&<?php echo("$WA_QSBind_FilteredString); ?>" >
LOG_KEY</a>

xag
06-04-2009, 05:51 AM
Thanks Ray!

xag
06-04-2009, 10:47 AM
One more Ray I promise! (fingers crossed behind my back of course)

I was just testing out my sort and notice something odd. When I first go to the back and sort by the column header i get the following error 'Subscript out of range: '[number: 0]'

I found out that this is because in my link the dreamweaver offset isn't set to = 0 (offset=0) in my URL. Is there anyway to set the offset that dreamweaver puts in after i click on one of the navigation to = 0 before the page loads?

Ray Borduin
06-04-2009, 10:58 AM
Add "offset" to the "Querystring bindings" settings. So instead of:

LOG_KEY

use:
LOG_KEY,offset

xag
06-04-2009, 11:22 AM
When I try to change it I get an error that says There are no QueryString bindings defined for this page

xag
06-04-2009, 11:29 AM
ok I was able to insert it. Now how do I append the offset binding to the of the links without messing them up

xag
06-04-2009, 11:50 AM
ok so when I do have offset in there it doesn't set itself to offset=0 before the page loads, it only sets itsself when I use the navigation tool once and it sets to the correct offset every time...

Ray Borduin
06-04-2009, 01:57 PM
Please describe the exact issue in more detail. I don't quite understand so I am unable to give advice.

xag
06-05-2009, 06:18 AM
ok so when I first go to my page /ControlPanel.asp there are no parms being passed yet or anything. I can see my recordset data and DW navigation buttons below my record set since its only shows the first 10 thus far. I get a 'Subscript out of range: '[number: 0]'' error when I click on one of my column headers and this is my URL when I click the header 'ControlPanel.asp?ColumnSort=LOG_KEY&' as you can see after the & nothing is being passed in the URL, what should be passed is offset =0.

But here is how it does work with no problem:

when I come to my page /ControlPanel.asp and use the recordset navigation images and display the next 10 recordsets I get this in my URL 'ControlPanel.asp?offset=10' . So now I go and use the column header links and this is in my URL '/ControlPanel.asp?ColumnSort=LOG_KEY&offset=0' so everything is showing up fine now and I can go about my business.


EDIT: OK i just found a work around... just manually put in the link ?offset=0 in the URL and it works fine