close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Manage Relational Tables: Relational Table Not Updating

Thread began 5/25/2009 1:45 pm by Nigel | Last modified 6/02/2009 5:50 am by Ray Borduin | 2885 views | 6 replies |

Nigel

Manage Relational Tables: Relational Table Not Updating

OK, after burning up way too many hours on this, I give up, I cannot get the MRT behavior to work. I'm trying to update the itemcolors table, which is a lookup table for my product options, linking ItemID to ColorID. I added the product options using the Insert Multiple Records behavior, that worked fine. Now I need to offer the ability to update that table, so after updating all other fields (product name, description, image, etc.,) the ItemID is passed in the URL to the item-update-options.php page.

STEPS. I created a checkbox list, bound the variables from the colors table, and applied a repeat region driven by a recordset from the colors table. I then applied the MRT behavior using the ItemID from the URL ($_GET['ItemID'] as the key value.

RESULTS. The checkbox list displays correctly, all the options are displayed and only the ones in the lookup table are checked. However, if I check or uncheck any options and submit, the page reloads (no redirect specified) and the original options are restored, i.e., the lookup table is not updated. I removed everything and started from scratch multiple times, I don't know what I'm doing wrong.

BTW, I've used the MRT before on another site and after a brief struggle I wrestled into submission. I've compared the code and the only differences I can see are that I previously used a session variable for the key value in step 2 of the wizard; and there is no repeat region outside of the DA repeat selection behavior, whereas in my current page DA left my repeat region and inserted it's repeat selection inside of it.

[Code removed for brevity.]

Sign in to reply to this post

Nigel

Solved

The page I used for the MRT was the item-update.php page re-purposed. I thought some old code in there might have been causing problems, I had taken out all the old server behaviours, but had left a bit of code debris in the HTML, specifically a redirect on the FORM and a hidden update field. Now the page seems to work. Just need to add another checkbox list and MRT and I should be good.

Sign in to reply to this post

Nigel

Two Manage Relational Table Server Behaviors in One Form

I added in the second checkbox list for sizes, and added a second Manage Relational Table server behavior, but no luck. The sizes display fine with the correct checkboxes checked, but changing them and submitting does not update the database. The first MRT for colors still works.

Do I need to do anything special to have two MRTs working on one page? They're both in the same form, the first MRT does not redirect, only the second one. The first is triggered by the button, the second by any form submission.

Incidentally, I could not apply the second MRT to the page properly, it added the server-side code to the top of the page but it did not make any changes to the HTML, my repeat region with the checkboxes. I had to copy the code for the checkbox list from the first MRT and alter it for the second one. Not sure if that's a bug.

Code Attached.

Appreciate any clues.... thanks!

Attached Files
manage-relational-tables.txt
Sign in to reply to this post

Ray BorduinWebAssist

It is difficult to debug something this complex without looking at the code and testing it in context. I have never used two MRT Server Behaviors on the same page, but I don't see why it wouldn't work.

It could be the position of your recordsets, code, or something else entirely... it is just too hard to say without debugging it working.

Sign in to reply to this post
Did this help? Tips are appreciated...

Nigel

Thanks Ray. I'll check out the order of the code, maybe switch it around a bit. I'll also try using two forms and having the one submit after the other is fired. Will post back if I have any success. I really don't want the user to have to go through two steps to change each option.

Sign in to reply to this post

Nigel

Hand Code Fix

OK, it seems like DataAssist is broken when it comes to adding two MRTs to one page. I could not get it to work through the WA interface. No problem applying the first MRT to a checkbox repeat region; but when I applied the second one the head of the document was updated but not the checkbox HTML in the body. I finally got the page working by copying and pasting the server-side code at the top and in the checkbox repeat in the body for the first region and then modifying it line by line. I hope this will be fixed, it's been a complete time-waster, and yet IMO it's one of the most useful server behaviors.

Sign in to reply to this post

Ray BorduinWebAssist

Thank you for the feedback. Please post a support incident with a full description of your use case.

I don't think we test for multiple MRT server behaviors on the page and it sounds like there is a bug there.

Thank you for bringing this to our attention.

Sign in to reply to this post
Did this help? Tips are appreciated...

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...