Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Escaped HTML in ListGrid vs DynamicForm

    Hi,

    I am escaping HTML characters on the server after being received from the client such that when the data is returned to the client datasource it is in escaped form. This works quite well for the ListGrid's as they convert the escaped values back into the original characters. However, when I go to edit a row from the ListGrid I display the data (from the same datasource) in a DynamicForm and the escaped characters are shown in their escaped format (ampersand l t semi-colon). Is there any way to have the FormItem display the original characters?

    Thanks!

    #2
    I have created a ValueFormatter and a ValueParser to handle the decoding/encoding around the FormItems but this seems like overkill. Is there no better way to handle this?

    Btw, I really like the flexibility of the smartGWT product. It seems to have hooks in all the right places to insure that almost anything can be accomplished. Great product!

    Thanks,
    John

    Comment


      #3
      Thanks for the kudos!

      How to do this depends on whether the user is editing the markup and whether and why the markup would be saved to the actual DataSource.

      Generally you would save the actual typed-in value to the database (eg ">" is really ">"). Then, editing is normal with no need to do round-trip escaping. Your only task is to decide whether the markup should be active when displayed; if it shouldn't be, escape it before allowing it to render. You can do this escaping server-side if you like, and use eg listGridField.displayField to tell the grid that the server is delivering a second value which should be used for display purposes.

      Comment

      Working...
      X