docs
Loading...
Searching...
No Matches
ActionInfo

#include <Ultralight/dom/data/ActionInfo.h>

Overview

Details of a delivered action (its name and the list row it fired from).

Take one as the second parameter of a generic action handler:

binding.OnAction<"roster.kick">([&](dd::Value payload, dd::ActionInfo info) {
if (info.has_row())
KickPlayer(info.row_int_key());
});

An action fired from ul-on:* markup never has a payload, and it doesn't say which View's page fired it.

Public Member Functions

const char * name () const
 Get the action's name.
bool has_row () const
 Whether or not the action fired from a list row.
bool row_key_is_string () const
 Whether or not the row's key is a string (see row_string_key()).
int64_t row_int_key () const
 Get the row's integer key.
std::string_view row_string_key () const
 Get the row's string key.

Member Function Documentation

◆ has_row()

bool has_row ( ) const
inline

Whether or not the action fired from a list row.

◆ name()

const char * name ( ) const
inline

Get the action's name.

Returns
Returns the name from the schema. For a row action this is its name in the row type's schema (eg, kick for roster.kick).

◆ row_int_key()

int64_t row_int_key ( ) const
inline

Get the row's integer key.

Returns
Returns the key (for a list without keys, the row's position when the page fired the action), or 0 when the key is a string or there's no row.

◆ row_key_is_string()

bool row_key_is_string ( ) const
inline

Whether or not the row's key is a string (see row_string_key()).

◆ row_string_key()

std::string_view row_string_key ( ) const
inline

Get the row's string key.

Returns
Returns the key, or an empty view when the key isn't a string or there's no row.
Note
The view is valid only during the handler call. Copy it to keep it.

The documentation for this class was generated from the following file: