Merged V3.2 to HEAD

18484: Merged DEV-TEMPORARY to V3.2 
                  18478: XForms errors - ACT 15969

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18485 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2010-02-05 21:02:51 +00:00
parent 6989a3fcb3
commit 7cbb3a0daf
2 changed files with 92 additions and 61 deletions

View File

@@ -33,6 +33,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
@@ -179,6 +180,8 @@ public class XFormsBean implements Serializable
private AVMBrowseBean avmBrowseBean;
private NavigationBean navigator;
private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
public static String BEAN_NAME = "XFormsBean";
/**
@@ -240,8 +243,17 @@ public class XFormsBean implements Serializable
final XMLEvent xmle = (XMLEvent)e;
if (XFormsBean.LOGGER.isDebugEnabled())
XFormsBean.LOGGER.debug("received event " + xmle.getType() + ": " + xmle);
try
{
lock.writeLock().lock();
XFormsBean.this.xformsSession.eventLog.add(xmle);
}
finally
{
lock.writeLock().unlock();
}
}
};
// interaction events my occur during init so we have to register before
@@ -631,6 +643,11 @@ public class XFormsBean implements Serializable
final Document result = XMLUtil.newDocument();
final Element eventsElement = result.createElement("events");
result.appendChild(eventsElement);
try
{
lock.readLock().lock();
for (XMLEvent xfe : this.xformsSession.eventLog)
{
final String type = xfe.getType();
@@ -695,7 +712,21 @@ public class XFormsBean implements Serializable
}
}
}
}
finally
{
lock.readLock().unlock();
}
try
{
lock.writeLock().lock();
this.xformsSession.eventLog.clear();
}
finally
{
lock.writeLock().unlock();
}
if (LOGGER.isDebugEnabled())
{

View File

@@ -1578,9 +1578,9 @@ alfresco.xforms.ComboboxSelect1 = alfresco.xforms.AbstractSelectWidget.extend({
this.widget = this.domNode;
for (var i = 0; i < values.length; i++)
{
if (initial_value && !values[i].valid)
if (!values[i].valid)
{
// skip the invalid value if we have a default value
// always skip the invalid values for combos
continue;
}
var option = new Element("option");