Hi,

I extended *GeneralizedFieldHandler* to create my own handler.


I'm trying to pass a parameter to it (since *GeneralizedFieldHandler*
implements
*ConfigurableFieldHandler*) and use it for many fields that are binding for
different methods.



My mapping file:



<!-- Handler mapping -->

<field-handler name="*myHandlerName*" class="myHandler">

<param name="myFlag" value="true"/>

</field-handler>



<!-- fields mapping -->

<field name="*myField1*" required="true" type="string" handler="*
myHandlerName*">

<bind-xml name="my-field-1" node="attribute"/>

</field>

<field name="*myField2*" required="true" type="string" handler="*
myHandlerName*">

<bind-xml name=" my-field-2" node="attribute"/>

</field>



The issue is that castor is calling *getMyField2* all the time (it never
calls *getMyField1 *for the first field).



After some debug in castor source code I saw that the myHandler instance is
the same all the time (it looks fine to me, since I have only one handler in
this mapping), but it has a reference to *FieldHandlerImpl* object
(attribute *_handler*) and this object has an attribute *_getMethod,* this
attribute is set for each field that I have in my mapping file, but the
handler instance is the same and in the moment of use it, *_getMethod* will
have the method that I have in my last mapped field that uses myHandlerName
(in this example: *myField2*).

Does anyone have similar issue?

Thanks,
Paulo

Reply via email to