Class: UU::OS::Form::Text

Inherits:
Input show all
Defined in:
uu_os_gvc-0.28.16/lib/uu/os/form/text.rb

Overview

Component for entering text.

Instance Attribute Summary (collapse)

Attributes inherited from Input

#data, #disabled, #read_only, #required, #submit_value_change, #value, #value_change_action_uri, #width

Attributes inherited from GVC::Component

#attributes, #code, #component_type, #form, #height, #id, #name, #width

Method Summary

Methods inherited from GVC::Component

#add_message, #focus, #initialize, #messages

Constructor Details

This class inherits a constructor from UU::OS::GVC::Component

Instance Attribute Details

- (Object) displayed_value (readonly)

The value as it is displayed to the user (after formatting). For example using type="NUMBER" and number_format="#,##0" and value="-1234", the displayed value for a Czech user would be "-1 234".



63
64
65
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 63

def displayed_value
  @displayed_value
end

- (Object) max_length

Max count of characters typed into input.



14
15
16
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 14

def max_length
  @max_length
end

- (Object) negative_number_color

The color to use for negative numbers. Applies only when type="NUMBER" and read_only=true. Allowed values are 6-digit hexadecimal color codes prefixed with #, e.g. "#ff0000" and logical names of colors from UU colormap, e.g. "red" or "priorityHigh".



53
54
55
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 53

def negative_number_color
  @negative_number_color
end

- (Object) number_format

The format of a number using Unicode CLDR notation. Supported formatting characters are '#', '0', ',' (thousand separator) and '.' (decimal separator). Note that ',' and '.' are not the actual separators. Instead, they'll be replaced according to the user's language settings.

Examples:

# standard format (displays "12,345.6" in English, "12 345,6" in Czech, ...)
comp.number_format = "#,##0.################"

# integers only
comp.number_format = "#,##0"

# integers, without thousand separators
comp.number_format = "#"

# display exactly 2 decimal digits
comp.number_format = "#,##0.00"

# display at least 2 decimal digits
comp.number_format = "#,##0.00##############"

See Also:



41
42
43
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 41

def number_format
  @number_format
end

- (Object) positive_number_color

The color to use for positive numbers and zero. Applies only when type="NUMBER" and read_only=true. Allowed values are 6-digit hexadecimal color codes prefixed with #, e.g. "#ff0000" and logical names of colors from UU colormap, e.g. "red" or "priorityHigh".



47
48
49
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 47

def positive_number_color
  @positive_number_color
end

- (Object) restriction

Input restrictions.



17
18
19
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 17

def restriction
  @restriction
end

- (Object) style

The styling of the component. This component allows styling using following CSS attributes:

  • text-align - alignment of the component text ("left", "right", "center").



58
59
60
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 58

def style
  @style
end

- (Object) type

Type of input. Can be one of "text", "password" or "number".



11
12
13
# File 'uu_os_gvc-0.28.16/lib/uu/os/form/text.rb', line 11

def type
  @type
end