close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Trying to use DD for what it's not intended for.

Thread began 3/17/2011 12:38 am by Lon Winters | Last modified 3/18/2011 10:00 am by Jason Byrnes | 1226 views | 3 replies |

Lon WintersBeta Tester

Trying to use DD for what it's not intended for.

Based on this thread, I already know at least part of the answer to my question -
showthread.php?t=18421

I have a customer table that includes the Customer Name, City and State. A Customer may have more than one location, and I want to user to easily choose the correct one. Unfortunately, in these instances there may be multiple records with the same customer name, but different locations.

I can't concatenate these fields for the list label because the drop down box would be too wide. I can't populate a text field as a child field using DD with the location information.

But, can I populate a second list menu with the location info from the record ID selected in the parent list, all getting their data from the same table?

I know I should create the link table according to how DD is meant to be used linking the Distinct customer name to all it's possible locations, but that's out of the scope of this project - and the customer table is very large and that would be time consuming.

Any ideas of how to make this work with or without DD? TIA!

Sign in to reply to this post

Jason ByrnesWebAssist

I think this could be done using dynamic dropdowns.


you are looking to have one list for customers, when a customer is selected, populate another list of possible states, when the state list is selected populate another list of possible cities. Is that correct?


In the first list, the customer name will be used for both the label and the value.


the recordset to populate the State Dynamic Array will be configured as:

SELECT customerName, state, CONCAT(customerName, '', state) AS custState FROM customers


in the Create Dynamic array behavior, set the customerName as the parent ID, custState as child ID and state as child label

the recordset for states will be created as

SELECT city, CONCAT(customerName, '', state) AS custState FROM customers

in the Create Dynamic array behavior, set the custState as the parent ID, city as child ID and city as child label



NOTE: In the create dynamic array behavior, you wont be able to select the aliased column that is created in the recordset, you will need to select a different column, then edit the code afterward to set it to use the aliased column.

Sign in to reply to this post

Lon WintersBeta Tester

Doing away with my initial question in the thread title, I think the best solution is to use DD the way it's designed with one exception - can I set up the parent-child list menu relationship based only on a single table in the database? Your solution may already address this, I will have to experiment a little.

Let's say the table contains 4 instances of ACME Corp in the company name field. They are distinguished by their locations, and we can treat city and state as a single entity. Originally I was thinking to use DD to simply display the corresponding location when the user selected one of the company name instances as it would show up in the parent list all four times. But that is clunky as they may have to make repeat selections.

So now, I plan on filtering the recordset on distinct company name (also greatly reducing the length of the list), and populating the child list menu with the four different locations. To do this the normal way, I would have to populate each record with a foreign key, then create a second table linking those keys to locations, correct?

So instead, could I just treat the company name as the identifier when creating the dynamic array? That would leave me with the four actual ACME Corp records, where I could combine the city and state to populate the child list labels, and the actual primary key ID as the value.

Thanks Jason!

Sign in to reply to this post

Jason ByrnesWebAssist

yes, if you read through my reply, It explains how to accomplish exactly what you are asking about.

Sign in to reply to this post

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