Skip to main content

Splitters in Dynamics AX [X++, SysFormSplitter_Y, SysFormSplitter_YBottomBound]

There are 3 types of splitters : X -axis, Y-axis and Y-axis BottomBound
Classes which help for adding splitters are listed below.
  • SysFormSplitter_X

  • SysFormSplitter_Y

  • SysFormSplitter_YBottomBound

  • Splitter is actually a group control but by setting up some properties on the group control will make it look like a thin line as a seperator.
    Let us learn all these splitters one by one with an example.. Follow me to learn splitters..
    Y_Axis splitter:
    Create a new form with name SR_YAxisSplitter and add 3 new controls to it.
    Add a stringEdit control “Name” and set the autodeclaration property as “Yes”
    Add a group control “GroupSplitter” and set the proeprties as shown in the image below.


    Add another string edit control “Organization” .
    Now, your form should like the screen shot below

    Modify the classdeclaration method of the form by creating an object of SysFormSplitter_Y as shown below

    public class FormRun extends ObjectRun
    {
    SysFormSplitter_Y _formSplitter;
    }

    Override the init() method of the form and instantiate the SysFormSplitter_Y class as shown below.

    void init()
    {
    super();

    _formSplitter = new SysFormSplitter_Y(groupSplitter,Name,element);
    }

    Override 3 methods mouseup(), mousedown() and mousemove() methods as shown below


    ______________________________________________________________________
    int mouseUp(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;

    ret = super(x, y, button, ctrl, shift);
    Return _formSplitter.mouseUp(x, y, button, ctrl, shift);
    }
    _______________________________________________________________________
    int mouseMove(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ret = super(x, y, button, ctrl, shift);
    Return _formSplitter.mouseMove(x,y,button,ctrl,shift);
    }
    _______________________________________________________________________
    int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ret = super(x, y, button, ctrl, shift);
    Return _formSplitter.mouseDown(x, y, button, ctrl, shift);
    }
    _______________________________________________________________________

    There you go.. We are done with the development. Now let’s see how your form look like with your newly created splitter. Below is the screen shot.

    X_Axis splitter:
    Let us learn now how to create X -Axis splitters on the form
    Create a new form by name SR_XAxisSplitter as shown below.
    Add first group control and set the following properties as shown below
    Height : ColumnHeight
    Widht : ColumnWidth
    Columns: 3
    FrameType : None
    Below is the screen shot for your reference : Columns property – set to 3

    Inside the group add 3 controls
    1) StringEdit control “Name” [Autodeclaration property - Yes]
    2)GroupSpliiter Control
    3)ListView control with properties [Height - ColumnHeight and width as ColumnWidth]
    Set the following properties on the GroupSplitter control


    Next, paste the following code in the classdeclaration method

    public class FormRun extends ObjectRun
    {
    SysFormSplitter_X _formSplitter;
    }

    Override the init() method and add the below code

    void init()
    {
    super();
    _formSplitter = new SysFormSplitter_X(groupSplitter,Name);
    }

    Override mouseup, mousemove and mousedown method on the groupsplitter control and add the below code

    ______________________________________________________________________

    int mouseUp(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ret = super(x, y, button, ctrl, shift);
    Return _formSplitter.mouseUp(x, y, button, ctrl, shift);
    }
    ______________________________________________________________________
    int mouseMove(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ret = super(x, y, button, ctrl, shift);
    Return _formSplitter.mouseMove(x,y,button,ctrl,shift);
    }
    ______________________________________________________________________
    int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ret = super(x, y, button, ctrl, shift);
    Return _formSplitter.mouseDown(x, y, button, ctrl, shift);
    }
    ______________________________________________________________________

    That’s it..we are done with X-Axis splitter as well. Now let’s see how the form looks like. Below is the screen shot

    Y_Axis BottomBound:
    Y-Axis button bound will be used in ListPages forms as a splitter between the grids and any other controls
    Below the screenshot – of newly created ListPage. Follow the properties and addition of controls as shown below.

    Next, paste the below code in class declaration method

    public class FormRun extends ObjectRun
    {
    SysFormSplitter_YBottomBound splitter;
    }

    Override the init() method and paste the following code

    public void init()
    {
    #define.startupHeight(175);
    super();
    splitter = new SysFormSplitter_YBottomBound(grid, ctrlSplitVertical, previewPane, this, #startupHeight);
    }

    Override the mouseup, mousemove, mousedown methods on the groupsplitter control and paste the below code

    int mouseUp(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ;
    super(x, y, button, ctrl, shift);
    ret = splitter.mouseUp(x, y, button, ctrl, shift);
    return ret;
    }
    ______________________________________________________________________
    int mouseMove(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ;
    super(x, y, button, ctrl, shift);
    ret = splitter.mouseMove(x, y, button, ctrl, shift);
    return ret;
    }
    _____________________________________________________________________
    int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
    {
    int ret;
    ;
    super(x, y, button, ctrl, shift);
    ret = splitter.mouseDown(x, y, button, ctrl, shift);
    return ret;
    }
    ______________________________________________________________________

    That’s it pals..we are done with the splitter on the list pages. Below is how your listpage look now.

    Popular posts from this blog

    Passing values between form and class

    Class name is EmplDuplication and Form is EmplTable . void clicked() {    MenuFunction mf;    args args = new Args();    ;     args.record(EmplTable);     mf = new menufunction(identifierstr(EmplDuplication), MenuItemType::Action); mf.run(args); } Meanwhile, in the main() method of the EmplDuplication class, we need to put this Axapta x++ code to get the datasource: static void main(Args args) {     EmplDuplication EmplDuplication; EmplTable localEmplTable; ;     if(args.record().TableId == tablenum(EmplTable)) localEmplTable = args.record();     ... }

    What does this mean: "The form datasource query object does not support changing its AllowCrossCompany property after the form has executed the query."?

    I have made a form with datasources vendtable and vendtrans. Inside vendtable_ds.executequery() looks like this: QueryBuildDataSource queryBuildDatasource ,queryBDS_VendTrans_Invoice; ; queryBuildDatasource = this.query().dataSourceTable(tablenum(vendtable)); queryBDS_VendTrans_Invoice = this.query().dataSourceTable(tablenum(vendtrans)); if (curext() == "MASTERCOMP") { this.query().allowCrossCompany(true); } else { this.query().allowCrossCompany(false); } //FilterVendorName = stringedit control on form if (FilterVendorName.text()) { queryBuildDatasource.addRange(fieldNum(VendTable,Name)).value(strfmt("*%1*", FilterVendorName.text())); } else { queryBuildDatasource.clearRange(fieldNum(VendTable,Name)); } //FilterInvoiceNumber = stringedit control on form if (FilterInvoiceNumber.valueStr() == "") { queryBDS_VendTrans_Invoice.enabled(false); } else { queryBDS_VendTrans_Invoice.enabled(true); queryBDS_VendTrans_In...