class AastraXmlApi::PhoneInputScreenEntry

Public Class Methods

new(type) click to toggle source

Create new input field as a given type. The type can be one of IP, string (default), number, timeUS, timeInt, dateUS, or dateInt.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 24
def initialize(type)
  @type = type
  @softkeys = []
end

Public Instance Methods

addSoftkey(index, label, uri, icon=nil) click to toggle source

Adds softkey to be displayed when editing this field.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 66
def addSoftkey(index, label, uri, icon=nil)
  @softkeys += [PhoneSoftkeyEntry.new(index, label, uri, icon)]
end
render() click to toggle source

Create XML text output for this entry.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 71
def render
  xml = "<InputField"
  xml += " type=\"#{@type}\"" if not @type.nil?
  xml += " password=\"yes\"" if @password == "yes"
  xml += " editable=\"yes\"" if @editable == "yes"
  xml += ">\n"
  xml += "<Prompt>#{@prompt}</Prompt>\n" if not @prompt.nil?
  xml += "<Parameter>#{@parameter}</Parameter>\n" if not @parameter.nil?
  xml += "<Selection>#{@selection}</Selection>\n" if not @selection.nil?
  xml += "<Default>#{@default}</Default>\n" if not @default.nil?
  @softkeys.each { |softkey| xml += softkey.render }
  xml += "</InputField>\n"
  return xml
end
setDefault(default) click to toggle source

Set default value to load this field with.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 55
def setDefault(default)
  @default = default
end
setEditable() click to toggle source

Make this input field editable, i.e. not read only.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 40
def setEditable
  @editable = "yes"
end
setParameter(parameter) click to toggle source

Set paramter name value to be used to identify this field on submit.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 45
def setParameter(parameter)
  @parameter = parameter
end
setPassword() click to toggle source

Set this input field as a password field masked by “*” characters.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 35
def setPassword
  @password = "yes"
end
setPrompt(prompt) click to toggle source

Set prompt to be displayed to let user know what this field is for.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 50
def setPrompt(prompt)
  @prompt = prompt
end
setSelection(selection) click to toggle source

The contents of this will be added when the submit key is pressed while editing this field.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 61
def setSelection(selection)
  @selection = selection
end
setType(type) click to toggle source

Set the type (see initialize for values) of this input field.

# File lib/aastra_xml_api/phone_input_screen_entry.rb, line 30
def setType(type)
  @type = type
end