Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 1 Jahr, 3 Monaten
Letzter Beitrag:
vor 1 Jahr, 3 Monaten
Beteiligte Autoren:
Danny Lauwers, Fabrice Harari, JP

[WB21] Active TAB lost after PageDisplayDialog ?

Startbeitrag von Danny Lauwers am 12.07.2016 01:20

Hi,

I have an classic Webapplication where on one page there are a few tab (Tab Control), in one of the TAB there are some functions that require extra input and a Page is called via PageDisplayDialog.

This works fine, but only after the return from PageDisplayDialog, the page is reloaden (correct functionality) but then my TAB control is back at Active tab 1 (first tab) instead of the active one ? The selections in the tables have stayed the same.

Any clue on what could be wrong ? Should the tabs selection stay ?

Thank
Danny

Antworten:

Hi Danny,

I don't know if that's normal or not, but I see two ways of working around that :

1. Use a celldisplaydialog instead of a pagedisplaydialog, so there won't be any reloading when you close the cell
2. if you continue with the page display dialog, put a value in a hidden field of your page to indicate that you are in this situation (it could be the tab number). WHen you load the page, check the value and activate the tab that you need

Best regards

von Fabrice Harari - am 12.07.2016 11:49
Fabrice

What is a hidden "field" ? Is this a control type?

von JP - am 12.07.2016 12:55
Hi JP

nope, just a filed that you hide (by making it invisible, by example)...

It is a common trick used for all kind of cases because a submit type button will send all fields contents to the server (including invisible ones) but NOT variables contents (variables are local to the browser side OR the server side)...

Best regards

von Fabrice Harari - am 12.07.2016 13:27
Fabrice

re hidden fields - so this is very interesting: If I have a button which runs server code to load a page according to the row selected in a table then 9/10 times this works fine in Firefox, fails about 1/10. In Internet Explorer it fails far more often. BUT, if I store the table row selected in a hidden text control when the row is clicked AND THEN call the button server code and use the value stored in the hidden control for the table row selected it works 100% of the time in both browsers.
Just interesting fyi ...

von JP - am 12.07.2016 14:13
Hi JP

that's web development for you... :-(

von Fabrice Harari - am 12.07.2016 14:44
Fabrice,

Thanks, I was hoping for some other solution :rp:. But I'll give it a try !

Danny

von Danny Lauwers - am 12.07.2016 15:27
Hi,

Ok, so I took another approach to not call PageDisplayDialog and use a Control Template to create a button with a popup.

When I include this template button in my page, I can call the ExecuteProcess to "click" on the Template button from code that will show the popup (cell).

This way, all is done via Ajax and there are no screen refreshes and I can still reuse the input screen (popup) in other pages by just including the templatecontrol and a few lines of code to initialize and call the popup.

I already used this method for lookup buttons that will show a popup to select some information that is then dropped in a linked control(s). This way if I need to select a customer in different pages, I can use the same lookup button and 2 or 3 lines of code everywhere. When my design of the lookup screen would change, it is automatically updated on all pages that use it !

Control Templates are quit powerfull ! Love this feature :spos:

Danny

von Danny Lauwers - am 13.07.2016 06:22
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.