Posted by Sreenath Reddy on June 8, 2011
This post is in continuation of my old post which helped to use SysLookUpMultiSelectCtrl class on Forms.
The below class will help you to implement the same in the dialogs [Used Runbase framework]. Please note I have used the same query [CustTableLookUp] which I used in my last post.
The below class will help you to implement the same in the dialogs [Used Runbase framework]. Please note I have used the same query [CustTableLookUp] which I used in my last post.
Please follow the class and its methods as shown below.
public class SR_LookupMultiSelectDialog extends RunBase
{
DialogRunbase dialog;
DialogGroup dialogGrp;
{
DialogRunbase dialog;
DialogGroup dialogGrp;
FormBuildStringControl fbsCtrlMultiSelect1;
FormStringControl fsCtrlMultiSelect1;
FormStringControl fsCtrlMultiSelect1;
container returnIds1;
SysLookupMultiSelectCtrl msCtrl1;
}
__________________________________________________
public ClassDescription caption()
{
return ‘Multiple select lookup on dialog’;
}
__________________________________________________
// Generate dialog
public Object dialog()
{
FormBuildControl setupGroupControl;
}
__________________________________________________
public ClassDescription caption()
{
return ‘Multiple select lookup on dialog’;
}
__________________________________________________
// Generate dialog
public Object dialog()
{
FormBuildControl setupGroupControl;
dialog = super();
dialog.alwaysOnTop(true);
dialog.windowType(FormWindowType::Standard);
dialogGrp = dialog.addGroup(‘Group’);
dialog.windowType(FormWindowType::Standard);
dialogGrp = dialog.addGroup(‘Group’);
setupGroupControl = dialog.formBuildDesign().control(dialogGrp.formBuildGroup().id());
// Control with the MULTI-SELECT
fbsCtrlMultiSelect1 = setupGroupControl.addControl(FormControlType::String, identifierstr(ctrlRoles1));
fbsCtrlMultiSelect1.label(‘Select multiple customers’);
fbsCtrlMultiSelect1 = setupGroupControl.addControl(FormControlType::String, identifierstr(ctrlRoles1));
fbsCtrlMultiSelect1.label(‘Select multiple customers’);
dialog.allowUpdateOnSelectCtrl(true);
this.dialogSelectCtrl();
return dialog;
}
__________________________________________________
__________________________________________________
public void dialogPostRun(DialogRunbase _dialog)
{
FormRun formRun;
{
FormRun formRun;
super(dialog);
formRun = _dialog.dialogForm().formRun();
if (formRun)
{
fsCtrlMultiSelect1 = formRun.design().control(fbsCtrlMultiSelect1.id());
msCtrl1 = SysLookupMultiSelectCtrl::construct(formRun, fsCtrlMultiSelect1, querystr(CustTableLookUp));
{
fsCtrlMultiSelect1 = formRun.design().control(fbsCtrlMultiSelect1.id());
msCtrl1 = SysLookupMultiSelectCtrl::construct(formRun, fsCtrlMultiSelect1, querystr(CustTableLookUp));
}
}
__________________________________________________
}
__________________________________________________
// Get input values
public boolean getFromDialog()
{
#Characters
public boolean getFromDialog()
{
#Characters
// Return Ids from the 1st mutli-select control
if (msCtrl1)
returnIds1 = msCtrl1.get();
if (msCtrl1)
returnIds1 = msCtrl1.get();
info(‘Control 1 – ‘ + con2StrUnlimited(returnIds1,#SEMICOLON));
return true;
}
__________________________________________________
}
__________________________________________________
static void main(Args _args)
{
SR_LookupMultiSelectDialog SR_LookupMultiSelectDialog = new SR_LookupMultiSelectDialog();
{
SR_LookupMultiSelectDialog SR_LookupMultiSelectDialog = new SR_LookupMultiSelectDialog();
if (SR_LookupMultiSelectDialog.prompt())
{
SR_LookupMultiSelectDialog.run();
}
}
__________________________________________________
{
SR_LookupMultiSelectDialog.run();
}
}
__________________________________________________
Below is the dialog [Screen shot for reference ] which will allow to select multiple values from the lookup
Aucun commentaire:
Enregistrer un commentaire