2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 @interface WOPasswordField : WOInput
27 // WODynamicElement: extraAttributes
28 // WODynamicElement: otherTagString
37 @end /* WOPasswordField */
39 @implementation WOPasswordField
41 - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_a
42 template:(WOElement *)_root
44 if ((self = [super initWithName:_name associations:_a template:_root])) {
45 self->size = OWGetProperty(_a, @"size");
55 /* generate response */
57 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
61 v = [self->value stringValueInComponent:[_ctx component]];
62 s = [self->size unsignedIntValueInComponent:[_ctx component]];
64 WOResponse_AddCString(_response, "<input type=\"password\" name=\"");
65 [_response appendContentHTMLAttributeValue:OWFormElementName(self, _ctx)];
66 WOResponse_AddCString(_response, "\" value=\"");
67 [_response appendContentHTMLAttributeValue:v];
68 [_response appendContentCharacter:'"'];
71 WOResponse_AddCString(_response, " size=\"");
72 WOResponse_AddUInt(_response, s);
73 [_response appendContentCharacter:'"'];
76 if ([self->disabled boolValueInComponent:[_ctx component]])
77 WOResponse_AddCString(_response, " disabled=\"disabled\"");
79 [self appendExtraAttributesToResponse:_response inContext:_ctx];
81 if (self->otherTagString != nil) {
82 v = [self->otherTagString stringValueInComponent:[_ctx component]];
83 WOResponse_AddChar(_response, ' ');
84 WOResponse_AddString(_response, v);
87 WOResponse_AddEmptyCloseParens(_response, _ctx);
92 - (NSString *)associationDescription {
93 NSMutableString *str = nil;
95 str = [NSMutableString stringWithCapacity:128];
96 [str appendString:[super associationDescription]];
98 if (self->size) [str appendFormat:@" size=%@", self->size];
103 @end /* WOPasswordField */