You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by H....@MI.unimaas.nl on 2004/06/17 17:24:38 UTC

RE: Desperately needing help with obscure JXTemplate problem - RE POST + UPDATE

After extensive debugging I figured out that the
JXTemplateGenerator.JSIntrospector can find "formattedValue" as a property
in one class (the one which behaves correctly) but not in the other. I
cannot figure out why.

I hope this rings a bell with someone. Anyone?

Bye, Helma


> -----Original Message-----
> From: H.vanderLinden@MI.unimaas.nl 
> [mailto:H.vanderLinden@MI.unimaas.nl] 
> Sent: Wednesday, 16 June 2004 17:17
> To: users@cocoon.apache.org
> Subject: Desperately needing help with obscure JXTemplate problem
> 
> 
> Hi,
> 
> Can someone please give a hint as to why the following does not work?
> 
> Class SomeClass() {
> .....
> private Object value;
> ....
> public void setValue(Object x) {
>    value = x;
> }
> public Object getValue() {
>    return value;
> }
> 
> public String getFormattedValue() {
>    String result = doSomething(value);
>    return result;
> }
> }
> 
> Class SomeOtherClass() {
> .....
> private Object value;
> ....
> public void setValue(Object x) {
>    value = x;
> }
> public Object getValue() {
>    return value;
> }
> 
> public String getFormattedValue() {
>    String result = doSomething(value);
>    return result;
> }
> }
> 
> 
> JXTemplates:
> 
> <jx:macro name="qualifierList">
>     <jx:parameter name="qList"/>
>     <value>${qList.someValue.formattedValue}</value>
> </jx:macro>
> 
> <jx:macro name="elementRow">
>     <jx:parameter name="elem"/>
>     <value>${elem.formattedValue}</value>
>     <qualifierList qList="${elem.qualifiers}"/>
> </jx:macro>
> 
> <jx:template ...>
> <jx:import uri="macros.jx"/>
> <qualifierList qList="${form.qualifiers}"/> 
> <value>${form.qualifiers.someValue}</value>
>           
> <jx:set var="elemDef" 
> value="${form.elements.strokeMeetingDiagnosis}"/>
> <elementRow elem="${elemDef}"/>
> 
> 
> Problem:
> ${elemDef.formattedValue} is of class SomeOtherClass and 
> correctly displays the formattedValue 
> ${qList.someValue.formattedValue} is of class SomeClass and 
> displays nothing for formattedValue
> 
> ${qList.someValue} correctly displays: SomeClass@1234
> 
> In the flowscript:
> 
> var o = form.qualifiers;
> var q = (Packages.mypackage.SomeClass)o.get('someValue');
> print(q.getFormattedValue());
> 
> correctly displays the formattedValue.
> 
> Any idea anyone?
> 
> 
> Bye,
> 
> Helma van der Linden
> 
> ---------------------------------------------------------------------
> 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