-------------------------------------------------------------------------------- -- Title: LWFormFile.lua -- Description: Like a square peg in a round hole -- Author: Raphaël Szwarc http://alt.textdrive.com/lua/ -- Creation Date: February 1, 2005 -- Legal: Copyright (C) 2005 Raphaël Szwarc -------------------------------------------------------------------------------- -- import dependencies local LWFormInput = require( "LWFormInput" ) local LWStyle = require( "LWStyle" ) local LUList = require( "LUList" ) local LUString = require( "LUString" ) -- define the class local super = LWFormInput local self = super() function self:handleComponentKeyWithValue( aComponent, aKey, aValue ) if LUString:endsWith( aKey, ".name" ) == false and LUString:endsWith( aKey, ".type" ) == false then local aMethod = self:componentMethodWithKey( aComponent, aKey ) if aMethod ~= nil then local someParameters = aComponent:context():request():parameters() local aName = someParameters:get( aKey .. ".name" ) local aType = someParameters:get( aKey .. ".type" ) if aName == "" then aName = nil end if aType == "" then aType = nil end if aValue == "" then aValue = nil end aComponent:invoke( aMethod, aName, aType, aValue ) end end end function self:prefix() return "file." end function self:type() return "file" end -- method for string representation function self:toString() local aBuffer = LUList() local aStyle = LWStyle:styleWithComponent( self ) aBuffer:add( "" ) return aBuffer:join( "" ) end return self