Description
This
mobile device JSP function is used in conjunction with the getForm()
function.
Syntax
public
YFCElement getField(YFCDocument formDoc, String fieldName) throws
Exception
Input
Parameters
formDoc - Required. Name of the YFCDocument
from which the element must be extracted.
fieldName -
Required. Name of the form field for which the other attributes need
to be set.
Example
The
following example shows the getField function.
Consider a form
with formName as formName. The following code creates a YFCDocument
from the XHTML form:
YFCDocument ydoc=getForm(formName);
Prior
to setting the attributes of the form for a specific element, getField
can be called as:
YFCElement dropoffLocationElem = getField(ydoc,"lblDropoffLocation");
To
set the type and subtype attributes for the dropoffLocationElem, use:
dropoffLocationElem.setAttribute("type","hidden");
dropoffLocationElem.setAttribute("subtype","Hidden");