NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on July 19, 2019, 11:02:23 PM
-
Hi Bruce
I have a form on a form. On the child form I have an File Upload field, inserting the files in a table, and then showed in an updated browse.
The outer form has the "Generate <form> tag" ON and the inner is OFF.
If I "run" the inner form everything works fine, but from the outer form the browse doesn't refresh.
Attached is an example.
I know the app doesn't make sense - just to illustrate the problem.
Regards Niels
-
Hi Niels,
Bruce posted this: the "outer form" can have the <form> tag, so the "inner" form must have the "generate <form> tag" option off.
In this thread: https://www.nettalkcentral.com/forum/index.php?topic=8245.0
Maybe this is your problem.
Regards
Johan de Klerk
-
Hi Johan
I'm aware of that. My outer form is ON and the inner is OFF.
I have tried other combinations, but it makes no difference.
But thanks anyway. Always nice when someone suggests a solution.
Regards Niels
-
Here you go Niels.
Small changes in the TestForm procedure.
Just had to look for the _event_=accepted.
Browse refreshes now. I did change the table driver to topspeed to make it easier to inspect the contents.
See what you think.
Don
-
Hi Don
Thanks!
But try to add a Delete Button to the browse (and delete a record). Then things breaks again.
Do you think this is a bug or has it always been like this? As I recall, I have done this many times before - without problems.
Regards Niels
-
No bug.
I have it working.
I'll have the modified example uploaded soon.
Update example app attached.
Added delete button and a change button. Changed the browse to display the uploaded image in the browse row.
The thing with the delete button is that you need to have a form for that table to perform the updates, deletes, etc. The form does the heavy lifting as far as actually deleting or updating the table record.
Also changed:
TES:Name = LOC:FileUpload
to
TES:Name = 'uploads/' & st.FileNameOnly(LOC:FileUpload)
Since you're performing the file upload on a form that is not the table's update form you're not directly affecting the table's field that stores the path to the uploaded image. Therefore the option to remove the webfolder path in the upload field will not work as expected.
You can see in the code that I'm re-generating the form after an upload or gainfocus event.
See what you think.
Don
-
Hi Don
Thanks!
Works great. Only one small thing. My upload control is also refreshed. But I can live with that for now.
Thanks again for taking the time to help.
Regards Niels
-
Hi Niels, Don;
Generally speaking it was a good response, and Don got to the heart of how to make it refresh.
But of course it should not need embed code to do this, so I dug a little deeper..
(Actually a lot deeper, the code is a bit complicated).
And it turns out it is indeed a bug - and strictly related to the Upload File field type. Other field types would update the browse fine, but the Upload File did not.
I have fixed the bug for the 11.17 build. So use the work-around for now, but please remove it when you have 11.17
cheers
Bruce
-
Hi Bruce
I'm glad my brain is still intact ;-)
Thanks for following up.
Regards Niels