Dynamic Dropdown with all Matching records

Collie-IT 26 Jul, 2020
Dear Support,

i strugle to get a Dynamic Dropdown running. My problem is that the dynamic options nor will be passed to the dropdown.

Dynamic Dropdown  with all Matching records image 1

The data seems to be importet in as var.

Dynamic Dropdown  with all Matching records image 2



The dynamic option is configurated.

Dynamic Dropdown  with all Matching records image 3

But the matching of Option data and Dropdown seeams to be messed up.

Dynamic Dropdown  with all Matching records image 4
Can you give me an advice how to fix it?
Best Regards
Collie-IT
Max_admin 26 Jul, 2020
Answer
The "option data value" should be {var:Countries.id} for example
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Collie-IT 27 Jul, 2020
Suddely it issen't work.
Dynamic Dropdown  with all Matching records image 5

Dynamic Dropdown  with all Matching records image 6
Collie-IT 28 Jul, 2020
After Debuging I found out that chronoforms7\chronog3\admin\extensions\chronofc\behaviors\views\field_dynamic_options\field_dynamic_options_output.php Line 22
$this->controller->Parser->parse($opdata['value'])  
returns allways null.

I fixed this with following ugly solution
 if(!empty($unit['data_source'])){
$results = $this->controller->FData->dsources($unit['data_source']);

foreach($results as $result){
foreach($result as $mkey => $mdata){
$this->set($mkey, $result[$mkey]);
}

$option = ;
$value = '';
foreach($unit['dynamic_options']['option_data'] as $opdata){

if($opdata['type'] == 'value'){
$value = $result[$opdata['value']];
}
if($opdata['type'] == 'content'){
$value = $result[$opdata['value']];
}
$option[$opdata['type']] = $value;
}

$unit['foptions'][$value] = $option;

}
}
This topic is locked and no more replies can be posted.