Page Action - Toggle Button Visibility
doddwell
Member Posts: 65
Hello
I have two 'filter' buttons on a List Page "All Orders" & "My Orders" and I want only one button to display at a time.
The Page initially Opens showing all Orders and, therefore the "My Orders" Action button is visible.
The "All Orders" button Visible property has a variable - AllOrdersVisible
The "My Orders" button Visible property has a variable - MyOrdersVisible
We have a ToggleVisibleButtons function:
LOCAL ToggleVisibleButtons()
AllOrdersVisible := MyOrdersVisible;
MyOrdersVisible := NOT AllOrdersVisible;
ToggleVisibleButtons() is called when the Page Opens and each time one of the Filter Action buttons is pressed.
Now for the problem:
When the "All Orders" filter button is pressed, the behaviour is as you would expect - the list page displays all records and the "My Orders" filter button is shown and the "All Orders" filter button is hidden.
BUT.....When the "My Orders" filter button is pressed, the list page displays My records BUT the "My Orders" filter button is still shown and the "All Orders" filter button remains hidden. If I click the "My Orders" button again, you then get the behaviour you would expect.
Any ideas why I have to press the "My Orders" button twice?
Many Thanks
I have two 'filter' buttons on a List Page "All Orders" & "My Orders" and I want only one button to display at a time.
The Page initially Opens showing all Orders and, therefore the "My Orders" Action button is visible.
The "All Orders" button Visible property has a variable - AllOrdersVisible
The "My Orders" button Visible property has a variable - MyOrdersVisible
We have a ToggleVisibleButtons function:
LOCAL ToggleVisibleButtons()
AllOrdersVisible := MyOrdersVisible;
MyOrdersVisible := NOT AllOrdersVisible;
ToggleVisibleButtons() is called when the Page Opens and each time one of the Filter Action buttons is pressed.
Now for the problem:
When the "All Orders" filter button is pressed, the behaviour is as you would expect - the list page displays all records and the "My Orders" filter button is shown and the "All Orders" filter button is hidden.
BUT.....When the "My Orders" filter button is pressed, the list page displays My records BUT the "My Orders" filter button is still shown and the "All Orders" filter button remains hidden. If I click the "My Orders" button again, you then get the behaviour you would expect.
Any ideas why I have to press the "My Orders" button twice?
Many Thanks
0
Best Answer
-
In that case it sounds like a bug in the client. You'll need to log a support issue with Microsoft and supply sample code and instructions to replicate the issue. Once they have that and they can replicate then they'll send over to the developers to fix this client.5
Answers
-
Have you set the IncludeInDataset property on both of the Boolean variables to Yes?0
-
Hello Kishorm. No....I hadn't. Just tried it though and has no effect. Thanks.0
-
Sounds like a CurrPage.UPDATE issue. Add CurrPage.UPDATE to refresh the page.0
-
Are you calling the ToggleVisibleButtons() anywhere else? Maybe it's getting called again when setting the filter to "My Orders" and is therefore going back to its original value?0
-
Endjinn...tried that...no good.
Kishorm....have checked and it's not being called twice.
Thanks0 -
I'd put a message in the ToggleVisibleButtons() function showing the value of the 2 variables, hopefully this should give you a clue as to when/why it's not working as expected.0
-
As suggested, I added a message to return the value of the 2 variables...these were as expected. I have noticed something significant about the behaviour though. I don't actually have any Orders assigned to me - so "My Orders" filter action return no records. When another user (with Orders assigned) runs the Page, the behaviour is as you would expect.
So it's something to do with the fact that I do not have any records...but the ToggleVisibleButtons() is called still called after my empty data set is displayed (I have also tried calling the ToggleVisibleButtons() function before the filter is applied...same result).
Thanks
0 -
In that case it sounds like a bug in the client. You'll need to log a support issue with Microsoft and supply sample code and instructions to replicate the issue. Once they have that and they can replicate then they'll send over to the developers to fix this client.5
-
Doodwell,
What NAV version are you using?
Can you reproduce this behavior in a Cronus database? If so, export the modified page as text file (from the Cronus database) and share it.
It is easier for us to try and find out what's going on.
Regards0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions