LogoLogo
InstallSource CodeIssuesSupport
v1.x
v1.x
  • Introduction
  • Essentials
    • Installation
    • Configuration
    • Creating Components
    • Rendering Views
    • Data Properties
    • Actions
    • Events
    • Lifecycle Events
  • Component Features
    • Redirecting
    • Logging
  • Templates
    • Loading States
    • Polling
    • Prefetching
    • Offline State
    • Dirty States
    • Defer Loading
  • JS Integrations
    • AlpineJS
    • Inline Scripts
  • Testing
  • Security
  • Troubleshooting
  • CommandBox Commands
Powered by GitBook
On this page

Was this helpful?

  1. Essentials

Actions

Actions in cbwire are methods in your cbwire component that are invoked when user interactions occur. Once an action has been invoked, the component's template is re-rendered.

// File: ./wires/Counter.cfc
component extends="cbwire.model.Component"{

    // Data property
    variables.data = {
        "counter": 0
    };

    // Action
    function increment(){
        variables.data.counter += 1;
    }
}
<div>
    <button wire:click="increment">Increment Counter</button>
</div>
PreviousData PropertiesNextEvents

Last updated 3 years ago

Was this helpful?