]> err.no Git - sope/blob - sope-appserver/NGObjWeb/DynamicElements/WOResetButton.m
bb6522a930d3529c773e5138ac64032de230a6cd
[sope] / sope-appserver / NGObjWeb / DynamicElements / WOResetButton.m
1 /*
2   Copyright (C) 2000-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21
22 #include "WOInput.h"
23 #include "WOElement+private.h"
24 #include "decommon.h"
25
26 @interface WOResetButton : WOInput
27 {
28   // WODynamicElement: extraAttributes
29   // WODynamicElement: otherTagString
30   // WOInput:    name
31   // WOInput:    value
32   // WOInput:    disabled
33 }
34
35 @end /* WOResetButton */
36
37 @implementation WOResetButton
38
39 // ******************** responder ********************
40
41 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
42   NSString *v = [self->value stringValueInComponent:[_ctx component]];
43
44   if ((self->name != nil) || (self->disabled != nil)) {
45     NSLog(@"WARNING: 'name' and 'disabled' properties are "
46           @"not supported in WOResetButton !");
47   }
48
49   WOResponse_AddCString(_response, "<input type=\"reset\" value=\"");
50   [_response appendContentHTMLAttributeValue:v];
51   WOResponse_AddChar(_response, '"');
52   [self appendExtraAttributesToResponse:_response inContext:_ctx];
53   if (self->otherTagString) {
54     WOResponse_AddChar(_response, ' ');
55     WOResponse_AddString(_response,
56                          [self->otherTagString stringValueInComponent:
57                               [_ctx component]]);
58   }
59   
60   WOResponse_AddEmptyCloseParens(_response, _ctx);
61 }
62
63 @end /* WOResetButton */