// Get the enclosing form tag
DSPFormTag dspFormTag = getDSPFormTag ();
Properties inputAttrs = new Properties();
// Get the request and response
DynamoHttpServletRequest request =
Utils.getDynamoRequest (mPageContext.getRequest ());
response = request.getResponse();
// Turn off IllegalStateException for dspjsp pages
oldStrictValue = response.setStrictOutputAccess(false);
// See if this is a submit tag
boolean isSubmit =
(mTypeSpecified &&
mType != null &&
("submit".equals (mType) ||
"image".equals (mType)));
// utility booleans
boolean isCheckbox =
(mTypeSpecified &&
mType != null &&
"checkbox".equals (mType));
boolean isRadio =
(mTypeSpecified &&
mType != null &&
"radio".equals (mType));
// Resolve the bean name against the imports
mBean = ImportedBeans.resolveName (mBean, mPageContext);
// Compute the property name
PropertyName propertyName = PropertyName.createPropertyName (mBean);
// Compute the string name, which must be calculated specially
// if the bean is an array reference
String nameString =
(mBean.indexOf ('[') >= 0) ?
DropletDescriptor.evalDynamicDimensions (propertyName, request) :
mBean;
// See if that tag's name is overridden by an explicit "name"
String tagName =
mNameSpecified ?
mName :
nameString;
// Compute the converters
ConverterInfo converterInfo =
Utils.computeConverterInfo
(mConverter,
mConverterSpecified,
mFormat,
mFormatSpecified,
mDate,
mDateSpecified,
mNumber,
mNumberSpecified,
mCurrency,
mCurrencySpecified,
mRequired,
mRequiredSpecified,
mValueishtml,
mMindate,
mMindateSpecified,
mMaxdate,
mMaxdateSpecified,
mNullable,
mLocale,
mLocaleSpecified,
mSymbol,
mSymbolSpecified,
mEuro,
mEuroSpecified,
mCurrencyConversion,
mCurrencyConversionSpecified,
mGroupingsize,
mGroupingsizeSpecified);
TagConverter converter = null;
Properties converterArgs = null;
if (converterInfo != null) {
converter = converterInfo.getConverter ();
converterArgs = converterInfo.getConverterArgs ();
if (mMindateSpecified && mMindate != null) {
converterArgs.setProperty("mindate",mMindate);
}
if (mMaxdateSpecified && mMaxdate != null){
converterArgs.setProperty("maxdate",mMaxdate);
}
}
// Get the value as a String
String valueString;
if (mBeanvalueSpecified) {
if (mParamvalueSpecified || mValueSpecified) {
throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
}
// Resolve the bean name against the imports
mBeanvalue = ImportedBeans.resolveName (mBeanvalue, mPageContext);
valueString =
DropletDescriptor.getPropertyStringValue
(request,
response,
mBeanvalue,
true,
null,
null);
}
else if (mParamvalueSpecified) {
if (mBeanvalueSpecified || mValueSpecified) {
throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
}
Object paramvalue = request.getObjectParameter(mParamvalue);
if (null == paramvalue){
valueString = "";
}else{
if(null != converter){
valueString = converter.convertObjectToString(request,
paramvalue,
converterArgs);
}else{
valueString = paramvalue.toString();
}
}
}
else if (mValueSpecified) {
if (mBeanvalueSpecified || mParamvalueSpecified) {
throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
}
if (null != converter &&
null != mValue &&
((String)mValue).trim().length() > 0){
Object obj = converter.convertStringToObject(request,
(String)mValue,
converterArgs);
valueString = converter.convertObjectToString(request,
obj,
converterArgs);
}else{
valueString = (mValue == null) ? "" : mValue.toString ();
}
}
else if (isSubmit &&
(mType.equals("image") ||
!DropletDescriptor.hasPropertyValue(request, propertyName)))
{
// We're trying to emulate the code in
// atg.servlet.pagecompile.InputSGMLTree
// that omits a value attribute for certain kinds of submit and all
// image tags.
valueString = null;
}
else if (isCheckbox &&
!mValueSpecified){
valueString = "true";
}
else {
valueString =
DropletDescriptor.getPropertyHtmlStringValue
(request,
response,
propertyName,
true,
converter,
converterArgs);
}
// Output the input tag
//out.print ("<input");
// Output the type
if (mTypeSpecified) {
inputAttrs.put("type",mType);
//out.print (" type=\"");
//out.print (mType);
//out.print ("\"");
}
// Output the name
inputAttrs.put("name",tagName);
//out.print (" name=\"");
//out.print (tagName);
//out.print ("\"");
// Output the value
if (valueString != null) {
inputAttrs.put("value",valueString);
//out.print (" value=\"");
// out.print (valueString);
//out.print ("\"");
}
// Output the "src"
if (mSrcSpecified) {
String encodedSrc = request.encodeURL ( mSrc,
true,
true,
true,
true);
inputAttrs.put("src",encodedSrc);