Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 3 Monaten, 1 Woche
Letzter Beitrag:
vor 2 Monaten, 4 Wochen
Beteiligte Autoren:
Sivaprakash, Stefan Bentvelsen, DerekT

Re: [WD22] Place to write code to display / not display [visible] of fields of a Table

Startbeitrag von Sivaprakash am 08.02.2018 06:00

Hello,

WD 22

I want either to display fields in a table according to the setup value. I wrote code in init section to make few fields invisible, [the following code] but it didn't work out.

Tablename.fieldname.visible = False

But the same code works, if executed at click of a button. But I want it to be executed when the window opens up.

Tried writing in end of init, focus gain of widow, but no effect.

Where the code to be written to have the right effect ?

Happiness always
BKR Sivaprakash

Antworten:

Re: [WD22] Place to write code to display / not display [visible] of fields of a Table

Hi Sivaprakash,

Tablename.columnname..visible = False

works fine for me, also in declaration of the window.

von Stefan Bentvelsen - am 08.02.2018 06:37

Re: [WD22] Place to write code to display / not display [visible] of fields of a Table

Thanks Stefan

But it's not working correctly for me.

Info("alt lang", sAlternateLanguage)
IF sAlternateLanguage = "N" THEN
Table_City.COL_CityName..Visible = False
ELSE
Table_City.COL_CityName..Visible = True
END

I write this in the Global declaration of a window. When I get the value "N" for the first time, the column's visible is set to False, which is working right. Then I change the value to "Y" in the setup screen, again open this window, CityName column doesn't show up. It's still in invisible state, though the variable sAlternateLanguage shows 'Y'.

What else should I do to make it visible ?

Happiness Always
BKR Sivaprakash

von Sivaprakash - am 08.02.2018 10:47

Re: [WD22] Place to write code to display / not display [visible] of fields of a Table

Not sure, whether AAF is having any role to play here ? I removed that conditional visibility altogether, still the field doesn't show up ?

von Sivaprakash - am 08.02.2018 10:50

Re: [WD22] Place to write code to display / not display [visible] of fields of a Table

You are placing the code before your table control has initialised? - check your Z order.

Move the code to the 'End of initialisation' section of the window or the 'Initialisation' of the control.

von DerekT - am 08.02.2018 11:28

Re: [WD22] Place to write code to display / not display [visible] of fields of a Table

Hi Sivaprakash,

after you make the column visible again, please try ones to rightclick the tableheader and select 'Select columns' in the context menu and check the column CityName if it isn't checked.

von Stefan Bentvelsen - am 08.02.2018 11:36

Re: [WD22] Place to write code to display / not display [visible] of fields of a Table

Stefan,

That worked out. But the issue is visibility is set by a super user, that should NOT be modified by that particular user. So that option [ Right click - show columns ] should be disabled first, and the visibility of columns to be set only through code.

Any other option(s) ?

Happiness Always
BKR Sivaprakash

von Sivaprakash - am 20.02.2018 12:56
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.