📄 form.html
字号:
for the specified variable then an exception will be raised.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable name that was completed.<DD><CODE>value</CODE> - the double value that was answered.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the answer type does not correspond with the field type.</DL></DD></DL><HR><A NAME="setAnswer(java.lang.String, boolean)"><!-- --></A><H3>setAnswer</H3><PRE>public void <B>setAnswer</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> variable, boolean value)</PRE><DL><DD>Sets a new boolean value to a given form's field. The field whose variable matches the requested variable will be completed with the specified value. If no field could be found for the specified variable then an exception will be raised.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable name that was completed.<DD><CODE>value</CODE> - the boolean value that was answered.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the answer type does not correspond with the field type.</DL></DD></DL><HR><A NAME="setAnswer(java.lang.String, java.util.List)"><!-- --></A><H3>setAnswer</H3><PRE>public void <B>setAnswer</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> variable, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/List.html" title="class or interface in java.util">List</A> values)</PRE><DL><DD>Sets a new values to a given form's field. The field whose variable matches the requested variable will be completed with the specified values. If no field could be found for the specified variable then an exception will be raised.<p> The Objects contained in the List could be of any type. The String representation of them (i.e. #toString) will be actually used when sending the answer to the server.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable that was completed.<DD><CODE>values</CODE> - the values that were answered.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.</DL></DD></DL><HR><A NAME="setDefaultAnswer(java.lang.String)"><!-- --></A><H3>setDefaultAnswer</H3><PRE>public void <B>setDefaultAnswer</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> variable)</PRE><DL><DD>Sets the default value as the value of a given form's field. The field whose variable matches the requested variable will be completed with its default value. If no field could be found for the specified variable then an exception will be raised.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable to complete with its default value.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the form is not of type "submit".<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the form does not include the specified variable.</DL></DD></DL><HR><A NAME="getFields()"><!-- --></A><H3>getFields</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A><<A HREF="../../../org/jivesoftware/smackx/FormField.html" title="class in org.jivesoftware.smackx">FormField</A>> <B>getFields</B>()</PRE><DL><DD>Returns an Iterator for the fields that are part of the form.<P><DD><DL><DT><B>Returns:</B><DD>an Iterator for the fields that are part of the form.</DL></DD></DL><HR><A NAME="getField(java.lang.String)"><!-- --></A><H3>getField</H3><PRE>public <A HREF="../../../org/jivesoftware/smackx/FormField.html" title="class in org.jivesoftware.smackx">FormField</A> <B>getField</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> variable)</PRE><DL><DD>Returns the field of the form whose variable matches the specified variable. The fields of type FIXED will never be returned since they do not specify a variable.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>variable</CODE> - the variable to look for in the form fields.<DT><B>Returns:</B><DD>the field of the form whose variable matches the specified variable.</DL></DD></DL><HR><A NAME="getInstructions()"><!-- --></A><H3>getInstructions</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getInstructions</B>()</PRE><DL><DD>Returns the instructions that explain how to fill out the form and what the form is about.<P><DD><DL><DT><B>Returns:</B><DD>instructions that explain how to fill out the form.</DL></DD></DL><HR><A NAME="getTitle()"><!-- --></A><H3>getTitle</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getTitle</B>()</PRE><DL><DD>Returns the description of the data. It is similar to the title on a web page or an X window. You can put a <title/> on either a form to fill out, or a set of data results.<P><DD><DL><DT><B>Returns:</B><DD>description of the data.</DL></DD></DL><HR><A NAME="getType()"><!-- --></A><H3>getType</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getType</B>()</PRE><DL><DD>Returns the meaning of the data within the context. The data could be part of a form to fill out, a form submission or data results.<p> Possible form types are: <ul> <li>form -> Indicates a form to fill out.</li> <li>submit -> The form is filled out, and this is the data that is being returned from the form.</li> <li>cancel -> The form was cancelled. Tell the asker that piece of information.</li> <li>result -> Data results being returned from a search, or some other query.</li> </ul><P><DD><DL><DT><B>Returns:</B><DD>the form's type.</DL></DD></DL><HR><A NAME="setInstructions(java.lang.String)"><!-- --></A><H3>setInstructions</H3><PRE>public void <B>setInstructions</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> instructions)</PRE><DL><DD>Sets instructions that explain how to fill out the form and what the form is about.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instructions</CODE> - instructions that explain how to fill out the form.</DL></DD></DL><HR><A NAME="setTitle(java.lang.String)"><!-- --></A><H3>setTitle</H3><PRE>public void <B>setTitle</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> title)</PRE><DL><DD>Sets the description of the data. It is similar to the title on a web page or an X window. You can put a <title/> on either a form to fill out, or a set of data results.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>title</CODE> - description of the data.</DL></DD></DL><HR><A NAME="getDataFormToSend()"><!-- --></A><H3>getDataFormToSend</H3><PRE>public <A HREF="../../../org/jivesoftware/smackx/packet/DataForm.html" title="class in org.jivesoftware.smackx.packet">DataForm</A> <B>getDataFormToSend</B>()</PRE><DL><DD>Returns a DataForm that serves to send this Form to the server. If the form is of type submit, it may contain fields with no value. These fields will be removed since they only exist to assist the user while editing/completing the form in a UI.<P><DD><DL><DT><B>Returns:</B><DD>the wrapped DataForm.</DL></DD></DL><HR><A NAME="createAnswerForm()"><!-- --></A><H3>createAnswerForm</H3><PRE>public <A HREF="../../../org/jivesoftware/smackx/Form.html" title="class in org.jivesoftware.smackx">Form</A> <B>createAnswerForm</B>()</PRE><DL><DD>Returns a new Form to submit the completed values. The new Form will include all the fields of the original form except for the fields of type FIXED. Only the HIDDEN fields will include the same value of the original form. The other fields of the new form MUST be completed. If a field remains with no answer when sending the completed form, then it won't be included as part of the completed form.<p> The reason why the fields with variables are included in the new form is to provide a model for binding with any UI. This means that the UIs will use the original form (of type "form") to learn how to render the form, but the UIs will bind the fields to the form of type submit.<P><DD><DL><DT><B>Returns:</B><DD>a Form to submit the completed values.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Smack</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/jivesoftware/smackx/DefaultMessageEventRequestListener.html" title="class in org.jivesoftware.smackx"><B>PREV CLASS</B></A> <A HREF="../../../org/jivesoftware/smackx/FormField.html" title="class in org.jivesoftware.smackx"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/jivesoftware/smackx/Form.html" target="_top"><B>FRAMES</B></A> <A HREF="Form.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 2003-2007 Jive Software. </i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -