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/16 17:17:10 UTC

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