Hi,
I read a lot of ways to try this on the FAQ but I don't seem to make it 'till the end.
In my DB is a list of products. I want to show these products in a dropdown list.
I've created a form with a dropdown field. On the SETUP-part, befor the HTML render, i've added an "DB read" which is linked with my database. There Ive chosen "external database" and selected a table. Then, i'm kinda lost. I need to set the ModelID? can I choose which name that is? After, i go to the dropdownfield. I click on "dynamic data". and than I need to fill in data path I guess. What is the correct way to add this then?
Thanks for helping me out,
kind regards,
Djiep Ly Mai
I read a lot of ways to try this on the FAQ but I don't seem to make it 'till the end.
In my DB is a list of products. I want to show these products in a dropdown list.
I've created a form with a dropdown field. On the SETUP-part, befor the HTML render, i've added an "DB read" which is linked with my database. There Ive chosen "external database" and selected a table. Then, i'm kinda lost. I need to set the ModelID? can I choose which name that is? After, i go to the dropdownfield. I click on "dynamic data". and than I need to fill in data path I guess. What is the correct way to add this then?
Thanks for helping me out,
kind regards,
Djiep Ly Mai
Hi Dijep,
You get to choose the Model ID - a short string like 'products' - then put the same string in the Data Path in the Dynamic Dropdown settings.
Bob
You get to choose the Model ID - a short string like 'products' - then put the same string in the Data Path in the Dynamic Dropdown settings.
Bob
Hi Bob,
Thanks for your add. Doesn't seem to do the trick yet. This is my contruction:
On Designer:
Basic: Dropdown.
When openend via edit,
> on tab Dynamic Data
- Enabled: Yes
- Data Path: Products (some string, but the same)
On Setup:
OnLoad > DB Read.
When opened,
> on tab 'External Database: linked to your own database with an ID & Name
> on tab Basic:
- Enable Model ID: Yes
- Model ID: 'Products' (some string)
- Fields: ID, Name
Thanks for your add. Doesn't seem to do the trick yet. This is my contruction:
On Designer:
Basic: Dropdown.
When openend via edit,
> on tab Dynamic Data
- Enabled: Yes
- Data Path: Products (some string, but the same)
On Setup:
OnLoad > DB Read.
When opened,
> on tab 'External Database: linked to your own database with an ID & Name
> on tab Basic:
- Enable Model ID: Yes
- Model ID: 'Products' (some string)
- Fields: ID, Name
Hi Djiep ,
Please remove any quotes round Products if you have them in the Model ID
Bob
Please remove any quotes round Products if you have them in the Model ID
Bob
i couldn't find the edit button on previous posts, so i wasn't able to remove the quotes from my example
Hi noeljm,
Please drag a Debugger action into the On Load event, then submit the form and post the debug results here.
Bob
Please drag a Debugger action into the On Load event, then submit the form and post the debug results here.
Bob
Hi,
Sorry for the delay, been caught up.
> The array is loaded with the content from the database. I've cut the list in the debugger. But that content doesn't appear in dropdownbox.
Here's my debugger.
Sorry for the delay, been caught up.
> The array is loaded with the content from the database. I've cut the list in the debugger. But that content doesn't appear in dropdownbox.
Here's my debugger.
Data Array
Array
(
[option] => com_content
[view] => article
[id] => 86
[Itemid] => 307
[lang] => nl
[Products] => Array
(
[0] => Array
( [Short_Desc_FR] => Accidents du travails )
[1] => Array
( [Short_Desc_FR] => Aptitudes )
[2] => Array
( [Short_Desc_FR] => Auto )
[3] => Array ( [Short_Desc_FR] => Incendie )
)
Array
( )
Errors
Array
( )
Debug Info
Array
(
[17] => Array
(
[DB Read] => Array
(
[Queries] => Array
(
)
)
)
)
Hi Dijep,
In your earlier post you have put ID and Name as the fields - but neither of these are in the Products array you are reading from the table. What do you want to have as the drop-down values and text?
Bob
In your earlier post you have put ID and Name as the fields - but neither of these are in the Products array you are reading from the table. What do you want to have as the drop-down values and text?
Bob
Hi,
i've changed the field I want to load.
Fields: Short_Desc_FR
It's shown in the array
( [Short_Desc_FR] => Accidents du travails )
I want the array/ist of [Short_Desc_FR] => Accidents du travails to be shown in the dropdown, which now is empty.
Thanks, again.
i've changed the field I want to load.
Fields: Short_Desc_FR
It's shown in the array
( [Short_Desc_FR] => Accidents du travails )
I want the array/ist of [Short_Desc_FR] => Accidents du travails to be shown in the dropdown, which now is empty.
Thanks, again.
Hi Djiep,
On the Drop down element Dynamic Data tab please put:
Products in the Data Path Box, and
Short_Desc_FR in both the Value key and Text key boxes.
Bob
On the Drop down element Dynamic Data tab please put:
Products in the Data Path Box, and
Short_Desc_FR in both the Value key and Text key boxes.
Bob
OK...
So then I just can't add a link to a table...
Guess I'll just copy 1200 lines to chronoform then
So then I just can't add a link to a table...
Guess I'll just copy 1200 lines to chronoform then
This topic is locked and no more replies can be posted.