How to add combo box on RunBase Dialog

Hi All,

Today, I am demonstrating on how to add combo box on RunBase Dialog.
Firstly, I want to give a brief introduction about RunBase Class.
This Class is used to schedule the batch jobs. So, Adding Comobox
to RunBase Dialog starts with Class Declaration.

class SampleComboDialog extends RunBaseBatch
{

DialogRunbase dialog;
DialogField operationField;

}

In the above class declaration, I declared dialog object of type DialogRunbase & operationField of type DialogField and then i overrided dialog method.

protected Object dialog()
{

dialog = super();
operationField = dialog.addField(enumStr(Operations));
return dialog;

}

In this, I assigned the Operation field which is of Type Base Enum to operationField which is of type DialogField and returned the dialog which of type object.

You can even use putToDialog() and getFromDialog() but I want to make it as simplified version. So, I wrote run() method here below.

public void run()
{
super();
info(strFmt(“the result is %1”, operationField.value()));
}

It displays the value selected in ComboBox but it requires to initialisation of RunBase Class Object. This is has to be written in main method of respective class.

public static void main(Args _args)
{
SampleComboDialog sampleComboDialog;
sampleComboDialog = new SampleComboDialog();

if(sampleComboDialog.prompt())
{
sampleComboDialog.run();
}
}

So, I compile & run it and here is the Output.

ComboBox

If you clicked at ComboBox, it show it list of enums.

ComboBox1

Suppose, If I select Add Operation from the ComboBox and press ok then, here it is the output.

Combobox2

That’s it, just try it and happy Daxing…….

Advertisements

One response

  1. Hi Raziq,

    How to add the checkbox field in dialog control,like
    (i,e) in “LedgerJournalTrans” table “prepayment” field(its enum type like:NOYes) is there i want to add that field in dialog control
    plz help me

    Thanks & regards ,
    joseph

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: