# Data Events

The code for the following examples are available in the [building-a-component](/wirebootstrap/working-with-components/building-a-component.md) project inside the `\data-events` folder.

In the previous example, [Hello World](/wirebootstrap/working-with-components/building-a-component/hello-world.md), the binding was *static*.  This means the information displayed inside the component does not change after its initial binding. &#x20;

Often times its desired that a component react to something a user does in another component on a page.  In WireBootstrap, [data events](/wirebootstrap/dataevents.md) can be used to listen for changes to data that may be of interest to a component.  Using data events, component data bindings can be *dynamic* where the data displayed inside a component changes based on other changes on a page.

In the example below, the component sets up a data event listener for an event called `my-component-change` and then rebinds to the data sent in the event when its fired on the page.

```javascript
...

// Listen for data event and re-bind
wire.data.DataEventManager.event("my-component-change").when((cfg) => {
    document.getElementById(el).innerHTML = cfg.data.value;
});

...
```

```javascript
// Fire data event passing a new 'value'
new wire.data.DataEvent()
  .event("my-component-change")
  .data({ value: "Hello Data Event" })
  .raise();

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wirebootstrap.com/wirebootstrap/working-with-components/building-a-component/data-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
