iframe breaks upon model save

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
I've designed a dashboard for handling support tickets. This consists of a queue which updates a page include. The page include contains a field editor and a template, which contains the HTML for an iframe containing the record's chatter feed.

(Note: I have it set up this way because when I tried adding the regular chatter component, the page seemed to break)

The problem I'm experiencing is thus: within the page include page, there is a "Mark task complete" button. This updates a field on the record and then saves its changed. When the save occurs, the iframe template breaks. When I inspect it, I see that the record ID is no longer being passed to the iframe source. 

Any ideas on why this is happening? Happy to provide further details as required.
Photo of Kathryn Castle

Kathryn Castle

  • 814 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yup. The template in the field editor is registered to the model being saved I assume?

Move the iframe to a template component and don't register it to a model. If you have any merge syntax, you'll have to update it by adding $Model.yourmodelidhere.data.0. ie. {{Name}} to {{$Model.yourmodelidhere.data.0.Name}}.
Photo of Kathryn Castle

Kathryn Castle

  • 814 Points 500 badge 2x thumb
Amazing, that worked perfectly. Thank you so much :)

If you don't mind, can you explain why it was breaking before? I'm really curious to understand that part.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Every time a model is saved/queried, then all the components registered with it are updated. Don't see why the template iframe would break. Should only refresh. Would need to investigate personally to see.

We're just avoiding the issue by using a template without any model registered to it.