Class: YuiRestClient::Widgets::Multilinebox

Inherits:
Base
  • Object
show all
Defined in:
lib/yui_rest_client/widgets/multilinebox.rb

Overview

Class representing a multilinebox in the UI. It can be YMultiLineEdit.

Instance Method Summary collapse

Methods inherited from Base

#action, #collect_all, #debug_label, #enabled?, #exists?, #initialize, #property

Methods included from YuiRestClient::Waitable

#wait_until, #wait_while

Constructor Details

This class inherits a constructor from YuiRestClient::Widgets::Base

Instance Method Details

#max_lengthInteger

Returns maximum string length to set in the multilinebox

Examples:

Check maximum string length in multilinebox with id ‘TEST_ID’

}
   "class" : "YMultiLineEdit",
   "debug_label" : "test_label",
   "default_visible_lines" : 3,
   "hstretch" : true,
   "hweight" : 1,
   "id" : "\"TEST_ID\"",
   "input_max_length" : -1,
   "label" : "test_label",
   "value" : "",
   "vstretch" : true
}
app.multilinebox(id: '"TEST_ID"').max_length
  # -1

Returns:

  • (Integer)

    maximum number of character to set in the multilinebox



25
26
27
# File 'lib/yui_rest_client/widgets/multilinebox.rb', line 25

def max_length
  property(:input_max_length)
end

#set(value) ⇒ Multilinebox

Sends action to set the value of multilinebox.

Examples:

Set text in multilinebox with id ‘TEST_ID’ to ‘text’

app.multilinebox(id: '"TEST_ID"').set("text\ntext in new line")

Parameters:

  • value (String)

    text to be set in multilinebox

Returns:



56
57
58
59
# File 'lib/yui_rest_client/widgets/multilinebox.rb', line 56

def set(value)
  action(action: Actions::ENTER_TEXT, value: value)
  self
end

#valueString

Returns text that is currently set for multilinebox. Gets value from ‘value’ parameter in JSON representation of YMultiLineEdit.

Examples:

Get value from multilinebox with id “address”

}
   "class" : "YMultiLineEdit",
   "debug_label" : "test_label",
   "default_visible_lines" : 3,
   "hstretch" : true,
   "hweight" : 1,
   "id" : "\"TEST_ID\"",
   "input_max_length" : -1,
   "label" : "test_label",
   "value" : "This is a \nmultiline\ntext",
   "vstretch" : true
}
app.multilinebox(id: '"TEST_ID"').value # This is a \nmultiline\ntext

Returns:

  • (String)

    text set as value in the multilinebox.



79
80
81
# File 'lib/yui_rest_client/widgets/multilinebox.rb', line 79

def value
  property(:value)
end

#visible_linesInteger

Returns the default visible number of lines for the multilinebox

Examples:

Check the default visible number of line for multilinebox with id ‘TEST_ID’

}
   "class" : "YMultiLineEdit",
   "debug_label" : "test_label",
   "default_visible_lines" : 3,
   "hstretch" : true,
   "hweight" : 1,
   "id" : "\"TEST_ID\"",
   "input_max_length" : -1,
   "label" : "test_label",
   "value" : "",
   "vstretch" : true
}
app.multilinebox(id: '"TEST_ID"').visible_lines
  # 3

Returns:

  • (Integer)

    default number of visible lines for the multilinebox



47
48
49
# File 'lib/yui_rest_client/widgets/multilinebox.rb', line 47

def visible_lines
  property(:default_visible_lines)
end