IDEMPIERE-750 Zk Address Editor: Address editor popup auto close after changes to state or country.
This commit is contained in:
parent
9cda551825
commit
63d373c71f
|
@ -139,6 +139,24 @@ public final class LayoutUtils {
|
||||||
Clients.response("_openPopupWindow_", new AuScript(window, script.toString()));
|
Clients.response("_openPopupWindow_", new AuScript(window, script.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* position opened window relative to the ref component
|
||||||
|
* @param ref
|
||||||
|
* @param window
|
||||||
|
* @param position
|
||||||
|
*/
|
||||||
|
public static void positionWindow(Component ref, Window window, String position) {
|
||||||
|
StringBuilder script = new StringBuilder();
|
||||||
|
script.append("_idempiere_popup_window('#")
|
||||||
|
.append(ref.getUuid())
|
||||||
|
.append("','#")
|
||||||
|
.append(window.getUuid())
|
||||||
|
.append("','")
|
||||||
|
.append(position)
|
||||||
|
.append("');");
|
||||||
|
Clients.response("_openPopupWindow_", new AuScript(window, script.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* open popup window relative to the ref component
|
* open popup window relative to the ref component
|
||||||
* @param ref
|
* @param ref
|
||||||
|
|
|
@ -40,6 +40,7 @@ import org.compiere.util.Msg;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
import org.zkoss.zk.ui.event.OpenEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sendy Yagambrum
|
* @author Sendy Yagambrum
|
||||||
|
@ -171,6 +172,7 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(Event event) throws Exception {
|
public void onEvent(Event event) throws Exception {
|
||||||
|
getComponent().getTextbox().focus();
|
||||||
m_value = ld.getValue();
|
m_value = ld.getValue();
|
||||||
//
|
//
|
||||||
if (!ld.isChanged())
|
if (!ld.isChanged())
|
||||||
|
@ -192,6 +194,14 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
|
||||||
setValue(ii);
|
setValue(ii);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
ld.addEventListener(Events.ON_OPEN, new EventListener<OpenEvent>() {
|
||||||
|
@Override
|
||||||
|
public void onEvent(OpenEvent event) throws Exception {
|
||||||
|
if (!event.isOpen()) {
|
||||||
|
ld.detach();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
ld.setTitle(null);
|
ld.setTitle(null);
|
||||||
LayoutUtils.openPopupWindow(getComponent(), ld);
|
LayoutUtils.openPopupWindow(getComponent(), ld);
|
||||||
}
|
}
|
||||||
|
|
|
@ -582,6 +582,7 @@ public class WLocationDialog extends Window implements EventListener<Event>
|
||||||
// refresh
|
// refresh
|
||||||
initLocation();
|
initLocation();
|
||||||
inCountryAction = false;
|
inCountryAction = false;
|
||||||
|
lstCountry.focus();
|
||||||
}
|
}
|
||||||
// Region Changed
|
// Region Changed
|
||||||
else if (lstRegion.equals(event.getTarget()))
|
else if (lstRegion.equals(event.getTarget()))
|
||||||
|
@ -594,6 +595,7 @@ public class WLocationDialog extends Window implements EventListener<Event>
|
||||||
m_location.setCity(null);
|
m_location.setCity(null);
|
||||||
// refresh
|
// refresh
|
||||||
initLocation();
|
initLocation();
|
||||||
|
lstRegion.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,6 +703,7 @@ public class WLocationDialog extends Window implements EventListener<Event>
|
||||||
}
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** returns a string that contains all fields of current form */
|
/** returns a string that contains all fields of current form */
|
||||||
String getFullAdress()
|
String getFullAdress()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue