Hi All,
Is it possible to modify dialog field while I am changing the other dialog field value accordingly.
I have created a dialog by class. It contain two fields custId & custName. what I want is, when I change the custId Field value on dialog, then accordingly the custName field should modified.
Plz help.
Thanks
Nitish Kr Gupta
The modified method can also be accessed by overridingpublic void dialogSelectCtrl(){}in the runbase class. Just calldialog.allowUpdateOnSelectCtrl(true);in the dialog method.You can also create a dialog form and pass it as the parameter in the dialog method of runbase class. you can find an example in tutorial_runbase class and form.
Hi Nitish,
In order to achieve dynamic dialog event overloading your dialog class need to extend Runbase class.
In your dialog method add this following code
dialog.allowUpdateOnSelectCtrl(true);
Create a new method
public void dialogSelectCtrl()
{
;
fieldName.value(custTable::find(fieldAccount.value()).Name);
}
No need of Fld1_1_modified() method.
dialogSelectCtrl is a method in Runbase class.
Hope this solves your problem.
HI Nitish,
To provide a better solution for this , you create a look up in your custId field and override the modified method of the look up
after which according to me your problem may get resolved.
With Regards :LMJ
Hi Lalit,
can u please explain in detail plesse.
Nitish
Its possible. First you should know the name of the custId dialog field. You can do so by adding the following code to the bottom of your dialog method.
info (custId.name());//custId is the dialog field
Once you know the dialog field name, you can override its modified method by adding the following method to your class.
void dialogFieldName_modified()//specify the name you get from the info method in place of "dialogFieldName"
<specify your logic here>
Hope this helps you
Hi Imran,
Thanks for replying.
Can u please explain how to specify logic here. I am not getting it.
I got the custId Field Name by Info its comming like "Fld1_1 ".
Eagerly waiting for ur reply.
By logic I mean, get the customer name for the selected customer Id and assign it to customer name dialog field here ...
your method should look like
void Fld1_1_modified()
CustName.value(custTable::find(CustId.value())).Name;
I did as u suggested, but custName is not showing in dialog field. I also applied debugger on 'fld1_1_modifid' method but debugger is not going there.
Here is code I written on modified method.
{;
here fieldName & fieldAccount are dialog field name for custName & custAccount respectively.
please suggest what next to do .
Hi,
try this...
Public boolean fld1_1_modified(){ FormStringControl control; boolean isFieldModified; ; control= dialog.formRun().controlCallingMethod(); isFieldModified = control.modified(); if(isFieldModified) {
dialogName.value(custTable::find(fieldAccount.value()).Name); } return isFieldModified;}
Thanks Imran
Its working.
but name in custName is changing after clicking on other control, not immediately after selecting the custId. if u have any idea about it, otherwise it ok.
Many Thanks
Hello !
i have the same problem, the value change after clicking on other control :s
do you have a solution ?
thanks a lot
hi,
Just view above in this page and you will gea soln..
Hi Don't forget to added this method in your class to make the fld1_1_Modified to work properly
public void dialogPostRun(DialogRunbase _dialog)
super(_dialog);
_dialog.dialogForm().formRun().controlMethodOverload(true);
_dialog.dialogForm().formRun().controlMethodOverloadObject(this);
Using This method is a problem if you want to modify the dialog field name after that it would allow you to change but it would still take the default code written for the account num change.
In scenario where you want to change the Name after it returns it is not possible to use this method