SHtml.ajaxEditable renders from unnecessarily #259

lopex opened this Issue Dec 24, 2009 · 5 comments


None yet
3 participants

lopex commented Dec 24, 2009

In the following code:





editMarkup is called unnecessarily and renders the form too eagerly bloating the output, it will be replaced anyways by subsequent ajax call.

Also, AjaxMapper shouldn't extend MappedField (it's self type should be made MappedField) so it doesn't bloat the code when scala rewraps trait methods when existing field classes mix it in. Extending MixableMappedField is enough (it has the asHtml to override, whereas it only calls toForm).


dpp commented Dec 28, 2009

The code is correct as it appears.

Additionally, there is no AjaxMapper class I can find.

In the future, please discuss issues on list before opening defects.

lopex commented Dec 29, 2009

Oh I meant AjaxEditableField trait in AjaxMapper.scala, sorry for confusion.
Wrt Shtml.ajaxEditable, it renders the form even when it's not visible yet and it will be replaced by subsequent ajax calls (imagine rendering select elements for each field in a html table). This is huge and unnecessary overhead.
Now I have my own ajaxEditable implementation with "{editMarkup}" removed from the template and it works perfectly. I Also have separate AjaxEditableField trait that can be mixed into ANY preexisting MappedField and make it ajax editable.


dpp commented Jan 1, 2010

I do not see any defects here.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment