# Setting Portlet Modes and States

You can add buttons to portlet titlebars that provide the following portlet modes and states:

## Modes

- Edit - Lets you specify a custom file that lets users modify the portlet's content when they click the Edit button.
- Help - Lets you specify a custom file that shows users help content for the portlet when they click the Help button.
- Float - Lets you display the portlet in a popup window when users click the Float button.

## States

- Minimize - Collapses the portlet, leaving only the titlebar, when users click the Minimize button.
- Maximize - Makes the portlet take up the entire desktop area (not including the desktop header and footer) when users click the Maximize button.
- Delete - Removes the portlet from the users' desktops when they click the Delete button.

When you define a portlet with the Portlet Wizard, one of the options is to enable or disable the titlebar. For example:

Here is an example of the Dictionary Portlet with a titlebar:

The Dictionary Portlet without a titlebar:

The Titlebar can be edited in the Portlet Wizard at creation time, or in the Portlet Designer by taking the following steps:

- From WebLogic Workshop, open the Portlet Designer by double-clicking on the *.portlet file.
- From the Properties Editor, change the values for the Titlebar attribute.
- Select File > Save to preserve your changes.

In the WebLogic Workshop IDE, you can add or modify a portlet's modes and states. The possible values are as follows:

Modes: Edit, Help, Float

States: Minimizable, Maximizable, Deletable

### About the Icons Used in Portlet Titlebars

The state and mode icons used in portlet titlebars are stored in a skin or theme /images directory. The portal framework reads the portal Web project's WEB-INF/netuix-config.xml file to determine which of these graphics to use for the portlet's different states and modes (minimize, maximize, help, edit).

## Setting Portlet Modes

When you create a portlet mode, a set of Mode Properties appears in the Property Editor. To create a portlet mode, you can click Insert > Edit Mode and Insert > Help Mode from the IDE's top-level menu. Or you can right-mouse click on the portlet's titlebar, and then enable or disable the modes on the menu. For example:

The default icon for the Edit mode is the pencil, and the default icon for Help is the question mark.

By selecting the mode in the Portlet Modes rectangle as shown above, you can view the mode's details in the Property Editor pane. In those property sheets, you will specify the URI for your Help JSP that gets called when a user clicks the Help icon, and the Edit JSP that can be used to modify characteristics about the portlet.

For descriptions of these properties, see Mode Properties in the Portlet Properties topic.

### Making Portlets Floatable

Float is a standard mode supported by WebLogic Portal and can be added to any portlet by inserting the float statement in the titlebar element of the .portlet file. For example:

    <netuix:titlebar>
        <netuix:float/>
    </netuix:titlebar>

## Setting Portlet States

You can determine whether a portlet is to be minimizable, maximizable, or deletable. When using the portlet wizard, these settings are available on the Portlet Details screen. These settings can also be edited in the Portlet Designer by taking the following steps:

1. From WebLogic Workshop, open the Portlet Designer by double-clicking on the portlet.
2. From the Properties Editor, change the values for Mode and State attributes.
3. Select File > Save to preserve your changes.

Related Topics

Customizing Portlets