You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by am...@yahoo.com on 2005/12/08 19:34:38 UTC
Template parse error
Hi,
I need to check that at least one check box is checked in a form, since this
was reusable I simply put it in the .html page.
The script:
<script>
function onInvestigationStateSubmit(button) {
var valid = false;
var form = button.form;
var select = form.stateSelect;
var option = select.options[select.selectedIndex];
if(option.value == 8 || option.value == 12) {
var inputs = fraudServiceDiv.getElementsByTagName("INPUT");
for(var i = 0; i < inputs.length; i++) {
if(inputs[i].type == 'checkbox' && inputs[i].checked) {
valid = true;
break;
}
}
} else {
valid = true; // Line 86
}
return valid;
}
</script>
The error:
Tag <> on line 86 contains more than one 'valid' attribute.
location: context:/WEB-INF/investigation/InvestigationDetail.html, line 86
81 valid = true;
82 break;
83 }
84 }
85 } else {
86 valid = true;
87 }
88
89 return valid;
90 }
91
Stack Trace:
org.apache.tapestry.parse.TemplateParser.templateParseProblem(TemplateParser.java:391)
org.apache.tapestry.parse.TemplateParser.addAttributeIfUnique(TemplateParser.java:889)
org.apache.tapestry.parse.TemplateParser.startTag(TemplateParser.java:783)
org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:494)
org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:326)
$ITemplateParser_1080ba0d7fa.parse($ITemplateParser_1080ba0d7fa.java)
$ITemplateParser_1080ba0d7fb.parse($ITemplateParser_1080ba0d7fb.java)
org.apache.tapestry.services.impl.TemplateSourceImpl.constructTemplateInstance(TemplateSourceImpl.java:339)
I am not sure what this error means.
Thanks,
Amir
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Template parse error
Posted by am...@yahoo.com.
Yes, I am using the the html script tag and not using .script file. I have other scripts that are placed .script files, but since this was not generic I decided to put it directly in to the html file.
I will move it to the .script file.
Thanks for the reply!
-Amir
Geoff Longman <gl...@gmail.com> wrote: I think Amir is adding an html tag to the template and not
using a tapestry .script file.
The template parser doesn't handle inline javascript very well and I
don't think it ever will.
The solution would be to create .script file and place it in the
classpath (at least in Tap 3 it has to be in the classpath).
a minimal .script file...
"-//Apache Software Foundation//Tapestry Script Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd">
function onInvestigationStateSubmit
....
]]>
and then use a Script component to insert the .script file..
recall that the path is a path in the classpath.
Geoff
On 12/9/05, Richard Kirby wrote:
> Hi,
>
> The script file is an XML file. Therefore you need to escape any special
> XML characters (ie & and <) with their entities, or better still, mark
> the whole section as cdata. If you look carefully, you have a < in the
> middle of your javascript, which any XML parser will assume marks the
> start of a tag.
>
> Try:
>
>
> > function onInvestigationStateSubmit
> ....
>
> ]]>
>
>
> Richard
>
> amirsguard-tapestry@yahoo.com wrote:
>
> >Hi,
> >
> >I need to check that at least one check box is checked in a form, since this
> >was reusable I simply put it in the .html page.
> >
> >The script:
> >
> >
> >function onInvestigationStateSubmit(button) {
> >
> > var valid = false;
> >
> > var form = button.form;
> > var select = form.stateSelect;
> > var option = select.options[select.selectedIndex];
> >
> > if(option.value == 8 || option.value == 12) {
> >
> > var inputs = fraudServiceDiv.getElementsByTagName("INPUT");
> > for(var i = 0; i [input] > > if(inputs[i].type == 'checkbox' & inputs[i].checked) {
> > valid = true;
> > break;
> > }
> > }
> > } else {
> > valid = true; // Line 86
> > }
> >
> > return valid;
> >}
> >
> >
> >
> >The error:
> >
> >Tag <> on line 86 contains more than one 'valid' attribute.
> >location: context:/WEB-INF/investigation/InvestigationDetail.html, line 86
> >81 valid = true;
> >82 break;
> >83 }
> >84 }
> >85 } else {
> >86 valid = true;
> >87 }
> >88
> >89 return valid;
> >90 }
> >91
> >
> >Stack Trace:
> >org.apache.tapestry.parse.TemplateParser.templateParseProblem(TemplateParser.java:391)
> >
> >org.apache.tapestry.parse.TemplateParser.addAttributeIfUnique(TemplateParser.java:889)
> >
> >org.apache.tapestry.parse.TemplateParser.startTag(TemplateParser.java:783)
> >org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:494)
> >org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:326)
> >$ITemplateParser_1080ba0d7fa.parse($ITemplateParser_1080ba0d7fa.java)
> >$ITemplateParser_1080ba0d7fb.parse($ITemplateParser_1080ba0d7fb.java)
> >org.apache.tapestry.services.impl.TemplateSourceImpl.constructTemplateInstance(TemplateSourceImpl.java:339)
> >
> >
> >I am not sure what this error means.
> >
> >Thanks,
> >Amir
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
The Spindle guy. http://spindle.sf.net
Get help with Spindle:
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates: http://spindle.sf.net/updates
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Template parse error
Posted by Geoff Longman <gl...@gmail.com>.
I think Amir is adding an html <script> tag to the template and not
using a tapestry .script file.
The template parser doesn't handle inline javascript very well and I
don't think it ever will.
The solution would be to create .script file and place it in the
classpath (at least in Tap 3 it has to be in the classpath).
a minimal .script file...
<?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 onInvestigationStateSubmit
....
]]>
</body>
</script>
and then use a Script component to insert the .script file..
<span jwcid="@Script" script="/path/to/my/Script.script">
recall that the path is a path in the classpath.
Geoff
On 12/9/05, Richard Kirby <rb...@capdm.com> wrote:
> Hi,
>
> The script file is an XML file. Therefore you need to escape any special
> XML characters (ie & and <) with their entities, or better still, mark
> the whole section as cdata. If you look carefully, you have a < in the
> middle of your javascript, which any XML parser will assume marks the
> start of a tag.
>
> Try:
>
> <script>
> <![CDATA[
> function onInvestigationStateSubmit
> ....
>
> ]]>
> </script>
>
> Richard
>
> amirsguard-tapestry@yahoo.com wrote:
>
> >Hi,
> >
> >I need to check that at least one check box is checked in a form, since this
> >was reusable I simply put it in the .html page.
> >
> >The script:
> >
> ><script>
> >function onInvestigationStateSubmit(button) {
> >
> > var valid = false;
> >
> > var form = button.form;
> > var select = form.stateSelect;
> > var option = select.options[select.selectedIndex];
> >
> > if(option.value == 8 || option.value == 12) {
> >
> > var inputs = fraudServiceDiv.getElementsByTagName("INPUT");
> > for(var i = 0; i < inputs.length; i++) {
> > if(inputs[i].type == 'checkbox' && inputs[i].checked) {
> > valid = true;
> > break;
> > }
> > }
> > } else {
> > valid = true; // Line 86
> > }
> >
> > return valid;
> >}
> >
> ></script>
> >
> >The error:
> >
> >Tag <> on line 86 contains more than one 'valid' attribute.
> >location: context:/WEB-INF/investigation/InvestigationDetail.html, line 86
> >81 valid = true;
> >82 break;
> >83 }
> >84 }
> >85 } else {
> >86 valid = true;
> >87 }
> >88
> >89 return valid;
> >90 }
> >91
> >
> >Stack Trace:
> >org.apache.tapestry.parse.TemplateParser.templateParseProblem(TemplateParser.java:391)
> >
> >org.apache.tapestry.parse.TemplateParser.addAttributeIfUnique(TemplateParser.java:889)
> >
> >org.apache.tapestry.parse.TemplateParser.startTag(TemplateParser.java:783)
> >org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:494)
> >org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:326)
> >$ITemplateParser_1080ba0d7fa.parse($ITemplateParser_1080ba0d7fa.java)
> >$ITemplateParser_1080ba0d7fb.parse($ITemplateParser_1080ba0d7fb.java)
> >org.apache.tapestry.services.impl.TemplateSourceImpl.constructTemplateInstance(TemplateSourceImpl.java:339)
> >
> >
> >I am not sure what this error means.
> >
> >Thanks,
> >Amir
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
--
The Spindle guy. http://spindle.sf.net
Get help with Spindle:
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates: http://spindle.sf.net/updates
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Template parse error
Posted by Richard Kirby <rb...@capdm.com>.
Hi,
The script file is an XML file. Therefore you need to escape any special
XML characters (ie & and <) with their entities, or better still, mark
the whole section as cdata. If you look carefully, you have a < in the
middle of your javascript, which any XML parser will assume marks the
start of a tag.
Try:
<script>
<![CDATA[
function onInvestigationStateSubmit
....
]]>
</script>
Richard
amirsguard-tapestry@yahoo.com wrote:
>Hi,
>
>I need to check that at least one check box is checked in a form, since this
>was reusable I simply put it in the .html page.
>
>The script:
>
><script>
>function onInvestigationStateSubmit(button) {
>
> var valid = false;
>
> var form = button.form;
> var select = form.stateSelect;
> var option = select.options[select.selectedIndex];
>
> if(option.value == 8 || option.value == 12) {
>
> var inputs = fraudServiceDiv.getElementsByTagName("INPUT");
> for(var i = 0; i < inputs.length; i++) {
> if(inputs[i].type == 'checkbox' && inputs[i].checked) {
> valid = true;
> break;
> }
> }
> } else {
> valid = true; // Line 86
> }
>
> return valid;
>}
>
></script>
>
>The error:
>
>Tag <> on line 86 contains more than one 'valid' attribute.
>location: context:/WEB-INF/investigation/InvestigationDetail.html, line 86
>81 valid = true;
>82 break;
>83 }
>84 }
>85 } else {
>86 valid = true;
>87 }
>88
>89 return valid;
>90 }
>91
>
>Stack Trace:
>org.apache.tapestry.parse.TemplateParser.templateParseProblem(TemplateParser.java:391)
>
>org.apache.tapestry.parse.TemplateParser.addAttributeIfUnique(TemplateParser.java:889)
>
>org.apache.tapestry.parse.TemplateParser.startTag(TemplateParser.java:783)
>org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:494)
>org.apache.tapestry.parse.TemplateParser.parse(TemplateParser.java:326)
>$ITemplateParser_1080ba0d7fa.parse($ITemplateParser_1080ba0d7fa.java)
>$ITemplateParser_1080ba0d7fb.parse($ITemplateParser_1080ba0d7fb.java)
>org.apache.tapestry.services.impl.TemplateSourceImpl.constructTemplateInstance(TemplateSourceImpl.java:339)
>
>
>I am not sure what this error means.
>
>Thanks,
>Amir
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org