[ http://issues.apache.org/jira/browse/COCOON-1804?page=comments#action_12412931 ]
Simone Gianni commented on COCOON-1804: --------------------------------------- Hi Andrew, you can obtain this functionality : - Patching your 2.1.9 installation (with the patch command, or with eclipse) using the patch here attached. - Checkiung out 2.1.X (2.1.10 dev) from SVN - Downloading a 2.1.X snapshot from here http://svn.apache.org/snapshots/cocoon-BRANCH_2_1_X/ > Javascript FOM_SCOPE issue when using Java as the flow engine - > ReferenceError: "cocoon" is not defined > ------------------------------------------------------------------------------------------------------- > > Key: COCOON-1804 > URL: http://issues.apache.org/jira/browse/COCOON-1804 > Project: Cocoon > Type: Bug > Components: Blocks: Java Flow > Versions: 2.1.8 > Reporter: Andrew Madu > Priority: Blocker > Fix For: 2.1.10-dev (current SVN) > Attachments: javaflow-fomcocoon.diff > > I have created a java flow class which does the following: > //Load in validation file > FormInstance form = new FormInstance("forms/login.xml"); > My login map (snippet) is as follows: > Login.xml: > <fd:validation> > <fd:javascript> > var success = true; > var newUserReg = new Packages.test.User(); > var username = widget.lookupWidget("username"); > var password = widget.lookupWidget("password"); > > try { > > var checkUserTest = newUserReg.getUser(username.value, > password.value); > > if (checkUserTest != null) { > cocoon.session.setAttribute("user", checkUserTest); > success = true; > }else{ > username.setValidationError(new > Packages.org.apache.cocoon.forms.validation.ValidationError(e, false)); > password.setValidationError(new > Packages.org.apache.cocoon.forms.validation.ValidationError("The password, > username combination does not exist. Please enter another one.", false)); > success = false; > } > } catch (e) { > username.setValidationError(new > Packages.org.apache.cocoon.forms.validation.ValidationError(e, false)); > password.setValidationError(new > Packages.org.apache.cocoon.forms.validation.ValidationError("e.", false)); > success = false; > } > return success; > </fd:javascript> > </fd:validation> > I am getting an error message when the line > 'cocoon.session.setAttribute("user", checkUserTest)' is hit.: > ReferenceError: "cocoon" is not defined > What is the issue here, can I create a session object from within form > validation/javascript in another way? > Andrew -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
