Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

SHtml.ajaxEditable renders from unnecessarily #259

Closed
lopex opened this Issue · 5 comments

3 participants

@lopex

In the following code:

{quote}



{displayMarkup}


{editMarkup}


{quote}

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
Owner

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

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
Owner
dpp commented

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
Something went wrong with that request. Please try again.