You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mark Stang <ms...@pingidentity.com> on 2006/06/20 00:39:28 UTC
RE: Suppressing page response - simply override the output stream manually
I am trying to use the form focus example in the documentation and I get:
An exception has occurred.
You may continue by restarting the session.
org.apache.tapestry.ApplicationRuntimeException
Unable to parse script context:/images/FormFocus.js.
component: org.apache.tapestry.html.Script$Enhance_290@182560c[login/$Script]
location: context:/images/FormFocus.js, line 1, column 1
org.apache.tapestry.ApplicationRuntimeException
Unable to parse script context:/images/FormFocus.js.
location: context:/images/FormFocus.js, line 1, column 1
org.apache.tapestry.util.xml.DocumentParseException
Unable to parse file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp2276pingfederate.war/images/FormFocus.js: Content is not allowed in prolog.
documentLocation: context:/images/FormFocus.js
location: context:/images/FormFocus.js, line 1, column 1
org.xml.sax.SAXParseException
Content is not allowed in prolog.
columnNumber: 1
lineNumber: 1
Stack Trace:
* org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
* org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
* org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
* org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
* org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
* org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
* org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
* org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
* org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
* org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
* org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
* javax.xml.parsers.SAXParser.parse(Unknown Source)
* org.apache.tapestry.util.xml.RuleDirectedParser.parse(RuleDirectedParser.java:173)
* org.apache.tapestry.util.xml.RuleDirectedParser.parse(RuleDirectedParser.java:127)
* org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java:115)
* org.apache.tapestry.engine.DefaultScriptSource.parse(DefaultScriptSource.java:74)
* org.apache.tapestry.engine.DefaultScriptSource.getScript(DefaultScriptSource.java:61)
* org.apache.tapestry.html.Script.getParsedScript(Script.java:121)
* org.apache.tapestry.html.Script.renderComponent(Script.java:145)
* org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
* org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:624)
* org.apache.tapestry.html.Body.renderComponent(Body.java:269)
* org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
* org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:118)
* org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
* org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
* org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:368)
* org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java:749)
* org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(AbstractEngine.java:1045)
* org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:899)
* org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:198)
* org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:159)
* javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
* javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
* org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
* org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
* org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
* org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
* org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
* org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
* org.mortbay.http.HttpServer.service(HttpServer.java:909)
* org.jboss.jetty.Jetty.service(Jetty.java:456)
* org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
* org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
* org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
* org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
* org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
* org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
In my html template, I have:
<span jwcid="@Script" script="/images/FormFocus.js"/>
FormFocus looks like this:
function setFocus() {
if (document.forms[0]) {
for (i = 0; i < document.forms[0].elements.length; i++) {
if (document.forms[0].elements[i].type != "hidden" &&
document.forms[0].elements[i].disabled != true) {
document.forms[0].elements[i].focus();
return;
}
}
}
}
I used the example as written in the 3.x Script Component. However, that didn't work either. So, I started removing things. Any idea why it doesn't like this?
Or an example on how to set the focus?
thanks,
Mark
Re: Using javascript in 3.03 to set the focus.
Posted by Jesse Kuhnert <jk...@gmail.com>.
Try this:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/form/LinkSubmit.script?view=markup
Also try making your file end with .script to see if that helps?
On 6/20/06, Mark Stang <ms...@pingidentity.com> wrote:
>
> I copied this exactly from the Tapestry web site:
>
>
> http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
>
> My script looks like:
> <!-- Sets the focus to the first form element which is not hidden and not
> disabled. -->
> <!-- /com/mycorp/scripts/FormFocus.script -->
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE script PUBLIC
>
> "-//Apache Software Foundation//Tapestry Script Specification 3.0
> //EN"
>
> "http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
>
> <script>
> <body>
> <![CDATA[
> function setFocus() {
> if (document.forms[0]) {
> for (i = 0; i < document.forms[0].elements.length; i++) {
> if (document.forms[0].elements[i].type != "hidden" &&
> document.forms[0].elements[i].disabled != true) {
>
> document.forms[0].elements[i].focus();
> return;
> }
> }
> }
> }
> ]]>
> </body>
> <initialization>
> setFocus();
> </initialization>
> </script>
>
> Has anyone tested this or am I doing something wrong?
>
> You may continue by restarting the session.
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> component: org.apache.tapestry.html.Script$Enhance_21@12faeca
> [login/$Script]
> location: context:/images/FormFocus.js, line 3, column 6
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> location: context:/images/FormFocus.js, line 3, column 6
>
> org.apache.tapestry.util.xml.DocumentParseException
> Unable to parse
> file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp11221pingfederate.war/images/FormFocus.js:
> The processing instruction target matching "[xX][mM][lL]" is not allowed.
> documentLocation: context:/images/FormFocus.js
> location: context:/images/FormFocus.js, line 3, column 6
>
> org.xml.sax.SAXParseException
> The processing instruction target matching "[xX][mM][lL]" is not allowed.
> columnNumber: 6
> lineNumber: 3
> Stack Trace:
>
> * org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> * org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> Source)
> * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
>
>
> Thanks,
>
> Mark
>
> -----Original Message-----
> From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
> Sent: Mon 6/19/2006 4:55 PM
> To: Tapestry users
> Subject: Re: Suppressing page response - simply override the output stream
> manually
>
> I think the script referenced can't just be a regular js file (as that
> would
> imply an @Include sort of component, not a @Script).
>
> You probably need to wrap it in xml elements as defined here
> http://tapestry.apache.org/tapestry4/UsersGuide/script.html.
>
> You can also focus form fields (in 4 at least) by playing with the focus
> parameters of the @Form or individual form components.
>
> On 6/19/06, Mark Stang <ms...@pingidentity.com> wrote:
> >
> > I am trying to use the form focus example in the documentation and I
> get:
> >
> > An exception has occurred.
> >
> > You may continue by restarting the session.
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script context:/images/FormFocus.js.
> > component: org.apache.tapestry.html.Script$Enhance_290@182560c
> > [login/$Script]
> > location: context:/images/FormFocus.js, line 1, column 1
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script context:/images/FormFocus.js.
> > location: context:/images/FormFocus.js, line 1, column 1
> >
> > org.apache.tapestry.util.xml.DocumentParseException
> > Unable to parse
> >
> file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp2276pingfederate.war/images/FormFocus.js:
> > Content is not allowed in prolog.
> > documentLocation: context:/images/FormFocus.js
> > location: context:/images/FormFocus.js, line 1, column 1
> >
> > org.xml.sax.SAXParseException
> > Content is not allowed in prolog.
> > columnNumber: 1
> > lineNumber: 1
> > Stack Trace:
> >
> > * org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException
> (Unknown
> > Source)
> > * org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> > Source)
> > * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> > * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> > * org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> > *
> > org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch
> (Unknown
> > Source)
> > * org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
> (Unknown
> > Source)
> > * org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > * org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > * org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > * org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> > * javax.xml.parsers.SAXParser.parse(Unknown Source)
> > * org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> > RuleDirectedParser.java:173)
> > * org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> > RuleDirectedParser.java:127)
> > * org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java
> :115)
> > * org.apache.tapestry.engine.DefaultScriptSource.parse(
> > DefaultScriptSource.java:74)
> > * org.apache.tapestry.engine.DefaultScriptSource.getScript(
> > DefaultScriptSource.java:61)
> > * org.apache.tapestry.html.Script.getParsedScript(Script.java:121)
> > * org.apache.tapestry.html.Script.renderComponent(Script.java:145)
> > * org.apache.tapestry.AbstractComponent.render(
> AbstractComponent.java
> > :857)
> > * org.apache.tapestry.AbstractComponent.renderBody(
> > AbstractComponent.java:624)
> > * org.apache.tapestry.html.Body.renderComponent(Body.java:269)
> > * org.apache.tapestry.AbstractComponent.render(
> AbstractComponent.java
> > :857)
> > * org.apache.tapestry.BaseComponent.renderComponent(
> BaseComponent.java
> > :118)
> > * org.apache.tapestry.AbstractComponent.render(
> AbstractComponent.java
> > :857)
> > * org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
> > * org.apache.tapestry.engine.RequestCycle.renderPage(
> RequestCycle.java
> > :368)
> > * org.apache.tapestry.engine.AbstractEngine.renderResponse(
> > AbstractEngine.java:749)
> > *
> > org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(
> > AbstractEngine.java:1045)
> > * org.apache.tapestry.engine.AbstractEngine.service(
> > AbstractEngine.java:899)
> > * org.apache.tapestry.ApplicationServlet.doService(
> > ApplicationServlet.java:198)
> > * org.apache.tapestry.ApplicationServlet.doGet(
> ApplicationServlet.java
> > :159)
> > * javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
> > * javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> > * org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java
> > :428)
> > * org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(
> > WebApplicationHandler.java:473)
> > * org.mortbay.jetty.servlet.ServletHandler.handle(
> ServletHandler.java
> > :568)
> > * org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
> > * org.mortbay.jetty.servlet.WebApplicationContext.handle(
> > WebApplicationContext.java:633)
> > * org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
> > * org.mortbay.http.HttpServer.service(HttpServer.java:909)
> > * org.jboss.jetty.Jetty.service(Jetty.java:456)
> > * org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
> > * org.mortbay.http.HttpConnection.handleNext(HttpConnection.java
> :982)
> > * org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
> > * org.mortbay.http.SocketListener.handleConnection(
> SocketListener.java
> > :244)
> > * org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> > * org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> >
> >
> > In my html template, I have:
> >
> > <span jwcid="@Script" script="/images/FormFocus.js"/>
> >
> > FormFocus looks like this:
> >
> > function setFocus() {
> > if (document.forms[0]) {
> > for (i = 0; i < document.forms[0].elements.length; i++) {
> > if (document.forms[0].elements[i].type != "hidden" &&
> > document.forms[0].elements[i].disabled != true) {
> >
> > document.forms[0].elements[i].focus();
> > return;
> > }
> > }
> > }
> > }
> >
> > I used the example as written in the 3.x Script Component. However,
> that
> > didn't work either. So, I started removing things. Any idea why it
> doesn't
> > like this?
> >
> > Or an example on how to set the focus?
> >
> > thanks,
> >
> > Mark
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Jesse Kuhnert
> Tacos/Tapestry, team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind.
>
>
>
--
Jesse Kuhnert
Tacos/Tapestry, team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.
RE: Using javascript in 3.03 to set the focus.
Posted by Mark Stang <ms...@pingidentity.com>.
Thanks everyone for your help, it was just those bloody comments before the PI.
Arrrgghhh.
-----Original Message-----
From: Shing Hing Man [mailto:matmsh@yahoo.com]
Sent: Tue 6/20/2006 11:39 AM
To: Tapestry users
Subject: RE: Using javascript in 3.03 to set the focus.
I have not tried not the example at
http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
But I think your error is caused by
hava an comment before
<?xml version="1.0" encoding="UTF-8"?>
in FormFocus.script.
You could try deleting the comment before it and see
what happens.
Shing
--- Mark Stang <ms...@pingidentity.com> wrote:
> I copied this exactly from the Tapestry web site:
>
>
http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
>
> My script looks like:
> <!-- Sets the focus to the first form element which
> is not hidden and not disabled. -->
> <!-- /com/mycorp/scripts/FormFocus.script -->
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE script PUBLIC
>
> "-//Apache Software Foundation//Tapestry Script
> Specification 3.0//EN"
>
>
>
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
>
> <script>
> <body>
> <![CDATA[
> function setFocus() {
> if (document.forms[0]) {
> for (i = 0; i <
> document.forms[0].elements.length; i++) {
> if (document.forms[0].elements[i].type
> != "hidden" &&
>
> document.forms[0].elements[i].disabled != true) {
>
>
> document.forms[0].elements[i].focus();
> return;
> }
> }
> }
> }
> ]]>
> </body>
> <initialization>
> setFocus();
> </initialization>
> </script>
>
> Has anyone tested this or am I doing something
> wrong?
>
> You may continue by restarting the session.
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> component:
>
org.apache.tapestry.html.Script$Enhance_21@12faeca[login/$Script]
> location: context:/images/FormFocus.js, line 3,
> column 6
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> location: context:/images/FormFocus.js, line 3,
> column 6
>
> org.apache.tapestry.util.xml.DocumentParseException
> Unable to parse
>
file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp11221pingfederate.war/images/FormFocus.js:
> The processing instruction target matching
> "[xX][mM][lL]" is not allowed.
> documentLocation: context:/images/FormFocus.js
> location: context:/images/FormFocus.js, line 3,
> column 6
>
> org.xml.sax.SAXParseException
> The processing instruction target matching
> "[xX][mM][lL]" is not allowed.
> columnNumber: 6
> lineNumber: 3
> Stack Trace:
>
> *
>
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> *
>
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> Source)
> *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>
>
> Thanks,
>
> Mark
>
> -----Original Message-----
> From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
> Sent: Mon 6/19/2006 4:55 PM
> To: Tapestry users
> Subject: Re: Suppressing page response - simply
> override the output stream manually
>
> I think the script referenced can't just be a
> regular js file (as that would
> imply an @Include sort of component, not a @Script).
>
> You probably need to wrap it in xml elements as
> defined here
>
http://tapestry.apache.org/tapestry4/UsersGuide/script.html.
>
> You can also focus form fields (in 4 at least) by
> playing with the focus
> parameters of the @Form or individual form
> components.
>
> On 6/19/06, Mark Stang <ms...@pingidentity.com>
> wrote:
> >
> > I am trying to use the form focus example in the
> documentation and I get:
> >
> > An exception has occurred.
> >
> > You may continue by restarting the session.
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script
> context:/images/FormFocus.js.
> > component:
> org.apache.tapestry.html.Script$Enhance_290@182560c
> > [login/$Script]
> > location: context:/images/FormFocus.js, line
> 1, column 1
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script
> context:/images/FormFocus.js.
> > location: context:/images/FormFocus.js, line
> 1, column 1
> >
> >
> org.apache.tapestry.util.xml.DocumentParseException
> > Unable to parse
> >
>
file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp2276pingfederate.war/images/FormFocus.js:
> > Content is not allowed in prolog.
> > documentLocation:
> context:/images/FormFocus.js
> > location: context:/images/FormFocus.js, line
> 1, column 1
> >
> > org.xml.sax.SAXParseException
> > Content is not allowed in prolog.
> > columnNumber: 1
> > lineNumber: 1
> > Stack Trace:
> >
> > *
>
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> > Source)
> > *
>
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> > Source)
> > *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> > *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> > *
>
org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown
> Source)
> > *
> >
>
org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
> > Source)
> > *
>
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > Source)
> > *
>
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> > *
>
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> > *
> org.apache.xerces.parsers.XMLParser.parse(Unknown
> Source)
> > *
>
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> > * javax.xml.parsers.SAXParser.parse(Unknown
> Source)
> > *
>
org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> > RuleDirectedParser.java:173)
> > *
>
org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> > RuleDirectedParser.java:127)
> > *
>
org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java:115)
> > *
>
org.apache.tapestry.engine.DefaultScriptSource.parse(
>
=== message truncated ===
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Using javascript in 3.03 to set the focus.
Posted by Shing Hing Man <ma...@yahoo.com>.
Also, there should be no blank line before
<?xml version="1.0" encoding="UTF-8"?>
Shing
--- Shing Hing Man <ma...@yahoo.com> wrote:
> I have not tried not the example at
>
http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
>
>
> But I think your error is caused by
> hava an comment before
> <?xml version="1.0" encoding="UTF-8"?>
>
> in FormFocus.script.
>
> You could try deleting the comment before it and see
> what happens.
>
> Shing
>
>
> --- Mark Stang <ms...@pingidentity.com> wrote:
>
> > I copied this exactly from the Tapestry web site:
> >
> >
>
http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
> >
> > My script looks like:
> > <!-- Sets the focus to the first form element
> which
> > is not hidden and not disabled. -->
> > <!-- /com/mycorp/scripts/FormFocus.script -->
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE script PUBLIC
> >
> > "-//Apache Software Foundation//Tapestry Script
> > Specification 3.0//EN"
> >
> >
> >
>
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
> >
> > <script>
> > <body>
> > <![CDATA[
> > function setFocus() {
> > if (document.forms[0]) {
> > for (i = 0; i <
> > document.forms[0].elements.length; i++) {
> > if (document.forms[0].elements[i].type
> > != "hidden" &&
> >
> > document.forms[0].elements[i].disabled != true) {
> >
> >
> > document.forms[0].elements[i].focus();
> > return;
> > }
> > }
> > }
> > }
> > ]]>
> > </body>
> > <initialization>
> > setFocus();
> > </initialization>
> > </script>
> >
> > Has anyone tested this or am I doing something
> > wrong?
> >
> > You may continue by restarting the session.
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script
> context:/images/FormFocus.js.
> > component:
> >
>
org.apache.tapestry.html.Script$Enhance_21@12faeca[login/$Script]
> > location: context:/images/FormFocus.js, line 3,
> > column 6
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script
> context:/images/FormFocus.js.
> > location: context:/images/FormFocus.js, line 3,
> > column 6
> >
> >
> org.apache.tapestry.util.xml.DocumentParseException
> > Unable to parse
> >
>
file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp11221pingfederate.war/images/FormFocus.js:
> > The processing instruction target matching
> > "[xX][mM][lL]" is not allowed.
> > documentLocation: context:/images/FormFocus.js
> > location: context:/images/FormFocus.js, line 3,
> > column 6
> >
> > org.xml.sax.SAXParseException
> > The processing instruction target matching
> > "[xX][mM][lL]" is not allowed.
> > columnNumber: 6
> > lineNumber: 3
> > Stack Trace:
> >
> > *
> >
>
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> > Source)
> > *
> >
>
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> > Source)
> > *
> >
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > *
> >
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> >
> >
> > Thanks,
> >
> > Mark
> >
> > -----Original Message-----
> > From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
> > Sent: Mon 6/19/2006 4:55 PM
> > To: Tapestry users
> > Subject: Re: Suppressing page response - simply
> > override the output stream manually
> >
> > I think the script referenced can't just be a
> > regular js file (as that would
> > imply an @Include sort of component, not a
> @Script).
> >
> > You probably need to wrap it in xml elements as
> > defined here
> >
>
http://tapestry.apache.org/tapestry4/UsersGuide/script.html.
> >
> > You can also focus form fields (in 4 at least) by
> > playing with the focus
> > parameters of the @Form or individual form
> > components.
> >
> > On 6/19/06, Mark Stang <ms...@pingidentity.com>
> > wrote:
> > >
> > > I am trying to use the form focus example in the
> > documentation and I get:
> > >
> > > An exception has occurred.
> > >
> > > You may continue by restarting the session.
> > >
> > > org.apache.tapestry.ApplicationRuntimeException
> > > Unable to parse script
> > context:/images/FormFocus.js.
> > > component:
> >
> org.apache.tapestry.html.Script$Enhance_290@182560c
> > > [login/$Script]
> > > location: context:/images/FormFocus.js,
> line
> > 1, column 1
> > >
> > > org.apache.tapestry.ApplicationRuntimeException
> > > Unable to parse script
> > context:/images/FormFocus.js.
> > > location: context:/images/FormFocus.js,
> line
> > 1, column 1
> > >
> > >
> >
> org.apache.tapestry.util.xml.DocumentParseException
> > > Unable to parse
> > >
> >
>
file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp2276pingfederate.war/images/FormFocus.js:
> > > Content is not allowed in prolog.
> > > documentLocation:
> > context:/images/FormFocus.js
> > > location: context:/images/FormFocus.js,
> line
> > 1, column 1
> > >
> > > org.xml.sax.SAXParseException
> > > Content is not allowed in prolog.
> > > columnNumber: 1
> > > lineNumber: 1
> > > Stack Trace:
> > >
> > > *
> >
>
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> > > Source)
> > > *
> >
>
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
>
=== message truncated ===
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine
http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Using javascript in 3.03 to set the focus.
Posted by Shing Hing Man <ma...@yahoo.com>.
I have not tried not the example at
http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
But I think your error is caused by
hava an comment before
<?xml version="1.0" encoding="UTF-8"?>
in FormFocus.script.
You could try deleting the comment before it and see
what happens.
Shing
--- Mark Stang <ms...@pingidentity.com> wrote:
> I copied this exactly from the Tapestry web site:
>
>
http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
>
> My script looks like:
> <!-- Sets the focus to the first form element which
> is not hidden and not disabled. -->
> <!-- /com/mycorp/scripts/FormFocus.script -->
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE script PUBLIC
>
> "-//Apache Software Foundation//Tapestry Script
> Specification 3.0//EN"
>
>
>
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
>
> <script>
> <body>
> <![CDATA[
> function setFocus() {
> if (document.forms[0]) {
> for (i = 0; i <
> document.forms[0].elements.length; i++) {
> if (document.forms[0].elements[i].type
> != "hidden" &&
>
> document.forms[0].elements[i].disabled != true) {
>
>
> document.forms[0].elements[i].focus();
> return;
> }
> }
> }
> }
> ]]>
> </body>
> <initialization>
> setFocus();
> </initialization>
> </script>
>
> Has anyone tested this or am I doing something
> wrong?
>
> You may continue by restarting the session.
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> component:
>
org.apache.tapestry.html.Script$Enhance_21@12faeca[login/$Script]
> location: context:/images/FormFocus.js, line 3,
> column 6
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> location: context:/images/FormFocus.js, line 3,
> column 6
>
> org.apache.tapestry.util.xml.DocumentParseException
> Unable to parse
>
file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp11221pingfederate.war/images/FormFocus.js:
> The processing instruction target matching
> "[xX][mM][lL]" is not allowed.
> documentLocation: context:/images/FormFocus.js
> location: context:/images/FormFocus.js, line 3,
> column 6
>
> org.xml.sax.SAXParseException
> The processing instruction target matching
> "[xX][mM][lL]" is not allowed.
> columnNumber: 6
> lineNumber: 3
> Stack Trace:
>
> *
>
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> *
>
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> Source)
> *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>
>
> Thanks,
>
> Mark
>
> -----Original Message-----
> From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
> Sent: Mon 6/19/2006 4:55 PM
> To: Tapestry users
> Subject: Re: Suppressing page response - simply
> override the output stream manually
>
> I think the script referenced can't just be a
> regular js file (as that would
> imply an @Include sort of component, not a @Script).
>
> You probably need to wrap it in xml elements as
> defined here
>
http://tapestry.apache.org/tapestry4/UsersGuide/script.html.
>
> You can also focus form fields (in 4 at least) by
> playing with the focus
> parameters of the @Form or individual form
> components.
>
> On 6/19/06, Mark Stang <ms...@pingidentity.com>
> wrote:
> >
> > I am trying to use the form focus example in the
> documentation and I get:
> >
> > An exception has occurred.
> >
> > You may continue by restarting the session.
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script
> context:/images/FormFocus.js.
> > component:
> org.apache.tapestry.html.Script$Enhance_290@182560c
> > [login/$Script]
> > location: context:/images/FormFocus.js, line
> 1, column 1
> >
> > org.apache.tapestry.ApplicationRuntimeException
> > Unable to parse script
> context:/images/FormFocus.js.
> > location: context:/images/FormFocus.js, line
> 1, column 1
> >
> >
> org.apache.tapestry.util.xml.DocumentParseException
> > Unable to parse
> >
>
file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp2276pingfederate.war/images/FormFocus.js:
> > Content is not allowed in prolog.
> > documentLocation:
> context:/images/FormFocus.js
> > location: context:/images/FormFocus.js, line
> 1, column 1
> >
> > org.xml.sax.SAXParseException
> > Content is not allowed in prolog.
> > columnNumber: 1
> > lineNumber: 1
> > Stack Trace:
> >
> > *
>
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> > Source)
> > *
>
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> > Source)
> > *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> > *
>
org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> > *
>
org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown
> Source)
> > *
> >
>
org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
> > Source)
> > *
>
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > Source)
> > *
>
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> > *
>
org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> > *
> org.apache.xerces.parsers.XMLParser.parse(Unknown
> Source)
> > *
>
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> > * javax.xml.parsers.SAXParser.parse(Unknown
> Source)
> > *
>
org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> > RuleDirectedParser.java:173)
> > *
>
org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> > RuleDirectedParser.java:127)
> > *
>
org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java:115)
> > *
>
org.apache.tapestry.engine.DefaultScriptSource.parse(
>
=== message truncated ===
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
RE: Using javascript in 3.03 to set the focus.
Posted by Mark Stang <ms...@pingidentity.com>.
I copied this exactly from the Tapestry web site:
http://jakarta.apache.org/tapestry/3.0.4/doc/ComponentReference/Script.html
My script looks like:
<!-- Sets the focus to the first form element which is not hidden and not disabled. -->
<!-- /com/mycorp/scripts/FormFocus.script -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script PUBLIC
"-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
<script>
<body>
<![CDATA[
function setFocus() {
if (document.forms[0]) {
for (i = 0; i < document.forms[0].elements.length; i++) {
if (document.forms[0].elements[i].type != "hidden" &&
document.forms[0].elements[i].disabled != true) {
document.forms[0].elements[i].focus();
return;
}
}
}
}
]]>
</body>
<initialization>
setFocus();
</initialization>
</script>
Has anyone tested this or am I doing something wrong?
You may continue by restarting the session.
org.apache.tapestry.ApplicationRuntimeException
Unable to parse script context:/images/FormFocus.js.
component: org.apache.tapestry.html.Script$Enhance_21@12faeca[login/$Script]
location: context:/images/FormFocus.js, line 3, column 6
org.apache.tapestry.ApplicationRuntimeException
Unable to parse script context:/images/FormFocus.js.
location: context:/images/FormFocus.js, line 3, column 6
org.apache.tapestry.util.xml.DocumentParseException
Unable to parse file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp11221pingfederate.war/images/FormFocus.js: The processing instruction target matching "[xX][mM][lL]" is not allowed.
documentLocation: context:/images/FormFocus.js
location: context:/images/FormFocus.js, line 3, column 6
org.xml.sax.SAXParseException
The processing instruction target matching "[xX][mM][lL]" is not allowed.
columnNumber: 6
lineNumber: 3
Stack Trace:
* org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
* org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
* org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
* org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
Thanks,
Mark
-----Original Message-----
From: Jesse Kuhnert [mailto:jkuhnert@gmail.com]
Sent: Mon 6/19/2006 4:55 PM
To: Tapestry users
Subject: Re: Suppressing page response - simply override the output stream manually
I think the script referenced can't just be a regular js file (as that would
imply an @Include sort of component, not a @Script).
You probably need to wrap it in xml elements as defined here
http://tapestry.apache.org/tapestry4/UsersGuide/script.html.
You can also focus form fields (in 4 at least) by playing with the focus
parameters of the @Form or individual form components.
On 6/19/06, Mark Stang <ms...@pingidentity.com> wrote:
>
> I am trying to use the form focus example in the documentation and I get:
>
> An exception has occurred.
>
> You may continue by restarting the session.
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> component: org.apache.tapestry.html.Script$Enhance_290@182560c
> [login/$Script]
> location: context:/images/FormFocus.js, line 1, column 1
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> location: context:/images/FormFocus.js, line 1, column 1
>
> org.apache.tapestry.util.xml.DocumentParseException
> Unable to parse
> file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp2276pingfederate.war/images/FormFocus.js:
> Content is not allowed in prolog.
> documentLocation: context:/images/FormFocus.js
> location: context:/images/FormFocus.js, line 1, column 1
>
> org.xml.sax.SAXParseException
> Content is not allowed in prolog.
> columnNumber: 1
> lineNumber: 1
> Stack Trace:
>
> * org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> * org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> Source)
> * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> * org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> *
> org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
> Source)
> * org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> * org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> * org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> * org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> * org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> * javax.xml.parsers.SAXParser.parse(Unknown Source)
> * org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> RuleDirectedParser.java:173)
> * org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> RuleDirectedParser.java:127)
> * org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java:115)
> * org.apache.tapestry.engine.DefaultScriptSource.parse(
> DefaultScriptSource.java:74)
> * org.apache.tapestry.engine.DefaultScriptSource.getScript(
> DefaultScriptSource.java:61)
> * org.apache.tapestry.html.Script.getParsedScript(Script.java:121)
> * org.apache.tapestry.html.Script.renderComponent(Script.java:145)
> * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :857)
> * org.apache.tapestry.AbstractComponent.renderBody(
> AbstractComponent.java:624)
> * org.apache.tapestry.html.Body.renderComponent(Body.java:269)
> * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :857)
> * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java
> :118)
> * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :857)
> * org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
> * org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java
> :368)
> * org.apache.tapestry.engine.AbstractEngine.renderResponse(
> AbstractEngine.java:749)
> *
> org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(
> AbstractEngine.java:1045)
> * org.apache.tapestry.engine.AbstractEngine.service(
> AbstractEngine.java:899)
> * org.apache.tapestry.ApplicationServlet.doService(
> ApplicationServlet.java:198)
> * org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java
> :159)
> * javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
> * javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> * org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java
> :428)
> * org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(
> WebApplicationHandler.java:473)
> * org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java
> :568)
> * org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
> * org.mortbay.jetty.servlet.WebApplicationContext.handle(
> WebApplicationContext.java:633)
> * org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
> * org.mortbay.http.HttpServer.service(HttpServer.java:909)
> * org.jboss.jetty.Jetty.service(Jetty.java:456)
> * org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
> * org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
> * org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
> * org.mortbay.http.SocketListener.handleConnection(SocketListener.java
> :244)
> * org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> * org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
>
>
> In my html template, I have:
>
> <span jwcid="@Script" script="/images/FormFocus.js"/>
>
> FormFocus looks like this:
>
> function setFocus() {
> if (document.forms[0]) {
> for (i = 0; i < document.forms[0].elements.length; i++) {
> if (document.forms[0].elements[i].type != "hidden" &&
> document.forms[0].elements[i].disabled != true) {
>
> document.forms[0].elements[i].focus();
> return;
> }
> }
> }
> }
>
> I used the example as written in the 3.x Script Component. However, that
> didn't work either. So, I started removing things. Any idea why it doesn't
> like this?
>
> Or an example on how to set the focus?
>
> thanks,
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tacos/Tapestry, team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.
Re: Suppressing page response - simply override the output stream manually
Posted by Jesse Kuhnert <jk...@gmail.com>.
I think the script referenced can't just be a regular js file (as that would
imply an @Include sort of component, not a @Script).
You probably need to wrap it in xml elements as defined here
http://tapestry.apache.org/tapestry4/UsersGuide/script.html.
You can also focus form fields (in 4 at least) by playing with the focus
parameters of the @Form or individual form components.
On 6/19/06, Mark Stang <ms...@pingidentity.com> wrote:
>
> I am trying to use the form focus example in the documentation and I get:
>
> An exception has occurred.
>
> You may continue by restarting the session.
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> component: org.apache.tapestry.html.Script$Enhance_290@182560c
> [login/$Script]
> location: context:/images/FormFocus.js, line 1, column 1
>
> org.apache.tapestry.ApplicationRuntimeException
> Unable to parse script context:/images/FormFocus.js.
> location: context:/images/FormFocus.js, line 1, column 1
>
> org.apache.tapestry.util.xml.DocumentParseException
> Unable to parse
> file:/home/mstang/projects/ping/devel/pingfederate/server/default/tmp/deploy/tmp2276pingfederate.war/images/FormFocus.js:
> Content is not allowed in prolog.
> documentLocation: context:/images/FormFocus.js
> location: context:/images/FormFocus.js, line 1, column 1
>
> org.xml.sax.SAXParseException
> Content is not allowed in prolog.
> columnNumber: 1
> lineNumber: 1
> Stack Trace:
>
> * org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
> * org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> Source)
> * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> * org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> * org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> *
> org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown
> Source)
> * org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> * org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> * org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> * org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> * org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> * javax.xml.parsers.SAXParser.parse(Unknown Source)
> * org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> RuleDirectedParser.java:173)
> * org.apache.tapestry.util.xml.RuleDirectedParser.parse(
> RuleDirectedParser.java:127)
> * org.apache.tapestry.script.ScriptParser.parse(ScriptParser.java:115)
> * org.apache.tapestry.engine.DefaultScriptSource.parse(
> DefaultScriptSource.java:74)
> * org.apache.tapestry.engine.DefaultScriptSource.getScript(
> DefaultScriptSource.java:61)
> * org.apache.tapestry.html.Script.getParsedScript(Script.java:121)
> * org.apache.tapestry.html.Script.renderComponent(Script.java:145)
> * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :857)
> * org.apache.tapestry.AbstractComponent.renderBody(
> AbstractComponent.java:624)
> * org.apache.tapestry.html.Body.renderComponent(Body.java:269)
> * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :857)
> * org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java
> :118)
> * org.apache.tapestry.AbstractComponent.render(AbstractComponent.java
> :857)
> * org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
> * org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java
> :368)
> * org.apache.tapestry.engine.AbstractEngine.renderResponse(
> AbstractEngine.java:749)
> *
> org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(
> AbstractEngine.java:1045)
> * org.apache.tapestry.engine.AbstractEngine.service(
> AbstractEngine.java:899)
> * org.apache.tapestry.ApplicationServlet.doService(
> ApplicationServlet.java:198)
> * org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java
> :159)
> * javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
> * javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> * org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java
> :428)
> * org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(
> WebApplicationHandler.java:473)
> * org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java
> :568)
> * org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
> * org.mortbay.jetty.servlet.WebApplicationContext.handle(
> WebApplicationContext.java:633)
> * org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
> * org.mortbay.http.HttpServer.service(HttpServer.java:909)
> * org.jboss.jetty.Jetty.service(Jetty.java:456)
> * org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
> * org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
> * org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
> * org.mortbay.http.SocketListener.handleConnection(SocketListener.java
> :244)
> * org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> * org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
>
>
> In my html template, I have:
>
> <span jwcid="@Script" script="/images/FormFocus.js"/>
>
> FormFocus looks like this:
>
> function setFocus() {
> if (document.forms[0]) {
> for (i = 0; i < document.forms[0].elements.length; i++) {
> if (document.forms[0].elements[i].type != "hidden" &&
> document.forms[0].elements[i].disabled != true) {
>
> document.forms[0].elements[i].focus();
> return;
> }
> }
> }
> }
>
> I used the example as written in the 3.x Script Component. However, that
> didn't work either. So, I started removing things. Any idea why it doesn't
> like this?
>
> Or an example on how to set the focus?
>
> thanks,
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Jesse Kuhnert
Tacos/Tapestry, team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.