Skip to main content

I create 2 Tables in SQL Test in Dev. for exaple Car Makes => Car Models.

CREATE TABLE CarMake

(

ID int NOT NULL IDENTITY(1,1) PRIMARY KEY,

Make varchar(255) NOT NULL

)

 

CREATE TABLE CarModel

(

ID int NOT NULL IDENTITY(1,1) PRIMARY KEY,

Model varchar(255) NOT NULL,

MakeID int NOT NULL

)

 

Sucessfully have the 2 SmartObjects pointing to each of the tables.

 

Create a First View for the Car Makes and Able to add from the web interface.

Add a Second View for the Car Models and changing the controls to dropdown nested works perfect.

 

However I like to take advantage of the Choice Control since is a really cool feature when some of the data does not exist in the DB.

 

I can add the Control and point to a data source, but seems like the control does not have the option to link the dependant parent like exist in the dropdown.

 

I wonder if somebody can point me in the right directions, perhaps making rules or a third object to filter the data based on the selection of the first dropdown ?

 

THX Dino.

Hi Dino

 

You will need to add a rule on the Car Makes control change event, and add a statement to execute the populate the Care Models list control. When you configure the statement you can pass in the value of the Car Makes control as a input parameter.  


It makes sens what you said. I did create a Rule in the Car Make dropdown 

 

11362iAED304DD19A968F5.jpg

 

13345i8D471C20467735BB.jpg

 

The problem is when I select a Make like, then the corresponding ID is the one by default gets place in the Specity your own Value.

 

I would expect the dropdown to be populated with the names of that correlate from Models table on reference to that specific Make_ID . and another thing that I noticed if I click on the radio button to select the dropdown, this causes the main Make dropdown to lose the value and clear.

 

I wonder if perhaps will need to create another runtime smartobject to make that the main data source for the choice control.

 

THX Dino.


Dino , your rule configuration  does not look correct. For the input mappings you should pass the "Make" control into the  "MakeID" property (provided the Make drop down control is using MakeID as the data value). You don't need to do anything in the Filter.


You are correct it worked perfectly !!!

 

13388i0A9A8C421DD5BBDC.jpg

 

Also on the Button for the Create Method needed to pass the Car Make ID to the Car Model to have the correct record to reference back.

 

11430i10622369EDC112D9.jpg

 

The final result looks like this....

 

16043iCB0A53133F66C272.jpg

 

Enter another name new to the Car Make.

 

11294i56AB025261802944.jpg

 

Now back selecting the Same Dropdown we can see our new record has been added !!!.

 

Andrew, thank you so much for the heads up !!!.


Reply