Method: SWS::Component#update_binding
- Defined in:
- lib/sws/component.rb
#update_binding(key, value) ⇒ Object
Updates binding described by key to value. Default implementation (often overriden in specific Component subclasses to perform custom initialization) just updates proper Slot value
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/sws/component.rb', line 336 def update_binding ( key, value ) slot = @slots[key] $log_sws_component.debug( "slot #{key}: binding #{slot}, component: #{self}" ) if slot slot.value = value else # This happens in cases like submitting INPUT type=image in Firefox, # which (besides usual name.x and name.y parameters) additionaly submits # "name" parameter (without any suffix) :(. So in order to avoid # exception we need to ignore the parameter. TODO: refactor the whole # parameter processing logic, as this workaround introduces some # overhead. subcomponent = subcomponent_for_name( key ) if subcomponent $log_sws_component.debug( "Ignoring parameter #{key} with value #{value} as it refers directly to subcomponent of component #{self}" ) else $log_sws_component.debug( "Ignoring bogus parameter #{key} with value #{value} for component #{self}" ) end end end |