PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 22 → prevent page refresh
prevent page refresh
Débuté par randy, 25 jan. 2017 08:39 - 6 réponses
//hostimage.webdev.info/avatars/default.gif
Posté le 25 janvier 2017 - 08:39
I'd like to display a hidden textfield when the user clicks a button. No problem, set visibility = true.
Then, however, the page refreshes and jumps to the top.

Any possibility to prevent the page from refreshing/jump back to top?

thanks
//hostimage.webdev.info/avatars/default.gif
Posté le 25 janvier 2017 - 10:58
Hi Randy,

set your sever code as running AJAX

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 1/25/2017 à 2:39 AM, randy a écrit :
I'd like to display a hidden textfield when the user clicks a button. No
problem, set visibility = true.
Then, however, the page refreshes and jumps to the top.
Any possibility to prevent the page from refreshing/jump back to top?

thanks
//hostimage.webdev.info/avatars/default.gif
Posté le 25 janvier 2017 - 11:54
Thank you Fabrice for your answer.

yes that works, then, however, I have a problem with the following line of code:

FileDisplay(iLastFile(), "application/pdf")

Should have mentioned that in my first post (too bad you can't edit).

I know I could let FileDisplay() run in the brower code, but I need the "iLastFile()" as I have an IF/ELSE before which selects which report should be printed.
//hostimage.webdev.info/avatars/default.gif
Posté le 25 janvier 2017 - 13:17
Thanks for your answer.

That's true. Then, however, I have a problem with the following line

FileDisplay(iLastFile(), "application/pdf")

should have mentioned in the previous post (too bad posts can't be edited).

I could use FileDisplay() in the browser code, but I need iLastFile() as I have an IF/ELSE before to check which report should be printed.
//hostimage.webdev.info/avatars/default.gif
Posté le 25 janvier 2017 - 13:41
Hi Randy,

what you have a problem with is web development logic.

To each server query, there can be only ONE answer:
- either ou modify your page
- or you display a pdf

So, basically, if you want both, it means that you need TWO server calls.
On the browser side of the code, you can do an executeprocess of another
button (hidden, perhaps) to generate your second call that will display
the pdf in another tab.

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 1/25/2017 à 7:17 AM, randy a écrit :
Thanks for your answer.

That's true. Then, however, I have a problem with the following line

FileDisplay(iLastFile(), "application/pdf")

should have mentioned in the previous post (too bad posts can't be edited).

I could use FileDisplay() in the browser code, but I need iLastFile() as
I have an IF/ELSE before to check which report should be printed.
//hostimage.webdev.info/avatars/default.gif
Posté le 26 janvier 2017 - 09:44
Hello Fabrice

Thank you. I've tried that. Two buttons, button "A" has AJAX enabled and executes the visible=true code for the textfield as well as ExecuteProcess(BTN_NoName1,trtClick).

Button B has AJAX disabled and has the FileDisplay(iLastFile(), "application/pdf") code. I still get the error, though.
Seems button A passes the AJAX to button B?
//hostimage.webdev.info/avatars/default.gif
Posté le 26 janvier 2017 - 19:15
Without seeing your code and all the settings, it's very hard to
troubleshoot your problem.

You can try starting a very short timer from button A, and running the
second code from the timer code

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 1/26/2017 à 3:44 AM, randy a écrit :
Hello Fabrice

Thank you. I've tried that. Two buttons, button "A" has AJAX enabled and
executes the visible=true code for the textfield as well as
ExecuteProcess(BTN_NoName1,trtClick).

Button B has AJAX disabled and has the FileDisplay(iLastFile(),
"application/pdf") code. I still get the error, though.
Seems button A passes the AJAX to button B?