Class: HInputTag
Direct Known Subclasses
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#modelName ⇒ Object
Returns the value of attribute modelName.
-
#name ⇒ Object
Returns the value of attribute name.
-
#placeholder ⇒ Object
Returns the value of attribute placeholder.
-
#reverse ⇒ Object
Returns the value of attribute reverse.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from HWidget
Class Method Summary collapse
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(name = "", modelName = "", placeholder = "", label = nil, type = nil) ⇒ HInputTag
constructor
A new instance of HInputTag.
- #setCarriageReturn(value = true) ⇒ Object
- #setReverse(value = true) ⇒ Object
- #setSelected(value) ⇒ Object
Methods inherited from HWidget
#_addJsSlot, #_set, #_setStyle, #addJsFunction, #appendChild, #appendChilds, #buildSignature, #closeTag, #connect, #copyConstructor, #get, #getChilds, #getElementBy, #getSystemProperty, #hotLog, #openTag, #replacePlaceholder, #reset, #set, #setChilds, #setCloseTag, #setClosedTag, #setEnablePlaceholder, #setInnerHTML, #setParent, #setPlaceholder, #setPlaceholders, #setProperties, #setSlots, #setStyle, #setStyles, #setSystemProperties, #setSystemProperty, #setTag, #storeSlots, #storeStyle, #strProperties, test, #unset, widgetSpace
Constructor Details
#initialize(name = "", modelName = "", placeholder = "", label = nil, type = nil) ⇒ HInputTag
Returns a new instance of HInputTag.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/hwidgets/hinputtag.rb', line 9 def initialize(name = "", modelName = "", placeholder = "", label = nil, type = nil) super("input") self.setClosedTag(false) @name = name @modelName = modelName @placeholder = placeholder @label = label @type = type @carriageReturn = false @reverse = false end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
7 8 9 |
# File 'lib/hwidgets/hinputtag.rb', line 7 def label @label end |
#modelName ⇒ Object
Returns the value of attribute modelName.
7 8 9 |
# File 'lib/hwidgets/hinputtag.rb', line 7 def modelName @modelName end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/hwidgets/hinputtag.rb', line 7 def name @name end |
#placeholder ⇒ Object
Returns the value of attribute placeholder.
7 8 9 |
# File 'lib/hwidgets/hinputtag.rb', line 7 def placeholder @placeholder end |
#reverse ⇒ Object
Returns the value of attribute reverse.
7 8 9 |
# File 'lib/hwidgets/hinputtag.rb', line 7 def reverse @reverse end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/hwidgets/hinputtag.rb', line 7 def type @type end |
Class Method Details
Instance Method Details
#html ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/hwidgets/hinputtag.rb', line 41 def html() self.set(name: "#{@modelName}[#{@name}]", id: "#{@modelName}_#{@name}", type: @type, placeholder: @placeholder) @label = HLabelTag.new(@name, @modelName, @placeholder).setCarriageReturn(@carriageReturn) if (@label == nil) return @label.html() + super() unless(@reverse) return super + @label.html() end |
#setCarriageReturn(value = true) ⇒ Object
27 28 29 30 |
# File 'lib/hwidgets/hinputtag.rb', line 27 def setCarriageReturn(value = true) @carriageReturn = value return self end |
#setReverse(value = true) ⇒ Object
32 33 34 35 |
# File 'lib/hwidgets/hinputtag.rb', line 32 def setReverse(value = true) @reverse = value return self end |
#setSelected(value) ⇒ Object
37 38 39 |
# File 'lib/hwidgets/hinputtag.rb', line 37 def setSelected(value) set(value: value) end |