# Is possible to change widget title Dynamically

**URL:** <https://community.cumulocity.com/t/is-possible-to-change-widget-title-dynamically/4198>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [October 6, 2023, 8:08am UTC](https://community.cumulocity.com/t/is-possible-to-change-widget-title-dynamically/4198 "2023-10-06T08:08:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranjithkumar\_m](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ranjithkumar\_m](https://community.cumulocity.com/u/ranjithkumar_m)\
**Post date:** [October 6, 2023, 8:08am UTC](https://community.cumulocity.com/t/is-possible-to-change-widget-title-dynamically/4198/1 "2023-10-06T08:08:46Z")

</div>

Hi  
Widget title: input change event based on I want to display the title dynamically. Could you please guide me to the Manage to name in dynamic approach?,Could you please guide to me

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/b/1/b15b27c48d438627d8add0e5ec9f98aa32256634.png)

---

<div class="post-metadata">

**Author:** ![ranjithkumar\_m](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ranjithkumar\_m](https://community.cumulocity.com/u/ranjithkumar_m)\
**Post date:** [October 6, 2023, 8:15am UTC](https://community.cumulocity.com/t/is-possible-to-change-widget-title-dynamically/4198/2 "2023-10-06T08:15:23Z")

</div>

Hi,  
Could you please help? these changes regarding?

---

<div class="post-metadata">

**Author:** ![Tristan\_Bastian](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/tristan_bastian/32/18259_2.png) [@Tristan\_Bastian](https://community.cumulocity.com/u/Tristan_Bastian)\
**Post date:** [October 6, 2023, 8:45am UTC](https://community.cumulocity.com/t/is-possible-to-change-widget-title-dynamically/4198/3 "2023-10-06T08:45:32Z")

</div>

Please make sure to follow the [IoT Forum rules & General Posting guidelines](https://community.cumulocity.com/t/iot-forum-rules-general-posting-guidelines/2665) the next time you create a post in this forum.  
Here is a short sample of how this could be done:

```auto
import { Component, Input } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';
import { DynamicComponent } from '@c8y/ngx-components';

@Component({
  selector: 'sample-widget-config',
  template: `
    <button class="btn-primary" (click)="changeTitle()">Change title</button>
  `,
  viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
})
export class SampleWidgetConfigComponent implements DynamicComponent {
  @Input() config = {};
  private index = 0;

  constructor(private ngForm: NgForm) {}

  changeTitle() {
    this.index++;
    const title = this.ngForm.form.get('title');
    title.setValue(`Incremented title ${this.index}`);
  }
}

```

---

<div class="post-metadata">

**Author:** ![ranjithkumar\_m](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ranjithkumar\_m](https://community.cumulocity.com/u/ranjithkumar_m)\
**Post date:** [October 6, 2023, 9:23am UTC](https://community.cumulocity.com/t/is-possible-to-change-widget-title-dynamically/4198/4 "2023-10-06T09:23:00Z")

</div>

its’s working fine. Thank you so much.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [April 3, 2024, 9:23am UTC](https://community.cumulocity.com/t/is-possible-to-change-widget-title-dynamically/4198/5 "2024-04-03T09:23:54Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
