NetTalk Central

Author Topic: Tab Hide  (Read 3214 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Tab Hide
« on: March 26, 2015, 10:12:53 PM »
Hi All,

I have 4 filtered browses (diff tables) on 4 tabs with no insert change or delete functionality. I would like to put a condition to include the Tab if there are records. What would the condition be?

Thanks,

Kevin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Tab Hide
« Reply #1 on: March 26, 2015, 10:25:15 PM »
Hi Kevin,
I suspect it would be more along the lines of hiding the tab if there are no records. Because there are basically 2 approaches here;

a) create a function which basically declares a view, with the same filer, and reads a record from the view to determine if there are going to be any records or not. Use this function as the "include" condition of the Tab. eg something like;

ChildRecordsExist()

Where ChildRecordsExist is a Source procedure (not NetWebSource) which simply tests a view and returns true or false.

If no records exist then the tab is not generated, and the browse is not populated (with nothing). However this approach is "static" you cannot dynamically make the tab appear if records are added (say via yet another tab.)

b) Use the Hide condition, rather than the Include Condition. In this approach the tab generates, as does the browse, but the tab can thn be hidden, and unhidden, on demand. (I'm busy working out your tab-heading question at the moment so I'll see if I can figure out the steps for this at the same time.)

cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Tab Hide
« Reply #2 on: March 26, 2015, 11:34:34 PM »
so it's fairly easy to do as a hide;

1) In the _Browse_ go to the line

do BrowseTable

which is in the GenerateBrowse routine

In the embed immediately after it save the value of loc:found into a session value, with some unique name. For example;

p_web.SSV('BrowseInvoices:Found',loc:found)

2) In the Form to the tab in question, and set the HIDE condition to be

p_web.GSV('BrowseInvoices:Found') = 0

Obviously the key being to use the same session value.

cheers
Bruce




kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Tab Hide
« Reply #3 on: March 30, 2015, 02:27:11 AM »
Thanks Bruce, it works a treat now!