Weird behaviour

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Weird behaviour

Jacques Le Roux
Administrator
Hi,

I faced something this morning which surprised me. I tried to use radio buttons in a multi form, with a corresponding indicator in
the Entity. I had to handle the fact that buttons are named by the multi mechanism and hence are alone in their "group". The
javascript part was not hard but it's the service which surprised me. It's a really simple service which uses
    <auto-attributes mode="IN" include="nonpk" optional="true"/>
in definition  and
    <set-nonpk-fields value-field="lookedUpValue" map="parameters"/>
in implementation.

As by default set-if-null is set to true for set-nonpk-fields, I thought that the values will be passed in the context, even if null
or empty. But it was not, and I had to clear the field in the lookedUpValue to have it working properly (ie removing old value
changed).For that I simply used
<if-empty field="parameters.setAsDefault">
    <clear-field field="lookedUpValue.setAsDefault"/>
</if-empty>

Is it the normal behaviour, should not the value be in the context? Maybe we need to had a set-if-empty attribute to
set-nonpk-fields? Though it seems the problem comes rather from the value not being in parameters

Please let me know your thought. If I'm not clear enough and I will try to explain better

Thanks

Jacques