|
| Inicio → WINDEV 2024 → Re: [WD22] Place to write code to display / not display [visible] of fields of a Table |
| Re: [WD22] Place to write code to display / not display [visible] of fields of a Table |
| Iniciado por guest, 08,feb. 2018 07:00 - 5 respuestas |
| |
| | | |
|
| |
| Publicado el 08,febrero 2018 - 07: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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,febrero 2018 - 07:37 |
Hi Sivaprakash,
Tablename.columnname..visible = False
works fine for me, also in declaration of the window. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,febrero 2018 - 11:47 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,febrero 2018 - 11:50 |
| Not sure, whether AAF is having any role to play here ? I removed that conditional visibility altogether, still the field doesn't show up ? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,febrero 2018 - 12:28 |
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. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,febrero 2018 - 12:36 |
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. |
| |
| |
| | | |
|
| | | | |
| | |
|