# How do I use the "entity-selector-dialog" compoenent?

**URL:** <https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653>\
**Category:** Questions\
**Created:** [March 4, 2019, 7:56pm UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653 "2019-03-04T19:56:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin.w](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/robin.w/32/75_2.png) [@Robin.w](https://forum.litium.com/u/Robin.w)\
**Post date:** [March 4, 2019, 7:56pm UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/1 "2019-03-04T19:56:43Z")

</div>

I’m trying to use the entity-selector-dialog in my custom fields (A block field) but I can’t find the component. What do I have to import/extend in Angular to be able to use it? Should it exist in `import { ... } from 'litium-ui';` ??

Just adding the code from the docs:

```auto
<entity-selector-dialog
    *ngIf="showDialog"
    [entityType]="'page'"
    [entityMultiSelect]="false"
    (onSubmit)="submit($event)"
    (onClose)="showDialog = false">
</entity-selector-dialog>

```

just result in an error asking if **entity-selector-dialog** is a component

I basically just want to open a page/category and/or file picker dialog. Do I need to use the iframe option? Or can this component be usable from a custom block field?

Litium version: 7.1

---

<div class="post-metadata">

**Author:** ![Robin.w](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/robin.w/32/75_2.png) [@Robin.w](https://forum.litium.com/u/Robin.w)\
**Post date:** [March 6, 2019, 1:10pm UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/2 "2019-03-06T13:10:37Z")

</div>

I still cant get the component to work, the problem with the [https://localhost/Litium/UI/frame/EntityTreeSelectorWrapper](https://localhost/Litium/UI/frame/EntityTreeSelectorWrapper) iframe is that it dose not return the name of the selected page, is there a builtin anguler service that I can use to resolve the gui’id into a name?

---

<div class="post-metadata">

**Author:** ![kaitoukid](https://avatars.discourse-cdn.com/v4/letter/k/3e96dc/32.png) [@kaitoukid](https://forum.litium.com/u/kaitoukid)\
**Post date:** [March 7, 2019, 3:57am UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/3 "2019-03-07T03:57:19Z")

</div>

1. The `EntitySelectorDialog` is not in `litium-ui`. If you want to use this component, you have to include the module that contains it.

2. In `EntityTreeSelectorWrapper` when submitting data after choosing page, it doesn’t return the name, it is just an object that contains `channelSystemId` and `systemId`. You should file it as a bug.  
However I think they have API to get page’s information by page’s systemId.

---

<div class="post-metadata">

**Author:** ![Robin.w](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/robin.w/32/75_2.png) [@Robin.w](https://forum.litium.com/u/Robin.w)\
**Post date:** [March 7, 2019, 2:08pm UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/4 "2019-03-07T14:08:55Z")

</div>

Do you know what module it is contained in? Or the name of that API?

---

<div class="post-metadata">

**Author:** ![kaitoukid](https://avatars.discourse-cdn.com/v4/letter/k/3e96dc/32.png) [@kaitoukid](https://forum.litium.com/u/kaitoukid)\
**Post date:** [March 8, 2019, 3:38am UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/5 "2019-03-08T03:38:33Z")

</div>

The API is [GET] `/Litium/app/api/websites/page/{pageSystemId}`

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [March 8, 2019, 7:41am UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/6 "2019-03-08T07:41:51Z")

</div>

Think of that this is an internal api for the back office and can be changed without notice between two versions.

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [March 8, 2019, 2:39pm UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/7 "2019-03-08T14:39:12Z")

</div>

Could you share the idea of the custom field? Cause if you only need a reference to a page, or category, would it be better to use the Pointer Field? You can also use Pointer field in MultiField. Then you don’t need to create any custom component.

---

<div class="post-metadata">

**Author:** ![Robin.w](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/robin.w/32/75_2.png) [@Robin.w](https://forum.litium.com/u/Robin.w)\
**Post date:** [March 8, 2019, 3:15pm UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/8 "2019-03-08T15:15:51Z")

</div>

I can of course create the logic that way, but custom-fields are a fantastic way of making complex blocks less cluttered for the editors. So I really think/hope that you should keep supporting it.

Am guessing that the documentation is wrong or a bit outdated and that this simply can’t be done in the newer versions of Litium??

The easiest thing might be just switching to the iframe option? If so, then I have a  
**simple request:**  
Could you consider, sometimes time down the line to extend the iframe options to match the internal components? mainly:

1. Add a multiselect option to the pagetree selector.

2. Get a category selector, also with multiselect.

3. A bonus would be if the pagetree selector like the file selector also returned the entity name and url in the iframe event messaged.

I have now created internal api’s to fix these things so i’m no longer stuck, but a fix from your end would be much cleaner and nicer 🙂

Thanks

---

<div class="post-metadata">

**Author:** ![ton.nguyen](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/ton.nguyen/32/989_2.png) [@ton.nguyen](https://forum.litium.com/u/ton.nguyen)\
**Post date:** [March 11, 2019, 12:48pm UTC](https://forum.litium.com/t/how-do-i-use-the-entity-selector-dialog-compoenent/653/9 "2019-03-11T12:48:58Z")

</div>

Glad to hear that you have found a workaround! We have identified the problem and bug has been created. We will soon release the fix.
