We can use the data we have created or called up on the grid without connecting to the CBO (Custom Business Object)

First, you define a class as follows. Note: Variables in the class must be public.

Grid Data Source Code
package com.lbs.customization;
public class formData
{
       public String field1;
       public formData(String string) {
             this.field1=string;
       }
       public String getField1() {
             return field1;
       }
       public void setField1(String field1) {
             this.field1 = field1;
       }
}


In the form OnInitialize method;

  •   Create an ArrayList and fill in,
  •   I define both the form and the formData class.    
OnInitialize method of the form source code
public void onInitialize(JLbsXUIControlEvent event)       {
             JLbsXUIPane container = event.getContainer();
         
             ArrayList datas = new ArrayList();
             datas.add(0,new formData("a"));
             datas.add(1,new formData("ab"));
             datas.add(2,new formData("abc"));
             datas.add(3,new formData("abcd"));
             datas.add(4,new formData("abcde"));


             JLbsObjectListGrid grid = (JLbsObjectListGrid) event.getContainer().getComponentByTag(2000001);
             grid.setObjectClass(datas.getClass());
             grid.setObjects(datas);
       }



In the Grid ColumnDefinitions field, we call the field name in the formData class.

Note: The variable defined in the Datafield field must be the same as the field in the formData class,

The dataForm must have the getter and setter methods of the field,

It will not work

 




Telif HakkıKullanım KoşullarıGizlilik
Copyright © 2018 Logo Yazılım