I need to trap changes to the postalcode in the address cluster.
I looked at the documentation and code and could not figure how to specifically trap the postalcode change.
I tried the following plus several variation but I was not successful. The code below call the function checkZip()
about 5 times as the successive fields get loaded.
From the doc: https://www.xtuple.org/sites/default/files/dev/latest/html/class_address_cluster.html#a5540070c63cbc4e9569027ad23ee3ed4
I see that the addressChange accepts several parameters but I am not sure what.
I am using this on shipTo screen for customers.
Help Please!
void | addressChanged (QString, QString, QString, QString, QString, QString, QString) |
//QMessageBox.information(mywindow,mywindow.windowTitle, "we are here: " );
var _address = mywindow.findChild("_address"); //empty until address field are loaded
//Q_INVOKABLE virtual QString postalCode() const { return _postalcode->text(); }
_address.addressChanged.connect(checkZip); //seems to fire every time a field is changed
function checkZip()
{
var tmp =_address.postalCode();
QMessageBox.information(mywindow,mywindow.windowTitle, "postal code: " + tmp );
}