You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Мария Григорьева <ma...@gmail.com> on 2008/08/25 11:28:10 UTC
using fd:on-value-changed ???
Hello!!! I'm trying to update form data, using on-value-changed:
<fd:field id="density" required="true">
<fd:label>Плотность</fd:label>
<fd:datatype base="decimal"/>
<fd:on-value-changed>
<javascript>
var value = this.value;
var test =
cocoon.parameters["comp_id"];
var sql = "update
compositions set density = " + value + " where id = " + test;
dao.dbi.execute(sql);
</javascript>
</fd:on-value-changed>
</fd:field>
But as output I've got the exception:
java.sql.SQLException: ORA-00904: "UNDEFINED": invalid identifier
What's the problem ?
RE: using fd:on-value-changed ???
Posted by Jasha Joachimsthal <j....@onehippo.com>.
________________________________
From: Мария Григорьева [mailto:magsend@gmail.com]
Sent: maandag 25 augustus 2008 11:28
To: users@cocoon.apache.org
Subject: using fd:on-value-changed ???
Hello!!! I'm trying to update form data, using on-value-changed:
<fd:field id="density" required="true">
<fd:label>Плотность</fd:label>
<fd:datatype base="decimal"/>
<fd:on-value-changed>
<javascript>
var value = this.value;
var test = cocoon.parameters["comp_id"];
var sql = "update compositions set density = " + value + " where id = " + test;
dao.dbi.execute(sql);
</javascript>
</fd:on-value-changed>
</fd:field>
But as output I've got the exception:
java.sql.SQLException: ORA-00904: "UNDEFINED": invalid identifier
What's the problem ?
[Jasha Joachimsthal]
value is probably undefined. what do you see when you try to print its value in the console. print('Value '+value);
Jasha Joachimsthal
www.onehippo.com <http://www.onehippo.com/>
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-3329 +1 (707) 773-4646
RE: using fd:on-value-changed ???
Posted by Мария Григорьева <ma...@gmail.com>.
Sorry, I wrote a wrong procedure:
Here:
function edit_phisical_parameters() {
var id = cocoon.parameters.id;
var form = new Form("forms/components.xml");
var formMap = form.asMap();
var experiment = dao.experiments.get(id);
var composit = dao.composition.get(experiment.get("id_compositions"));
var composition_id = experiment.get("id_compositions");
cocoon.parameters.comp_id = composition_id;
var comp_in_composition = dao.component_in_composition.get(experiment.get("id_compositions"));
formMap.put("density", composit.get("density"));
form.showForm("viewform-component-template.html");
if (form.isValid) {
var sql = "update compositions set density = " + formMap.get("density") + " where id = " + experiment.get("id_compositions");
dao.dbi.execute(sql);
}
var url = "" + id + "/do_list_compositions";
cocoon.redirectTo("phisical_parameters", true);
}
-----Original Message-----
From: Jeroen Reijn [mailto:j.reijn@onehippo.com]
Sent: Monday, August 25, 2008 1:40 PM
To: users@cocoon.apache.org
Subject: Re: using fd:on-value-changed ???
Hi,
See http://ora-00904.ora-code.com/. It means that the settings are
probably incorrect for the columns in the db.
Regards,
Jeroen Reijn
Мария Григорьева wrote:
> Hello!!! I’m trying to update form data, using on-value-changed:
>
>
>
> <fd:field id="density" required="true">
>
> <fd:label>Плотность</fd:label>
>
> <fd:datatype base="decimal"/>
>
> <fd:on-value-changed>
>
> <javascript>
>
> var value = this.value;
>
> var test =
> cocoon.parameters["comp_id"];
>
> var sql = "update
> compositions set density = " + value + " where id = " + test;
>
> dao.dbi.execute(sql);
>
> </javascript>
>
> </fd:on-value-changed>
>
> </fd:field>
>
>
>
> But as output I’ve got the exception:
>
>
>
> java.sql.SQLException: ORA-00904: "UNDEFINED": invalid identifier
>
>
>
> What’s the problem ?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: using fd:on-value-changed ???
Posted by Мария Григорьева <ma...@gmail.com>.
No, when I do it in flowscript procedure it works fine:
function do_new_component() {
var param = cocoon.parameters.id;
var form = new Form("forms/components.xml");
var formMap = form.asMap();
form.showForm("viewform-component-template.html");
if (form.isValid) {
dao.dbi.execute("insert into compositions values(seq_compositions.NEXTVAL, :density)", formMap);
}
var url = "" + param + "/do_list_compositions";
cocoon.redirectTo("phisical_parameters", true);
}
-----Original Message-----
From: Jeroen Reijn [mailto:j.reijn@onehippo.com]
Sent: Monday, August 25, 2008 1:40 PM
To: users@cocoon.apache.org
Subject: Re: using fd:on-value-changed ???
Hi,
See http://ora-00904.ora-code.com/. It means that the settings are
probably incorrect for the columns in the db.
Regards,
Jeroen Reijn
Мария Григорьева wrote:
> Hello!!! I’m trying to update form data, using on-value-changed:
>
>
>
> <fd:field id="density" required="true">
>
> <fd:label>Плотность</fd:label>
>
> <fd:datatype base="decimal"/>
>
> <fd:on-value-changed>
>
> <javascript>
>
> var value = this.value;
>
> var test =
> cocoon.parameters["comp_id"];
>
> var sql = "update
> compositions set density = " + value + " where id = " + test;
>
> dao.dbi.execute(sql);
>
> </javascript>
>
> </fd:on-value-changed>
>
> </fd:field>
>
>
>
> But as output I’ve got the exception:
>
>
>
> java.sql.SQLException: ORA-00904: "UNDEFINED": invalid identifier
>
>
>
> What’s the problem ?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: using fd:on-value-changed ???
Posted by Jeroen Reijn <j....@onehippo.com>.
Hi,
See http://ora-00904.ora-code.com/. It means that the settings are
probably incorrect for the columns in the db.
Regards,
Jeroen Reijn
Мария Григорьева wrote:
> Hello!!! I’m trying to update form data, using on-value-changed:
>
>
>
> <fd:field id="density" required="true">
>
> <fd:label>Плотность</fd:label>
>
> <fd:datatype base="decimal"/>
>
> <fd:on-value-changed>
>
> <javascript>
>
> var value = this.value;
>
> var test =
> cocoon.parameters["comp_id"];
>
> var sql = "update
> compositions set density = " + value + " where id = " + test;
>
> dao.dbi.execute(sql);
>
> </javascript>
>
> </fd:on-value-changed>
>
> </fd:field>
>
>
>
> But as output I’ve got the exception:
>
>
>
> java.sql.SQLException: ORA-00904: "UNDEFINED": invalid identifier
>
>
>
> What’s the problem ?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org