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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 16 June 2004 17:17 > To: [EMAIL PROTECTED] > 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: [EMAIL PROTECTED] > > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
