
<%@page import = "oracle.portal.provider.v2.render.PortletRenderRequest,
                  oracle.portal.provider.v2.http.HttpCommonConstants,
                  oracle.portal.utils.xml.v2.XMLUtil"

   contentType = "text/vnd.oracle.mobilexml"
%>

<SimpleText>
    <SimpleTextItem>
        This portlet has two public portlet parameters that can 
        receive values from page parameters.
    </SimpleTextItem>
</SimpleText>

<SimpleTable border='1'>
    <SimpleTableHeader>
        <SimpleCol>
            Parameter Name
        </SimpleCol>
        <SimpleCol>
            Value
        </SimpleCol>
    </SimpleTableHeader>
    <SimpleTableBody>

<%
try
{
    PortletRenderRequest portletRequest = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);

    //
    // The portlet definition in provider.xml includes 
    // public portlet parameters "param1" and "param2"
    //
    String[] names = { "param1", "param2" };

    // Display values for each of the public portlet 
    // parameters "param1" and "param2"
    for ( int i = 0; i < 2; i++ )
    {
        // Get the public portlet parameter values
        String[] values = portletRequest.getParameterValues(names[i]);

        // Display the parameter's values.
        // Each portlet parameter can have 0, 1, or multiple values.
        if ( values == null )
        {
            // No values for this parameter.
%>
        <SimpleRow>
            <SimpleCol>
                <%= XMLUtil.escapeXMLText(names[i]) %>
            </SimpleCol>
            <SimpleCol>
                No values have been submitted yet.
            </SimpleCol>
        </SimpleRow>
<%
        }
        else
        {
            // Display each non-null value of the current parameter
            // on a separate line.
            for ( int j = 0; (values != null) && (j < values.length); j++ )
            {
%>
        <SimpleRow>
            <SimpleCol>
                <%= XMLUtil.escapeXMLText(names[i]) %>
            </SimpleCol>
            <SimpleCol>
                <%= XMLUtil.escapeXMLText(values[j]) %>
            </SimpleCol>
        </SimpleRow>
<%
            }
        }
    }
}
catch (Exception e)
{
%>
    <br>Exception occurred: <%= e.getMessage() %>
<%
}
%>
    </SimpleTableBody>
</SimpleTable>

