Fixed potential concurrent modification exception.
Image dialog not saving uploaded file to ad_image.
This commit is contained in:
parent
dbbca01f82
commit
7e0a2141bb
|
@ -269,7 +269,9 @@ public class WButtonEditor extends WEditor
|
|||
if (Events.ON_CLICK.equals(event.getName()))
|
||||
{
|
||||
ActionEvent actionEvent = new ActionEvent(this, getColumnName(), Events.ON_CLICK);
|
||||
for (ActionListener evtListener : actionListeners)
|
||||
ActionListener[] listeners = new ActionListener[0];
|
||||
listeners = actionListeners.toArray(listeners);
|
||||
for (ActionListener evtListener : listeners)
|
||||
{
|
||||
evtListener.actionPerformed(actionEvent);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.zkoss.zk.ui.event.Events;
|
|||
public class WDateEditor extends WEditor
|
||||
{
|
||||
private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE};
|
||||
@SuppressWarnings("unused")
|
||||
private static final CLogger logger;
|
||||
|
||||
static
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.zkoss.zk.ui.event.Events;
|
|||
public class WDatetimeEditor extends WEditor
|
||||
{
|
||||
private static final String[] LISTENER_EVENTS = {Events.ON_CHANGE};
|
||||
@SuppressWarnings("unused")
|
||||
private static final CLogger logger;
|
||||
|
||||
static
|
||||
|
|
|
@ -133,7 +133,9 @@ public class WEditorPopupMenu extends Menupopup implements EventListener
|
|||
{
|
||||
ContextMenuEvent menuEvent = new ContextMenuEvent(evt);
|
||||
|
||||
for (ContextMenuListener listener : menuListeners)
|
||||
ContextMenuListener[] listeners = new ContextMenuListener[0];
|
||||
listeners = menuListeners.toArray(listeners);
|
||||
for (ContextMenuListener listener : listeners)
|
||||
{
|
||||
listener.onMenu(menuEvent);
|
||||
}
|
||||
|
|
|
@ -71,6 +71,17 @@ public class WImageDialog extends Window implements EventListener
|
|||
// load data
|
||||
if (m_mImage == null)
|
||||
m_mImage = MImage.get (Env.getCtx(), 0);
|
||||
else
|
||||
{
|
||||
try {
|
||||
AImage aImage = new AImage(m_mImage.getName(), m_mImage.getData());
|
||||
|
||||
image.setContent(aImage);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "load image", e);
|
||||
}
|
||||
}
|
||||
|
||||
fileButton.setLabel(m_mImage.getName());
|
||||
// imageLabel.setIcon(m_mImage.getIcon());
|
||||
AEnv.showCenterScreen(this);
|
||||
|
@ -172,7 +183,6 @@ public class WImageDialog extends Window implements EventListener
|
|||
}
|
||||
|
||||
String fileName = imageFile.getName();
|
||||
byte[] data = null;
|
||||
|
||||
// See if we can load & display it
|
||||
try
|
||||
|
@ -197,7 +207,7 @@ public class WImageDialog extends Window implements EventListener
|
|||
// Save info
|
||||
m_mImage.setName(fileName);
|
||||
m_mImage.setImageURL(fileName);
|
||||
m_mImage.setBinaryData(data);
|
||||
m_mImage.setBinaryData(image.getContent().getByteData());
|
||||
} // cmd_file
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue