View Javadoc

1   /*
2       Jiffie Plugin for Jameleon - An Internet Explorer plug-in for Jameleon
3       Copyright (C) 2004-2006 Christian W. Hargraves (engrean@hotmail.com) and
4                          Matthias Marschall (matthias@marschalls.de)
5   
6       This program is free software; you can redistribute it and/or modify
7       it under the terms of the GNU General Public License as published by
8       the Free Software Foundation; either version 2 of the License, or
9       (at your option) any later version.
10  
11      This program is distributed in the hope that it will be useful,
12      but WITHOUT ANY WARRANTY; without even the implied warranty of
13      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14      GNU General Public License for more details.
15  
16      You should have received a copy of the GNU General Public License
17      along with this program; if not, write to the Free Software
18      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20  package net.sf.jameleon.plugin.jiffie.tags;
21  
22  import net.sf.jameleon.plugin.jiffie.IEFunctionTag;
23  
24  /***
25   * This action point sets the value of any hidden field.
26   * 
27   * Some example uses might be:
28   * 
29   * Setting the text field defined by <input type="hidden" name="hiddenField1"</a>
30   * <pre><source>
31   *  &lt;ie-set-hidden-field functionId="Set a value of the hidden field to 'some value'" 
32   *       name="hiddenField1" 
33   *       value="some value"
34   *       form="testForm"/&gt;
35   * </source></pre>
36   * @jameleon.function name="ie-set-hidden-field" type="action"
37   * @jameleon.step Find the given form and set it as the working form
38   * @jameleon.step Find the given hidden field and set its value
39   */
40  public class IESetHiddenFieldTag extends IEFunctionTag {
41  
42      /***
43       * The name of the hidden field
44       * @jameleon.attribute required="true" contextName="ieSetHiddenFieldName"
45       */
46      protected String name;
47  
48      /***
49       * The value to set the hidden field to
50       * @jameleon.attribute required="true" contextName="ieSetHiddenFieldValue"
51       */
52      protected String value;
53  
54      /***
55       * The name, id or index of the form
56       * @jameleon.attribute contextName="ieSetHiddenFieldForm"
57       */
58      protected String form;
59  
60      public void testBlock() {
61          setWorkingForm(form);
62          setHiddenFieldValue(name, value);
63      }
64  }