Sample Plugin Editable List Maintenance as a ShowDialog()  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Sample Plugin Editable List Maintenance as a ShowDialog()

Postby neil.interactit » Tue May 02, 2023 5:06 pm

Hi Mike,

I have been using your Sample Plugin Editable List Maintenance to create various lists in support of some required business logic.

I have a need to drill down into some further detail for each record in one of these lists. I made up another Sample Plugin Editable List Maintenance based form for this detail, and added a JiwaLookupButtonCellType column to the calling list which calls:
Code: Select all
                var managerForm = new RunSheet(recId);
                managerForm.ShowDialog();

The form pops up, but has no rows populated. I assume that when the Jiwa appliucation create a form it then subsequently makes a call to it to kick off the Read() process??? I have tried various approaches but keep getting "object not set" errors, so I guess I am making the call before instantiation has completed, but I can't find the correct event to hook into. Could you please advise?

As a related question ... you will notice above, the (recId) parameter passed to the constructor. This is used set set BusinessLogic.Tag, then I access base.Tag in the Read() override to set a @DeliveryRunID SQL parameter. I guess this should work (once I can get the rows displaying) but it seems a little fudgy. Is there a more correct approach to pass in a parameter to the Read() override?

Thanks,
Neil
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Sample Plugin Editable List Maintenance as a ShowDialog(

Postby Mike.Sheen » Tue May 02, 2023 5:48 pm

When we load dialogs we use the dialog factory to create a dialog:

Code: Select all
DebtorAllocationDialog debtorAllocationDialog = Manager.DialogFactory.CreateDialog<DebtorAllocationDialog>(new object[] { BankReceiptLine.BankReceiptLineDebtors[key], JiwaBanking.BankReceipts.BankReceipt.AllocationTypes.Discount }, this, "");
debtorAllocationDialog.ShowDialog(this);


That'll set the Manager property and invoke the do other things like initialise controls, set the icon and then invoke the Start method of the dialog. In the start method is typically where we'd read data and/or populate controls such as grids.

Do you want this form to just be a dialog, or are you wanting to make it behave only as a dialog sometimes?
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Sample Plugin Editable List Maintenance as a ShowDialog(

Postby neil.interactit » Tue May 02, 2023 8:48 pm

Thanks Mike,

I'll try that tomorrow.

This will only every be as a dialog - as, the row clicked to call it determines the seed parent recid used to display the correct detail rows.

Cheers,
Neil
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Sample Plugin Editable List Maintenance as a ShowDialog(

Postby neil.interactit » Wed May 03, 2023 10:35 am

Hi Mike,

I have had no joy. I have tried a few different approaches within the class without success.

I was able to pass in the parameter through IJiwaDialog.Start(), but the Read() is still not fired. It "feels like" the override Setup() is not being called via this ShowDialog approach (as I guess it is from a Jiwa menu firing). If I manually call Setup() within Start() I get the same "object not set" errors.

Is there any chance you could knock up a copy of Sample Plugin Editable List Maintenance that can be called via Manager.DialogFactory.CreateDialog<>.ShowDialog(this)?

Many thanks,
Neil.
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6

Re: Sample Plugin Editable List Maintenance as a ShowDialog(  Topic is solved

Postby Mike.Sheen » Wed May 03, 2023 3:06 pm

Attached is the plugin adapted to be a dialog.

I've made it add a button the ribbon of the inventory maintenance form ,"Test Dialog" - when pressed it loads the dialog.

TestDialog.png


It currently doesn't have a cancel button - but it's easy enough to add one that simply closes the form - the code adds the Save button, so it's just programming by numbers to add another button.
Attachments
Plugin Sample Plugin - List Maintenance Dialog.xml
(68.28 KiB) Downloaded 59 times
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Sample Plugin Editable List Maintenance as a ShowDialog(

Postby neil.interactit » Wed May 03, 2023 5:54 pm

Awesome! Many thanks Mike.

I'm busy adapting based on your sample now!

Thanks again,
Neil
neil.interactit
Kohai
Kohai
 
Posts: 227
Joined: Wed Dec 03, 2014 2:36 pm
Topics Solved: 6


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 19 guests