Limit Tabs / Forms  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Re: Limit Tabs / Forms

Postby Mike.Sheen » Fri Jan 17, 2020 9:10 am

SBarnes wrote:After Start message shows up and looking in Just Decompile in the form Factory BeforeFormStart is declared but never checked for being set and called


Logged as DEV-8008. I'll find you another way to cancel loading of a form and post back here.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Limit Tabs / Forms  Topic is solved

Postby SBarnes » Fri Jan 17, 2020 9:13 am

You don't have to the following works in the after form start

Code: Select all
      if(JiwaForm.Manager.MDIParentForm.MdiChildren.Length > ApplicationManagerPlugin.FormLimit)
      {
         System.Windows.Forms.MessageBox.Show("You can't open more than " + ApplicationManagerPlugin.FormLimit.ToString() + " forms");
         JiwaForm.Form.Close();
         throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException();
      }
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Limit Tabs / Forms

Postby Mike.Sheen » Fri Jan 17, 2020 9:17 am

SBarnes wrote:You don't have to the following works in the after form start

Code: Select all
      if(JiwaForm.Manager.MDIParentForm.MdiChildren.Length > ApplicationManagerPlugin.FormLimit)
      {
         System.Windows.Forms.MessageBox.Show("You can't open more than " + ApplicationManagerPlugin.FormLimit.ToString() + " forms");
         JiwaForm.Form.Close();
         throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException();
      }


Ok, great - but still going to fix the issue where the BeforeFormStart event does not fire in the FormFactory, because that's what it was created explicitly for! Would also be more efficient to do that rather than cancel after loaded... and because it will be pretty confusing to the user if the form loads, a message box or something is displayed (often people have message boxes displayed when a record with certain data values is loaded), and then the form disappears.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests