close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Help needed using the MRT server behaviours

Thread begun 12/06/2009 11:02 am by rob75685 | Last modified 3/08/2010 4:42 pm by Eric Mittman | 6391 views | 29 replies |

rob75685

Help needed using the MRT server behaviours

hi there

In a previous post Eric kindly outlined how to use the MRT server behaviour as follows:

Originally Said By: Eric Mittman
  I have done a bit of testing on the Manage Relational Table server behavior and can confirm it to be working as expected.

Here is the basic idea of how to use this server behavior.

1
Start on an insert or update page. You will first need to add a new recordset to your page to select the records from your secondary table, for example if you were configuring product options you would have a recoredset select all the records from your options table that you would like to associate with this product.

2
Once the recordset is in place on the page you will need to add the input to record the values of this secondary table. In regards to the example above you can add in a checkbox.

3
Next you will need to associate this new input with your new recordset. For the value you can bind the id from the new recordset, and for the label you can just use whatever value from the recodset would best reflect that record.

4
The next thing to go is to apply the repeat region server behavior to this new input and the label for it. In the repeat region server behavior make sure to choose your new recorset and let it display all records.

5
The final part is to add in the Manager Relational Table server behavior. When you add this server behavior you will fist need to specify the trigger and the relational table. For the trigger you can just use the button insert/update pressed. For the table make sure to select your relational table. Make sure you select the redirect page on this step.
On the next step you will select which column in your relational table will hold the id from your main table, you also need to select what type of data this will be and use the lightning bolt icon to select the id value that will be inserted here, it should be the id for the just inserted record held in the session varialble for an insert page and the id from the product recordset for an update page.

In the step after this you will select the column in the relational table that will hold the secondary table's id, like the previous step you will need to select the data type, for the value it should be defaulted to your repeat region input.

In step 4 of 4 you can set the value of the id or other columns in this table, if you have an auto incrementing id then you do not need to set a value for this column. You can finish it now to add the Manage Relational Table server behavior into your page.

When you test the page out you should see your newly added repeat region with the values from the recordset displayed. When you select these values and insert or update it should update your relational table.  



-----------------------

I'm still struggling a bit with this, so could someone clarify in a more clearer way for me please.

I have three tables:

1. Products:

ProductID
name
desc
etc

2. Options:
OptionID
size
price

3. Lookup table

ProductID
OptionID

I have a standard DataAssist results page here:

products_Results.php

which links to the update page

and now would like to link this to add/update the various options.

Can you talk me through the first step on how to change this page to link it to the options page for each product please...

many thanks

Sign in to reply to this post

Eric Mittman

Would the linking page be the details page for the item with the options listed, or would this be a page for options that is filtered by a particular item? I'm just not so clear on weather you are looking to add to the detail page or create a new page for options. Please post back with a little more detail and I will try to point you in the rite direction.

Sign in to reply to this post

rob75685

hi Eric

Thanks for your help.

First off I need to create a new page for options so that I can add/update the options for each product

Sign in to reply to this post

Eric Mittman

To create your options page you would first use the DataAssist wizard to create the pages for this options table. This would give you a set of pages that will allow you to insert, update, delete, and search for the options.

Once you have this page in place you can then go into the steps listed for applying the MRT to the product insert and update pages.

Have you configured your options pages yet? If so let me know where in the steps you are for applying the MRT and I will help you out with whatever I can.

Sign in to reply to this post

rob75685

hi Eric

I've now used the DataAssist wizard to produce the insert, update, search and delete pages for my options.

I'm not sure what to do next as when I go to my product results page and try the MRT behaviour it tells me that I need a multi-select or files within a repeated region...

So, what's the next step please, many thanks

Sign in to reply to this post

Eric Mittman

You will need to be applying the MRT server behavior on your products insert and update pages. To do this you should start with the steps listed in your first post. These are the specific steps you will need to take to get this implemented correctly on your product insert and update pages. If you have any problem with the steps please let me know which step you are having trouble with.

Sign in to reply to this post

rob75685

hi Eric

Originally Said By: rob75685
  1
Start on an insert or update page. You will first need to add a new recordset to your page to select the records from your secondary table, for example if you were configuring product options you would have a recoredset select all the records from your options table that you would like to associate with this product.  



So how do I go about creating a recordset for the secondary table.. and how do I link that to the product ?.... sorry I'm not finding this very clear

Sign in to reply to this post

Eric Mittman

This step is telling you to create a recordset to select all of the options that you would like to make available for the product. This could be as simple as 'SELECT * FROM options'. You just need to query your table to return the options that you would like to be able to associate with the product. If you are not familiar with SQL and recordsets I would suggest that you read up on this a little more to have a better idea of how to make use of recordsets. We have a free training for databases, it is called the Database Starter Kit for PHP, here is a link to the page you can get this from:

tutorials-and-training/

Since using the MRT server behavior will require you to have an understanding of the basics of SQL and inserting/updating records it is very helpful to learn this knowledge in advance.

Sign in to reply to this post

rob75685

hi Eric

Thanks for your reply again.

Will all respect I've been using recordsets with php and MySQL for a few years now - I'm just a bit confused as to what recordset I need to set up.

Sign in to reply to this post

Eric Mittman

I guess that I'm having a hard time understanding what part you are stuck on in regards to the recordset. Do you want to list all of the available options from your options table? If so then your recordset should just be a simple 'SELECT * FROM your_product_table'.

If you want to display only certain options from this table to associate with a product then you would want to further filter the recordset to only include these options.

The idea is that this recordset will power the list of available options that have check boxes next to them. You will use the checkboxes to associate options for the product you are working with, it is the MRT server behavior that will handle the association in the db for you, this first step is just to get the options listed on the page for you to associate with the selected product.

If I'm misunderstanding the question or issue at hand please explain for me. I apologize if my last post came off as disrespectful in any way, that was not my intent, I deal with an assortment of user experience levels every day.

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