mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
need to pass cookies to the submission handler, otherwise content is written to the wrong xformsbean.
removing the submit button. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3520 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -103,17 +103,8 @@ public class XFormsBean
|
|||||||
LOGGER.debug(this + " building xform");
|
LOGGER.debug(this + " building xform");
|
||||||
final FacesContext context = FacesContext.getCurrentInstance();
|
final FacesContext context = FacesContext.getCurrentInstance();
|
||||||
final ResponseWriter out = context.getResponseWriter();
|
final ResponseWriter out = context.getResponseWriter();
|
||||||
|
|
||||||
final Map requestParameters = context.getExternalContext().getRequestParameterMap();
|
final Map requestParameters = context.getExternalContext().getRequestParameterMap();
|
||||||
// final String templateTypeName = (String)requestParameters.get("template_type_name");
|
LOGGER.debug("building xform for " + this.tt.getName());
|
||||||
|
|
||||||
LOGGER.debug("building xform for " + this.tt.getName()); //templateTypeName);
|
|
||||||
|
|
||||||
// final TemplatingService ts = TemplatingService.getInstance();
|
|
||||||
// final TemplateType tt = ts.getTemplateType(templateTypeName);
|
|
||||||
// final XFormsInputMethod tim = (XFormsInputMethod)
|
|
||||||
// tt.getInputMethods().get(0);
|
|
||||||
// final Document form = tim.getXForm(tt);
|
|
||||||
final Node form = this.chibaBean.getXMLContainer();
|
final Node form = this.chibaBean.getXMLContainer();
|
||||||
final TemplatingService ts = TemplatingService.getInstance();
|
final TemplatingService ts = TemplatingService.getInstance();
|
||||||
ts.writeXML(form, out);
|
ts.writeXML(form, out);
|
||||||
|
@@ -36,7 +36,6 @@ import org.alfresco.web.bean.repository.Node;
|
|||||||
import org.alfresco.web.data.IDataContainer;
|
import org.alfresco.web.data.IDataContainer;
|
||||||
import org.alfresco.web.data.QuickSort;
|
import org.alfresco.web.data.QuickSort;
|
||||||
import org.alfresco.web.templating.*;
|
import org.alfresco.web.templating.*;
|
||||||
import org.alfresco.web.bean.ajax.XFormsBean;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
|||||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import org.alfresco.web.app.servlet.FacesHelper;
|
import org.alfresco.web.app.servlet.FacesHelper;
|
||||||
import org.chiba.xml.xforms.exception.XFormsException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bean implementation for the "Create Content Wizard" dialog
|
* Bean implementation for the "Create Content Wizard" dialog
|
||||||
|
@@ -51,3 +51,29 @@ final InstanceData instanceData = new InstanceData() {
|
|||||||
};
|
};
|
||||||
tim.generate(instanceData, tt, out);
|
tim.generate(instanceData, tt, out);
|
||||||
%>
|
%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
dojo.addOnLoad(function()
|
||||||
|
{
|
||||||
|
//alert('foo');
|
||||||
|
var b = document.getElementById("wizard:next-button");
|
||||||
|
var baseOnClick = b.onclick;
|
||||||
|
b.onclick = function()
|
||||||
|
{
|
||||||
|
if (!document.submitTrigger.done)
|
||||||
|
{
|
||||||
|
document.submitTrigger.buttonClick();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return baseOnClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function doSubmit()
|
||||||
|
{
|
||||||
|
var b = document.getElementById("wizard:next-button");
|
||||||
|
b.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@@ -9,6 +9,30 @@ dojo.require("dojo.html.style");
|
|||||||
dojo.hostenv.writeIncludes();
|
dojo.hostenv.writeIncludes();
|
||||||
dojo.addOnLoad(xforms_init);
|
dojo.addOnLoad(xforms_init);
|
||||||
|
|
||||||
|
//dojo.provide("alfresco.xforms.textarea");
|
||||||
|
//
|
||||||
|
//dojo.declare("alfresco.xforms.Widget",
|
||||||
|
// null,
|
||||||
|
// function(node)
|
||||||
|
// {
|
||||||
|
// this.node = node;
|
||||||
|
// },
|
||||||
|
// id: "",
|
||||||
|
// isRequired: function()
|
||||||
|
// {
|
||||||
|
// },
|
||||||
|
// getInitialValue: function()
|
||||||
|
// {
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
//dojo.declae("alfresco.xforms.TextArea",
|
||||||
|
// alfresco.xforms.Widget,
|
||||||
|
// function() { },
|
||||||
|
//
|
||||||
|
//{
|
||||||
|
// alert(element);
|
||||||
|
//}
|
||||||
|
|
||||||
var bindings = {};
|
var bindings = {};
|
||||||
var xform = null;
|
var xform = null;
|
||||||
function xforms_init()
|
function xforms_init()
|
||||||
@@ -93,6 +117,7 @@ function load_body(body, ui_element_stack)
|
|||||||
ui_element_stack.pop();
|
ui_element_stack.pop();
|
||||||
break;
|
break;
|
||||||
case "xforms:textarea":
|
case "xforms:textarea":
|
||||||
|
// new alfresco.xforms.textarea(o);
|
||||||
var row = document.createElement("tr");
|
var row = document.createElement("tr");
|
||||||
ui_element_stack[ui_element_stack.length - 1].appendChild(row);
|
ui_element_stack[ui_element_stack.length - 1].appendChild(row);
|
||||||
|
|
||||||
@@ -340,6 +365,9 @@ function load_body(body, ui_element_stack)
|
|||||||
caption: "submit"
|
caption: "submit"
|
||||||
},
|
},
|
||||||
nodeRef);
|
nodeRef);
|
||||||
|
w.hide();
|
||||||
|
document.submitTrigger = w;
|
||||||
|
document.submitTrigger.done = false;
|
||||||
w.onClick = function()
|
w.onClick = function()
|
||||||
{
|
{
|
||||||
fireAction(w.widgetId);
|
fireAction(w.widgetId);
|
||||||
@@ -449,7 +477,8 @@ function fireAction(id)
|
|||||||
mimetype: "text/xml",
|
mimetype: "text/xml",
|
||||||
load: function(type, data, evt)
|
load: function(type, data, evt)
|
||||||
{
|
{
|
||||||
// alert("fired action " + id);
|
document.submitTrigger.done = true;
|
||||||
|
doSubmit();
|
||||||
},
|
},
|
||||||
error: function(type, e)
|
error: function(type, e)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user