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");
|
||||
final FacesContext context = FacesContext.getCurrentInstance();
|
||||
final ResponseWriter out = context.getResponseWriter();
|
||||
|
||||
final Map requestParameters = context.getExternalContext().getRequestParameterMap();
|
||||
// final String templateTypeName = (String)requestParameters.get("template_type_name");
|
||||
|
||||
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);
|
||||
LOGGER.debug("building xform for " + this.tt.getName());
|
||||
final Node form = this.chibaBean.getXMLContainer();
|
||||
final TemplatingService ts = TemplatingService.getInstance();
|
||||
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.QuickSort;
|
||||
import org.alfresco.web.templating.*;
|
||||
import org.alfresco.web.bean.ajax.XFormsBean;
|
||||
import org.apache.commons.logging.Log;
|
||||
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 java.io.OutputStreamWriter;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.chiba.xml.xforms.exception.XFormsException;
|
||||
|
||||
/**
|
||||
* Bean implementation for the "Create Content Wizard" dialog
|
||||
|
@@ -51,3 +51,29 @@ final InstanceData instanceData = new InstanceData() {
|
||||
};
|
||||
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.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 xform = null;
|
||||
function xforms_init()
|
||||
@@ -93,6 +117,7 @@ function load_body(body, ui_element_stack)
|
||||
ui_element_stack.pop();
|
||||
break;
|
||||
case "xforms:textarea":
|
||||
// new alfresco.xforms.textarea(o);
|
||||
var row = document.createElement("tr");
|
||||
ui_element_stack[ui_element_stack.length - 1].appendChild(row);
|
||||
|
||||
@@ -340,6 +365,9 @@ function load_body(body, ui_element_stack)
|
||||
caption: "submit"
|
||||
},
|
||||
nodeRef);
|
||||
w.hide();
|
||||
document.submitTrigger = w;
|
||||
document.submitTrigger.done = false;
|
||||
w.onClick = function()
|
||||
{
|
||||
fireAction(w.widgetId);
|
||||
@@ -449,7 +477,8 @@ function fireAction(id)
|
||||
mimetype: "text/xml",
|
||||
load: function(type, data, evt)
|
||||
{
|
||||
// alert("fired action " + id);
|
||||
document.submitTrigger.done = true;
|
||||
doSubmit();
|
||||
},
|
||||
error: function(type, e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user