class HInputTag

Attributes

label[RW]
modelName[RW]
name[RW]
placeholder[RW]
reverse[RW]
type[RW]

Public Class Methods

init(name: "", modelName: "", placeholder: "", label: nil, type: nil) click to toggle source
# File lib/hwidgets/hinputtag.rb, line 21
def self.init(name: "", modelName: "", placeholder: "", label: nil, type: nil)

  return HInputTag.new(name, modelName, placeholder, label, type)  

end
new(name = "", modelName = "", placeholder = "", label = nil, type = nil) click to toggle source
Calls superclass method HWidget::new
# 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

Public Instance Methods

html() click to toggle source
Calls superclass method HWidget#html
# 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) click to toggle source
# File lib/hwidgets/hinputtag.rb, line 27
def setCarriageReturn(value = true)
  @carriageReturn = value
  return self
end
setReverse(value = true) click to toggle source
# File lib/hwidgets/hinputtag.rb, line 32
def setReverse(value = true)
  @reverse = value
  return self
end
setSelected(value) click to toggle source
# File lib/hwidgets/hinputtag.rb, line 37
def setSelected(value)
  set(value: value) 
end