Struct ::exo::dom::Button

Overview

Button dom node.

This node is used inside a dom to display a either a button, highlight button or link. Supported fields of this node are:

  • id: The id of this node
  • name: The name to display
  • status: The stati where the node should be shown
  • rights: One of the rights needed to show the node
  • edit: Defines the edit state of the node
  • text: The second line text of the highlight button
  • icon: The icon of the button
  • link: The href link where to navigate to on click
  • target: The target to open the new link in like _self/_blank
  • workflow: The workflow which should be executed on click
  • typ: Define the type of the button as: button/highlight/link

Within the layouter this button can be used like this:

<button id="id_123" name="Click Here" icon="link" workflow="click_wf" />
<button id="id_123" name="Click Here" icon="link" workflow="click_wf" typ="highlight" />
<highlight-button id="id_123" name="Click Here" icon="link" link="www.exolynk.app" />
<link id="id_123" name="Click Here" link="www.exolynk.app" />

Methods

fn new() -> Button

Creates a new Button.

Example

let node = exo::dom::Button::new();
node.name = "Click here";
node.text = "Cool Button";
node.icon = "link";
node.link = "www.exolynk.app";
node.typ = "highlight";

Protocols

protocol partial_eq
if value == b { }

Allows for partial equality operations to work.

protocol string_debug
println("{:?}", value)

Allows the value to be debug printed.

protocol string_display
println("{}", value)

Allows the value to be display printed.

protocol get id
let output = value.id

Get the id of the node as String. A node Id should be unique inside the complete dom.

Example

let node = exo::dom::Button::new();
node.id = "id_123456";
assert_eq!(node.id, "id_123456");
protocol set id
value.id = input

Set the id of the node as String. A node Id should be unique inside the complete dom.

Example

let node = exo::dom::Button::new();
node.id = "id_123456";
assert_eq!(node.id, "id_123456");
protocol get name
let output = value.name

Get the name of the node as String. The name is used to display a title or main text.

Example

let node = exo::dom::Button::new();
node.name = "Click Here";
assert_eq!(node.name, "Click Here");
protocol set name
value.name = input

Get the name of the node as String. The name is used to display a title or main text.

Example

let node = exo::dom::Button::new();
node.name = "Click Here";
assert_eq!(node.name, "Click Here");
protocol get status
let output = value.status

Get the different status of the node as Vec<String>. This node and all it's child will only be displayed, when no status is set or the record has any of the given stati.

Example

let node = exo::dom::Button::new();
node.status = ["new", "released"];
assert!(node.status.iter().any(|s| s == "new"));
protocol set status
value.status = input

Set the status of the node as Vec<String>. This node and all it's child will only be displayed, when no status is set or the record has any of the given stati.

Example

let node = exo::dom::Button::new();
node.status = ["new", "released"];
assert!(node.status.iter().any(|s| s == "new"));
protocol get edit
let output = value.edit

Get the edit status of the node as Option<bool>. The edit mode can be set as true or false. When the edit mode is not set, it takes the system edit state.

Example

let node = exo::dom::Button::new();
node.edit = Some(false);
assert_eq!(node.edit, Some(false));
protocol set edit
value.edit = input

Set the edit status of the node as Option<bool>. The edit mode can be set as true or false. When the edit mode is not set, it takes the system edit state.

Example

let node = exo::dom::Button::new();
node.edit = Some(false);
assert_eq!(node.edit, Some(false));
protocol get style
let output = value.style

Get the style of the node as String.

Example

let node = exo::dom::Button::new();
node.style = "color: red;";
assert_eq!(node.style, "color: red;");
protocol set style
value.style = input

Set the style of the node as String.

Example

let node = exo::dom::Button::new();
node.style = "color: red;";
assert_eq!(node.style, "color: red;");
protocol get rights
let output = value.rights

Get the different rights of the node as Vec<String>. This node and all it's child will only be displayed, when no rights are set or the user has one of the rights.

Example

let node = exo::dom::Button::new();
node.rights = ["user_right", "can_release"];
assert!(node.rights.iter().any(|s| s == "can_release"));
protocol set rights
value.rights = input

Get the different rights of the node as Vec<String>. This node and all it's child will only be displayed, when no rights are set or the user has one of the rights.

Example

let node = exo::dom::Button::new();
node.rights = ["user_right", "can_release"];
assert!(node.rights.iter().any(|s| s == "can_release"));
protocol get text
let output = value.text

Get the second line text of the node.

Example

let node = exo::dom::Button::new();
node.text = "Beatiful button";
assert_eq!(node.text, "Beatiful button");
protocol set text
value.text = input

Set the second line text of the node.

Example

let node = exo::dom::Button::new();
node.text = "Beatiful button";
assert_eq!(node.text, "Beatiful button");
protocol get icon
let output = value.icon

Get the icon of the button.

Example

let node = exo::dom::Button::new();
node.icon = "link";
assert_eq!(node.icon, "link");
protocol set icon
value.icon = input

Set the icon of the button.

Example

let node = exo::dom::Button::new();
node.icon = "link";
assert_eq!(node.icon, "link");
protocol get link
let output = value.link

Get the link of the button.

Example

let node = exo::dom::Button::new();
node.link = "www.exolynk.app";
assert_eq!(node.link, "www.exolynk.app");
protocol set link
value.link = input

Set the link of the button.

Example

let node = exo::dom::Button::new();
node.link = "www.exolynk.app";
assert_eq!(node.link, "www.exolynk.app");
protocol get target
let output = value.target

Get the target of the button.

Example

let node = exo::dom::Button::new();
node.target = "_blank";
assert_eq!(node.target, "_blank");
protocol set target
value.target = input

Set the target of the button.

Example

let node = exo::dom::Button::new();
node.target = "_blank";
assert_eq!(node.target, "_blank");
protocol get workflow
let output = value.workflow

Get the target of the button.

Example

let node = exo::dom::Button::new();
node.workflow = "test_wf";
assert_eq!(node.workflow, "test_wf");
protocol set workflow
value.workflow = input

Set the target of the button.

Example

let node = exo::dom::Button::new();
node.target = "_blank";
assert_eq!(node.target, "_blank");
protocol get typ
let output = value.typ

Get the typ of the button.

Example

let node = exo::dom::Button::new();
node.typ = "link";
assert_eq!(node.typ, "link");
protocol set typ
value.typ = input

Set the typ of the button.

Example

let node = exo::dom::Button::new();
node.typ = "link";
assert_eq!(node.typ, "link");