MappedLongForeignKey::asJsExp should generate JE.JsNull

9 views
Skip to first unread message

aw

unread,
Apr 17, 2011, 2:24:16 PM4/17/11
to Lift
I have several Mapper classes with a MappedLongForeignKey field that
is nullable/optional.

When the Mapper instance does not have a concrete reference/value for
that foreign key field, the call to asJsExp on the Mapper instance
produces a zero (0) for the MappedLongForeignKey value. Technically,
I don't believe this is correct; I think it should emit a JE.JsNull.

Before raising this issue, I searched the Issue Tracker and discovered
Issue 282 was a very similar issue raised for asJsonValue:
https://www.assembla.com/spaces/liftweb/tickets/282?batch=&tickets_report_id=10&ticket_id=282&commit=Go+%C2%BB

It would seem that a fix was added to asJsonValue, but a similar fix
was never applied to asJsExp.

(Another idea is to have MappedLongForeignKey leverage
MappedNullableLong rather than MappedLong -- but that idea was
mentioned in Ticket 282, yet not done.)

(Note that I stumbled across this issue with Lift 2.2, but it doesn't
look like this was changed with Lift 2.3. I am temporarily overriding
asJsExp, but ultimately would like to see Lift fixed if we can all
agree that this is a bug/oversight.)

David Pollak

unread,
Apr 17, 2011, 7:14:16 PM4/17/11
to lif...@googlegroups.com
Please open a ticket and assign it to me.


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Reply all
Reply to author
Forward
0 new messages