Hi All,
1-2 days ago, I've send an email (see below) concerning a problem that I
have with a really simple repeater. I try to add 1 or more keywords to a
Specification class using an "addKeyword(String keyword)" method. Each
keyword is a String. I was hoping that some of you could have a look at
this and explain to me what is wrong. It should be something really
trivial but I don't get it.
Possibly the error ("Cannot set property: /keywords[1]/keyword - no such
property") has to do with <fb:on-bind>? If so, to what is the path
'keyword' then referring? If this is referring to a "setKeyword(String
keyword)" method on the Specification class, that I do not understand
what the purpose of that would be. The idea would be to add all keywords
with the addKeyword method, right? What do I miss?
Thanks,
Andre
Andre Juffer wrote:
Hi,
I have a problem with a very simple repeater in
cocoon-2.1.9/tomcat-5.5.16/java-1.6.
This is the binding that I use:
<fb:repeater id="keywords" parent-path="." row-path="keywords">
<fb:on-bind>
<fb:value id="keyword" path="keyword" />
</fb:on-bind>
<fb:on-delete-row>
<fb:delete-node />
</fb:on-delete-row>
<fb:on-insert-row>
<fb:insert-bean classname="java.lang.String"
addmethod="addKeyword" />
</fb:on-insert-row>
</fb:repeater>
The class for which the binding is, contains, among other,
public class Specification {
...
public void addCategory(String category)
{
this.categories.add(category);
}
}
There is no setCategory(String category) method.
Below is the relevant portion of the definition:
<fd:repeater id="keywords" initial-size = "1">
<fd:widgets>
<fd:field id="keyword" required="true">
<fd:label>Keyword</fd:label>
<fd:datatype base="string" />
</fd:field>
...
</fd:widgets>
</fd:repeater>
The flow contains, among other,
var spec = new Specification();
...
form.save(spec);
..
The error message that I get when form.save(spec) is executed is:
org.apache.commons.jxpath.JXPathException: Cannot set property:
/keywords[1]/keyword - no such property
What exactly is the meaning of the error? Should there be a
setCategory() method on the Specification class? That would not make
sense to me. What is missing/wrong?
Thanks,
--
Andre H. Juffer | Email: [EMAIL PROTECTED]
The Biocenter and | WWW: www.biochem.oulu.fi/Biocomputing/
the Dep. of Biochemistry | Fax: +358-8-553-1141
University of Oulu, Finland | Phone: +358-8-553 1161
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]