Sample Code Request for Jiwa Forms Standardisation  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Sample Code Request for Jiwa Forms Standardisation

Postby jiwameister » Mon Sep 01, 2014 7:17 pm

Hi,

We would like to convert our existing IP into Jiwa 7, some of these projects requires new forms to be created within Jiwa.

We would like to have these forms look and feel (and work) like standard Jiwa forms. Do you have a template form or a sample project that you might use as a template for creating standard Jiwa Forms?

In particular, we are interested in creating the same look and feel for grids, tabs etc.

Thanks
Glenn Lake
Managing Director
Lonicera Pty Ltd
http://www.lonicera.com.au
User avatar
jiwameister
Occasional Contributor
Occasional Contributor
 
Posts: 27
Joined: Sun Mar 02, 2008 12:36 am
Location: Melbourne, Australia

Re: Sample Code Request for Jiwa Forms Standardisation  Topic is solved

Postby Mike.Sheen » Tue Sep 02, 2014 10:38 am

jiwameister wrote:We would like to have these forms look and feel (and work) like standard Jiwa forms. Do you have a template form or a sample project that you might use as a template for creating standard Jiwa Forms?

In particular, we are interested in creating the same look and feel for grids, tabs etc.



At this moment we don't have a sample, but some of the sample plugins in the demo data do create their own forms styled in the same manner.

If your form inherits from our base form types, then you will get the ribbon and styling. The 4 main type of forms are:
  • JiwaFinancials.Jiwa.JiwaApplication.Maintenance.UserInterface
  • JiwaFinancials.Jiwa.JiwaApplication.ListMaintenance.UserInterface
  • JiwaFinancials.Jiwa.JiwaApplication.ProcessAction.UserInterface
  • JiwaFinancials.Jiwa.JiwaApplication.MultiListMaintenance.UserInterface

As well as the styling, you'll get automatic persistence of the form dock state, size and location.

As for the grids and tabs - use a JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaGrid control for the grid and it will be styled appopriately. For tabs, use a JiwaFinancials.Jiwa.JiwaApplication.Controls.JiwaTabControl.

When initialising / setting up a JiwaGrid control, be sure to call SetupComplete after adding the required columns. For example:

Code: Select all
        With grdContactNames
            .AddColumn("Key", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType, "Key", 0, True, False, True, True)
            .AddColumn("ItemNo", New CellType.NumberCellType, "Item No.", 5, , , , True)
            .AddColumn("Title", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType, "Title", 10, , , True, , 30)
            .AddColumn("FirstName", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType, "First Name", 10, , , True, , 50)
            .AddColumn("Surname", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType, "Surname", 10, , , True, , 50)
            .AddColumn("Phone", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType, "Phone", 10, , , True, , 20)
            .AddColumn("Debtor", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType, "Debtor", 10, , , True, True, 50)
            .AddColumn("DebtorLookupButton", New JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaLookupButtonCellType, "")
            .AddColumn("Bin", New JiwaBinButtonCellType, "")
            .SetupComplete()
        End With


If the form the grid is on inherits from one of the 4 types I mentioned earlier, then your grid will get automatic persistence of the custom column information.

I'll put up some samples over the next few days to show in more detail what I've outlined above.

Mike
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: 2488
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

Re: Sample Code Request for Jiwa Forms Standardisation

Postby perry » Fri Sep 26, 2014 6:37 pm

Hi Mike,

Can you provide us some sample codes on this topic please?

So far, I have a maintenance form (Inherits JiwaFinancials.Jiwa.JiwaApplication.Maintenance.UserInterface),
Code: Select all
Namespace UI
    Public Class frmOrder
        Inherits JiwaFinancials.Jiwa.JiwaApplication.Maintenance.UserInterface

        Public Overrides Sub Setup()
            MyBase.Setup()
        End Sub
       
    End Class
End Namespace


a business logic class (Inherits JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance)
Code: Select all
Namespace BL

    Public Class Order
        Inherits JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance


        Public Overrides Sub Clear()

        End Sub

        Public Overrides Sub Copy()

        End Sub

        Public Overrides Sub CreateNew()

        End Sub

        Public Overrides Sub Delete()

        End Sub

        Public Overrides Sub Deserialise(XMLString As String)

        End Sub

        Public Overrides Sub Read(RecID As String)

        End Sub

        Public Overrides ReadOnly Property RecIDFieldName As String
            Get

            End Get
        End Property

        Public Overrides Sub Serialise(ByRef XML As String)

        End Sub

        Public Overrides Sub Setup()

        End Sub

        Public Overrides ReadOnly Property SortFieldValue As String
            Get

            End Get
        End Property

        Public Overrides ReadOnly Property TableName As String
            Get

            End Get
        End Property
    End Class

End Namespace



Without any codes, I can compile the the DLL, include the form in form maintenance and include in the menu, however, it fails in Setup().
I'm assuming there are properties I need to initialize.
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: Sample Code Request for Jiwa Forms Standardisation

Postby Mike.Sheen » Tue Sep 30, 2014 12:15 pm

perry wrote:Hi Mike,

Can you provide us some sample codes on this topic please?


Here's the Supplier Return Request form code (attached). It should provide enough of a template to get you going.

Request.zip
Supplier Returns Request form
(12.46 KiB) Downloaded 187 times


Mike
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: 2488
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

Re: Sample Code Request for Jiwa Forms Standardisation

Postby perry » Wed Oct 01, 2014 2:16 pm

Hi Mike,

I'm still building the UI and it's business logic and came a cross 1 issue so far I don't understand why.

Whenever "Cancel" button from menu is clicked, the form gets deactivated and showdown itself. It doesn't seem to be calling any public methods from Business object class...

it will be great if you know what is wrong without seeing my code. Otherwise, I will continue my work here, gather more questions and ask you in 1 go with sample codes/data.

Regards,
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: Sample Code Request for Jiwa Forms Standardisation

Postby Mike.Sheen » Fri Oct 03, 2014 3:13 pm

perry wrote:Whenever "Cancel" button from menu is clicked, the form gets deactivated and showdown itself. It doesn't seem to be calling any public methods from Business object class...

it will be great if you know what is wrong without seeing my code. Otherwise, I will continue my work here, gather more questions and ask you in 1 go with sample codes/data.

Regards,


Hi Perry,

If you're inheriting from our Maintenance.UserInterface class then you will see that behaviour of the form closing when clicking cancel upon certain conditions. We decided if a maintenance form was being opened and there was no initial record to read (eg: empty database or a filter resulting in no initial record), then we put the business logic into new mode immediately. If the user clicks cancel under these conditions, we close the form as that seems most appropriate.

To make this not happen, you need to make sure your business logic RecID property is set to something at the conclusion of your Read method. If you don't have anything to read - then the user clicking cancel should close the form. This is how all our maintenance forms function in version 7.

Mike
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: 2488
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 770

Re: Sample Code Request for Jiwa Forms Standardisation

Postby perry » Tue Oct 07, 2014 12:57 pm

/dance

To make this not happen, you need to make sure your business logic RecID property is set to something at the conclusion of your Read method.


That's it, thanks!
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron