Data Binding

Overview

You can bind your data properties to input elements within your template using wire:model.

// wires/MyComponent.cfc
component extends="cbwire.models.Component" {
    // Data properties
    data = {
        "name" : ""
    };
}
<!--- ./wires/mycomponent.cfm --->
<cfoutput>
    <div>
        <form>
            <input wire:model.live="name" type="text">
            Name updated at #now()#
        </form>
    </div>
</cfoutput>

Resources

See the wire:model page for complete documentation.

When data properties are updated using wire:model, CBWIRE has several methods you can hook into such as onUpdate and onHyrdate ( See Lifecycle Methods ).

Last updated