+

Search Tips   |   Advanced Search


WML tags used by the portal JSPs

Learn about the tags in the portal JSPs that are used for WML devices. These tags can be found in the portal tag library located in the WebSphere Portal directory

The following taglib declarations must be provided in the parent JSP of the theme.

 <%@ taglib uri="/WEB-INF/tld/portal.tld" prefix="wps" %>
 <%@ taglib uri="/WEB-INF/tld/portal-wml.tld" prefix="portal-wml" %>

Use the tags described in this topic to modify the appearance and layout of the portal page.


Summary of the WML JSP tags

The following table provides a brief description of each tag. For more complete descriptions, see Detailed descriptions of the WML JSP tags .

Do not use portal tags in portlet JSPs.

Tag Description
<portal-wml:popupMenu/> Generates the markup for a pop-up menu. This tag should be used only in theme JSPs for WML.
<portal-wml:popupMenuTemplate/> Defines the template that is used to define each pop-up menu item. This tag should be used only in theme JSPs for WML.
<portal-wml:popupMenuItem/> Defines a single entry in the pop-up menu. This tag should be used only in theme JSPs for WML.
<portal-wml:popupMenuParam/> Defines a parameter of a pop-up menu item. This tag should be used only in theme JSPs for WML.


Detailed descriptions of the WML JSP tags

The following tags are used by the portal JSPs.

Some of the tags and attributes in the tag library are not listed here because they are either obsolete or should not be used for some other reason.

<portal-wml:popupMenu maxItem="number">

Generates the markup for the pop-up menu. This tag is designed to work with WML clients that might require a customized pop-up menu for some screens. The contents of the menu are defined by other tags. The actual markup for the menu is produced by this tag. The basic method of producing the pop-up menu is as follows:

  1. Define the menu template (using the <portal-wml:popupMenuTemplate> tag)

  2. Define each item in the menu (using the <portal-wml:popupMenuItem> and <portal-wml:popupMenuParam> tags)

  3. Generate the markup (using the <portal-wml:popupMenu> tag)

By default, this tag produces markup for all menu items that have been defined. The optional parameter maxItem can be used to limit the markup to only the first number of items. As an example, the following tags could be placed in the <template/> section of a WML deck (in the /themes/wml/Default.jsp file):

    
  <template>

     <%-- basic template for the popup menu --%>
     <portal-wml:popupMenuTemplate>
        <do type="options" label="{0}">
             {1}
        </do>
     </portal-wml:popupMenuTemplate>

     <%-- 1. Back --%>
     <portal-wml:popupMenuItem item="1">
        <portal-wml:popupMenuParam param="0">
             <portal:text key="link.back.wml" bundle="nls.engine"/>
        </portal-wml:popupMenuParam>
        <portal-wml:popupMenuParam param="1">
             <prev/>
        </portal-wml:popupMenuParam>
     </portal-wml:popupMenuItem>

     <%-- 2. Home --%>
     <portal-wml:popupMenuItem item="2">
         <portal-wml:popupMenuParam param="0">
             <portal:text key="link.home.wml" bundle="nls.engine"/>
         </portal-wml:popupMenuParam>
         <portal-wml:popupMenuParam param="1">
             <go href="<portal:url home="public" />"/>
         </portal-wml:popupMenuParam>
     </portal-wml:popupMenuItem>

     <%-- 3. LogIn --%>
     <portal-wml:popupMenuItem item="3">
         <portal-wml:popupMenuParam param="0">
             <portal:text key="link.login.wml" bundle="nls.engine"/>
         </portal-wml:popupMenuParam>
         <portal-wml:popupMenuParam param="1">
             <go href="<portal:url screen="Login" />"/>
         </portal-wml:popupMenuParam>
     </portal-wml:popupMenuItem>

     <portal:if notScreen="Login" >
         <portal-wml:popupMenu />
     </portal:if>

  </template>
    

  1. The <portal-wml:popupMenuTemplate/> defines each item as a WML <do type="options" /> statement that has a variable label and body.

  2. The first item in the menu is defined to have a label of "Back" (link.back.wml in the nls/engine.properties bundle) and the body is mapped to the <prev/> command.

  3. The second item is defined to have a label of "Home" and is mapped to the home page by the <portal:url> tag.

  4. The third item is defined to have a label of "Login" and is mapped to the login page.

  5. The last <portal:if> tag generates the markup for the pop-up menu for all screen other than the login screen.

Because this is all defined in the WML template, all cards in the WML deck will use this menu definition. On an Openwave browser, the menu items are generated with numbers that can be pressed to invoke the option. This menu would be rendered

     1 Back
     2 Home
     3 Login
    

On other browsers (such as Nokia), the menu items are displayed without numbers. So on some phones the menu would be rendered

     Back
     Home
     Login
    

and the user would have to scroll down to select each item. However, on the Login screen, the third item should be mapped to the LoginUser command, rather than the Login screen, following these steps:

  1. Not generating the pop-up menu markup in the <template/> section (using <portal:if notScreen="Login"/>)

  2. Redefining the third menu item in the <card/> section

  3. Generating the markup in the <card/> section

In the file, /screens/wml/Login.jsp:

    <card id="Login" link.login" bundle="nls.engine"/>">
        <portal-wml:popupMenuItem item="3">
            <portal-wml:popupMenuParam param="1">
                <go href="<portal:url command="LoginUser"/>" method="post">
                    <postfield name="userid" value="$userid"/>
                    <postfield name="password" value="$password"/>
                </go>
            </portal-wml:popupMenuParam>
        </portal-wml:popupMenuItem>

        <portal-wml:popupMenu />

        ...

    <card />
    

<portal-wml:popupMenuTemplate/>

Defines the template that is used to define each pop-up menu item. The body of this tag should be a message format pattern with up to five parameter substitutions (numbered {0} to {4}).

The following example defines a template that will use parameter 0 as its label and parameter 1 as its action.

        <portal-wml:popupMenuTemplate>
            <do type="options" label="{0}">
                {1}
            </do>
        </portal-wml:popupMenuTemplate>
    

<portal-wml:popupMenuItem item="menu_item"/>

Defines a single entry in the pop-up menu. The body of this tag should be a series of <portal-wml:popupMenuParam> tags that define the parameters for menu_item. The item parameter is required and ranges from 1 to 10.

<portal-wml:popupMenuParam param="n" trim="true|false"/>

Defines a parameter of a pop-up menu item. The body of this tag should be a string to be substituted for the {n} parameter in the pop-up menu template. The param attribute is required and should only appear nested inside of a <portal-wml:popupMenuItem> tag. By default, the body of the tag is trimmed before being substituted into the template. If trimming is not desired, it can be turned off by setting the optional trim attribute to "false".


Parent topic:

Portal design reference


Related reference


Drag and drop JSP tags


Related information


Tags used by the portal JSPs