Simple Logic but annoying

I got this code from a web site ...it seems easy....The
trouble I am having is : when the page loads it shows 10 record per
page but when I click next link it shows 20 records on the
page...another next will populate 30 records on page...I need 10
records on each navigation...Any help :D
<cfparam name="start" type="numeric" default="1">
<cfparam name="step" type="numeric" default="10">
<cfquery datasource="..." name="queryResults">
select * from table
</cfquery>
<cfif queryResults.recordcount gt 0>
<cfoutput>
<p>
<!--- if past start --->
<cfif (start-step-step) gt 1>
<a href="#cgi.SCRIPT_NAME#?start=1"><img
src="/images/beginning_blue.png" alt="Beginning"
align="absbottom"></a>
</cfif>
<cfif start gt 1>
<a href="#cgi.SCRIPT_NAME#?start=#start-step#"><img
src="/images/previous_blue.png" alt="Previous"
align="absbottom"></a>
</cfif>
<strong>#start# - #iif(start + step gt
queryResults.recordcount,queryResults.recordcount,start + step-1)#
of #queryResults.recordcount# records</strong>
<!--- if still some not displayed --->
<cfif (start + step) lte queryResults.recordcount>
<a href="#cgi.SCRIPT_NAME#?start=#start+step#"><img
src="/images/next_blue.png" alt="Next"
align="absbottom"></a>
</cfif>
<cfif (start+step+step) lte queryResults.recordcount>
<a
href="#cgi.SCRIPT_NAME#?start=#queryResults.recordcount-step+1#"><img
src="/images/end_blue.png" alt="End"
align="absbottom"></a>
</cfif>
</p>
</cfoutput>
</cfif>
<cfloop query="queryResults" startrow="#start#"
maxrow="#start + step-1#">
...... output query here
</cfloop>

There is an example that does just this in the CF help
look-up cfquery / example
I've posted the example below
Example
<!--- This example shows the use of CreateTimeSpan with
CFQUERY ------>
<!--- to cache a record set. Define startrow and maxrows
to ---->
<!--- facilitate 'next N' style browsing. ---->
<cfparam name="MaxRows" default="10">
<cfparam name="StartRow" default="1">
<!--------------------------------------------------------------------
Query database for information if cached database information
has
not been updated in the last six hours; otherwise, use cached
data.
--------------------------------------------------------------------->
<cfquery
name="GetParks" datasource="cfdocexamples"
cachedwithin="#CreateTimeSpan(0, 6, 0, 0)#">
SELECT PARKNAME, REGION, STATE
FROM Parks
ORDER BY ParkName, State
</cfquery>
<!--- Build HTML table to display query.
------------------------->
<table cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="f0f0f0">
</td>
<td bgcolor="f0f0f0">
<b><i>Park Name</i></b>
</td>
<td bgcolor="f0f0f0">
<b><i>Region</i></b>
</td>
<td bgcolor="f0f0f0">
<b><i>State</i></b>
</td>
</tr>
<!--- Output the query and define the startrow and maxrows
parameters.
Use the query variable CurrentCount to keep track of the row
you
are displaying. ------>
<cfoutput query="GetParks" startrow="#StartRow#"
maxrows="#MaxRows#">
<tr>
<td valign="top" bgcolor="ffffed">
<b>#GetParks.CurrentRow#</b>
</td>
<td valign="top">
<font size="-1">#ParkName#</font>
</td>
<td valign="top">
<font size="-1">#Region#</font>
</td>
<td valign="top">
<font size="-1">#State#</font>
</td>
</tr>
</cfoutput>
<!--- If the total number of records is less than or equal
to the total number of rows, then offer a link to
the same page, with the startrow value incremented by
maxrows (in the case of this example, incremented by 10).
--------->
<tr>
<td colspan="4">
<cfif (StartRow + MaxRows) LTE GetParks.RecordCount>
<cfoutput><a
href="#CGI.SCRIPT_NAME#?startrow=#Evaluate(StartRow +
MaxRows)#">
See next #MaxRows# rows</a></cfoutput>
</cfif>
</td>
</tr>
</table>

Similar Messages

  • Simple, funny but annoying question, putting a pixel

    Maybe this could be simple, funny but annoying question.
    How do you put a pixel or draw a pixel?
    Is there a method to draw a pixel directly on screen in j2SDK API?

    This is a very open ended question, do you want to draw a pixel in an image or just draw a shape on the screen?
    If you want to edit single pixels at a time then the best option is to create a BufferedImage and use the WritableRaster to edit the pixels you want by using setPixel().
    Something like the following:
    BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    WritableRaster raster = img.getRaseter();
    raster.setPixel(x_coord, y_coord, new int[]{R_val, G_val, B_val});This image can then be displayed by putting it in a JLabel (there are many other techniques but I find this the easiest method).
    JLabel l = new JLabel(new ImageIcon(img));
    JFrame jf = new JFrame();
    jf.setContentPane(l);
    jf.pack();Alternatively, you can draw shapes by using Graphics or Graphics2D objects
    e.g.
    public class MyPanel extends JPanel
      public void paintComponent(Graphics2D g)
         super.paintComponent(g);
         g.drawLine(x1,y1,x2,y2);
    }Hope this helps,
    Stef

  • Need pl/sql stmnts. for this simple logic

    Hi,
    I need PL/SQL program for this simple logic i am doing mistake somewhere unbale to trace
    out ..
    select * from GSR03_PO_DTL;
    PO_NUM
    L53177000 -- > no changes reqd (only one entry with new format)
    L00041677 --> to be updated to L41677000(only one entry with OLD format)
    L43677000 -- > no change reqd (exists one row with new format and old format like below)
    L00043677 -- > to be deleted this is old format (and new format like above already exists)
    EX:
    L00012345 --- old format
    L12345000 --- new format
    Hope question is clear. I written the following program.
    update is working fine but delete is not working.
    Please help.
    Thanks in Advance
    Devender
    declare
    Cursor c_test is
    (select po_num from GSR03_PO_DTL);
    BEGIN
    FOR r_test in c_Test
    LOOP
    dbms_output.put_line (r_test.po_num);
    IF ('L'||substr(r_test.po_num,5,5)) = ('L'||substr(r_test.po_num,2,5)) then
         dbms_output.put_line ('delete stmnt');
    END IF;     
    EXIT WHEN c_test%NOTFOUND;
    END LOOP;
    FOR r_test in c_Test
    LOOP
    IF r_test.po_num like 'L000%' then
    IF ('L'||substr(r_test.po_num,5,5)) is not NULL then
         update GSR03_PO_DTL set PO_NUM = 'L'||substr(po_num,5,5)||'000'
         where po_num like 'L000%' ;
         dbms_output.put_line ('update stmnt');
    END IF;     
    END IF;
    END LOOP;
    END;
    *********************

    No need for PL/SQL, man.
    SQL> SELECT po_no FROM po1
      2  /
    PO_NO
    L53177000
    L00041677
    L43677000
    L00043677
    SQL> UPDATE po1 y
      2  SET    y.po_no = 'L'||substr(y.po_no,5,5)||'000'
      3  WHERE  y.po_no LIKE 'L000%'
      4  AND    NOT EXISTS ( SELECT null FROM po1 x
      5                      WHERE x.po_no =  'L'||substr(y.po_no,5,5)||'000')
      6  /
    1 row updated.
    SQL> DELETE FROM po1 y
      2  WHERE  y.po_no LIKE 'L000%'
      3  AND    EXISTS ( SELECT null FROM po1 x
      4                  WHERE x.po_no =  'L'||substr(y.po_no,5,5)||'000')
      5  /
    1 row deleted.
    SQL> SELECT po_no FROM po1
      2  /
    PO_NO
    L53177000
    L41677000
    L43677000
    SQL> Cheers, APC

  • A few simple Logic questions...please help.

    I have a few probably simple Logic questions, that are nonetheless frustrating me, wondering if someone could help me out.
    1. I run Logic 8, all of the sounds that came with logic seem to work except organ sounds. I can't trigger any organ sounds (MIDI) on Logic, they won't play. I have a Yamaha Motif as my midi controller.
    Any idea why?
    2. I've starting running into a situation where I will record a MIDI track, the notes are recorded but they won't playback. The only track effected is the one that was just recorded. All other midi tracks playback.
    I have to cut the track, usually go out of Logic and back in, re record for it to playback properly. Any idea why this may be happening?
    3. How important is it to update to Logic 9. Are there any disadvantages down the road if I don't upgrade. If I purchase the $200 upgrade, do I get a package of discs and material, or it just a web download.
    Any help is appreciated!
    Colin

    seeren wrote:
    Data Stream Studio wrote:
    3) You get a full set of disks and manuals.
    They're including manuals now?
    I think his referring to the booklets ...on how to install etc
    It would be great to see printed manuals though ...I love books especially Logic/Audio related !!
    A

  • Simple logic group to operate prior to custom import script?

    Hi all,
    Thanks for taking the time to read my question. I will gladly mark this thread as helpful or answered if you can help me. I'm a novice at FDM so please bear with.
    I have a custom import script that assigns ICP None to a specific account (overriding any ICP detail). However, now I need the ICP detail for that account in a second statistical account. I setup a simple logic group to create the logic account that I can map to the statistical but then realized that the import script runs prior to the logic group so I lose all ICP detail in the logic account as well.
    Is there a way to run the logic group prior to import script or is there a better way to accomplish what I'm trying to do?
    I'm not sure how critical this is but I'm using FDM v11.1.1.3.01 adapter 11x-G5-C
    Edited by: user4591089 on Aug 17, 2011 2:10 PM
    Edited by: user4591089 on Aug 17, 2011 2:50 PM

    Do the following:
    1) Remove the custom import script.
    2) Create a complex logic account and override the ICP dimension in the Group By Column with the Value [ICP None]. This will then be what is diplayed on the import screen for this logic account.
    3) Map the original source as the statistical account and the logic account as appropriate
    Edited by: SH on Aug 18, 2011 9:48 AM

  • Please a simple problem but I don't know how to solve it. After installing 16 gb of ram all is good but when I turn on the computer it is a window signaling that all is correct. How is possible to delete once and for all that window? Thank you

    Please a simple problem but I don't know how to solve it. After installing 16 gb of ram all is good but when I turn on the computer it is a window signaling that all is correct. How is possible to delete once and for all that window? Thank you

    Well then maybe you could take a screenshot because the appearance of such a window is news to me.
    Also post your OS X version and what model Mac you have. The more detail, the better. Thanks.
    To take a screenshot hold ⌘ Shift 4 to create a selection crosshair. Click and hold while you drag the crosshair over the area you wish to capture and then release the mouse or trackpad. You will hear a "camera shutter" sound. This will deposit a screenshot on your Desktop.
    If you can't find it on your Desktop look in your Documents or Downloads folder.
    When you post your response, click the "camera" icon above the text field:
    This will display a dialog box which enables you to choose the screenshot file (remember it's on your Desktop) and click the Insert Image button.
    ⌘ Shift 4 and then pressing the space bar captures the frontmost window.
    ⌘ Shift 3 captures the entire screen.
    Drag the screenshot to the Trash after you post your reply.

  • I have a pc and downloaded a trial version of Adobe Acrobat DC to create pdfs. I have followed the simple instructions but what I get is an entire screen shot saved instead of just my document. The instructions seem so simple. I can't imagine what I am do

    I have a pc and downloaded a trial version of Adobe Acrobat DC to create pdfs. I have followed the simple instructions but what I get is an entire screen shot saved instead of just my document. The instructions seem so simple. I can't imagine what I am doing wrong. Have project I need to submit today. Please help.

    Unfortunately, what you describe isn't a common problem. It is pretty surprising, but hopefully it's a simple as clicking or pressing the wrong thing. So, to find this out we need to know, step by step, at the most basic level, what you click or type EXACTLY and what you see. That should let us get to the cause.

  • Simple SQL, but i get an error?

    Here's my code:
    <cfquery name="setNote"
    datasource="#DS#" dbtype="ODBC"
    username="#DSUsername#" password="#DSPassword#"
    >
    update Notes set note = 'test' where noteid = 1
    </cfquery>
    Seems simple enough, but I get this:
    [Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
    UPDATE statement.
    Yeah, I know "Access Sucks.", but this still seems like it
    should work, no?
    If I do a "select * from notes" and cfdump the results, I see
    the data that is there, I just can't update it.
    What am I missing here?

    duplicate post. answered in db access forum.
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • My garageband can't be used because when I open a project (new or old) the program extends beyond the bottom of the display screen and I can't access what is below the bottom of the screen (like the record button).  I know there's a simple fix, but what?

    My garageband can't be used because when I open a project (new or old) the program extends beyond the bottom of the display screen and I can't access what is below the bottom of the screen (like the record button).  I know there's a simple fix, but what?

    two things to try: either click the green "zoom" bottom at the topLeft of the window in the title bar, or go to your System Prefs and then Displays, and increase the resolution that is used

  • TS1717 Im new to itunes so this might be a simple answer but...

    Im new to itunes so this might be a simple answer but...I downloaded 20 songs a few days ago and the last 45-60 second ds of more than half didn't download. When playing the song it will kirt move to the next song. How can I get it to download again or get my money back? It does this whether I'm on my ipod touch, laptop, shuffle, etc.

    That has been a common problem at the Store for several months.  The easiest thing is to download fresh copies at no charge, per these instructions: 
    http://support.apple.com/kb/PH1619

  • Editing Cells - Simple Issue, but Confused

    Simple issue, but I can't seem to figure this one out in Numbers. I'll do my best to explain in words here.
    Let's say I store the following dollar amount in cell A1 = 1264. The number is formatted to dollars. Therefore A1 is presented as $1,264.00. All is well up to this point.
    Okay, now let's assume I click out of the cell completely. Now let's say I wanted to add $250.50 to this amount in cell A1. When I go to the formula bar to add in the $250.50 it's requiring me to remove the dollar sign and comma out of my $1,264.00 number in order to complete the computation. Is this normal? I never had to do this in Excel. My thought was that I should only need to include an equal sign at the beginning of the formula (in other words, there shouldn't be a need to remove the dollar sign and comma every time, right?).
    Just wanted to make sure that I'm not missing anything overly simple (which I'm sure I am).
    Any help is greatly appreciated! I'm really enjoying my trial version of Numbers thus far.
    Message was edited by: randy.humes

    Randy,
    There is another way to remove each comma and dollar sign, one that will work on multiple cell at once if needed. Select the cells that you want to clean-up and using the Cells Inspector, change the format from Currency to Number and then click the Thousands Separator checkbox to deselect it. Then all that remains is to add the equal sign when you go in to edit the content by changing your input to a formula. Then if you still want the value to be displayed as currency, change the format back.
    I'm not saying that this method is better, but may be worth a try if your are backspace/delete averse.
    Jerry

  • How do I select a square brush for the brush tool in CS6?  Sorry if this is a simple question, but nothing has ever been simple for me in Photoshop.

    How do I select a square brush for the brush tool in CS6?  Sorry if this is a simple question, but nothing has ever been simple for me in Photoshop.

    I don't believe there is a square brush among the sets that ship with Photoshop, but there are plenty to download, and it is super easy to make one.
    Just drag with the rectangular Marquee tool, fill with black on a new layer, and go Edit > Define brush preset
    Browsing Photoshop Brushes on DeviantArt

  • ALV Interactive report! Need Simple Logic

    Hi!
       Can any one tell me the simple logic (steps) to be followed in developing alv interactive report
      NO CODING PLEASE
      Thanks
      Imran

    Hi Imran,
        Here i am trying to explain through the standard ALV FMs...
    1) You will do the same coding as how you will do for normal ALV through FMs.
    2)  Create an event type variable of type - SLIS_T_EVENT
    3) Call function module REUSE_ALV_EVENTS_GET to get all the events like 'USER COMMAND'
    4) Fill the internal table with the form name against USER COMMAND event.
    5) create FORM & ENDFORM for the USER COMMAND event.
    6) With in the form which you created in 5th step, create a variable of type - SLIS_SELFIELD, to capture user click information like on which field name & value user clicked.
    7) When you press on Base list of ALV, SY-UCOMM value will be &IC1, based on that you can validate whether user clicked or not on base list.
    8) Again you will populate the internal tables with required entries for the interactive list and we will call REUSE_ALV fm once again.
    I hope you understand the process, if not please get back to me.
    Regards,
    Donepudi
    Reward if its helpful.

  • Legal, but not logical, logical, but not legal, and neither logical, nor le

    After having failed his exam in "Logistics and Organization", a student goes and confronts his lecturer  about it.
    Student:  "Sir, do you really understand anything about the subject?"
    Professor:  "Surely I must. Otherwise I would not be a professor!"
    Student: "Great, well then I would like to ask you a question. If you can give me the correct answer, I will accept my mark as is and go. If you however do not know the answer, I want you give me an "A" for the exam. "
    Professor: "Okay, it's a deal. So what is the question?"
    Student: "What is legal, but not logical, logical, but not legal, and neither logical, nor legal?"
    Even after some long and hard consideration, the professor cannot give the student an answer, and therefore changes his exam mark into an "A", as agreed.
    Afterwards, the professor calls on his best student and asks him the same question.
    He immediately answers: "Sir, you are 63 years old and married to a 35 year old woman, which is legal, but not logical. Your wife has a 25 year old lover, which is logical, but not legal. The fact that you have given your wife's lover an "A", although he really should have failed, is neither legal, nor logical."

    Asking some question here in SCN is legal but this post is not a question but marked as question which is not legal neither logical and funny thing is it is marked as assumed answered which is again not logical but I enjoyed the post. It is old and Olg is Gold
    Thank$

  • Hi I have just bought a mac book pro 2ghz 8gb ram with haswell.also it's running maverick. I am wanting to start using logic but does it work ok with maverick everything I read says it's no good please help

    Hi I have just bought a mac book pro 2ghz 8gb ram with haswell.also it's running maverick. I am wanting to start using logic but does it work ok with maverick everything I read says it's no good please help

    Which version of Logic? I have 9, but I've yet to install it. I'm just creating the images of the disks atm to install them on my Haswell. Will let you know how that performs.
    Logic 10 would most certainly work fine though.

Maybe you are looking for

  • Scheduling Agreement -Schedule line should not pass the requirement to MRP

    Hi Friends! As we all know the scheduling agreements is outline agreement with future schedule lines, with this system will  pass the requirements to MRP for the schedule line which is even after 5 years, so my requirement is  if the schedule line da

  • Deleting anchor point, deletes entire path

    Need a solution...when I create a path with the pen tool I am unable to delete anchor points without deleting the entire path. Using the Pen tool + option reveals the white arrow (Direct Selection Tool) - I click and drag a box around the desired anc

  • Can I share my calendar?

    Myself and a colleague both have e71 phones. Both phones are sync'd via mfe with exchange server. We each have our own outlook calendars which are individually sync'd with the outlook calendars at work. We can copy entries on the pc at work to eachot

  • All that jitters is not gold . . .

    I have dead-ended. I recently purchased a Wacom Intuos3 tablet. When I try to use it, the cursor has a severe case of the jitters. It also randomly causes popups to appear, as if I were holding down the "control" key, even though none of the keys on

  • Script Editor doesn't work in Firefox on Windows XP

    The script editor doesn't upload or display scripts. No matter what, the actual editing control stays blank. It's not a display issue--the scripts don't run either. It works in IE6 on my system, however. Firefox 2.0.0.4, Windows XP Pro SP 2.