Add new tab page to RunBaseBatch dialog

Hi guys,

My problem is to add new TabPage to RunBaseBatch dialog window. I have too many dialog fields on one page and I want to split them on 2 pages. When I want to use

protected Object dialog(DialogRunbase _dialog, boolean _forceOnClient)
{
    DialogRunbase   dialog;
    Object          obj;
    ;

    obj = super(_dialog, _forceOnClient);
    dialog = obj;
   
    filterPage  = dialog.addTabPage("Tab");

    grInteractions  = dialog.addGroup("@KVA8665");
    dCycleId        = dialog.addField(typeId(KPDebtCycleId));

.......... some code .........

    return dialog;
}

And when running this class, I’m receiving error:

DialogTabPage object does not have method ‘frameType’

When I try to create DialogRunBase and make some tabs there, and secondly push it to the super(DialogRunbase rb, boolean forceOnClient), then tabs are created and shown, but buttons from showQuerySelectButton or ShowDefaultButton are created on newly created tab, that I can’t make active and nothing can be put inside except these 2 buttons.

I found out, that when I set return value of showQueryValues() to false, then this error is not present. Best way to reproduce this error is to add method

public boolean showQueryValues()
{
return false;
}

to Tutorial_RunbaseBatch and see what’s happening.

Look at Tutorial_RunbaseBatch class; it’s a working example of a RunBase dialog with an extra tab.

Well, you’ve resolved your problem, but I’ll keep it my reply here. It might be useful for somebody one day.

I did, but there is a problem with tabs and “Query Values” preview frame, see my previous post. Have you ever met with this problem before?

Sorry for previous post. My intention is to keep both tabs and “Query Values” frame… Any proposals? I would like not to give up from any of them…

Aha, so you didn’t resolve your problem…

You get the error because the code in RunBaseDialogModify.post() confuses the tab page with the main group. Fix the code finding mainGrp and it should work.

Solution is to save mainFormGroup after super() call and restore it before returning dialog. Works smooth on Ax 2009.

protected Object dialog()
{
    DialogRunbase   dialog;
    Object          obj;
    ;

    dialog = super();
    //Save main form group pointer
    obj = dialog.mainFormGroup(); 
   
    filterPage  = dialog.addTabPage("Tab");

    grInteractions  = dialog.addGroup("@KVA8665");
    dCycleId        = dialog.addField(typeId(KPDebtCycleId));

.......... some code .........

    //Assign main form group pointer back
    dialog.mainFormGroup(obj);

    return dialog;
}