move read data to text area

MPartales 06 Jul, 2018
Hello!

When manually changing a dropdown , I want to select one row in database and take a description field to move in text area.


---------------- Desing -------------
move read data to text area image 1
Content = {var:options}
reload event = dynamic


---------------- Setup -------------
move read data to text area image 2

Read_Data 18, it works
Designer label : readclasse
Model name : PrimaryDatabase
table : Ark_Classe
Where condition : idclasse:{data:ddclasse}
Select type : Index the results list by one or more
Fields to retrieve : Description

PHP:
$options;
$options = $this->get("read_data18", "default");
return $options;

Custom code17:
Content : {view:field_textarea5}

My debug after that
move read data to text area image 3

But my field Area are empty ?? but .. Why ?

small precision, I am not a pro of PHP !!

Sorry for my english and thank you for reading me
GreyHead 08 Jul, 2018
Hi mikaelpiecoup,

I've never used this combination but I suspect that you need your 'dynamic' event to just return the text string that you need and not an array of results.

Bob
healyhatman 08 Jul, 2018
Change select type to First result found

In the Value for the field area, put
{var:read_data18}
and get rid of that PHP block.
MPartales 08 Jul, 2018
Hi Bob,

Thanks for your reply,
yes, in reality I'm just trying to put a description under the dropdown. The description must be updated each time the dropdown is changed.
I do not know if there is another way to make it easier.


Hi healyhatman,
Thanks for your reply,
with
{var:read_data18}
doesn't work.

But, if i put this here !
move read data to text area image 4
I get good value except it's under and not in the field.

Mike
healyhatman 08 Jul, 2018
Yes forgot the model.field sorry.

And put it in VALUE not DESCRIPTION
MPartales 09 Jul, 2018
I'm try but it doesn't worksmove read data to text area image 5
MPartales 09 Jul, 2018
maybe overall my solution is not good.
How would you do a dropdown and text link to the dropdown?
healyhatman 09 Jul, 2018
No no reason it shouldn't work, unless you have your read data set up wrong and it isn't returning anything
MPartales 09 Jul, 2018
For me, my read data is OK.
especially that it works for the description field in the info tab.

move read data to text area image 6
MPartales 09 Jul, 2018
I'm Tried with "text field" same result
move read data to text area image 7

a Bug ?

Have you another solution for Link a dropdown and upgrade a text field ?
healyhatman 09 Jul, 2018
If you're putting it in the text field again put it in the VALUE field not description
MPartales 10 Jul, 2018
Yes, I understood, on the screenshot above I put in value.
It was to show that it works in the fields descriptions and tooltip but not value!
healyhatman 10 Jul, 2018
Works perfectly for me so don't know
MPartales 10 Jul, 2018
for which version ?

for me : Joomla, 3.8.10

move read data to text area image 8
healyhatman 10 Jul, 2018
OK my bad sorry it's actually not working for me either, I was remembering other scenarios where it did work (dropdowns and on page load). You should let the dev know using the contact link.
healyhatman 10 Jul, 2018
I've also made a bug post on the bug forum.
MPartales 10 Jul, 2018
Answer
I found a solution by a another way

In reload event, i call function PHP like this :

$this->data('text4',$this->data('select2'),true);
the text field is updated every time I change the dropdown.

thank you very much, Heal
This topic is locked and no more replies can be posted.