PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → prevent page refresh
prevent page refresh
Started by randy, Jan., 25 2017 8:39 AM - 6 replies
Posted on January, 25 2017 - 8:39 AM
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
Posted on January, 25 2017 - 10:58 AM
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
Posted on January, 25 2017 - 11:54 AM
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.
Posted on January, 25 2017 - 1:17 PM
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.
Posted on January, 25 2017 - 1:41 PM
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.
Posted on January, 26 2017 - 9:44 AM
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?
Posted on January, 26 2017 - 7:15 PM
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?