Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren
Letzter Beitrag:
vor 2 Jahren
Beteiligte Autoren:
JP, Fabrice Harari

[WB21] - Hide/Show Controls

Startbeitrag von JP am 07.06.2016 18: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?




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

von Fabrice Harari - am 07.06.2016 19:00

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?

von JP - am 08.06.2016 06:53
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

von Fabrice Harari - am 08.06.2016 14:09
Fabrice, thank you. I am making headway and really enjoying this ! Re-watched your WebDev tutorial again as a background refresher.

von JP - am 08.06.2016 18:37
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.