PAPIAttributes papiAttributes) throws PAPIException {
MarinerPageContext pageContext
= ContextInternals.getMarinerPageContext(context);
XFOptionGroupAttributes xfoga =
(XFOptionGroupAttributes) papiAttributes;
optiongroup = new SelectOptionGroup();
TextAssetReference object;
PolicyReferenceResolver resolver =
pageContext.getPolicyReferenceResolver();
// Process the caption as a mariner expression.
object = resolver.resolveQuotedTextExpression(xfoga.getCaption());
optiongroup.setCaption(object);
// Process the prompt as a mariner expression.
object = resolver.resolveQuotedTextExpression(xfoga.getPrompt());
optiongroup.setPrompt(object);
Object enclosing = pageContext.getCurrentElement();
optiongroup.setStyles(pageContext.getStylingEngine().getStyles());
if (enclosing instanceof XFSelectElementImpl) {
XFSelectAttributes selectAttributes =
((XFSelectElementImpl) enclosing).getProtocolAttributes();
// Initialise the attributes specific to this field.
selectAttributes.addOptionGroup(optiongroup);
} else {
SelectOptionGroup sfoga =
((XFOptionGroupElementImpl) enclosing).getOptionGroup();
sfoga.addSelectOptionGroup(optiongroup);
}
pageContext.pushElement(this);
return PROCESS_ELEMENT_BODY;
}