RTC - cannot change page column visibility dynamically

arpadozsvararpadozsvar Member Posts: 6
edited 2012-10-12 in NAV Three Tier
Hi,

Simple problem: have some some columns on an RTC Page and their visibility I have to change dynamically.
I have the standard solution: have Boolean variables for visibility control, have their IncludeInDataSet property set to Yes.
The first decision which columns to display happens in OnOpenPage. Depending on the conditions I have the right columns are visible. So this part works.

Then I have another global variable which is also show on the page (a kind of worksheet type, but the page is actually a ListPlus) and when I change this variable's value through lookup the conditions for the column visibility change so I change the Booleans for visibility, make a CurrPage.UPDATE (this all in the lookup trigger) and expect that the right colums are now visible. But there is no change. The same columns stay visible which were set visible in OnOpenPage.

Through Info to this Page I can check the value of the Boolean variables and they are correct. But not the corresponding columns are shown! With simple debugging messages I have checked the value of the Booleans before I call CurrPage.UPDATE and they are correct at that time.

Any help is appreciated. Thanks in advance.

Regards,
Arpad

Comments

  • koushikkoushik Member Posts: 3
    You just Take two different Repeaters

    One with A,B,C,E Repeater name FirstRepeater

    Two with A,B,C,D Repeater name SecondRepeater

    In this case i want to make D invisible if i select option One

    and if i select option Two i want make E invisible and D visible

    On selection of One i will just make FirstRepeater visible and SecondRepeater invisible
    And on selection of i will just make SecondRepeater visible and FirstRepeater invisible
  • arpadozsvararpadozsvar Member Posts: 6
    Because it is similar to my page I tried to reproduce the problem with Page 39 General Journal

    1)
    Add two global variables
    "Shortcut Dimension 1 CodeVisib" - Boolean, Property IncludeInDataset = Yes
    ToggleVisible - Boolean

    2)
    Change "Shortcut Dimension 1 Code" column's property Visible to variable "Shortcut Dimension 1 CodeVisib"

    3)
    add to page's OnInit
    "Shortcut Dimension 1 CodeVisib" := TRUE;
    

    4) add code to CurrentJnlBatchName - OnLookup to get this
    CurrPage.SAVERECORD;
    GenJnlManagement.LookupName(CurrentJnlBatchName,Rec);
    //+add
    ToggleVisible := NOT ToggleVisible;
    "Shortcut Dimension 1 CodeVisib" := ToggleVisible;
    //-add
    CurrPage.UPDATE(FALSE);
    

    5)
    now run the page and change through lookup CurrJnlBatchName several times
    the value of the variable "Shortcut Dimension 1 CodeVisib" changes TRUE/FALSE/TRUE/...
    the visiblity of the column "Shortcut Dimension 1 Code" does not change

    Please explain me what happens here ??
  • deV.chdeV.ch Member Posts: 543
    In NAV2009 Visibility can not be changed after the page is shown. You need to close and reopen a page to use visibility dynamically.

    I think in NAV2013 this is fixed, but i'am not 100% sure.

    Edit: Take a look at this: http://www.mibuso.com/forum/viewtopic.php?f=32&t=46587
  • arpadozsvararpadozsvar Member Posts: 6
    Thanks, the workaround from code with open the same page close the current one works.

    Thanks a lot!
Sign In or Register to comment.