Edit metod örneği

Merhaba

Edit metodların bir  çok kullanım alanı  vardır. Biride bir formda kayıtları seçtirmek için noyes edit metodu yazmaktır.

bu metodla alınan kayıtları bir map  veya set’ e atayıp kullanabilirsiniz.

örnek kodlar  şöyledir.

classDecleration

map         oMark ;

init

oMark = new map(types::String,types::Integer);

void clicked()
{
    Args args;
    MenuFunction menu;

    super();

    args = new args();

    args.object(oMark);
    menu = new MenuFunction(“DenemeReport”,menuitemtype::Output);
    menu.run(args);

}

args(); la DenemeReport ‘a seçtiğimiz satırları gönderiyoruz.

satır seçmek  için gerekli olan edit metodu datasource’a yazıp sürükleyerek  grid e bırakıyoruz. 

edit NoYes markTrans(boolean set, ETGInventItemSecGroup _ETGInventItemSecGroup, NoYes _markTrans)

{

 if (set)

{

 element.lock(); element.unLock();

 this.refresh();

 if(_markTrans)

oMark.insert(_ETGInventItemSecGroup.PreGroupId,_markTrans);

else

oMark.remove(_ETGInventItemSecGroup.PreGroupId);

}

else

 {

 if (oMark.exists(_ETGInventItemSecGroup.PreGroupId))

{

 _markTrans = oMark.lookup(_ETGInventItemSecGroup.PreGroupId);

}

 }

return _MarkTrans;

}

Raporun init metodunda

public void init()
{    ;
    super();

    ArgsEmplTable =  element.args().record();
    oMark =  element.args().object();

}

Bundan sonra istediğiniz şekilde satırları kullanabilirsiniz.

Kolay gelsin.

 
Comment are closed.