|
Inicio → WEBDEV 2024 → How to update the contents of a Rich Text Area to hyperfile database |
How to update the contents of a Rich Text Area to hyperfile database |
Iniciado por Stefan BUTENEERS, 08,oct. 2017 13:00 - 3 respuestas |
| |
| | | |
|
| |
Miembro registrado 23 mensajes |
|
Publicado el 08,octubre 2017 - 13:00 |
Hi all,
Should be quite simple but it isn't. I want to allow my website admin to dynamically edit a site using Rich Text Areas (RTA). Enabling the Rich Text Areas for editing by the admin is no problem and the contents of the RTA can be modified using the various available tools of the control.
However when trying to save the modifications to the hyperfile database, no matter what I do the original value of the RTA (assigned through a query run when opening the page) is sent to the server instead of the modified text.
I tried - using the ..value and .. Displayedvalue properties of the RTA but they both always contain the value assigned at page load. I presumed the Displayedvalue property should change after a user edits the RTA and exits it. But it doesn't.
- bonding the control to the data file via a query and running PageToFile / ScreenTofile after the modification. Reading the help files this ought to work when combined with a HModify, but it doesn't. Maybe I am doing it wrong ?
SWITCH Nation() CASE nationDutch : pageToFile(PAGE_Home,File_Pagetext) hreadseekfirst(,File_Pagetext,PageTextID,1) if Hfound then HModify(File_Pagetext,1) END CASE ...
- running an update query in servercode but I can find no way to transfer the browser value of the control to the server code of a button. I can assign a browser variable which is succesfully changed when exiting the RTA after modification. But the browser variable cannot be transferred to a server variable as browser code does not support this. In the other direction the issue is the same: server code cannot read browser variables.
This should be pretty straightforward, but I am probably missing something obvious ?
Regards Stefan |
| |
| |
| | | |
|
| | |
| |
Publicado el 08,octubre 2017 - 23:02 |
Hi Stefan,
I haven't played with this exact scenario, however, based on what you are describing, this is my idea:
- The content you want to manage is text. - you seem to be able to get to it in browser code (...I can assign a browser variable which is succesfully changed when exiting the RTA after modification. ...) - a simple ajaxexecute can send a string to the server
so, get the content on the browser side, set it in a variable, and do an ajaxexecute to send it to a server procedure that will save it
Best regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Le 10/8/2017 à 5:00 AM, Stefan BUTENEERS a écrit :
Hi all,
Should be quite simple but it isn't. I want to allow my website admin to dynamically edit a site using Rich Text Areas (RTA). Enabling the Rich Text Areas for editing by the admin is no problem and the contents of the RTA can be modified using the various available tools of the control.
However when trying to save the modifications to the hyperfile database, no matter what I do the original value of the RTA (assigned through a query run when opening the page) is sent to the server instead of the modified text.
I tried - using the ..value and .. Displayedvalue properties of the RTA but they both always contain the value assigned at page load. I presumed the Displayedvalue property should change after a user edits the RTA and exits it. But it doesn't.
- bonding the control to the data file via a query and running PageToFile / ScreenTofile after the modification. Reading the help files this ought to work when combined with a HModify, but it doesn't. Maybe I am doing it wrong ?
SWITCH Nation() CASE nationDutch : pageToFile(PAGE_Home,File_Pagetext) hreadseekfirst(,File_Pagetext,PageTextID,1) if Hfound then HModify(File_Pagetext,1) END CASE ...
- running an update query in servercode but I can find no way to transfer the browser value of the control to the server code of a button. I can assign a browser variable which is succesfully changed when exiting the RTA after modification. But the browser variable cannot be transferred to a server variable as browser code does not support this. In the other direction the issue is the same: server code cannot read browser variables.
This should be pretty straightforward, but I am probably missing something obvious ?
Regards Stefan |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 23 mensajes |
|
Publicado el 09,octubre 2017 - 12:45 |
Hi Fabrice,
As always, you were right on the money . Thank you ! I thought ajax actions could only be triggered where returning from a server procedure if ajax is enabled in that specific server procedure.
Keeps me wondering though why the Displayedvalue property of an RTA does not change after it has been modified ? Does this not mean that ..Value and ..Displayedvalue are identical ?
Rehgards Stefan |
| |
| |
| | | |
|
| | |
| |
Publicado el 09,octubre 2017 - 13:56 |
Hi Stefan
I do not know, it does sound strange, and that's definitely something that you should ask the free support, by sending them a simplified example of the problem.
Either they give you a simple solution, or they mark it as a bug to be corrected.
When I run in something like that, I try to find a workaround (done here) and I send them the information for correction...
Best regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Le 10/9/2017 à 4:45 AM, Stefan BUTENEERS a écrit :
Hi Fabrice, As always, you were right on the money . Thank you ! I thought ajax actions could only be triggered where returning from a server procedure if ajax is enabled in that specific server procedure. Keeps me wondering though why the Displayedvalue property of an RTA does not change after it has been modified ? Does this not mean that ..Value and ..Displayedvalue are identical ? Rehgards Stefan |
| |
| |
| | | |
|
| | | | |
| | |
|