Page 1 of 1
Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sat May 10, 2025 10:43 pm
by yvesf
Hello,
In nuBuilder, I have a subform that contains a button and a textarea field named textareasubform
. When I click the button, it opens a popup which contains another textarea field named textareapopup
, along with a button labeled "Copy Textareapopup".
The purpose of this button is to copy the content of textareapopup
from the popup back into the textareasubform
field in the subform.
How can you do that ? Is subform is considered as a child of the parent form ?
Thank you very much for your help!
Yves
Re: Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sat May 10, 2025 11:16 pm
by steven
Hi yvesf,
Can you share your database?
Steven
Re: Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sun May 11, 2025 7:25 am
by yvesf
Here is the database
2025-05-11_042020_68203394d4dbe_nuBuilder_backup.zip
Yves
Re: Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sun May 11, 2025 7:49 am
by steven
yves,
yves wrote:
The purpose of this button is to copy the content of textareapopup from the popup back into the textareasubform field in the subform.
How can you do that ? Is subform is considered as a child of the parent form ?
Thank you very much for your help!
I'm sorry man, I don't understand your question or questions.
Steven
Re: Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sun May 11, 2025 11:27 am
by yvesf
Dear Steven,
I have created a dedicated nubuilder app focusing on this pb precisely.
Here is how it works
Clic on Visits button
visit.png
Clic on the first line to open the record
Clicfirstline-2.png
Clic on the build button of the first prescription currently empty to build the prescription
cliconbuildbutton_2.png
A popup appears in which we build the prescription
textareapopup.png
Behind the button I would like to copy the content of the texarea popup into the teextrea related prescription record.
InsertButton.png
Behind the button
Insert AI result
you have the current script
Code: Select all
parent.nuSetValue('pre_prescription',nuGetValue('blr_prescription_ai'));
Unfortunately this code doesn't work probably because we have to insert in the subform on the first record which is different than writing in a form. Any help will be highly appreciated.
I hope it is clearer.
Many thx for your help,
Yves
Re: Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sun May 11, 2025 12:06 pm
by steven
OK,
I think I understand.
You want blr_prescription_ai to populate pre_prescription.
But every subform field is a combination of 3 things.
Subform Name : vis_prescription_sf
Row number : 000
Object Name : pre_prescription
(vis_prescription_sf000pre_prescription)
So your nuSetValue() code won't work with just pre_prescription.
Steven
Re: Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sun May 11, 2025 1:38 pm
by yvesf
Yes !!!!! How do you retrieve the Row number in the subform to transfer it to the popup and return back to the right row ? I have tried with nuCurrentRow()
on the subform and a counter on the related form in order to be able to create the field with the right row number : it seems to me overkilling for something simple.
Many thx anyway .
Yves
Re: Copy Textarea Content from Popup to Subform in nuBuilder
Posted: Sun May 11, 2025 2:30 pm
by steven
Try this...
Code: Select all
parent.nuSetValue('vis_prescription_sf' + parent.nuCurrentRow() + 'pre_prescription',nuGetValue('blr_prescription_ai'));
Steven