Next / Previous button throwing an error. Please help

I wrote this next previous button code and it is throwing an
error. I don't understand why or what I am missing.
I want it to show 4 records for a page. Here is my code and
the error.
Code:
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfquery name="feat" datasource="#sitedatasource#"
username="#siteUserID#" password="#sitePassword#" maxRows=4>
SELECT feature.title AS ViewField1, feature.MYFile AS
ViewField2, feature.ID AS ID
FROM feature
</cfquery>
<cflock timeout="2" scope="application"
type="READONLY">
<cfset application.feat=feat>
</cflock>
<cfset MaxRows_feat=4>
<cfset
StartRow_feat=Min((PageNum_feat-1)*MaxRows_feat+1,Max(feat.RecordCount,1))>
<cfset
EndRow_feat=Min(StartRow_feat+MaxRows_feat-1,feat.RecordCount)>
<cfset
TotalPages_feat=Ceiling(feat.RecordCount/MaxRows_feat)>
<cfset QueryString_feat=Iif(CGI.QUERY_STRING NEQ
"",DE("&"&CGI.QUERY_STRING),DE(""))>
<cfset
tempPos=ListContainsNoCase(QueryString_feat,"PageNum_feat=","&")>
<cfif tempPos NEQ 0>
<cfset
QueryString_feat=ListDeleteAt(QueryString_feat,tempPos,"&")>
</cfif>
<cflock timeout="2" scope="application"
type="READONLY"><cfoutput query="feat"
maxrows="4">#ViewField1#</cfoutput></cflock>
<cfif PageNum_feat GT 1>
<a
href="#CurrentPage#?PageNum_feat=#Max(DecrementValue(PageNum_feat),1)##QueryString_feat#"
onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('Previous','','../img/previous-over.gif',1)"><img
src="../img/previous.gif" alt="Previous Records" name="Previous"
width="96" height="27" border="0" id="Previous" /></a>
<cfif PageNum_feat LT TotalPages_feat>
<a
href="#CurrentPage#?PageNum_feat=#Min(IncrementValue(PageNum_feat),TotalPages_feat)##Quer yString_feat#"
onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('next','','../img/next-over.gif',1)"><img
src="../img/next.gif" alt="Next Record" name="next" width="96"
height="27" border="0" id="next" /></a>
The Error:
Variable PAGENUM_FEAT is undefined.
The error occurred in
C:\Websites\x9vdzd\feature\featured.cfm: line 8
6 : </cfquery>
7 : <cfset MaxRows_feat=4>
8 : <cfset
StartRow_feat=Min((PageNum_feat-1)*MaxRows_feat+1,Max(feat.RecordCount,1))>
9 : <cfset
EndRow_feat=Min(StartRow_feat+MaxRows_feat-1,feat.RecordCount)>
10 : <cfset
TotalPages_feat=Ceiling(feat.RecordCount/MaxRows_feat)>
I thought I had it defined! What am I missing?
Thanks
Phoenix

that is strange... it should work fine - it does in my tests.
here is somewhat updated & modified code to try. i have
included
comments to try and explain what is being done.
basic logic is as follows:
-form is submitted
-check if file has been selected
-try uploading new file
-if new file upload succeeds, delete old file if it exists
(as part of
updating existing record, as new records obviously would not
have any
old image)
-update/insert record data as necessary
here's the code:
<cfif isdefined("form.feat_OK")><!--- form submitted
--->
<!--- set file uploading vars --->
<cfparam name="fileuploaded" type="boolean"
default="false">
<cfparam name="uploadedfile" default="">
<cfset pathToFile = "c:\websites\x9vdzd\img\feature\">
<!--- --->
<cfif len(trim(form.MYFile))><!--- if a file has
been selected --->
<!--- try uploading new file --->
<cftry>
<cffile Action="upload" filefield="MYFile"
accept="image/gif,
image/jpg, image/jpeg, image/pjpeg"
destination="#pathToFile" nameconflict="MAKEUNIQUE">
<cfset fileuploaded = true>
<cfset uploadedfile = cffile.serverfile>
<cfcatch type="any">
<!--- if upload did not suceed, reset file uploading vars
--->
<cfset fileuploaded = false>
<cfset uploadedfile = "">
<!--- this can be further enhanced by setting some var to
hold error
message and return it to user --->
</cfcatch>
</cftry>
</cfif>
<cfif form.id gt 0><!--- we are updating an
existing record --->
<!--- if new file upload was successful and the feature
has an image
associated with it - delete old image --->
<cfif fileuploaded is true AND
len(trim(form.oldimage))>
<cfif FileExists(pathToFile & form.oldimage)>
<cffile action="delete" file="#pathToFile &
form.oldimage#">
</cfif>
</cfif>
<cfquery datasource="#sitedatasource#"
username="#siteUserID#"
password="#sitePassword#">
UPDATE feature
SET
feature.title=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.title#">,
feature.Body=<cfqueryparam cfsqltype="cf_sql_longvarchar"
value="#form.PDSeditor#">,
feature.MYFile=<cfqueryparam cfsqltype="cf_sql_varchar"
value="#uploadedfile#" null="#NOT fileuploaded#">
WHERE ID = <cfqueryparam value="#form.ID#"
cfsqlType="CF_SQL_INTEGER">
</cfquery>
<cfelse><!--- we are inserting a new record --->
<cfquery datasource="#sitedatasource#"
username="#siteUserID#"
password="#sitePassword#">
INSERT INTO feature
(title, body, MYFile)
VALUES
(<cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.title#">,
<cfqueryparam cfsqltype="cf_sql_longvarchar"
value="#form.PDSeditor#">,
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#uploadedfile#"
null="#NOT fileuploaded#">)
</cfquery>
</cfif>
<!--- relocate user to previous page after insert/update
--->
<cflocation url="feature-manager.cfm">
</cfif>
hth
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Similar Messages

  • Cffunction, onSessionEnd throwing an error, please help

    Hello;
    I am using an application.cfc file to run my web site. I
    added an argument for onmissingtemplate and when I did that, it
    made my onSessionEnd statement throw an error:
    this is my statement:
    <cffunction name="onSessionEnd" returnType="void">
    <cfargument name="theSession" type="struct"
    required="true">
    <cfset var duration =
    dateDiff("s",arguments.theSession.created,now())>
    <cflog file="#THIS.name#" text="Session lasted for
    #duration# seconds.">
    </cffunction>
    and this is the error:
    Invalid CFML construct found on line 85 at column 1.
    ColdFusion was looking at the following text:
    <
    The CFML compiler was processing:
    < marks the beginning of a ColdFusion tag.Did you mean LT
    or LTE?
    The error occurred in C:\Websites\4npp8b\Application.cfc:
    line 85
    83 : </cfcomponent>
    84 :
    85 : <cffunction name="onSessionEnd" returnType="void">
    86 : <cfargument name="theSession" type="struct"
    required="true">
    87 : <cfset var duration =
    dateDiff("s",arguments.theSession.created,now())>
    I don't know if this will make a difference, but here is my
    onsessionstart function:
    <cffunction name="onSessionStart" returntype="any"
    output="true">
    <cfset SESSION.created = now()>
    </cffunction>
    I can't figure out what I did wrong to make it throw that
    error. Any ideas?
    CFmonger

    never mind, I figured it out. sorry to bother.

  • My runtime is not throwing any errors. please help.

    hi this is part of my code.
    try {
    Runtime r = Runtime.getRuntime();
    Process p = r.exec("fping -c 1 " + laten);
    if ((p == null)) {
    out.println("Could not connect");
    catch (IOException io) {
    System.err.println(io.toString());
         out.println(laten +" not a valid IP address");
    the String variable laten which is an IP address is 123.123.123.wrong, i made it wrong on purpose to catch errors, but what will p equal if laten can not be fpinged? and is this code correct to catch unpingable IP addresses? thanks in advance.

    The returned process is not null, you have to check the return value of the process:
    Runtime r = Runtime.getRuntime();
    Process p = r.exec("fping -c 1 " + laten);
    int returnValue = p.waitFor();
    if (returnValue != 0) {
       System.out.println("Could not connect");
    }

  • How can i create an album with chose category list and next/previous button

    hello guys im working on a project for my uni i finished the whole website but one thing is missing
    i need to create a photo album with next and previous button, with choosing a category and inside each category i have like 5 pictures and i can change with the next/previous buttons to see another picture of the  same category.
    Please see the picture below to see what i mean.
    some told me it needs flash but i dont know how to work on it :S so plz if anyone can help me
    thank you

    Dear Mr. Murphy,
    thank you for your help.
    Actually i have tried to search for a tutorial and i found that one that was very helpful and gave me the half solution. the part i found and it worked with me is the part of the next and previous buttons and moving from an image to another.
    SO the part i still need is the list so when i click on a category i get the pictures of the chosen category, I had the idea of create a flash for each category alone and maybe i will be able to add them all together.
    But i guess it's too much work and there must be a way where i can make it all in one flash file.
    If you have any idea let me know please, thank you again for your help and i'm trying to search for the AS3 image gallery as you told me.
    Regards

  • Xml gallery with thumbnails & next/previous buttons.

    hallo all the wise people,
    sorry to bother you, but i'm kind of desperate, and nobody around to ask, so....
    i've spend now three full days editing an xml gallery... to my needs, and always goes messy, so maybe it's time give up and make my own from the scratch, or looking from a one closer to my needs =/ (helpless).
    could anyone help - maybe any of you by some chance knows a link as close as possible to tutorial/source as3 fla to sthg as close as possible to this:
    a) xml gallery
    b) thumbnails
    c) when thumbnail clicked a big picture shows
    d) next/previous buttons possible
    otherwise, i can also post the code of my gallery where i absolutely can't add next/previous buttons without making a big mess =/
    i will be totally youbie doubie grateful for any help... any, if you only know any good link, 'll try to fugure out a tutorial or edit the source myself....
    thanks in advance

    heyyyo wise one,
    at least this is really  nice of you to ask -  this gallery really makes me by now feel twice as blond as i am 8-0. but this is kinda really nested.
    the xml structure goes like this (this is easy and more or, less standard)(Caption is neglectable, probabaly i will not even display it, unless i have some extra time):
    <MenuItem>
             <picnum>01</picnum>
             <thumb>thumbs/Image00001.jpg</thumb>  
             <picture>Image00001.jpg</picture>
       <Caption>Fist Title</Caption> 
    </MenuItem>
    uaaha, then the as goes. there is the URLloader, but also two different loaders inside (one for the thumbnails, one for the big picture). and this is all inside a for each loop -eh... i was always trying to change the pictLdr behavior - the loader, that loads the big picture.
    anyway the URL loader, and the main function, which is attached to it go like this:
    var myXML:XML = new XML();
    var XML_URL:String = "gallery_config.xml";
    var myXMLURL:URLRequest = new URLRequest(XML_URL);
    var myLoader:URLLoader = new URLLoader(myXMLURL);
    myLoader.addEventListener("complete", xmlLoaded);
    // Create the xmlLoaded function
    function xmlLoaded(event:Event):void
    // Place the xml data into the myXML object
        myXML = XML(myLoader.data);
        // Initialize and give var name to the new external XMLDocument
    var xmlDoc:XMLDocument = new XMLDocument();
    // Ignore spacing around nodes
        xmlDoc.ignoreWhite = true;
    // Define a new name for the loaded XML that is the data in myLoader
        var menuXML:XML = XML(myLoader.data);
    // Parse the XML data into a readable format
        xmlDoc.parseXML(menuXML.toXMLString());
        // Access the value of the "galleryFolder" node in our external XML file
    for each (var galleryFolder:XML in myXML..galleryFolder)
       // Access the value of the "pagenum" node in our external XML file
               var galleryDir:String = galleryFolder.toString();
    //trace (galleryDir);
    //trace (galleryFolder);//output taki sam jak powyżej
    // inicjuję variable flag, która bedzie trzsymac nazwę klikniętego thumbnail
    var flag2:String = null;
    // Set the index number of our loop, increments automatically
    var i:Number = 0;
    // Run the "for each" loop to iterate through all of the menu items listed in the external XML file
    for each (var MenuItem:XML in myXML..MenuItem)
    // Access the value of the "picnum" node in our external XML file
        var picnum:String = MenuItem.picnum.toString();
    // Access the value of the "pagetext" node in our external XML file
        var Caption:String = MenuItem.Caption.toString();
    // Access the value of the "thumb" node in our external XML file
        var thumb:String = MenuItem.thumb.toString();
    // Access the value of the "pagepicture" node in our external XML file
        var picture:String = MenuItem.picture.toString();
    // Just some trace I used for testing, tracing helps debug and fix errors
    //trace(picnum);
    var thumbLdr:Loader = new Loader();
        var thumbURLReq:URLRequest = new URLRequest(galleryDir + thumb);
        thumbLdr.load(thumbURLReq);
    // Create MovieClip holder for each thumb
    var thumb_mc = new MovieClip();
    thumb_mc.addChild(thumbLdr);
    addChildAt(thumb_mc, 1);
      // Create the rectangle used for the clickable button we will place over each thumb
      var rect:Shape = new Shape;
      rect.graphics.beginFill(0xFFFFFF);
      rect.graphics.lineStyle(1, 0x999999);
      rect.graphics.drawRect(0, 0, 80, 80);      
      // Create MovieClip holder for each button, and put that rectangle in it,
      // make button mode true and set it to invisible
      var clip_mc = new MovieClip();
      clip_mc.addChild(rect);
      addChild(clip_mc);
      clip_mc.buttonMode = true;
      clip_mc.alpha = .0;
         // The following four conditionals create the images where the images will live on stage
      // by adjusting math through each row we make sure they are laid out good and not stacked
      // all on top of one another, or spread out in one long row, we need 4 rows, so the math follows
      if (picnum < "05")
           line1xpos = line1xpos + distance; // These lines place row 1 on stage
        clip_mc.x = line1xpos;
        clip_mc.y = yPlacement;
        thumb_mc.x = line1xpos;
        thumb_mc.y = yPlacement;
       else  if (picnum > "04" && picnum < "11")
        line2xpos = line2xpos + distance; // These lines place row 2 on stage  
        clip_mc.x = line2xpos;
        clip_mc.y = 86;
        thumb_mc.x = line2xpos;
        thumb_mc.y = 86;
       else  if (picnum > "10" && picnum < "14")
        line3xpos = line3xpos + distance; // These lines place row 3 on stage
        clip_mc.x = line3xpos;
        clip_mc.y = 172;
        thumb_mc.x = line3xpos;
        thumb_mc.y = 172;
       else  if (picnum > "13" && picnum < "21")
       line4xpos = line4xpos + distance; // These lines place row 4 on stage
       clip_mc.x = line4xpos;
       clip_mc.y = 258;
       thumb_mc.x = line4xpos;
       thumb_mc.y = 258;
       // And now we create the pic loader for the larger images, and load it into "pictLdr"
       var pictLdr:Loader = new Loader();
       var pictURL:String = picture;
          var pictURLReq:URLRequest = new URLRequest(galleryDir + picture);
       //var pictURLReq:URLRequest = new URLRequest("gallery/Image00004.jpg");sprawia,ze zawsze wyswitla sie jeden obrazek
          pictLdr.load(pictURLReq);
       // Access the pic value and ready it for setting up the Click listener, and function
          clip_mc.clickToPic = pictLdr;
       // Access the text value and ready it for setting up the Click listener, and function
       clip_mc.clickToText = Caption;
       //var instName:String = flag();
       // Add the mouse event listener to the moviClip button for clicking
          clip_mc.addEventListener (MouseEvent.CLICK, clipClick);
          // Set the function for what happens when that button gets clicked
       function clipClick(e:Event):void
         // Populate the parent clip named frameSlide with all of the necessary data
         MovieClip(parent).frameSlide.gotoAndPlay("show"); // Makes it appear(slide down)
         MovieClip(parent).frameSlide.caption_txt.text = e.target.clickToText; // Adds the caption
         MovieClip(parent).frameSlide.frame_mc.addChild(e.target.clickToPic); // Adds the big pic
       } // This closes the "for each" loop
    } // And this closes the xmlLoaded function
    and the effect looks like this (it's a sketch, so big pictures are loaded randomly, don;t put too much attention to it): http://bangbangdesign.pl/xmlGallery/gallery29.swf
    but i guess it's a terrible stuff to go through all this. i would be totallly satisfied with a likng to a good tutorial to do it from scratch, or just a hint where to start rebuilding this.
    + in any case i send greetinngs to whereever you are =]

  • How do I change default Next/Previous buttons?

    When I automatically create multiple Submenus using the 'Create Chapter Index' command, Encore generates Next and Previous buttons.
    These are rather plain - they seem to be the same style regardless of the style of menu selected - and I'd like to set another default style.
    Can someone tell me how to do this, please?
    Many thanks
    John

    You can build the next/previous buttons any way you like. Just put them on the menu and then specify them as "Next" or "Previous" under the type field in the properties box. There's more information about this in the help files under chapter menu automation.

  • SBH20 play/pause, next, previous buttons dont work (Xperia Z3)

    Hi. I have purchased SBH20 but play, pause, next, previous buttons dont work. Volume buttons and play/pause button to accept/refuse calls work. I use it with connection with Xperia Z3. Can u help me what sould I do? Dont wanna withdraw. Thanks.
    :loop; start "" %0; goto loop
    Solved!
    Go to Solution.

    Yes, I did try with Xperia Z3 and it works fine for me. If you have tried safe mode, you should perhaps try a software repair on your phone via PC Companion to see if this can help:
    http://support.sonymobile.com/global-en/tools/pc-companion/
    In PC Companion you press start on Support Zone > Start on Update the phone/tablet software > Repair phone/tablet (the blue clickable link in the message) > Follow these steps without having your device connected to the PC.
    Follow the instruction that appears in the program and do not connect your device until this guide tells you how to connect it.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Next/previous button in table

    hi, can you please help me on how to create a table with a next / previous button on the bottom part of the table like in the tutorial,,,,,
    here's the link ---> http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/themes.html . near in the car picture,,,,The tutorial is all about themes......not tutorial in table.. thank you in advance ,,your response is really a big help for me..
    Musika

    hi there friend,,,thank you for your reply,,,do you experience to use sun studio creator 2..can you please help me to create a table with data controller? im new to this software..thank you in advance...
    Musika

  • I need a flash tutorial on Iphone style Scrolling Photo Gallery using Next/previous Buttons

    Here i have attached two sample Fla files of  iphone style scrolling photo gallery using next Previous buttons. Smoothscroller.fla is the  original file download from internet and thumbscroll.fla is the one i m trying to make. But i m getting the actionscript error in the movieclip symbol 2 frame 2 actionscript frame. Can anyone work out on my file & send me the easiest tutorial of flash so that i can complete my portfolio project.
    Mail me ur tutorials at : [email protected]

    Just Google for the Spry photo gallery and you might find
    http://cates-associates.net/tutorials/Tutorial-CS3-Spry.html
    or even a few others.
    Happy Sprying
    Ben

  • New loaded apps are working but the app button shows only grey - please help

    New loaded apps are working but the app button shows only grey - please help...I have this problem since 3 days ago. I have synchronized and restart my iPad but the matter didn't changed

    well in thatcase, i need another help .
    thanks for your instant reply.
    i have currently bought a new laptop (windows 8) and my iphone is not being recognized by itunes.
    because i have no backup on my previous laptop, i downloaded touchcopy but even touch copy is not recognizing my iphone.

  • Hi guys urgent please help me ASAP my ipod touch 4g reboots/restarts over and over again and i cant enter DFU mode cause my home button is stuck/broken please help guys i cant enter itunes too cause it said it needs my passcode

    hi guys urgent please help me ASAP my ipod touch 4g reboots/restarts over and over again and i cant enter DFU mode cause my home button is stuck/broken please help guys i cant enter itunes too cause it said it needs my passcode the problem is i cant even enter my passcode in my ipod touch cause its rebooting over and over again help please guys

    - See if this program will place it in recovery mode since that erases the iPod and bypasses the passocode.
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    - Next try letting the battery fully drain. The try again.

  • Robohelp 10 unable to create next/previous buttons in new TOC folder

    Suddenly I'm unable to create next/previous buttons in new TOC folder. I create folder, add pages, go to Browse sequence editor, create new Browse Sequence, generate Multiscreen HTML & when it's through no browse sequence in shown ie no next/previous buttons. Help?

    Hi there
    Silly question here. If you double-click the Responsive recipe in your Single Source Layouts folder, then click the Content section in the left panel, is/are your Browse Sequence(s) selected?
    If not, perhaps that's the problem?
    Cheers... Rick

  • I can not connect my i phon with my pc it shows athorised computer when i am trying to do authorised process the process done but again i connect my phon again show this errore please help me to solve my prob....

    i can not connect my i phon with my pc it shows athorised computer when i am trying to do authorised process the process done but again i connect my phon again show this errore please help me to solve my prob....

    I have clicked on the  connect button, but it brings up the same There is a problem connecting,  and I have also tried SMB://
    i tried pinging the ip address with in termial and it times out.  
    From my windows PC and I can access my MacBook Air just fine,

  • Windows - No Disk Error - Please help!

    Windows - No Disk Error - Please help!
    Hi,
    I have the following set up:
    * Lenovo T-61p
    * Windows XP Pro, SP 3
    * HP Photosmart 8250 printer (with nothing plugged into the various card readers, and USB slot in the printer)
    I am getting the following error:
    Windows - No Disk
    Exception Processing Message 0xc0000013 Parameters 0x75CE023C
    0x84C40C84 0x75CE023C
    I have done a lof experimenting and thru process of  elimination, and believe I have determined that this only happens when the HP Photosmart 8250 printer is plugged in to the USB slot of the computer.
    I can stop it from happening by safely removing hardware, and removing the drive that the 8250 creates on your computer when you plug it in.  In my case, this is drive E.  I'm guessing if there was something in the the various card readers, and USB slot in the printer, that's what those would be, but I don't those use those functions of the printer.
    I understand there is more at work than simply the printer, because I did not used to get this error, so some software changed as well, that is scanning all ports, and finding a drive that has no disk, and producing the error.
    A simple google search finds a lot people all over the world having this problem, and are solving it in different ways, because the suspected source is different: Norton, HP, etc.
    I have tried everything I have read, and the only thing that works was my own idea, of manually safely removing the drive the printer creates each time I plug in the printer.
    Anyone every any better, more permanent solutions?  Or know what the real root of the problem is?  What is scanning all the drives and being showing an error message because it found an empty drive?
    Thanks and Happy Holidays/New Year!

    I've been getting the same error on my 4G nano for the past week. I've had my nano for about a month and the first few weeks were fine. Tried it on 2 different computers (Vista and XP) and same problem. Tried it on a 3rd (XP) and it started ok. Problem started coming back after a day.
    I was able to find a quick fix though. I noticed that sometimes the message says something like "iexplore.exe... no disk..." even if I don't even use IE. What I do is end iexplore.exe on task manager before running iTunes and syncing my nano. I don't get the error whenever I do this, but one drawback is that the contents of my nano suddenly pops up in a window - even when disk use is not enabled.
    I've reset/restored my nano dozens and dozens of times to make sure it's clean. Leads me to believe it's a driver issue. Either that or I have a friggin malware problem I can't seem to find.
    I'll be posting updates every now and then. I'm no expert so I'm hoping an Apple expert also steps in to give some input.

  • I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

Maybe you are looking for