// get the form name
String formName = getParentFormName(context);
URLEncoder encoder = context.getURLEncoder();
/*Object destination = node.getAttributeValue(context, DESTINATION_ATTR);*/
// get the body of a function called when there is switchApp event
// not publicly documented because don't want clients doing
// this in general, so for now this attribute not in xsd
Object onClickBody = node.getAttributeValue(context,
ON_SWITCH_APP_ATTR);
StringBuffer function = new StringBuffer();
// if no body of function buffer should be empty
// otherwise create new function with parameter called 'type',
// body should refer to 'type' to distinguish between which
// button pushed
if (onClickBody != null)
{
function.append( "var func = new Function( \"type\",\"");
function.append( onClickBody ).append("\");return func('");
function.append( SWITCH_APP_TYPE_GOTO ).append("');");
}
// encode parameters
/*String eventKey = encoder.encodeParameter( EVENT_PARAM );*/
String sourceKey = encoder.encodeParameter( SOURCE_PARAM );
/*String typeKey = encoder.encodeParameter( TYPE_PARAM );*/
StringBuffer handler = new StringBuffer();
FormValueRenderer.addNeededValue(context, formName, sourceKey);