close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Followed the TUT but still can't get multiple updates to work!

Thread began 11/17/2009 9:17 am by Banksie | Last modified 2/24/2010 7:42 am by Ray Borduin | 8213 views | 11 replies |

Banksie

Followed the TUT but still can't get multiple updates to work!

Re-posted, as requested, from another thread....

I'm having similar problems using DW8 and DA 2.0.6.!!!

Thought it was me so created a simple example of tables and pages and followed the video tutorial to the letter just to test the theory. My update page doesn't even update! Nor does it redirect - just refreshes the page with the original data still intact. I'm using a simple recordset and trying to update a single text field in each record.

I have a "list all" page, an insert page and an update page. On the update page I've set the recordset to feed the form field with the data that can be updated. I've created a table with the field in one <td> and set the <tr> to repeat (DW Repeat Region behavior) for all records. I've then selected the DA > Update > Multiple Record Updates and set the repeated form to the only choice available at that point - the repeat region - with all other selections pointing to the table to be updated and the sources (in he fom) from which the update should come.

On "finish" the wizard cloes and sets a "repeat selection, 1" region around the entire first repeat region. Weird but consistent!

The resulting page, posetd to my test server, doesn't update nor does it trigger the redirect which was set, in the wizard, to the "list all" page. Instead, all it does is reload the update page and all of the original data (as it hasn't triggered the update).

Help!!

Sign in to reply to this post

Banksie

Possible cause / fault

OK, I've spent some time digging on this and have found that the DA Multiple Records (Insert, Delete, Update) seems to act strangely at my end. The Repeat Selection behavior inserted by the wizards seems to appear randomly and also to rename my designated button adding an incremented number - hence not action when the button is pressed.

Below I've copied the chunks of code generated by the wizards followed by the hand edited code that corrects the anomaly and which subsequently works as required.

Is this an error with my set-up (DW8, DA 2.0.6) or a bug?

Please advise soonest.

Wizard generated code:
<form id="del_MultiplesForm" name="del_MultiplesForm" method="post" action="">
<?php
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_rsCart2Printer){
?>
<table width="300">
<?php do { ?>
<tr>
<td><?php echo $row_rsCart2Printer['printerName']; ?></td>
<td><input type="hidden" name="WADA_RepeatID_cart2PrinterID_<?php echo $RepeatSelectionCounter_1; ?>" id="WADA_RepeatID_cart2PrinterID_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_rsCart2Printer["cart2PrinterID"]; ?>" />
<input type="checkbox" name="btn_DelMultiCheck_<?php echo $RepeatSelectionCounter_1; ?>" id="btn_DelMultiCheck_<?php echo $RepeatSelectionCounter_1; ?>" value='<?php echo $row_rsCart2Printer["cart2PrinterID"]; ?>'/></td>
</tr>
<?php } while ($row_rsCart2Printer = mysql_fetch_assoc($rsCart2Printer)); ?>
<tr>
<td><input type="submit" name="btn_DeleteMultiples_<?php echo $RepeatSelectionCounter_1; ?>" id="btn_DeleteMultiples_<?php echo $RepeatSelectionCounter_1; ?>" value="Delete Selected" /></td>
<td>&nbsp;</td>
</tr>
</table>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
<td>No records match your request.</td>
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_rsCart2Printer && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_rsCart2Printer = mysql_fetch_assoc($rsCart2Printer);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop
?>
</form>


Hand edited / corrected code:
(Note the position of the RepeatSelectionCounter code and the name o the submit button - btn_DelMultiples)

<form id="del_MultiplesForm" name="del_MultiplesForm" method="post" action="">
<table width="300" class="dataTable">
<?php do { ?>
<tr>
<?php
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_rsCart2Printer){
?>
<th><?php echo $row_rsCart2Printer['printerName']; ?></th>
<td><input type="hidden" name="WADA_RepeatID_cart2PrinterID_<?php echo $RepeatSelectionCounter_1; ?>" id="WADA_RepeatID_cart2PrinterID_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_rsCart2Printer["cart2PrinterID"]; ?>" />
<input type="checkbox" name="btn_DelMultiCheck_<?php echo $RepeatSelectionCounter_1; ?>" id="btn_DelMultiCheck_<?php echo $RepeatSelectionCounter_1; ?>" value='<?php echo $row_rsCart2Printer["cart2PrinterID"]; ?>'/></td>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
<td>No records match your request.</td>
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_rsCart2Printer && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_rsCart2Printer = mysql_fetch_assoc($rsCart2Printer);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop
?>
</tr>
<?php } while ($row_rsCart2Printer = mysql_fetch_assoc($rsCart2Printer)); ?>
<tr>
<td><input type="submit" name="btn_DelMultiples" id="btn_DelMultiples" value="Delete Selected" /></td>
<td>&nbsp;</td>
</tr>
</table>
</form>

Sign in to reply to this post

Eric Mittman

When you applied the repeat selection server behavior to the page did you apply it to the entire form? The repeat selection should be only applied to the fields in the form that you need to make use of in the multiple update or delete. If the button or any other part of the form were selected when applying this server behavior this is the result that would occur. Please let me know about this and if there are issues that you are finding and I can do some tests like you are doing to see if there is a problem.

Sign in to reply to this post

Banksie

lauded princeton

Eric - no, have selected the <tr> in which the form field and delete checkbox reside. The wizard places the code anywhere - just tried again and this time put the repeatselectioncounter enclosing the entire table - so renamed the button with the increment again!!

Sign in to reply to this post

Eric Mittman

I have been doing a bit of testing on this with DA 2.0.6 in DW8 and CS3. I have not been able to reproduce the issues you are experiencing. What is the OS you are working in? If you can please post back with the page in question before the repeat selection or multi delete is added. I will use this as a guide along with the os info you post to try and reproduce the problem the same way you are experiencing it. If we can get the issue to happen for us we will have a much better chance of figuring out what the problem is.

Sign in to reply to this post

Banksie

Reply

Eric - code for the page below. I run WinXP on a P4. DWCS4 and DA2.0.6.

Hope you can come up with something - look forward to hearing from you.

Regards

Gary

<?php require_once('../Connections/connCompats.php'); ?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.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;
}
}
?>
<?php
$ParamcartID_WADAcartridges = "-1";
if (isset($_GET['cartID'])) {
$ParamcartID_WADAcartridges = (get_magic_quotes_gpc()) ? $_GET['cartID'] : addslashes($_GET['cartID']);
}
mysql_select_db($database_connCompats, $connCompats);
$query_WADAcartridges = sprintf("SELECT cartID, compatsRef, cartCode, cartDescr, cartColor, cartImage FROM cartridges WHERE cartID = %s", GetSQLValueString($ParamcartID_WADAcartridges, "int"));
$WADAcartridges = mysql_query($query_WADAcartridges, $connCompats) or die(mysql_error());
$row_WADAcartridges = mysql_fetch_assoc($WADAcartridges);
$totalRows_WADAcartridges = mysql_num_rows($WADAcartridges);

$targetCart_rsCart2Printer = "1";
if (isset($_GET['cartID'])) {
$targetCart_rsCart2Printer = (get_magic_quotes_gpc()) ? $_GET['cartID'] : addslashes($_GET['cartID']);
}
mysql_select_db($database_connCompats, $connCompats);
$query_rsCart2Printer = sprintf("SELECT carts2printers.cart2PrinterID, carts2printers.cartID, carts2printers.printerID, printers.printerName FROM carts2printers, printers WHERE carts2printers.cartID = %s AND printers.printerID = carts2printers.printerID", GetSQLValueString($targetCart_rsCart2Printer, "int"));
$rsCart2Printer = mysql_query($query_rsCart2Printer, $connCompats) or die(mysql_error());
$row_rsCart2Printer = mysql_fetch_assoc($rsCart2Printer);
$totalRows_rsCart2Printer = mysql_num_rows($rsCart2Printer);?>
<?php
// WA Application Builder Delete
if (isset($_POST["Delete_x"])) // Trigger
{
$WA_connection = $connCompats;
$WA_table = "cartridges";
$WA_redirectURL = "cartridges_ListAll.php";
$WA_keepQueryString = false;
$WA_fieldNamesStr = "cartID";
$WA_columnTypesStr = "none,none,NULL";
$WA_fieldValuesStr = "".((isset($_POST["WADADeleteRecordID"]))?$_POST["WADADeleteRecordID"]:"") ."";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_comparisions = explode("|", $WA_comparisonStr);
$WA_connectionDB = $database_connCompats;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$deleteParamsObj = WA_AB_generateWhereClause($WA_fieldNames, $WA_columns, $WA_fieldValues, $WA_comparisions);
$WA_Sql = "DELETE FROM `" . $WA_table . "` WHERE " . $deleteParamsObj->sqlWhereClause;
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<!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"><!-- InstanceBegin template="/Templates/2ColTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Delete a cartridge</title>
<!-- InstanceEndEditable -->
<link href="../styles/compats_basics.css" rel="stylesheet" type="text/css" /><!--[if IE 5]>
<style type="text/css">
/* place css box model fixes for IE 5* in this conditional comment */
.thrColFixHdr #sidebar1 { width: 180px; }
.thrColFixHdr #sidebar2 { width: 190px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
.thrColFixHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<!-- InstanceBeginEditable name="head" -->


<link href="../WA_DataAssist/styles/Elemental_Slate.css" rel="stylesheet" type="text/css" />
<link href="../WA_DataAssist/styles/Verdana.css" rel="stylesheet" type="text/css" />
<!-- InstanceEndEditable -->
</head>

<body class="twoColFixHdr">

<div id="container">
<div id="header">
<div id="logo"><img src="../images/compatsLogo02.gif" width="215" height="46" alt="Compats" /></div>
<h1>Compats</h1>
<!-- end #header -->
</div>
<div id="sidebar1"><!-- InstanceBeginEditable name="sideBar1Content" -->
<?php require_once('../includes/nav_Admin.php'); ?>
<!-- InstanceEndEditable -->
<!-- end #sidebar1 --></div>
<div id="mainContent"><!-- InstanceBeginEditable name="mainContent" -->
<div id="breadcrumbs"><p><a href="index.php">Admin Home</a>&nbsp;&gt;&nbsp;Delete a cartridge</p></div>
<h1>Delete a cartridge</h1>
<?php if ($totalRows_rsCart2Printer == 0) { // Show if recordset empty ?>
<div class="WADADeleteContainer">
<?php if ($totalRows_WADAcartridges > 0) { // Show if recordset not empty ?>
<form action="cartridges_Delete.php?cartID=<?php echo(rawurlencode($row_WADAcartridges['cartID'])); ?>" method="post" name="WADADeleteForm" id="WADADeleteForm">
<p class="WADAMessage">Are you sure you want to delete the following record?</p>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">Compats Ref:</th>
<td class="WADADataTableCell"><?php echo($row_WADAcartridges['compatsRef']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">M/F Part No:</th>
<td class="WADADataTableCell"><?php echo($row_WADAcartridges['cartCode']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">Description:</th>
<td class="WADADataTableCell"><?php echo($row_WADAcartridges['cartDescr']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">Colour:</th>
<td class="WADADataTableCell"><?php echo($row_WADAcartridges['cartColor']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">&nbsp;</th>
<td class="WADADataTableCell"><img src="../images/<?php echo $row_WADAcartridges['cartImage']; ?>" /></td>
</tr>
</table>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Delete" id="Delete" value="Delete" alt="Delete" src="../WA_DataAssist/images/Slate/Elemental_delete.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="cartridges_ListAll.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../WA_DataAssist/images/Slate/Elemental_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADADeleteRecordID" type="hidden" id="WADADeleteRecordID" value="<?php echo(rawurlencode($row_WADAcartridges['cartID'])); ?>" />
</div>
</form>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAcartridges == 0) { // Show if recordset empty ?>
<div class="WADANoResults">
<div class="WADANoResultsMessage">No record found.</div>
</div>
<?php } // Show if recordset empty ?>
</div>
<?php } // Show if recordset empty ?>
<?php if ($totalRows_rsCart2Printer > 0) { // Show if recordset not empty ?>
<h1>Warning!!</h1>
<p>This cartridge is still associated with the following printers. You must
delete that association before you can delete the cartridge.</p>
<p>&nbsp;</p>
<form id="del_MultiplesForm" name="del_MultiplesForm" method="post" action="">
<table width="300">
<?php do { ?>
<tr>
<td><?php echo $row_rsCart2Printer['printerName']; ?></td>
<td><input type="checkbox" name="del_MultiCheck" id="del_MultiCheck" /></td>
</tr>
<?php } while ($row_rsCart2Printer = mysql_fetch_assoc($rsCart2Printer)); ?>
<tr>
<td><input type="submit" name="btn_DelMultiples" id="btn_DelMultiples" value="Delete Selected" /></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
<p>&nbsp;</p>
<?php } // Show if recordset not empty ?>
<!-- InstanceEndEditable -->
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<p>&copy; www.compats.com <?php echo date("Y") ?></p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($WADAcartridges);

mysql_free_result($rsCart2Printer);
?>

Sign in to reply to this post

Eric Mittman

I have done a bit more testing and here is what I have found. If I highlight just the row with the checkbox in it I'm not able to get the multiple delete server behavior to rewrite the code for the button in this form. I tried a couple of other things and the only way I was able to get this to occur was if I highlighted both rows in that table in the form, or if I highlighted the entire table.

I think this must be what you are experiencing. I found that if I went into the split or code view and made the highlights it seemed to always select the portion of the table I was expecting. If I did the same thing in design view it seemed that it was easy to select the entire table or both rows in the table and it may not be known to you when you do this.

When I apply the repeat selection and go into code view the button is not within this area. If the button is within the repeat selection when I apply the multiple delete it rewrites the code on the button with the repeat selection increment variables. The next time you apply the repeat selection make sure to go into code view and check what is within the loop, if your button is in the loop you should move it out before applying the multiple delete to the page.

Sign in to reply to this post

Banksie

response

Hi Eric,

Sorry to disappoint but (and I've just tried it again - in split view to check the code blocks being selected) I select the row from the <tr> tag in the tag selector. This is the block of code highlighted in code view and yet still, when I apply the server behavior, the repeatselection behavior encompasses the entire table - including buttons.

If, as a further example, I select only one of the items in the required row (say the dynamic text drawn from the recordset) and then apply the repeatselection behavior, the opening code block is placed even before the "<!DOCTYPE html PUBLIC ..." declaration with the closing code block after the table in which the data appears!!!

If you'd like to arrange a mutually convenient time to log on I'll show you the prcess and the result.

Please advise

Regards

Gary

Sign in to reply to this post

Banksie

PS....

You mentioned that you'd tested in DW8 and CS3 - what about CS4?

Sign in to reply to this post

Eric Mittman

Since you are able to get this to occur with regularity I have created a ticket for you on this issue so that it can be looked into further. To check the status of your ticket or update it just login to the site and visit your support history.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...