In previous releases of smartpos we have open existent windows at the end of a process, with the existent method:
String whereString = " smj_closecash_ID= "+elementId+" ";
MQuery query = new MQuery("smj_closecash");
query.addRestriction(whereString);
int AD_Window_ID = 1000004; // close cash window is 1000004
AEnv.zoom(AD_Window_ID, query);
But now we have to open custom forms (zk based), they are already working from the normal menu but we have to open them at the end from a custom toolbar button /java class now.
Analyzing the source code we have tried with this approach, and thogh we do not get any exception, nothing is displayed .. so it looks we have something missing, any suggestion ....?
public class ProductButton implements IAction {
@Override
public void execute(Object target) {
ADWindow window = (ADWindow) target;
ADWindowContent content = window.getADWindowContent();
GridTab tab = content.getActiveGridTab();
log.info("boton pressed" + tab.getRecord_ID());
try {
WQueryProducts wProducts;
wProducts = new WQueryProducts();
GridTab grid = window.getADWindowContent().getActiveGridTab();
ADForm.openForm(1000001,grid);
Thanks in advance for your comments,
Pedro R