Recordset Paging
Dear All,
Can anyone plz help me in knowing how the prev << 2 3 4 5 6 >> Next link can be used to navigate from first 10 records to display next 10 and then other next.
Plz reply soon, its urgent.
Regards,
Simmy
your problem is highly depending on the way you write your JSP's. Do you use scriptlets, or JSTL? Do you use servlets?
The basic way would be to do keep track of a pagenumber. Somewhere you hardcode how many records to display per page, say a 100. So page 1 contains records 1-100, page 2 contains records 101-200, etc. Using the pagenumber you can calculate what record to display first.
To limit your resultset: this is more tricky. If you are using MySQL/PostgreSQL, you can use the LIMIT() sql command. Otherwise you will have to use the setMaxRows() method of the Statement object.
A trick to fix the next>> link is to fetch 1 record more than you are willing to display (so if you display a 100 records, fetch a 101 records). If you actually have a 101 records in your resultset, you can safely display a next>> link because you know for sure that there is at least one more record available to display.
I hope this has given you enough of a hint to fix the problem yourself.
Similar Messages
-
After Creating a RecordSet using Wizard, Unable to Create RecordSet Paging - Error Occurs
I created a record set using the wizard and it tested just fine using the test button. So my next step was to create the "RecordSet Paging" "Move to First Record", whe I select this I get the error "Before using this Server Behavior, please create a record set"
The record set is there, it is even checked off in the binding list as being there, yet I can not do anything, I even went in and deleted it and tried again with the same result, this is getting very annoying and is causing me a lot of extra work.
Is this a BUG!!!
I have seen this issue several times now.
Running Version 11.0 build 4993
Signed
Frustrated!!!!!Hi,
For questions regarding dynamic site development, hop over to the following forum. You'll get better answers there.
Dreamweaver Application Development Forum
http://forums.adobe.com/community/dreamweaver/dreamweaver_development?view=discussions
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb -
Recordset paging without refresh
Hi i have some recordset paging halfway down my page and when
i click next prev the page refreshs and it goes to the top of the
page which is annoying as you have to scroll down again to see the
next set of records.
I tried using anchors to get the page to stay where the
paging is but i get a undynamic looking flash as it corrects
itself.
Is there a way to solve this?Hi i have some recordset paging halfway down my page and when
i click next prev the page refreshs and it goes to the top of the
page which is annoying as you have to scroll down again to see the
next set of records.
I tried using anchors to get the page to stay where the
paging is but i get a undynamic looking flash as it corrects
itself.
Is there a way to solve this? -
Spry Tabbed Panel Defaults to home page with recordset paging
I have Spry ver. 1.6.1. A Spry Tabbed Panel titled "Check Ride Activity Report" (Tab 6) accesses a mysql database and shows the records in a table format. Instead of having all the records display at once I want to limit the records displayed to a few at a time. e.g. 5 per page. I added a recordset navigation bar and set the $maxRows_GetChkRideRecs = 5; It works but each time the navigation bar "Next" or "Last" or "First" or "Previous" is clicked the page reloads with the default Home page Tab displayed. The user then has to click on Tab 6 to view the new results. The url where this can be viewed is at http://Training.reliantair.com. Is there a way to code this tab so that Tab 6 remains the default tab once it is selected until the user selects another tab?
I want to avoid putting another button on the page to accomplish this as shown in the spry utils samples where the user clicks to set the default tab.
Can this be done within the recordset paging code similar to how it is done on a form submit to keep the focus on the current tab?I didn't try the cookie method suggested. The tab method listed in spry utils does work but requires an additional button, so I came up with this solution.
In the Head of the HTML document I put this code. It searches for the query string in the HREF when any of the record paging buttons is pressed.
<script type="text/javascript" src="SpryURLUtils.js"></script>
<script type="text/javascript">
var params = Spry.Utils.getLocationParamsAsObject();
if (location.href.indexOf("GetChkRideRecs") != -1 && location.href.indexOf("tab") == -1)
location.href +="&tab=5#TabbedPanels1";
</script>
Then in the body of the HTML document at the bottom of the page the tabbed panel widget is changed like this:
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1",{defaultTab: (params.tab ? params.tab:0)});
The first time a recordset paging link is clicked the HREF attribute of &tab=5#TabbedPanels1 is added to the location HREF. Subsequent clicks of any of the links do not change the HREF because the code looks for "tab" and does nothing if it is found. -
Ampersands not being encoded in recordset paging
Trying to validate a page and it appears that the ampersands
are not being encoded, thus not validating the page. When I create
a link and use parameters the ampersands get encoded correctly, its
just the next/previous links that don't appear to get encoded. Any
ideas how to overcome this? The links in Dreamweaver are just
variables, and I could try to replace the & in the function
that creates them with &Amp; but I would have to do this
everytime I used recordset paging.
SteveI used the wrong syntax for the URLEncode, here is what made
it work:
<%
MM_moveFirst = Server.URLEncode(MM_moveFirst)
MM_moveLast = Server.URLEncode(MM_moveLast)
MM_moveNext = Server.URLEncode(MM_moveNext)
MM_movePrev = Server.URLEncode(MM_movePrev)
%>
Once I had sorted these I had to also sort all the other
ones, and am still struggling to get it to validate, it seems like
a lot of work, so will leave it for another day. -
I am trying to use the recordset paging button in dreamweaver it seems to load right
but when I hit next it says 0-0 zero and is empty even though the first page says there is
517 items to look at . I am not getting to the second page and beyond for some reason I cant figure out. Is this an issue with cs3 I have cs4 as well but use cs3 on my laptop. I can post the code if need be ...Thanks for the helpful info.
Brandon
"danilocelic AdobeCommunityExpert"
<[email protected]> wrote in
message news:f7ll5h$1u9$[email protected]..
> Nancy - Adobe Comm. Expert wrote:
>> The code for
>>> the recordsets created with CS3 appears to be
different. Why would the
>>> new code "break" my setup (it's not recognizing
any sorts)?
>>
>>
>> Recordset code was not updated in CS3, but rather in
8.02 to deter SQL
>> injection attacks. Quickly remake the recordset with
the new version and
>> you should be good to go.
>
> Nancy,
>
> Unfortunately, what the OP is asking for isn't possible
with the "new
> version" of recordset, as it assumes that all parameters
within the SQL
> are column value parameters, and dynamic SQL generation
is no longer
> supported. This has caused a number of folks )including
Tom Muck quite
> vociferously) to complain about the lack of versatility
of the new
> recordset code.
>
>
>
> Brandon, What you'll need to do is to hand edit the
recordset after you've
> applied it to the page. I've not tried this particular
use case recently,
> but it is possible that after editing that DW will no
longer recognize
> that the recordset is on the page.
>
> FWIW: You should never directly use a querystring
parameter in your code,
> you should always "clean" it first. IIRC The old style
of recordsets did a
> replace on the value replacing all single quotes with
doubled single
> quotes. A better way may be to have some code that
checks for the value of
> the querystring parameter and if it matches one of your
column you can
> sort on, then use a string of your own making to use
within the SQL.
>
>
> --
> Danilo Celic
> | Extending Knowledge Daily :
http://CommunityMX.com/
> | Adobe Community Expert -
I need to display many records, and I will acheive this by using the recordset paging features, but I have content above my list that I only want visible on the first page. Is there a way to remove the surplus content on subsequent pages? If so, how?
Thanks.Test the recordset paging value in the querystring. If it's above the range of the first page, branch around the code you don't want to execute. Include a sample of your page code if you need more specific details.
-
Recordset paging with two db in a single page
I have two table to be show in a page, I can create a
recordset paging for a table(A), but when i try create another
recordset paging for other table(B) it changes all my other
behaviors for my table(A). so is there any help for this?Create the rs for table A on one page, then create the rs for
table B on another page, then go to the code for table B and copy
it from the second page and paste it into the first page with table
A.
Have you got a connection string for both db's? If you have
two db's, then you should have two connection strings at the top of
the page after the first line of code.
I have a site with three db's on a couple of pages!
Mat -
Problems with recordset paging and dynamic menu displaying all the options
Hi hope someone can help on this - I've posted the code on the FoEd Backend Blight - with no takers/success yet -
I've created a jobs page using DWCS3 which has a dynamic drop down menu filtering the 'countries' that jobs are located in. When I introduce a recordset page only those countries associated with the jobs on that particular page are shown in the dynamic menu above, not all of the countries listed in the database. When I get to the second page of results - again - only those jobs' countries are shown in the menu (and not the previous pages/next pages as well).
I'd clearly like a user to be able to select from the menu of countries available for all the jobs in the database, and not just those on the page. Any ideas?
On a similar strain - my country menu/filter is wrapped up in a form above the list of jobs. On loading the page, only the search and menus appear. No jobs are shown until I hit submit. Is there a way to have all the jobs display on first load, and then for the search/menu filter to work on the displayed jobs. I've tried altering the variables on the search to 1 from -1, and other options but I can't seem to get a page of content on first load.
I'd really appreciate any pointers on the above, as this would help solve the final stage of my project. The full post and code can be seen on the friendsofed website under backend blight.
Many thanks in advance.
MattI'm still stuck on getting the page to load with some actual content, however. I'm just getting the search box and country filter displaying on first load.
Pages 584-6 explain why you get nothing when a page first loads. Dreamweaver sets the default value to -1. The problem with trying to change the default value even to an empty string or % is that Dreamweaver's security function, GetSQLValueString() changes an empty string to NULL and wraps % in quotes, so neither will work.
One way to display all records when the page first loads is to create another recordset that selects all records. Wrap the code in a conditional statement that checks whether the $_GET array contains any values:
if (!$_GET) {
// recordset to retrieve all records here
This means that you need two repeat regions to display the results. Wrap both of them in conditional statements:
if (isset($fullRecordsetName)) {
// display the full recordset
} elseif (isset($searchResultsRecordsetName)) {
// display the search results
You also need to wrap the mysql_free_result() statements in conditional statements at the end of the page:
if (isset($fullRecordsetName)) mysql_free_result($fullRecordsetName);
if (isset($searchResultsRecordsetName)) mysql_free_result($searchResultsRecordsetName);
Another way to do it is to use just one recordset, but split the SQL query into two sections:
$query_RecordsetName = "SELECT * FROM myTable";
if (isset($_GET['searchTerm')) {
$query_RecordsetName .= sprintf(" WHERE searchTerm LIKE %s",
GetSQLValueString("%" . $colname_RecordsetName . "%", "text"));
This uses the combined concatenation operator to add the WHERE clause to the query only if $_GET['searchTerm'] has been set. Notice that you need a space before the "WHERE". -
Hi
I have a problem with my recordset. Im trying to add
navigation and that shows up on first page. Ive also added count
and this counter says its only app 600 records found. Now, I know
that it has more than 26000 records. In my query it shows all...Why
wont it show all in counter? The next problem is when I do a query
it wont show navigation at all. Anyone who has a solution.Ive manage to show pagenavigation but all it does is that
when I press next it goes to first page in the recordset and not
the next query search results. Anyone?? -
Recordset pageing and unencoded ampersands in URLs
Hi
In DW8 the code written by the record set paging object fails w3c validation because of unencoded ampersands in URLs
ie
page.php?pageNum_portfolio=1&totalRows_portfolio=52
rather than
page.php?pageNum_portfolio=1&totalRows_portfolio=52
Can anyone advise how I resolve this?
Has this been fixed in a later release of DW?
Thanks
http://www.lamtha2.co.uk/portfolio.php?pageNum_portfolio=1&totalRows_portfolio=52Are you using Dreamweaver 8.0.2? If not, get the updater from http://www.adobe.com/support/dreamweaver/downloads_updaters.html#dw8. You will also need to install the PHP extension fix for 8.0.2. Get it from the link in the first paragraph on the following page: http://kb2.adobe.com/cps/000/b6c2ae2a.html.
I have just compared the code from a site made in DW 8.0.2 with one made in DW CS4. It's identical, and it correctly encodes the ampersand.
If you're using 8.0.2, and the ampersand is not correctly encoded, it could be the version of PHP you're using. Try the following:
<?php printf('&'); ?>
Load that into a browser and view the source. In PHP 5.3, it outputs it as the correct HTML entity. -
Search Result Recordset Paging
The standard Dreamweaver Recordset Navigation Bar works well
with the listing recordset.
But when I tried to use it with my search result recordset, I
had the following error message (searchgallery is the name of the
TextField of my search bar):
Variable SEARCHGALLERY is undefined.
The error occurred in
C:\ColdFusion8\wwwroot\visual_cornucopia\stunninglygorgeous.com\www\gallery.cfm:
line 90
88 : SELECT *
89 : FROM image_img
90 : WHERE image_img.filename_img LIKE '%#searchgallery#%'
91 : OR image_img.description_img LIKE '%#searchgallery#%'
92 : </cfquery>
Please Help !
Amanda NguyenThis was a problem with POST as soon as I changed it all to
GET the problem went away. I haven't a clue why this happened. Went
back a few times and the same thing happened everytime.
Using POST on other pages in my website no problems. -
Cannot get recordset navigation to work
I've created a search results page with a recordset titled
rsPhoneList. Here is the code for it that DW created:
SELECT *
FROM DistrictPhoneList
WHERE EmpName LIKE %colname%
When I run a test on it, it displays 17 of my records when I
put in a few letters for a name and indeed there are 17 records.
That works great. For the repeat region, I changed it to show 10
records at a time. When I do the search, it comes up with 10
records.
However, the navigation bar will not work. I go to Insert,
Dynamic Data, Recordset Paging, Recordset Navigation. It created my
recordset navigation bar. I save and upload. When I do the search
it shows me the first 10 records. When I click Next, it shows me an
empty table with the correct headings, but no records. Nothing
works, the previous, next, last. Here is the code it created:
<table border="0">
<tr>
<td><?php if ($pageNum_rsPhoneNames > 0) { //
Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsPhoneNames=%d%s",
$currentPage, 0, $queryString_rsPhoneNames);
?>">First</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_rsPhoneNames > 0) { //
Show if not first page ?>
<a href="<?php printf("%s?pageNum_rsPhoneNames=%d%s",
$currentPage, max(0, $pageNum_rsPhoneNames - 1),
$queryString_rsPhoneNames); ?>">Previous</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_rsPhoneNames <
$totalPages_rsPhoneNames) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsPhoneNames=%d%s",
$currentPage, min($totalPages_rsPhoneNames, $pageNum_rsPhoneNames +
1), $queryString_rsPhoneNames); ?>">Next</a>
<?php } // Show if not last page ?>
</td>
<td><?php if ($pageNum_rsPhoneNames <
$totalPages_rsPhoneNames) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_rsPhoneNames=%d%s",
$currentPage, $totalPages_rsPhoneNames, $queryString_rsPhoneNames);
?>">Last</a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
What am I doing wrong or what can I do to get it to work
correctly and show me the rest of the records in the recordset.
Thanks,
--LindaOn the search page, using Post doesn't seem to work with the
Recordset Paging, Insert Navigation bar. I did some further reading
and saw that someone else had the issue as well and changed to GET.
I did that and now everything works. -
Broken Recordset:
I have created a Form with a table that includes 15
textfields and a recordset that polls data based on a login page. I
have mapped specific fields from the database to return the data
under the textfields that are labeled First Name, Last Name, ID,
and 13 other informational fields. The login page only asks the
users for their First Name, Last Name and an ID which corresponds
to the recrdset I have created. When a user logs in only 6 of the
fields are populated by the recordset and the rest are blank when
their is data in all fields in the database. Now here is the
strange thing..If i copy the recordset and rename it and then map
another field or two that were not populating from the original
recordset, that field or two now shows up. So I can get all fields
to populate by creating multiple recordsets, I have created up to
SEVEN duplicate Recordsets to get all the info to populate.
This is a big issue as this is a View page and the recordset
paging can only be linked to ONE recordset so only some of my data
shows when users page/scroll through the records.
It almost sounds like a memory buffer issue in Dreamweaver
Recordset code.
Has anyone experienced this issue and is there a
resolution?MBaron007 wrote:
> Broken Recordset:
> I have created a Form with a table that includes 15
textfields and a recordset
> that polls data based on a login page. I have mapped
specific fields from the
> database to return the data under the textfields that
are labeled First Name,
> Last Name, ID, and 13 other informational fields. The
login page only asks the
> users for their First Name, Last Name and an ID which
corresponds to the
> recrdset I have created. When a user logs in only 6 of
the fields are
> populated by the recordset and the rest are blank when
their is data in all
> fields in the database. Now here is the strange
thing..If i copy the recordset
> and rename it and then map another field or two that
were not populating from
> the original recordset, that field or two now shows up.
So I can get all
> fields to populate by creating multiple recordsets, I
have created up to SEVEN
> duplicate Recordsets to get all the info to populate.
> This is a big issue as this is a View page and the
recordset paging can only
> be linked to ONE recordset so only some of my data shows
when users page/scroll
> through the records.
> It almost sounds like a memory buffer issue in
Dreamweaver Recordset code.
> Has anyone experienced this issue and is there a
resolution?
Nothing to do with memory, more than likely due to your data
types. What
database are you using? What data types for each column are
you using?
Steve -
Form values not carried over to subsequent recordset displays
Example
of the problem
(Input the name "hruska" and then attempt to get the second
page of 30 results.)
This is a form which inserts the variable of "last_name" into
a query for records from my db. Using the DW CS3 server behaviors
(with some modification), I'm displaying the rows in a table 30 to
a page and have a recordset navigation bar below my results table
to advance to subsequent result displays.
The first 30 results display but when I click the "next"
arrow/button to call up the next 30 results, I only get the table
headers and the recordset navigation bar. The page says I'm
displaying the next 30 results from the db, but they don't show.
However, if I re-enter the last name and re-submit, voila, there
are my next 30 results.
I understand why this is happening, but I don't understand
the best way to fix it so my recordset paging works without having
to resubmit the variable for each subsequent result display.
I appreciate any help anyone can offer.
Code follows:Hi,
as this forum is focused on the Adobe Dreamweaver Developer Toolbox (ADDT) - extension and its usage, I'd suggest asking your question in the "Dreamweaver Application Development" forum
Günter Schenk
Adobe Community Expert, Dreamweaver
Maybe you are looking for
-
How to measure thermocouple in lab view and save the data..
hi.. i am using my DAQ with 2 analog channels.. i need to acquire signal from thermo couple i have T type thermo couple with brown jacket.. i have connected the thermocoupe in ai0.. and i selected the thermocouple type... when i select the built in o
-
How do I sync the contacts on my iphone 5 and my macbook and my email?
I can't get all my contacts to sync with one another so the info that appears on my computer is the same as the info on my iphone. Help!
-
Cant burn dvds!??
I have googled and googled but can't find anything online that says anything about why all of a sudden I can't burn any dvds? Got my imac in Julyish of 08' and I have the "MATSHITA DVD-R UJ-875:" I don't know anything in terms of if I need to clean i
-
Flash player 11.7.700.203 update won't download.
I've tried advice from the forums but it still says it's not installed. Please help.
-
Can I transfer a video disk from my IMAC to my IPAD 4? I own the video.