close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to create a detail and / or results page that displays content from a multiple choice list

Thread begun 8/12/2013 9:51 am by Jonas | Last modified 8/26/2013 11:28 am by Jason Byrnes | 3366 views | 9 replies |

Jonas

How to create a detail and / or results page that displays content from a multiple choice list

I would like to know how to create a detail and / or results page that displays content from a multiple choice list.

I have read your tutorial "Manage Relational Tables" and viewed pages from your example-site "Blue Sky Music". And from this, I think I understand how to create both an insert and update-page with a multi-choice list and using the "Manage Relational Table" command.

But I can not find any information, tutorial, example - on how to view the content from such a list. Neither the results page or products page from the above mentioned site contains this.

For simplicity's sake, could you explain how it is possible to show the results from the table "Genres" in the site "Blue Sky Music" - as a text with commas between each selection in the list on the detail page.

If I understand correctly, you have to create a recordset (RS) with Inner Join. But I do not really understand how this works.

I hope you understand what I mean.

Sign in to reply to this post

Jason ByrnesWebAssist

after following the Manage Relational table tutorial, the WADAitems recordset on my details page looks like this:

SELECT ItemID, `itemcategory`.`ItemCatName` AS itemcategory_ItemCatName, ItemName, ItemShortDesc, ItemLongDesc, ItemPrice, ItemSKU, ItemThumb, ItemImage, ItemWeight
FROM items LEFT JOIN itemcategory ON itemcategory.ItemCatID = items.ItemCatID
WHERE ItemID = ParamItemID



This is returning details from the items table, and the related category name from the itemcategory table. the ParamItemID variable used in the where clause is the ItemID URl variable that is used to tell the details page which item to display.

to return the related genres, you would need to edit the recordset to include the genres.GenreName column in the select statement, and include left joins for the itemgenres and genres tables:

SELECT ItemID, `itemcategory`.`ItemCatName` AS itemcategory_ItemCatName, ItemName, ItemShortDesc, ItemLongDesc, ItemPrice, ItemSKU, ItemThumb, ItemImage, ItemWeight, genres.GenreName
FROM items
LEFT JOIN itemcategory ON itemcategory.ItemCatID = items.ItemCatID
LEFT JOIN itemgenres ON itemgenres.ItemGenreItemID = items.ItemID
LEFT JOIN genres ON itemgenres.ItemGenreGenreID = genres.GenreID
WHERE ItemID = ParamItemID



Then add the genres.GenreName binding to the page and add a repeat region around it.

Doing this on the results page would be more problematic, you would need to use a nested recordset to do this on the results page.

Sign in to reply to this post

Jonas

Thanks Jason. It works well on this exercise site.

But now I want to use my new knowledge to my own projects.

In this project there are three multiple choice boxes and four radio-buttons.

I suspect it is not as easy to use 'Insert Multiple Records' function and the 'Manage Relational Table' here!

The result is that the radio-buttons are saved correctly in the corresponding 'items' table. But multi-choice boxes are not saved in the corresponding 'itemgenres' table - there is an error message when I press' Insert'.

I have created three columns in the corresponding 'itemgenres' table. These relate to the three multi-choice boxes on the 'update'-page. Here I had to create 'Manage Relational Table' 3 times, which seems strange?

On the Insert page I have also created 'Insert Multiple Record' 3 times. Could it be this that messes with that?

Sign in to reply to this post

Jason ByrnesWebAssist

I dont quite follow.

can you provide more details on what it is you are trying to accomplish and a copy of the pages please.

Sign in to reply to this post

Jonas

Unfortunately I can not see any other way than the explanation as below. I am using a local server.

I have five tables.
Table 1 is called 'Genres'. Columns here are: 'id', 'id-name1', 'id-name2', 'id-name3' and id-items'.
Table 2 is called 'Category 1'. Columns here are: 'id' and 'name1'.
Table 3 is called 'Category 2'. Columns here are: 'id' and 'name2'.
Table 4 is called 'Category 3'. Columns here are: 'id' and 'name3'.
The last table named 'Items'. Columns here are: 'id', 'itemName'.

All 3 Category tables containing multiple-choice buttons. Its content is saved in 'Genres' table as described above.

Just as your guides describe is Item-insert page created with server extension 'Multiple Record Insert'. Any Category table has its own 'Multiple Record Insert'.

Update site is created using 'Manage Relational Table'. Any Category table has its own 'Manage Relational Table'.

I get an error message when I open the insert page in the browser and fill out the form and press send.

So I wonder if it is supposed to use your server-ons 'Multiple Record Insert' and 'Manage Relational Table' to create a form with several multiple-choice buttons in the same form.

Sign in to reply to this post

Jason ByrnesWebAssist

why us category 1 , 2, and 3?

why not use one category table and a manage relational table behavior to manage the categories an item can belong to?

that would make much more sense, and would not limit an item to only belonging to 3 categories.

use the category table and an itemcategory table similar to genres and itemgenres.

Sign in to reply to this post

Jonas

You're right, it sounds more logical to coordinate all the categories in a table and make a relationship between them and each article.

I have now restructured the tables that contain categories into a single category table.

I have also registered a number of articles related to the correct category. This is okay.

On the Update page:
I want each category to be displayed individually, as repeating check-boxes. I just want to show 50 items at a time from each category. Therefore, I have restructured the form so each category is in its own fieldset.

Then I have created a recordset for each category, filtered on category id. This seems to work fine, so far.

When I created the relationship comes the problem. If I understand correctly, I have to create multiple relationships that everyone goes to the same table and field, because I have several recordset.

If I try a relationship that is connected to only one category - it works fine. Data is written into the table and displayed correctly on the Update page. But when I do multiple relationships, it does not.

How can I solve this? Grateful for help!

Sign in to reply to this post

Jason ByrnesWebAssist

you should have a categoris and itemcategories table.

on the items insert page, create the checkbox section of the categories just like you did for the genres

and add another multiple insert behavior to insert the selected categories to the itemcatagories table.

on the update page, do the same, set up the checkboxes for categories the same as you did for the genres, and add the manage relational table behavior to manage the itemcategories table.

Sign in to reply to this post

Jonas

I think I understand what you mean when I look at the test site 'BlueSkyMusic'. But in my case - contains each category various genres. Do I have a dependent Category menu?

Sign in to reply to this post

Jason ByrnesWebAssist

ok, so then you need a page to manage the genres

you would create data assist pages for managing the genres table, and add the checkboxes there for assigning the categories to the genres.

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