# Solved: How to refresh a CustomElement

**URL:** <https://discourse.aurelia.io/t/solved-how-to-refresh-a-customelement/2722>\
**Category:** Help Requests\
**Created:** [July 5, 2019, 6:22pm UTC](https://discourse.aurelia.io/t/solved-how-to-refresh-a-customelement/2722 "2019-07-05T18:22:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [July 5, 2019, 6:22pm UTC](https://discourse.aurelia.io/t/solved-how-to-refresh-a-customelement/2722/1 "2019-07-05T18:22:12Z")

</div>

I have an element which displays the contents of an array via ‘repeat for’

I want to refresh the element when the array is sorted

I used the Binding engine’s Collection Observer to know when the array changes

But I can’t figure out how to actually force a redraw of the Custom Element

I’ve even set the array = [] and then re-connected it to the source in a TaskQueue.queueTask

What is the command to tell Aurelia to redraw a custom element\>

---

<div class="post-metadata">

**Author:** ![ajoslin103](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/ajoslin103/32/281_2.png) [@ajoslin103](https://discourse.aurelia.io/u/ajoslin103)\
**Post date:** [July 5, 2019, 6:53pm UTC](https://discourse.aurelia.io/t/solved-how-to-refresh-a-customelement/2722/2 "2019-07-05T18:53:51Z")

</div>

Solved (without a solution)

I was calling resort on the array before the binding had updated on the control that modified the sort order

Once the timing of the resort request was corrected it was enough just to observe (with a no-op function) to get the refresh to work automatically

`this.bindingEngine.collectionObserver(this.items).subscribe(() => { })`

I love Aurelia – whenever I can’t make something work, I’m just trying too hard!!
