Class: SWS::FormElement

Inherits:
Component show all
Defined in:
lib/sws/component.rb

Overview

Base class for all components being the part of a form

Instance Attribute Summary

Attributes inherited from Component

#action_components, #definition_component, #encoding, #html_attrs, #method_to_call, #name, #parameters, #parent, #request, #request_number, #slots, #subcomponents, #tokens

Instance Method Summary collapse

Methods inherited from Component

#api_filename, #app, #append_to_response, #awake, #content?, create, #create_component_tree, #definition_filename, #initialize, #page, #perform_action, #process_bindings, #process_parameters, #process_request, #remove_subcomponents, #session, #set_request_subcomponents, #sleep, #slot_bound?, #subcomponent_for_name, synchronize_slot, #synchronize_slot?, #synchronize_slots, #template_filename, #tokenize_binding, #update_binding, #url_string

Constructor Details

This class inherits a constructor from SWS::Component

Instance Method Details

#container?Boolean

All form parts are not container components - they do not contains other components or HTML content

Returns:

  • (Boolean)


566
567
568
# File 'lib/sws/component.rb', line 566

def container? ()
	return false
end

#element_nameObject

Returns base name attribute of HTML tag created from names of all parents separated by ‘.’. Used for creating HTTP parameters containing values entered by user.



551
552
553
554
555
556
557
558
559
560
561
# File 'lib/sws/component.rb', line 551

def element_name ()
	
	name = @name
	component = @parent
	while ( component != nil )
		name = "#{component.name}.#{name}"
		component = component.parent
	end
	return name
	
end