Monday, 11 August 2014

Creation Of Custom "LookUp Form"


                  Creating A lookUp Form On a Form Control

Now we are going to enable a LookUpForm on a form level bounded control.

Requirement:
Create a form(CusttForm) with a control named “id” and it should enable a form lookup (lookup form) having two fields Customeraccount and Name
 
 
Step1:

 
Create a form(CusttForm) with data source as custTable. Add the AccountNum field and Name(method) from custTable to this form Design -->Grid control.

Step2:
   
Change the CusttForm's  Design--> Property--> “Style:LookUp”



Step3:

Create a table[AssesTable] with a field “id” which extends your own EDT and add this table into a new form's[ AssesForm], and add “id” field to Design-->'Group' control as String edit control.





Step4:

write Lookup(override) method in the above control with following code

public void lookup()

{

Args args = new Args("CusttForm");

FormRun FR;

CustTable custTable;

args.caller(this);

FR = new FormRun(args);
FR.init();

this.performFormLookup(FR);

}

or

public void lookup()

{

FormRun formRun;

Args args;

args = new Args("CusttForm");

formRun = classFactory::formRunClassOnClient(args);

formRun.init();

this.performFormLookup(formRun);

}


Step5:
write a piece of code in run method as follows, in CusttForm--->Methods

public void run()

{

element.selectMode(CustTable_AccountNum);


super();

}
 
 
 




 
 
 
 
 
 
 
 
 
 
 
 
Note:

When ever we are writing lookup method , the form lookup will be enabled, but the selected value won't come to the “ id” control.


To get that selected value in control level , we are writing the “element.selectmode.(controlName)” in run method.



--->Now open the assesForm and check the working of lookup form

















 

No comments:

Post a Comment