PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WB21] - Hide/Show Controls
[WB21] - Hide/Show Controls
Iniciado por guest, 07,jun. 2016 20:44 - 4 respuestas
Publicado el 07,junio 2016 - 20:44
Hi All

WebDev 21
Classic Site
Ajax off/not set

I have a page with 2 zones. On the one zone is a control with visible set to false at design time. On the other zone is a button. When the user clicks the button I want to test something on the server and, if OK, I want to make visible the control in the first zone.

I try this in the Server Code of the button:

PAGE_Start.ZONE_Navigation.MyControl..Visible = True && does not work

PAGE_Start.MyControl..Visible = True && does not work

No errors are generated but neither option works.

Is it possible to do this?

TIA
Publicado el 07,junio 2016 - 21:00
Hi JP

yes it is...

1. make sure that the control is set as "dynamic"

2. set the button server code as ajax

That should do it

Best regards
Publicado el 08,junio 2016 - 08:53
Fabrice,

Thanks I got that working. I made an error in my initial description of the problem; the button was in an iFrame which was in the second zone. When I moved the button off the iFrame and just placed it on the second zone itself everything worked. In addition, I did not need to make the control to hide "dynamic" and I did not need to make the code of the button as ajax !

So I have 2 questions which I hope you can give some comment on:

1) Why would this not work if the button is on an iFrame? How or why does the button-on-the-iFrame prevent this from working?

2) I notice that if the button code is set to "ajax" it hides the control faster i.e. it seems to be more responsive/quicker. Why is that? When should one use ajax and when not?
Publicado el 08,junio 2016 - 16:09
Hi again

1. an iframe is a container for a separate web page. Therefore, if you want to do code from one page to the other, you'll need to use a syntax reflecting that (IF that works at all)

2. AJAX is made to allow refreshing PART of a page without having to send back and redisplay the whole page. So you want to use it when you need to do exactly that.

Best regards
Publicado el 08,junio 2016 - 20:37
Fabrice, thank you. I am making headway and really enjoying this ! Re-watched your WebDev tutorial again as a background refresher.