How to hand-code a repeat region? (ASP/VBScript)  WorldPay workaround.

Hi,
So far I've been using the standard Dreamweaver Repeat Region
behaviour to
add a database repeat region to my page. However, the code
this produces
doesn't work with WorldPay's callback script and I need to
know if it's
possible to hand code a repeat region. My repeat region data
includes
images etc so, as well as creating/displaying the repeat
region, I also need
to know how to incorporate some basic HTML.
Would appreciate any advice or links to a tutorial.
Thanks
nath.

Hi Joe,
I have database content on my WorldPay callback page, which
is fed by a form
variable sent back from WorldPay. I can therefore call up
order details, in
my database, by ID.
Anyway, I have two recordsets displaying correctly on my
callback page;
Order Summary and Order Items. Because a customer may
purchase more than
one item, I need to show all records in the Order Items table
that match the
order ID. I therefore need a repeat region for the Order
Items recordset to
show all products, so I've inserted the standard DW repeat
region:
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsItems_numRows = rsItems_numRows + Repeat1__numRows
%>
...(above the head tag) and....
<%
While ((Repeat1__numRows <> 0) AND (NOT rsItems.EOF))
%>
...Recordset Data...
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsItems.MoveNext()
Wend
%>
...within my page where I want the repeat region to be.
If I DON'T include this code, both recordsets display data,
however the
Order Items recordset only shows 1 item (obviously, because
there is no
repeat region). When I add the repeat region code, as above,
WorldPay
fails.
WorldPay support can't actually tell you what's wrong, nor do
you receive an
error line or anything, however I know it's the repeat region
because both
recordsets display correctly WITHOUT the repeat region code.
Any way around this? I really need this to work because
otherwise I'm going
to have to force a re-direct and an auto-submission of a form
value
(nasty!), in order to be able to display the customers order
summary, and
order items, on one page.
Hope you can help. Thanks Joe.
Regards
Nath.
"Joe Makowiec" <[email protected]> wrote in
message
news:[email protected]...
> On 02 Jul 2007 in macromedia.dreamweaver.appdev,
tradmusic.com wrote:
>
>> So far I've been using the standard Dreamweaver
Repeat Region
>> behaviour to add a database repeat region to my
page. However, the
>> code this produces doesn't work with WorldPay's
callback script and
>> I need to know if it's possible to hand code a
repeat region. My
>> repeat region data includes images etc so, as well
as
>> creating/displaying the repeat region, I also need
to know how to
>> incorporate some basic HTML.
>
> Before you go re-inventing the wheel, what doesn't work?
>
> --
> Joe Makowiec
>
http://makowiec.net/
> Email:
http://makowiec.net/contact.php

Similar Messages

  • How to make server behaviors repeat region vertical?

    I have done many "Server Behavior, Repeat Region" showing vertical list without any other setup, now I’m doing a new one and is showing horizontal which doesn't make any sense. Does anybody know why and how to fix this “bad behavior”?

    This is very simple page no external or internal css is for internal use only to retrieve data base information. I currently have to more from different sites working fine without any third party app or any extra coding effort.  here are codes.
    Thank you guys for your prompt response.
    <?php require_once('Connections/customers.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    mysql_select_db($database_customers, $customers);
    $query_Recordset1 = "SELECT * FROM customers";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $customers) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table width="158%" border="1">
      <tr>
      <th scope="col">ID</th>
        <th scope="col">Name</th>
        <th scope="col">Last Name</th>
        <th scope="col">Address</th>
        <th scope="col">City</th>
        <th scope="col">State</th>
        <th scope="col">Zip Code</th>
        <th scope="col">E-mail</th>
        <th scope="col">Phone</th>
        <th scope="col">Username</th>
        <th scope="col">Password</th>
        <th scope="col">Role</th>
      </tr>
      <tr>
        <?php do { ?>
          <td align="left"><?php echo $row_Recordset1['id']; ?></td>
          <td align="left"><?php echo $row_Recordset1['name']; ?></td>
          <td align="left"><?php echo $row_Recordset1['lname']; ?></td>
          <td align="left"><?php echo $row_Recordset1['address']; ?></td>
          <td align="left"><?php echo $row_Recordset1['city']; ?></td>
          <td align="left"><?php echo $row_Recordset1['state']; ?></td>
          <td align="left"><?php echo $row_Recordset1['zip']; ?></td>
          <td align="left"><?php echo $row_Recordset1['email']; ?></td>
          <td align="left"><?php echo $row_Recordset1['phone']; ?></td>
          <td align="left"><?php echo $row_Recordset1['username']; ?></td>
          <td align="left"><?php echo $row_Recordset1['password']; ?></td>
          <td align="left"><?php echo $row_Recordset1['role']; ?></td>
          <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
      </tr>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

  • How do I keep a Repeat Region after selection?

    I have a Link/Menu button where the user chooses a city.  That populates a table with all the courses for that city.  Then the user can select any course to show information about that course I have the link set like this, charlottenccourses.php?course=<?php echo $row_getAll['course'];?>.  That is working fine, but when they select it, the table with the courses for the city disappears. So they have to select it again and hit go to see the courses again.  How can I make that stay to the same city with all the courses until they choose another one?  Thanks!

    What I have is all on the same page.  Let me explain.  I have a list/menu
    that displays all the cities.  Once that is selected, I have a "GO" button
    and that creates the table list of all the course in a repeat region.  And
    the rest of the page is a record set for which course is selected so it
    previews information for the course selected.  The link is this:
    charlottenccourses.php?course=<?php echo $row_getAll['course']; ?>
    Once that is selected all the information for that course appears.  The
    problem is, the original list of courses from the selected city now
    disappears.  So the user has to go back and select the city, "GO" button if
    they want to preview another course. I want to figure out a way to keep that
    list of courses there even when the course is selected.
    Is there a way to do that will the current structure of the page?

  • How can I use a Looper inside a Repeat Region?

    I have a Dreamweaver standard Repeat Region applied to a HTML table containing two horizontal loopers. The HTML table is to display a list of company contacts for our members. The loopers display find for the first company but after that they stop. To key the loopers to the company Im using a trick mentioned by Günter Schenk in this thread: http://www.adobeforums.com/webx/.59b524b4/5. He calls it a sub query; at times I use to help myself by using some sort of "sub query" like the following
    <br />
    <br />Ive linked my looper recordset to the recordset used for the Repeat Region. Heres one of the looper queries:
    <br />
    <br />$KTColParam1_rsContactFeatures = "-1";
    <br />if (isset($_SESSION["kt_login_id"])) {
    <br />$KTColParam1_rsContactFeatures = $_SESSION["kt_login_id"];
    <br />}
    <br />mysql_select_db($database_RNW, $RNW);
    <br />$query_rsContactFeatures = sprintf("SELECT DISTINCT list_feature.description_feature, company.id_company, contact_cnt.idpremissions_cnt FROM (((company LEFT JOIN company_to_feature ON company_to_feature.idcompany=company.id_company) RIGHT JOIN list_feature ON list_feature.id_list_feature=company_to_feature.idlistfeature) LEFT JOIN contact_cnt ON contact_cnt.idcompany_cnt=company.id_company) WHERE company.id_company='".$row_rsContactAll['id_company']."' AND company_to_feature.id_feature is not null AND contact_cnt.idpremissions_cnt=%s ORDER BY company.id_company ASC ", GetSQLValueString($KTColParam1_rsContactFeatures, "int"));
    <br />$rsContactFeatures = mysql_query($query_rsContactFeatures, $RNW) or die(mysql_error());
    <br />$row_rsContactFeatures = mysql_fetch_assoc($rsContactFeatures);
    <br />$totalRows_rsContactFeatures = mysql_num_rows($rsContactFeatures);
    <br />
    <br />This is my link in both quires: WHERE company.id_company='".$row_rsContactAll['id_company']."'
    <br />
    <br />Heres the code for the connected looper:
    <br />
    <br /><?php<br />do { // horizontal looper version 3<br />?>
    <br />
    <br />
    <br />
    <br />
    <br />As I said this works fine for the first item in the list but then it quits. Heres a screen shot of what I dont want: http://www.retirenw.com/images/help/looper_inside_repeat_region.gif
    <br />
    <br />Is there anyway to change the php for the loopers to make this work?
    <br />
    <br />Thanks for your help
    <table>
    <tr>
    <td>
    <img src="../images/bullet.gif" width="8" height="14" />
    </td>
    <td>
    <?php echo $row_rsContactFeatures['description_feature']; ?>
    </td><?php <br />$row_rsContactFeatures = mysql_fetch_assoc($rsContactFeatures);<br />if (!isset($nested_rsContactFeatures)) { <br />$nested_rsContactFeatures= 1;<br />}<br />if (isset($row_rsContactFeatures) && is_array($row_rsContactFeatures) && $nested_rsContactFeatures++ % 1==0) {<br />echo "</tr><tr>";<br />}<br />} while ($row_rsContactFeatures); //end horizontal looper version 3<br />?>
    </tr>
    </table>

    I found an easy solution.
    I moved my looper quires out of my head and into my bodyinside the repeat region (the Looper Wizard puts the quires in the head). I put the quires right before my looper code. Finally, I had to make sure my conditional regional code came after the looper quires but before the looper code.

  • How to create a repeating region like the attachements in Gmail

    I don't even know how to begin Googling or searching here for
    this topic. But I've got a form and I want to have two fields show
    up for inputting the fabric type and then the pattern name. This
    site will allow them to request fabric swatches to see in person
    how they look and make a decision for their furniture. And if
    customers want to ask for more than one sample, I want to be able
    to have a link that says, "Request another" and when clicked, it
    creates another instance of those two fields automagically, just
    how the attachments in Gmail work.
    Is this something possible with Spry? I'd like to think it
    is, but it might need some jury rigging to ensure that the ids for
    those text inputs are all unique and such. But like I said, I don't
    even know how to begin searching for this topic since "repeating
    area" or "repeating region" brings back 1000s of unrelating
    results.
    Anyone have any experience doing something like this and
    could shed some light on it and/or point me toward some resources
    that could help out?
    Thanks!

    Hi unnamed,
    Suppose you have an id that identifies your record.
    Go to Report definiton, tab report attirbutes.
    Select the id of your record.
    Create a link to the page you want to go to.
    Hope this helps.
    If not, I suggest you to create a from with report, and analyze the way the wizard has generated it.
    Leo

  • Nested Repeat Region (How to convert from table to list)

    Sorry, i am really no PHP hero :-(
    i created a menu with the "nested repeat region" wizzard. Now i want to change the HTML from TABLE to LIST.
    I thought i just need to delete <table>- and <td>-tags, replace <tr> with <ul> and that's it. (But ist's NOT!)
    This is my code:
    ------- START ----------------
    <ul id="nav">
          <?php do { ?>      
              <li><?php echo $row_master1waa_page_top['top_name']; ?></li>
            <?php
      if ($totalRows_master1waa_page_top>0) {
        $nested_query_detail2waa_page_sub = str_replace("123456789", $row_master1waa_page_top['id_top'], $query_detail2waa_page_sub);
        mysql_select_db($database_WAA);
        $detail2waa_page_sub = mysql_query($nested_query_detail2waa_page_sub, $WAA) or die(mysql_error());
        $row_detail2waa_page_sub = mysql_fetch_assoc($detail2waa_page_sub);
        $totalRows_detail2waa_page_sub = mysql_num_rows($detail2waa_page_sub);
        $nested_sw = false;
        if (isset($row_detail2waa_page_sub) && is_array($row_detail2waa_page_sub)) {
          do { //Nested repeat
    ?>
              <ul>
                <li>  <?php echo $row_detail2waa_page_sub['sub_head']; ?></li>
              </ul>
              <?php
          } while ($row_detail2waa_page_sub = mysql_fetch_assoc($detail2waa_page_sub)); //Nested move next
    ?>
            <?php } while ($row_master1waa_page_top = mysql_fetch_assoc($master1waa_page_top)); ?>
    </ul>  
    ------- END -----
    The problem is located in line 3. the result is a list like this:
    <ul id="nav">
         <li>xxx</li>
         <li>xxx</li>
              <ul>
                    <li>xxx</li>
                    <li>xxx</li>
              </ul>
         <li>xxx</li>
    </ul>
    Of course it will not work. I need the nested list inserted like this:
    <ul id="nav">
         <li>xxx</li>
         <li>xxx
              <ul>
                    <li>xxx</li>
                    <li>xxx</li>
              </ul>
          </li>
         <li>xxx</li>
    </ul>
    Can someone please help me changing my code to get this result?

    Hi,
    I had trouble replying. I may be of some assistance until one of the Guru's get on.
    The whole thing works on loops based inside do and while
    EX.
    <?php
              do{    //end php, use html
    ?>
    I can repeat anthing here in HTML!
    <?php } while ( /* some critera exist ex: i<5 */      ); ?>
    so, your 'options' tag or LI' tags should only exist inside the first loop, check your { }
    The entire LIST  would repeat if you add the UL tags inside the nested loop area
    You may find it easier to reaplace the table with div tags and then indent the sub or nested loop with a class
    I don't have time to test this but try this:
    <ul id="nav">
    <ul>
    <?php do { ?>      
      <li><?php echo $row_master1waa_page_top['top_name']; ?></li>
    <?php
      if ($totalRows_master1waa_page_top>0) {
        $nested_query_detail2waa_page_sub = str_replace("123456789", $row_master1waa_page_top['id_top'], $query_detail2waa_page_sub);
        mysql_select_db($database_WAA);
        $detail2waa_page_sub = mysql_query($nested_query_detail2waa_page_sub, $WAA) or die(mysql_error());
        $row_detail2waa_page_sub = mysql_fetch_assoc($detail2waa_page_sub);
        $totalRows_detail2waa_page_sub = mysql_num_rows($detail2waa_page_sub);
        $nested_sw = false;
        if (isset($row_detail2waa_page_sub) && is_array($row_detail2waa_page_sub)) { ?>
       <ul>
      <?php  do { //Nested repeat ?>   
                   <li>  <?php echo $row_detail2waa_page_sub['sub_head']; ?></li>
            <?php } while ($row_detail2waa_page_sub = mysql_fetch_assoc($detail2waa_page_sub)); //Nested move next ?>
        </ul>
    <?php 
    ?>
            <?php } while ($row_master1waa_page_top = mysql_fetch_assoc($master1waa_page_top)); ?>
    </ul>
    Hit me back if its close but wonky..
    J

  • How to do a  vertical or horizontal repeat region

    The default repeat region reads all the data until its finished in a simple vertical manner. Is there a way to do a horizontal or more complex vertical repeat.

    Well i figured this out from a spry image gallery tutroial. Simple declare a css rule, something similar to this and call it as needed:
    .horizontalrepeat{
    width: 100px;
    height: 100px;
    float:left;
    margin: 5px;
    /*any other thing you want to add*/
    the key is the width and the float left.

  • How To: repeat region key command

    I would like to assign a key command to the 'Repeat Region' function. I'm having trouble locating the appropriate command in the key command menu though. Any help would be much appreciated.
    Thanks.

    It's called "Repeat Object..."

  • Repeating Regions

    I have a strange question. I know this can be done in ASP
    dynamically, but I'm wondering if Dreamweaver has a way of doing it
    with the generated HTML.
    I am designing some sites with Contribute users in mind. I
    have a script that creates a ticker where each ticker fades in and
    out as the next is displayed. The content of the ticker is read
    from a regular HTML page, where each set of ticker content is in
    it's own DIV tag. The advantage is that I can create a blank web
    page based on my repeating region template. Then the the Contribute
    user can use the cool little [+ - ^ v] thing to modify the data of
    the ticker.
    Here is the bad part. Each DIV tag has to have a unique
    sequential ID. Like Div0, Div1, Div2... Is there any way I can make
    the ID attribute count as new regions are created?

    For grins, try changing this -
    <div id="content1" style="display:none">
    to this (IN THE TEMPLATE FILE) -
    <div id="content@@(_repeat._index)@@''
    style="display:none">
    (that should be a " character after the last @ sign - I had
    to use two '
    characters to keep the code from getting munged in my
    newsreader)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:g2m3cq$85h$[email protected]..
    >I need to see the template markup around the repeating
    region, please.
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    > ==================
    >
    >
    > "ITLogic" <[email protected]> wrote in
    message
    > news:g2m25n$6se$[email protected]..
    >> Sure. I'm using DW CS3. Here is a copy of the
    repeating regions I'm
    >> trying to
    >> create. Notice each DIV has a sequential ID. I could
    go hand edit this,
    >> but I'm
    >> trying to automate it as much as possible. I am
    selling Contribute as a
    >> means
    >> for clients to edit their own content. Most don't
    know how to spell HTML
    >> much
    >> less know how to use it.
    >>
    >> <div id="content0" style="display:''">
    >>
    >> <!-- ADD TICKER's CONTENT #1
    HERE--------------------->
    >>
    >> <p>Hello</p>
    >>
    >> <!-- END CONTENT #1----------------->
    >>
    >> </div>
    >>
    >> <div id="content1" style="display:none">
    >>
    >> <!-- ADD TICKER's CONTENT #2
    HERE--------------------->
    >>
    >> <p>World</p>
    >>
    >> <!-- END CONTENT #2----------------->
    >>
    >> </div>
    >>
    >

  • Contribute Acting strange - template parameters with repeating regions

    Basically what I'm trying to achieve is that there is a
    repeating region on a page, and each region is supposed to
    alternate colors. To achieve this, the regions with the colors are
    put into a div which has a background color applied to it. To do
    this, I have created two expressions, one to check to see if it's
    an even numbered region, and if so, to open the div, and another to
    close the div. That looks like this:
    quote:
    <!-- TemplateBeginRepeat name="Article" -->
    @@((_index & 1) ? shade : noshade )@@
    stuff
    @@((_index & 1) ? shadeend : noshade )@@
    <!-- TemplateEndRepeat -->
    At the top, I have three template parameters to go along with
    these:
    quote:
    <!-- TemplateParam name="shade" type="text"
    value="<div>" -->
    <!-- TemplateParam name="shadeend" type="text"
    value="</div>" -->
    <!-- TemplateParam name="noshade" type="text" value=""
    -->
    Which look like this on the actual pages:
    quote:
    <!-- InstanceParam name="shade" type="text"
    value="&lt;div&gt;" -->
    <!-- InstanceParam name="shadeend" type="text"
    value="&lt;/div&gt;" -->
    <!-- InstanceParam name="noshade" type="text" value=""
    -->
    The odd thing is that, when I add an editable region,
    something weird occurs with the template parameters and they end up
    looking like this:
    quote:
    <!-- InstanceParam name="shade" type="text"
    value="&lt;div&gt;" --><!-- InstanceParam
    name="shadeend" type="text" value="&lt;/div&gt;"
    -->->
    <!-- InstanceParam name="noshade" type="text" value=""
    -->
    And that, of course, results in having a nice "->" showing
    up at the top of my page. The repeating region appears to work. It
    changes background colors just like it should, but I have no idea
    why it's throwing in the "->" at the end.

    For grins, try changing this -
    <div id="content1" style="display:none">
    to this (IN THE TEMPLATE FILE) -
    <div id="content@@(_repeat._index)@@''
    style="display:none">
    (that should be a " character after the last @ sign - I had
    to use two '
    characters to keep the code from getting munged in my
    newsreader)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:g2m3cq$85h$[email protected]..
    >I need to see the template markup around the repeating
    region, please.
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    > ==================
    >
    >
    > "ITLogic" <[email protected]> wrote in
    message
    > news:g2m25n$6se$[email protected]..
    >> Sure. I'm using DW CS3. Here is a copy of the
    repeating regions I'm
    >> trying to
    >> create. Notice each DIV has a sequential ID. I could
    go hand edit this,
    >> but I'm
    >> trying to automate it as much as possible. I am
    selling Contribute as a
    >> means
    >> for clients to edit their own content. Most don't
    know how to spell HTML
    >> much
    >> less know how to use it.
    >>
    >> <div id="content0" style="display:''">
    >>
    >> <!-- ADD TICKER's CONTENT #1
    HERE--------------------->
    >>
    >> <p>Hello</p>
    >>
    >> <!-- END CONTENT #1----------------->
    >>
    >> </div>
    >>
    >> <div id="content1" style="display:none">
    >>
    >> <!-- ADD TICKER's CONTENT #2
    HERE--------------------->
    >>
    >> <p>World</p>
    >>
    >> <!-- END CONTENT #2----------------->
    >>
    >> </div>
    >>
    >

  • Assigning "position" in repeat region

    I have a site that runs a contest and displays winners from
    across the
    nation. Through the year they compete and can go online to
    see where they
    stand in relation to others in their same territory. In order
    to display
    the winner's positions on the page, I sort the underlying
    data in sql using
    the necessary criteria, then on my asp page, as part of the
    repeat region, I
    run code that loops through the recordset and uses an x+1
    method of
    displaying each person's position. Whether or not this is the
    best way to
    do this, it works.
    MY PROBLEM...
    Up until now I only needed to display the positions based on
    one selected
    territory. So my results would always simply show 1 -x, in
    order.
    Joe territory1 1
    Van territory1 2
    Tim territory1 3
    Bob territory1 4
    NOW I am being asked to show the entire nation on one page
    for
    administrators. They want to see ALL the territories and the
    positions of
    each person for each territory, and have the ability to sort
    based on
    various columns. So now my "positions" column will have
    several people in
    1st position, several in 2nd, etc.
    Joe territory1 1
    Jen territory2 1
    Van territory1 2
    Sue territory2 2
    Tim territory1 3
    Len territory2 3
    Bob territory1 4
    Ken territory2 4
    I'm not sure how to go about this, and would greatly
    appreciate any advice!

    In the actual case the criteria for winning is that 1) ALL
    criteria are met
    (there are actually four of them, not two as shown in my
    example), and then
    2) you have the highest perentage.
    So in the case below, remembering that each territory has its
    own set of
    winners, it would look like this (if sorted by winning
    position - keeping in
    mind that I need to allow sorting on ANY column by the user):
    name territory Criteria_A Criteria_B Criteria_C POS
    Bob 1 74% Y Y
    1
    Tim 1 42% Y Y
    2
    Van 1 25% Y Y
    3
    Len 2 66% N Y
    1
    Sue 2 56% N Y
    2
    Joe 1 43% Y N
    4
    Ken 2 82% N N
    3
    Jen 2 68% N N
    4
    Here you can see that Bob, Tim, and Van all have Y for both
    their B & C
    criteria, so they are sorted to the top (how I do that is
    somewhat secondary
    at this point -- you can just assume that Y=10 and N=0 and
    I'll sort on the
    sum of those columns).
    Then Len, Sue, and Joe each have one Y and one N, so they are
    grouped
    together based on that, then sorted by percent. Note that Joe
    has a
    position of 4 because he is in Territory 1.
    Lastly, Ken and Jen have "N" for both criteria, so they are
    sorted last, and
    then by their percentage.
    I put a dashed line in there as a visual aid -- doesn't need
    to be in my
    results.
    "Pizza Good" <[email protected]> wrote in message
    news:[email protected]...
    > Hmm...interesting.
    >
    > In the sample data below, can you please sort them how
    you want them to
    > appear? I want to see how you handle the Y's and N's.
    >
    >
    > "HX" <[email protected]> wrote in message
    > news:[email protected]...
    >> Because "position" isn't a field in the database -
    it's determined based
    >> on sorting the list on various criteria. For
    example, let's say the
    >> winner for each territory will have met all of
    criteria_B and _C and then
    >> will have the highest % in criteria_A . All I have
    in my database is:
    >>
    >> name territory Criteria_A Criteria_B Criteria_C
    >> Joe 1 43% Y N
    >> Jen 2 68% N N
    >> Van 1 25% Y Y
    >> Sue 2 56% N Y
    >> Tim 1 42% Y Y
    >> Len 2 66% N Y
    >> Bob 1 74% Y Y
    >> Ken 2 82% N N
    >>
    >> For Territory 1 I can pull out those names, sort
    based on my criteria,
    >> then loop in my repeat region and assign their
    positions right there in
    >> the asp.
    >>
    >> But when I combine ALL of them onto one page, I
    can't do that.
    >>
    >> Is there some way to set those positions in the
    sub-query (for each
    >> territory) and reference that field in a 2nd query?
    >>
    >>
    >>
    >>
    >> "Pizza Good" <[email protected]> wrote
    in message
    >> news:[email protected]...
    >>> Why not just sort by both fields?
    >>>
    >>> Not sure what your fields are called so I will
    use:
    >>>
    >>> territory
    >>> position
    >>>
    >>> ORDER BY territory ASC, position ASC
    >>>
    >>>
    >>>
    >>>
    >>> "HX" <[email protected]> wrote in
    message
    >>> news:[email protected]...
    >>>>I have a site that runs a contest and
    displays winners from across the
    >>>>nation. Through the year they compete and can
    go online to see where
    >>>>they stand in relation to others in their
    same territory. In order to
    >>>>display the winner's positions on the page, I
    sort the underlying data
    >>>>in sql using the necessary criteria, then on
    my asp page, as part of the
    >>>>repeat region, I run code that loops through
    the recordset and uses an
    >>>>x+1 method of displaying each person's
    position. Whether or not this is
    >>>>the best way to do this, it works.
    >>>>
    >>>> MY PROBLEM...
    >>>>
    >>>> Up until now I only needed to display the
    positions based on one
    >>>> selected territory. So my results would
    always simply show 1 -x, in
    >>>> order.
    >>>>
    >>>> Joe territory1 1
    >>>> Van territory1 2
    >>>> Tim territory1 3
    >>>> Bob territory1 4
    >>>>
    >>>> NOW I am being asked to show the entire
    nation on one page for
    >>>> administrators. They want to see ALL the
    territories and the positions
    >>>> of each person for each territory, and have
    the ability to sort based
    >>>> on various columns. So now my "positions"
    column will have several
    >>>> people in 1st position, several in 2nd, etc.
    >>>>
    >>>> Joe territory1 1
    >>>> Jen territory2 1
    >>>> Van territory1 2
    >>>> Sue territory2 2
    >>>> Tim territory1 3
    >>>> Len territory2 3
    >>>> Bob territory1 4
    >>>> Ken territory2 4
    >>>>
    >>>> I'm not sure how to go about this, and would
    greatly appreciate any
    >>>> advice!
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

  • Show random all images in a repeat region

    Hello,
    I have a repeat region that shows images from a db in
    ascending order.
    Is it possible to show the images random on another place?
    Example: you have image "A" - "B" - "C" after a refresh page
    you have "C"-"A"-"B"
    or "B" - "C" - "A"
    Is this possible or is there a good extension out there?
    Thanks in advanced,
    Sam

    No that would not work in Access.
    As it happens I offer a code snippet: Access db randomizer
    for aspVB.
    Email me directly if you'd like to hear more.
    emichael brandt
    michael -> valleywebdesigns.com
    SamDesign.be wrote:
    > Can I use this for asp vb with a access table ?
    > SELECT *
    > FROM qry_pub_rechts
    > ORDER BY naam_bedrijf ASC
    > Thanks in advanced
    >
    > "geschenk" <[email protected]> a
    écrit dans le message de news:
    > evgm55$34t$[email protected]..
    >> that´s how you can alter a MySQL query to give
    random results:
    >>
    >> SELECT * FROM your_table ORDER BY RAND()
    >
    >

  • Tabbed panels repeat region in cms displays 2nd item as a block of content

    Hi everyone, hope someone can help:
    I have a test page live
    http://aegmotorhomes.co.uk/usedtest1.php
    Problem is this-
    I have added a repeat region on my dreamweaver template
    I use Perch CMS as my management for staff to add new items for sale on this page
    I have built a tabbed panels to list the item
    On my CMS it allows me to press "add another" which then adds the tabbed panels again as a new item and the staff input the details
    My problem is the first item works perfect and all tabbs work fine, each item after that doesn't have tabbs and shows all content as one whole block
    I think it is to do with the ID and applies the java file only to item one, thats my guess.
    I have attached code below for my tabbed panels template, .js file and .css file - can anyone shed any light on this issue"
    TEMPLATE
    <style type="text/css">
    #container1 {
              width: 700px;
              background-color: #E6E6E6;
              border: .1em solid #999;
              padding-top: 5px;
              padding-right: 5px;
              padding-left: 5px;
              height: auto;
              margin-bottom: 30px;
    #item_description {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.3em;
              color: #333;
              background-color: #FFF;
              height: 30px;
              border-bottom-width: .1em;
              border-bottom-style: dotted;
              border-bottom-color: #333;
              font-weight: bold;
              margin-bottom: 10px;
    #price {
              margin-top: 5px;
              float: right;
              width: 150px;
              background-color: #EAEAEA;
              border: 0.1em solid #CCC;
    .BOLDTEXT {
              font-weight: bold;
              text-align: center;
              color: #FFF;
    .BOLDTEXT_PRICE {
              color: #333;
    #engine_spec {
              float: left;
              width: 190px;
              font-family: Arial, Helvetica, sans-serif;
              font-size: .75em;
              border-top-style: none;
              border-right-style: none;
              border-bottom-style: none;
              border-left-style: none;
    #top_price {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.2em;
              color: #099;
              float: right;
              width: 150px;
              font-weight: bold;
              text-align: right;
    #top_price {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.4em;
              color: #099;
    #overview_picture {
              height: 150px;
              width: 200px;
              background-color: #CCC;
              float: left;
              margin-right: 10px;
              margin-top: 5px;
    .BOLDTEXT_blackprice {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.4em;
              color: #099;
    #smallprint {
              font-family: Arial, Helvetica, sans-serif;
              font-size: .5em;
              color: #666;
              margin-top: 2px;
    table tr td {
              font-size: 0.75em;
              font-family: Arial, Helvetica, sans-serif;
    .specwhite {
              color: #FFF;
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1em;
              font-weight: bold;
    #reserve {
              font-family: Arial, Helvetica, sans-serif;
              font-size: 1.2em;
              font-weight: bold;
              color: #FFF;
              background-color: #099;
              width: 140px;
              float: right;
              margin-top: 10px;
              padding: 5px;
              text-align: center;
              border: .1em solid #999;
    </style>
    <script src="../../../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="../../../../SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
    <div id="container1">
      <div id="TabbedPanels1" class="TabbedPanels">
        <ul class="TabbedPanelsTabGroup">
          <li class="TabbedPanelsTab" tabindex="0">Overview</li>
          <li class="TabbedPanelsTab" tabindex="0">Description</li>
          <li class="TabbedPanelsTab" tabindex="0">Images</li>
          <li class="TabbedPanelsTab" tabindex="0">Specification</li>
        </ul>
        <div class="TabbedPanelsContentGroup">
          <div class="TabbedPanelsContent">
            <div id="item_description"><perch:content id="Title1" label="Title" type="text" />
              <div id="top_price">£<perch:content id="Title2" label="Top Price" type="text" /></div>
            </div>
            <div id="overview_picture"><img src="<perch:content id="photo" label="Photo" type="image" />" class="photo" /></div>
            <div class="engine_spec" id="engine_spec">
              <table width="100%" border="0" cellpadding="5" cellspacing="7">
                <tr>
                  <td width="35%" bgcolor="#EAEAEA">Year of Make</td>
                  <td width="65%" bgcolor="#999999"><strong class="spec_white"><span class="engine_spec"><span class="specwhite"><perch:content id="Title3" label="Year" type="text" /></span></span></strong></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Current Miles</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title4" label="Mileage" type="text" /></span></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Engine Size</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title5" label="Engine" type="text" /></span></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Body Colour</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title6" label="Colour" type="text" /></span></td>
                </tr>
                <tr>
                  <td bgcolor="#EAEAEA">Transmission</td>
                  <td bgcolor="#999999" class="spec_white"><span class="specwhite"><perch:content id="Title7" label="Transmission" type="text" /></span></td>
                </tr>
              </table>
            </div>
            <div id="price">
              <table width="150" border="0" cellspacing="9">
                <tr>
                  <td width="50" height="25" bgcolor="#999999" class="BOLDTEXT">WAS</td>
                  <td width="81" class="BOLDTEXT"><span class="BOLDTEXT_blackprice">£<perch:content id="Title8" label="Old Price" type="text" /></span></td>
                </tr>
                <tr>
                  <td height="25" bgcolor="#999999" class="BOLDTEXT">NOW</td>
                  <td class="BOLDTEXT"><span class="BOLDTEXT_blackprice">£<perch:content id="Title9" label="New Price" type="text" /></span></td>
                </tr>
                <tr>
                  <td height="25" bgcolor="#999999" class="BOLDTEXT">SAVE</td>
                  <td class="BOLDTEXT"><span class="BOLDTEXT_blackprice">£<perch:content id="Title9a" label="Save" type="text" /></span></td>
                </tr>
              </table>
            </div>
            <div id="reserve">Reserve Motorhome</div>
          </div>
          <div class="TabbedPanelsContent"><perch:content id="Text" label="Description" type="textarea" editor="ckeditor" html="true" /></div>
          <div class="TabbedPanelsContent"><table width="650" cellspacing="5">
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
      <tr>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
        <td width="106" height="80" bgcolor="#CCCCCC"> </td>
      </tr>
    </table></div>
          <div class="TabbedPanelsContent"><perch:content id="Text1" label="Specification" type="textarea" editor="ckeditor" html="true" /></div>
        </div>
      </div>
    </div>
    <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    </script>
    .JS file
    (function() { // BeginSpryComponent
    if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {};
    Spry.Widget.TabbedPanels = function(element, opts)
              this.element = this.getElement(element);
              this.defaultTab = 0; // Show the first panel by default.
              this.tabSelectedClass = "TabbedPanelsTabSelected";
              this.tabHoverClass = "TabbedPanelsTabHover";
              this.tabFocusedClass = "TabbedPanelsTabFocused";
              this.panelVisibleClass = "TabbedPanelsContentVisible";
              this.focusElement = null;
              this.hasFocus = false;
              this.currentTabIndex = 0;
              this.enableKeyboardNavigation = true;
              this.nextPanelKeyCode = Spry.Widget.TabbedPanels.KEY_RIGHT;
              this.previousPanelKeyCode = Spry.Widget.TabbedPanels.KEY_LEFT;
              Spry.Widget.TabbedPanels.setOptions(this, opts);
              // If the defaultTab is expressed as a number/index, convert
              // it to an element.
              if (typeof (this.defaultTab) == "number")
                        if (this.defaultTab < 0)
                                  this.defaultTab = 0;
                        else
                                  var count = this.getTabbedPanelCount();
                                  if (this.defaultTab >= count)
                                            this.defaultTab = (count > 1) ? (count - 1) : 0;
                        this.defaultTab = this.getTabs()[this.defaultTab];
              // The defaultTab property is supposed to be the tab element for the tab content
              // to show by default. The caller is allowed to pass in the element itself or the
              // element's id, so we need to convert the current value to an element if necessary.
              if (this.defaultTab)
                        this.defaultTab = this.getElement(this.defaultTab);
              this.attachBehaviors();
    Spry.Widget.TabbedPanels.prototype.getElement = function(ele)
              if (ele && typeof ele == "string")
                        return document.getElementById(ele);
              return ele;
    Spry.Widget.TabbedPanels.prototype.getElementChildren = function(element)
              var children = [];
              var child = element.firstChild;
              while (child)
                        if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
                                  children.push(child);
                        child = child.nextSibling;
              return children;
    Spry.Widget.TabbedPanels.prototype.addClassName = function(ele, className)
              if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
                        return;
              ele.className += (ele.className ? " " : "") + className;
    Spry.Widget.TabbedPanels.prototype.removeClassName = function(ele, className)
              if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
                        return;
              ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
    Spry.Widget.TabbedPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
              if (!optionsObj)
                        return;
              for (var optionName in optionsObj)
                        if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
                                  continue;
                        obj[optionName] = optionsObj[optionName];
    Spry.Widget.TabbedPanels.prototype.getTabGroup = function()
              if (this.element)
                        var children = this.getElementChildren(this.element);
                        if (children.length)
                                  return children[0];
              return null;
    Spry.Widget.TabbedPanels.prototype.getTabs = function()
              var tabs = [];
              var tg = this.getTabGroup();
              if (tg)
                        tabs = this.getElementChildren(tg);
              return tabs;
    Spry.Widget.TabbedPanels.prototype.getContentPanelGroup = function()
              if (this.element)
                        var children = this.getElementChildren(this.element);
                        if (children.length > 1)
                                  return children[1];
              return null;
    Spry.Widget.TabbedPanels.prototype.getContentPanels = function()
              var panels = [];
              var pg = this.getContentPanelGroup();
              if (pg)
                        panels = this.getElementChildren(pg);
              return panels;
    Spry.Widget.TabbedPanels.prototype.getIndex = function(ele, arr)
              ele = this.getElement(ele);
              if (ele && arr && arr.length)
                        for (var i = 0; i < arr.length; i++)
                                  if (ele == arr[i])
                                            return i;
              return -1;
    Spry.Widget.TabbedPanels.prototype.getTabIndex = function(ele)
              var i = this.getIndex(ele, this.getTabs());
              if (i < 0)
                        i = this.getIndex(ele, this.getContentPanels());
              return i;
    Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex = function()
              return this.currentTabIndex;
    Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount = function(ele)
              return Math.min(this.getTabs().length, this.getContentPanels().length);
    Spry.Widget.TabbedPanels.addEventListener = function(element, eventType, handler, capture)
              try
                        if (element.addEventListener)
                                  element.addEventListener(eventType, handler, capture);
                        else if (element.attachEvent)
                                  element.attachEvent("on" + eventType, handler);
              catch (e) {}
    Spry.Widget.TabbedPanels.prototype.cancelEvent = function(e)
              if (e.preventDefault) e.preventDefault();
              else e.returnValue = false;
              if (e.stopPropagation) e.stopPropagation();
              else e.cancelBubble = true;
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabClick = function(e, tab)
              this.showPanel(tab);
              return this.cancelEvent(e);
    Spry.Widget.TabbedPanels.prototype.onTabMouseOver = function(e, tab)
              this.addClassName(tab, this.tabHoverClass);
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabMouseOut = function(e, tab)
              this.removeClassName(tab, this.tabHoverClass);
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabFocus = function(e, tab)
              this.hasFocus = true;
              this.addClassName(tab, this.tabFocusedClass);
              return false;
    Spry.Widget.TabbedPanels.prototype.onTabBlur = function(e, tab)
              this.hasFocus = false;
              this.removeClassName(tab, this.tabFocusedClass);
              return false;
    Spry.Widget.TabbedPanels.KEY_UP = 38;
    Spry.Widget.TabbedPanels.KEY_DOWN = 40;
    Spry.Widget.TabbedPanels.KEY_LEFT = 37;
    Spry.Widget.TabbedPanels.KEY_RIGHT = 39;
    Spry.Widget.TabbedPanels.prototype.onTabKeyDown = function(e, tab)
              var key = e.keyCode;
              if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
                        return true;
              var tabs = this.getTabs();
              for (var i =0; i < tabs.length; i++)
                        if (tabs[i] == tab)
                                  var el = false;
                                  if (key == this.previousPanelKeyCode && i > 0)
                                            el = tabs[i-1];
                                  else if (key == this.nextPanelKeyCode && i < tabs.length-1)
                                            el = tabs[i+1];
                                  if (el)
                                            this.showPanel(el);
                                            el.focus();
                                            break;
              return this.cancelEvent(e);
    Spry.Widget.TabbedPanels.prototype.preorderTraversal = function(root, func)
              var stopTraversal = false;
              if (root)
                        stopTraversal = func(root);
                        if (root.hasChildNodes())
                                  var child = root.firstChild;
                                  while (!stopTraversal && child)
                                            stopTraversal = this.preorderTraversal(child, func);
                                            try { child = child.nextSibling; } catch (e) { child = null; }
              return stopTraversal;
    Spry.Widget.TabbedPanels.prototype.addPanelEventListeners = function(tab, panel)
              var self = this;
              Spry.Widget.TabbedPanels.addEventListener(tab, "click", function(e) { return self.onTabClick(e, tab); }, false);
              Spry.Widget.TabbedPanels.addEventListener(tab, "mouseover", function(e) { return self.onTabMouseOver(e, tab); }, false);
              Spry.Widget.TabbedPanels.addEventListener(tab, "mouseout", function(e) { return self.onTabMouseOut(e, tab); }, false);
              if (this.enableKeyboardNavigation)
                        // XXX: IE doesn't allow the setting of tabindex dynamically. This means we can't
                        // rely on adding the tabindex attribute if it is missing to enable keyboard navigation
                        // by default.
                        // Find the first element within the tab container that has a tabindex or the first
                        // anchor tag.
                        var tabIndexEle = null;
                        var tabAnchorEle = null;
                        this.preorderTraversal(tab, function(node) {
                                  if (node.nodeType == 1 /* NODE.ELEMENT_NODE */)
                                            var tabIndexAttr = tab.attributes.getNamedItem("tabindex");
                                            if (tabIndexAttr)
                                                      tabIndexEle = node;
                                                      return true;
                                            if (!tabAnchorEle && node.nodeName.toLowerCase() == "a")
                                                      tabAnchorEle = node;
                                  return false;
                        if (tabIndexEle)
                                  this.focusElement = tabIndexEle;
                        else if (tabAnchorEle)
                                  this.focusElement = tabAnchorEle;
                        if (this.focusElement)
                                  Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "focus", function(e) { return self.onTabFocus(e, tab); }, false);
                                  Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "blur", function(e) { return self.onTabBlur(e, tab); }, false);
                                  Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "keydown", function(e) { return self.onTabKeyDown(e, tab); }, false);
    Spry.Widget.TabbedPanels.prototype.showPanel = function(elementOrIndex)
              var tpIndex = -1;
              if (typeof elementOrIndex == "number")
                        tpIndex = elementOrIndex;
              else // Must be the element for the tab or content panel.
                        tpIndex = this.getTabIndex(elementOrIndex);
              if (!tpIndex < 0 || tpIndex >= this.getTabbedPanelCount())
                        return;
              var tabs = this.getTabs();
              var panels = this.getContentPanels();
              var numTabbedPanels = Math.max(tabs.length, panels.length);
              for (var i = 0; i < numTabbedPanels; i++)
                        if (i != tpIndex)
                                  if (tabs[i])
                                            this.removeClassName(tabs[i], this.tabSelectedClass);
                                  if (panels[i])
                                            this.removeClassName(panels[i], this.panelVisibleClass);
                                            panels[i].style.display = "none";
              this.addClassName(tabs[tpIndex], this.tabSelectedClass);
              this.addClassName(panels[tpIndex], this.panelVisibleClass);
              panels[tpIndex].style.display = "block";
              this.currentTabIndex = tpIndex;
    Spry.Widget.TabbedPanels.prototype.attachBehaviors = function(element)
              var tabs = this.getTabs();
              var panels = this.getContentPanels();
              var panelCount = this.getTabbedPanelCount();
              for (var i = 0; i < panelCount; i++)
                        this.addPanelEventListeners(tabs[i], panels[i]);
              this.showPanel(this.defaultTab);
    })(); // EndSpryComponent
    >CSS file
    @charset "UTF-8";
    /* SpryTabbedPanels.css - version 0.6 - Spry Pre-Release 1.6.1 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    /* Horizontal Tabbed Panels
    * The default style for a TabbedPanels widget places all tab buttons
    * (left aligned) above the content panel.
    /* This is the selector for the main TabbedPanels container. For our
    * default style, this container does not contribute anything visually,
    * but it is floated left to make sure that any floating or clearing done
    * with any of its child elements are contained completely within the
    * TabbedPanels container, to minimize any impact or undesireable
    * interaction with other floated elements on the page that may be used
    * for layout.
    * If you want to constrain the width of the TabbedPanels widget, set a
    * width on the TabbedPanels container. By default, the TabbedPanels widget
    * expands horizontally to fill up available space.
    * The name of the class ("TabbedPanels") used in this selector is not
    * necessary to make the widget function. You can use any class name you
    * want to style the TabbedPanels container.
    .TabbedPanels {
              overflow: hidden;
              margin: 0px;
              padding: 0px;
              clear: none;
              width: 100%; /* IE Hack to force proper layout when preceded by a paragraph. (hasLayout Bug)*/
    /* This is the selector for the TabGroup. The TabGroup container houses
    * all of the tab buttons for each tabbed panel in the widget. This container
    * does not contribute anything visually to the look of the widget for our
    * default style.
    * The name of the class ("TabbedPanelsTabGroup") used in this selector is not
    * necessary to make the widget function. You can use any class name you
    * want to style the TabGroup container.
    .TabbedPanelsTabGroup {
              margin: 0px;
              padding: 0px;
    /* This is the selector for the TabbedPanelsTab. This container houses
    * the title for the panel. This is also the tab "button" that the user clicks
    * on to activate the corresponding content panel so that it appears on top
    * of the other tabbed panels contained in the widget.
    * For our default style, each tab is positioned relatively 1 pixel down from
    * where it wold normally render. This allows each tab to overlap the content
    * panel that renders below it. Each tab is rendered with a 1 pixel bottom
    * border that has a color that matches the top border of the current content
    * panel. This gives the appearance that the tab is being drawn behind the
    * content panel.
    * The name of the class ("TabbedPanelsTab") used in this selector is not
    * necessary to make the widget function. You can use any class name you want
    * to style this tab container.
    .TabbedPanelsTab {
              position: relative;
              top: 1px;
              float: left;
              background-color: #DDD;
              list-style: none;
              -moz-user-select: none;
              -khtml-user-select: none;
              cursor: pointer;
              font-family: sans-serif;
              font-size: small;
              font-weight: bold;
              margin-top: 0px;
              margin-right: 1px;
              margin-bottom: 0px;
              margin-left: 0px;
              padding-top: 4px;
              padding-right: 10px;
              padding-left: 10px;
              padding-bottom: 4px;
    /* This selector is an example of how to change the appearnce of a tab button
    * container as the mouse enters it. The class "TabbedPanelsTabHover" is
    * programatically added and removed from the tab element as the mouse enters
    * and exits the container.
    .TabbedPanelsTabHover {
              background-color: #CCC;
    /* This selector is an example of how to change the appearance of a tab button
    * container after the user has clicked on it to activate a content panel.
    * The class "TabbedPanelsTabSelected" is programatically added and removed
    * from the tab element as the user clicks on the tab button containers in
    * the widget.
    * As mentioned above, for our default style, tab buttons are positioned
    * 1 pixel down from where it would normally render. When the tab button is
    * selected, we change its bottom border to match the background color of the
    * content panel so that it looks like the tab is part of the content panel.
    .TabbedPanelsTabSelected {
              background-color: #FFF;
              color: #333;
              border-top-color: fff;
              border-right-color: fff;
              border-bottom-color: fff;
              border-left-color: fff;
              border-color: fff;
              outline-color: fff;
    /* This selector is an example of how to make a link inside of a tab button
    * look like normal text. Users may want to use links inside of a tab button
    * so that when it gets focus, the text *inside* the tab button gets a focus
    * ring around it, instead of the focus ring around the entire tab.
    .TabbedPanelsTab a {
              color: black;
              text-decoration: none;
    /* This is the selector for the ContentGroup. The ContentGroup container houses
    * all of the content panels for each tabbed panel in the widget. For our
    * default style, this container provides the background color and borders that
    * surround the content.
    * The name of the class ("TabbedPanelsContentGroup") used in this selector is
    * not necessary to make the widget function. You can use any class name you
    * want to style the ContentGroup container.
    .TabbedPanelsContentGroup {
              clear: both;
              background-color: #F9F9F1;
              height: auto;
              margin-bottom: 3px;
              border: .1px solid #999;
    /* This is the selector for the Content panel. The Content panel holds the
    * content for a single tabbed panel. For our default style, this container
    * provides some padding, so that the content is not pushed up against the
    * widget borders.
    * The name of the class ("TabbedPanelsContent") used in this selector is
    * not necessary to make the widget function. You can use any class name you
    * want to style the Content container.
    .TabbedPanelsContent {
              overflow: hidden;
              padding: 4px;
    /* This selector is an example of how to change the appearnce of the currently
    * active container panel. The class "TabbedPanelsContentVisible" is
    * programatically added and removed from the content element as the panel
    * is activated/deactivated.
    .TabbedPanelsContentVisible {
              background-color: #FFF;
              font-family: Arial, Helvetica, sans-serif;
              font-size: 0.75em;
              color: #333;
              padding: 20px;
              clear: both;
              margin-bottom: 5px;
              height: auto;
    /* Vertical Tabbed Panels
    * The following rules override some of the default rules above so that the
    * TabbedPanels widget renders with its tab buttons along the left side of
    * the currently active content panel.
    * With the rules defined below, the only change that will have to be made
    * to switch a horizontal tabbed panels widget to a vertical tabbed panels
    * widget, is to use the "VTabbedPanels" class on the top-level widget
    * container element, instead of "TabbedPanels".
    .VTabbedPanels {
              overflow: hidden;
              zoom: 1;
    /* This selector floats the TabGroup so that the tab buttons it contains
    * render to the left of the active content panel. A border is drawn around
    * the group container to make it look like a list container.
    .VTabbedPanels .TabbedPanelsTabGroup {
              float: left;
              width: 10em;
              height: 20em;
              background-color: #EEE;
              position: relative;
              border-top: solid 1px #999;
              border-right: solid 1px #999;
              border-left: solid 1px #CCC;
              border-bottom: solid 1px #CCC;
    /* This selector disables the float property that is placed on each tab button
    * by the default TabbedPanelsTab selector rule above. It also draws a bottom
    * border for the tab. The tab button will get its left and right border from
    * the TabGroup, and its top border from the TabGroup or tab button above it.
    .VTabbedPanels .TabbedPanelsTab {
              float: none;
              margin: 0px;
              border-top: none;
              border-left: none;
              border-right: none;
    /* This selector disables the float property that is placed on each tab button
    * by the default TabbedPanelsTab selector rule above. It also draws a bottom
    * border for the tab. The tab button will get its left and right border from
    * the TabGroup, and its top border from the TabGroup or tab button above it.
    .VTabbedPanels .TabbedPanelsTabSelected {
              background-color: #EEE;
              border-bottom: solid 1px #999;
    /* This selector floats the content panels for the widget so that they
    * render to the right of the tabbed buttons.
    .VTabbedPanels .TabbedPanelsContentGroup {
              clear: none;
              float: left;
              padding: 0px;
              width: 30em;
              height: 20em;
    /* Styles for Printing */
    @media print {
    .TabbedPanels {
              overflow: visible !important;
    .TabbedPanelsContentGroup {
              display: block !important;
              overflow: visible !important;
              height: auto !important;
    .TabbedPanelsContent {
              overflow: visible !important;
              display: block !important;
              clear:both !important;
    .TabbedPanelsTab {
              overflow: visible !important;
              display: block !important;
              clear:none !important;
              height: 100%;
    #TabbedPanels1 {
              height: auto;
              padding-top: 5px;
              background-color: #EAEAEA;
              width: 700px;
    I did read this but don't know where to start: http://www.webdevforums.com/showthread.php?27428-Dreamweaver-spry-collapsible-panel-amp-re peating-regions
    Can anybody HELP PLEASE PLEASE

    I think I counted three tabbed panels in the markup, each with an ID of TabbedPanels1
    You have only one constructor that makes one instance of the tabeed panels with an ID of TabbedPanels1
    There are a couple of things that create the problem.
    There can only be one ID with the same name in a document, thus the ID's of the TabbedPanels will need to change from TabbedPanels1 for the second and third instances to TabbedPanels2 and TabbedPanels3 (or similar) respectively.
    There needs to be a constructor for each tabbed panels like
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
    var TabbedPanels3 = new Spry.Widget.TabbedPanels("TabbedPanels3");
    Gramps

  • How to implement this algorithm with region growing ?

    hi,
    I would like to ask u to help me in developing code for the region growing segmentation algorithm for digital images.The algorithm perform
    1.Model I should use the average of the pixel(for each colorchanel,red-green-blue ) from the color I choose.
    2. Strating start by choosing an arbitrary seed pixel via 10X10 region and calculate the average of the region and compare it with neighbouring pixels.
    3. growing region is grown from the seed pixel by adding in neighbouring pixels that are similar , increasing the size of the region.
    4. stop when the growth of one region stops, then the program should try another direction. the growth is starting on the left and in the same direction as the rotating hands of a clock
    the whole process is stoped until the growth of all the direction stoped and choose a largest region with a bounding box. all the pixels in the bounding box is now similar.
    I really don't know , how can I do it?
    Please suggest the tips to develop or code if u have for this algorithm.
    Thanks for ur help

    Something you need to consider is what sort of data structure you will use to hold the result of a region that you are growing. One possibility is to keep a second black and white image that is simply a mask of the grown region, i.e. black in the areas that have been included and white in the areas not yet covered.
    You also need to determine a threshold for similarity. How close in color space must two pixels be in order that you consider them to belong to the same region. You will need a boolean function that compares two colors and returns true if they are similar.
    Finally, if you use a mask bitmap to indicate where you have been, you can proceed in the following sort of manner.
    You can sweep across the entire image array, first right to left, then top to bottom, then left to right, then bottom to top, cycling through these 4 directions until nothing changes.
    A single sweep will consist of a double nested for loop, one incrementing x and the other incrementing y. Inside the inner loop you are considering a single pixel at (x,y)
    So assume that you are sweeping from left to right, i.e. incrementing x
    You will be expanding the reagion at (x,y) only if
    a) mask(x-1,y) is black (i.e. the previous pixel is in the region.
    b) maks(x,y) is white (the current point is not in the region
    c) color of image at (x,y) is similar to color of region
    When you update the region you will
    a) color the mask at (x,y) black
    b) add the RGB from the image to TotalR,TotalG,TotalB in region
    c) increase point count for the region
    The point count for a region and the TotalR etc allow you to compute the average color of the region at any time. You can detect if a single pass changed anything by noticing if the pointCount changed between two passes
    This algorithm is not particularly efficient, because you keep sweeping over the entire array, but it is easy to comprehend and easy to code.
    Note: the hard part is determining a decent threshold for color similarity. everything else is very straight forward.
    Enjoy!

  • PhP/MySQL Horizontal/Vertical Repeat Region

    Hi Guys,
    I'm pretty sure this question would have been asked many times before. If so, first of all my apologies for re-posting this.
    Anyway, what I'm trying to do is create a repeat region that spans for 4 columns and then repeats the rest in rows. For example, if I have 100 records in my table (MySQL), then I want to display this in a table of 4 columns and and 25 rows (in reality, the number of records would be unspecified, of course, but still the records need to be displayed on a 4 column, X row table). For example:
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    name
    comment
    At the moment, I have no issue with displaying the records either horizontally or vertically (explicitly) using the built in "repeat region" behavior. However, where I'm having the problem is with displaying the records in a table as the one I described above.
    I'm using DW CS5 with PhP/MySQL.
    Can I still do this using the built in "repeat region" server behavior, if so how?
    Otherwise, how else could I achieve this (ideally without using any extensions)?
    Thanks in advance for any help and support,
    Cheers

    I'm believe you should be able to modify the repeat region code to do what you want it to do.  With that said we will need 2 things:
    1.  To see the code from the page.
    2.  To know the order of the results is it:
    Horizontal: 1 2 3 4
                    5 6 7 8
    Or Vertical:
    1 5
    2 6
    3 7
    4 8

Maybe you are looking for

  • Safari doesn't open PHP files

    If i try to open a PHP file in safari, it shows the code. If the PHP file isn't local, for example, on a local website (using air sharing on my ipod touch and adding php files to it), it will download the file. If I open it there, it will only displa

  • How can I display multiple column results of a sql query?

    I'm wanting to display the results of a query selecting from multiple columns, but I can't seem to find an item type that will allow this. I've tried LOV, multiselect, display as text and others. Any ideas on how to do this. Here is my basic query: S

  • Oracle Data Provider (ODP)

    Does the new Oracle Data Provider 9.2.0.1.1 (from Visual Basic .Net) support passing arrays to PL/SQL Packages whose procedures accept table arrays as the input parameters? oo4o supported this functionality.

  • Push value in index 0 in array

    Hi, all I am creating a row which have 8 thumbnails in it, I save these in a array, When user drag row right to left then first Movieclip shift to last position, then i splice array 0 index and push to last position.. it  works fine but when i drag i

  • Pinterest is not loading

    My pinterest is not loading im using a macbook air. I already tried cleaning erasing all my history and cookies. My pinterest works in my other browsers just not in firefox. hope you can help me.