[ Pobierz całość w formacie PDF ]
.The Recordset Navigation Baris one of Dreamweaver s Application Objects  one that can take the drudgery out of a repeti-tious implementation.All the Application Objects are accessible through either the Insert ª'Application Objects menu or the Application tab in the Insert bar.The Recordset Navigation Bar Application Object serves the following multiple purposes:&' Adds four links to the page in a borderless, single row table: First, Previous, Next, andLast.The links may be either text or graphics.&' Attaches the appropriate Recordset Paging server behavior to the four links.&' Inserts a Show Region server behavior to each of the links:" Show If Not First Record is added to the First and Previous record links." Show If Not Last Record is added to the Next and Last record links.&' Centers the table on the page and sets the width to 50%.What s even more impressive about this list of functions is that they are implemented with asingle command, which, in turn, references a very simple dialog box, as shown in Figure 17-9.Here s how it works:1.Choose Insert ª' Application Objects ª' Recordset Navigation Bar or choose InsertRecordset Navigation Bar from the Application category of the Insert bar.The RecordsetNavigation Bar dialog box is displayed.2.Select the data you want to control from the Recordset list.3.To create a series of text links, choose the Display Using Text option.4.To use graphics to trigger the navigation, choose the Display Using Images option.CautionYou must save your page if you select the Display Using Images option.Dreamweaver copiesimages from the Shared/Dreamweaver/Images folder when you choose this option, and thepage into which they are being inserted must be saved in order to store them in the siteproperly.The images are stored in the same folder as the page containing them.Figure 17-9: The Recordset Navigation Bar dialogbox offers a choice between text links or graphics.After the Recordset Navigation Bar has been inserted, you can adjust the text or imagesin any way you see fit.The text may be styled or modified, and you can even swap out theimages  by changing the srcattribute  for another graphic. 214931-6 ch17.F 7/18/02 7:00 AM Page 565Chapter 17 &' Managing Data565Tracking record statusAnother Application Object inserts the text and all the server behaviors necessary to displaythe records currently being viewed.By default, the syntax used by the Recordset NavigationStatus Application Object is as follows:Records First_Record_Shown to Last_Record_Shown of Total_RecordsThis syntax works perfectly for Web applications that use a Repeat Region server behaviorto show multiple records.When viewed through the browser, the Recordset Navigation Statusoutput looks like the following:Records 5 to 10 of 37.If you re displaying one record at a time, you can adjust the Application Object code insertedto something similar to the following:Record First_Record_Shown of Total_RecordsLike the Recordset Navigation Bar, this Application Object works with only one recordset at atime; applying the Recordset Navigation Status Application Object works similarly, as shownin the following steps:1.Choose Insert ª' Application Objects ª' Recordset Navigation or click the RecordsetNavigation Status icon on the Application category of the Insert bar.The RecordsetNavigation Status dialog box is displayed, as shown in Figure 17-10.Figure 17-10: The Recordset Navigation StatusApplication Object inserts three different serverbehaviors in one operation.2.Select the data you want to control from the Recordset list.3.Click OK when you re done.Dreamweaver Technique: Using FlashButtons for Recordset NavigationFlash Buttons are an excellent Dreamweaver tool for adding lively navigation aids to yourWeb page, but they re intended for page-to-page linking, not recordset navigation.However,with a little additional work, you can adapt standard or custom Flash Buttons to controlDreamweaver s Recordset Paging server behaviors.Flash Buttons are actually Macromedia Generator Templates, which when processed byDreamweaver become Flash movies.As a Generator Template, the link information is com-piled into the Flash movie and is not accessible for server-side processing  a necessity for 214931-6 ch17.F 7/18/02 7:00 AM Page 566Part III &' Incorporating Dynamic Data566moving from one record to another.Enabling Flash Buttons to control recordset navigationrequires four main components:&' Server-side code for moving from record to record&' A JavaScript call from the Flash Button&' A JavaScript function in the of the document&' A hidden field variable in a formThe first requirement is actually the easiest, as the necessary server-side code is provided byDreamweaver.Step 1: Prepare the pageBefore you can begin the specific steps for converting the Flash Buttons for your use, somepreliminary work needs to be in place.First, make sure that you have added your recordsetand any necessary fields.You can always add more fields from the Bindings panel later, butit s good to have one or two in the page to test the navigation buttons.Next, add the server-side code.You can accomplish this in one of two ways: Either enter sometext and attach a Recordset Paging server behavior to it, or use Dreamweaver s RecordsetNavigation Bar from the Insert ª' Application Object menu.To save time  and because you lllikely be adding multiple controls  choose the Application Object route by selecting Insert ª'Application Object ª' Recordset Navigation Bar.If you follow this path, choose the DisplayUsing Text option, rather than images.You will delete the links (but not the code) later; andwhen you do, you ll have extraneous files in your local site if you opt for graphics now.One final bit of prep work before you add the Flash Buttons: Add a form to your page if oneis not already present.If you like, give it a unique name; one convention you might try is toidentify the forms on your pages with the name theForm.The form may enclose the otherelements, as shown in Figure 17-11, or be separate.Step 2: Add the Flash ButtonsNow you re ready to insert your Flash Buttons.Note one small difference between the regularFlash Buttons and the ones used in the Dreamweaver technique.In your version, you call aJavaScript function, rather than link to another page.Cross- If you re not familiar with Flash Buttons, be sure to look over Chapter 25 to understand theirReferencebasic usage and learn how you can create your own custom Flash Buttons with Flash MX.To insert your modified Flash Button, follow these steps:NoteIf you re already familiar with Flash Buttons, skip to Step 7.1.Make sure that the current document has been saved.If you re working on a new document, Dreamweaver requires that you save it beforeadding a Flash Button.2.Choose Insert ª' Interactive Images ª' Flash Button.The Insert Flash Button dialog box,shown in Figure 17-12, is displayed. 214931-6 ch17.F 7/18/02 7:00 AM Page 567Chapter 17 &' Managing Data567Figure 17-11: To prepare for the Flash Recordset Navigation buttons, add a form andDreamweaver s standard Recordset Navigation Bar [ Pobierz caÅ‚ość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • personata.xlx.pl