public class

PromptListboxTransform

extends AbstractPromptObjectTransform
implements LayoutTransform
java.lang.Object
   ↳ com.microstrategy.web.transform.AbstractTransform
     ↳ com.microstrategy.web.transform.AbstractLayoutTransform
       ↳ com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
         ↳ com.microstrategy.web.app.transforms.PromptListboxTransform

Class Overview

Renders the list of available items inside a listbox, items selected become the answer. This transforms makes use of Tag instances to render HTML output. See reference to TagsFactory.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.web.beans.EnumPromptsBeanEvents
Fields
public FormalParameter multiSelect Boolean flag that specifies whether or not to enable multi-select in selected list.
public FormalParameter selectSize The number of elements that the Selected list box displays.
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
Public Constructors
PromptListboxTransform()
Default no-args constructor, initialize all the formal parameters.
Public Methods
boolean canTransform(Transformable data)
Extends canTransform() by returning true only if the prompt is of type WebPromptTypeObjects or WebPromptTypeElements
String getDescription()
This transforms description.
void initializeCss()
Initialize the CSS information to be used by this transform.
boolean isAnswerComplex()
Determines whether a prompt has a default answer, and if it has, if the default answer is complex.
void renderAvailable(MarkupOutput out)
Renders the list of available items.
void renderCloseSelect(MarkupOutput out)
Renders closing HTML tag for Select list.
void renderEmptyOption(MarkupOutput out)
Renders empty HTML option tag.
void renderEmptyOption(MarkupOutput out, int availableSize)
Renders empty HTML option tag.
void renderListOption(MarkupOutput out, WebDisplayUnit item)
Renders HTML option tag populated with data from WebDisplayUnit instance.
void renderListOption(MarkupOutput out, WebDisplayUnit item, boolean isComplexAnswer)
Renders HTML option tag populated with data from WebDisplayUnit instance.
void renderOpenSelect(MarkupOutput out)
Renders open HTML tag for Select list.
void renderPromptContent(MarkupOutput out)
Renders prompt's content in Question area.
Protected Methods
boolean isNoneOptionRendered()
Indicates whether or not 'none' options needs to be rendered as part of the available list.
void setExtraArguments()
Sets extra arguments for this prompt.
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.AbstractPromptObjectTransform
From class com.microstrategy.web.transform.AbstractLayoutTransform
From class com.microstrategy.web.transform.AbstractTransform
From class java.lang.Object
From interface com.microstrategy.web.transform.LayoutTransform
From interface com.microstrategy.web.transform.Transform

Fields

public FormalParameter multiSelect

Boolean flag that specifies whether or not to enable multi-select in selected list.
Not all prompt types and style support multiselect of elements, so even if this parameter is true, the multiselect functionality might not be available.
This flag is used as a boolean value.

public FormalParameter selectSize

The number of elements that the Selected list box displays.
This flag is used as an int value.

Public Constructors

public PromptListboxTransform ()

Default no-args constructor, initialize all the formal parameters.

Public Methods

public boolean canTransform (Transformable data)

Extends canTransform() by returning true only if the prompt is of type WebPromptTypeObjects or WebPromptTypeElements

Parameters
data object PromptObject to transform
Returns

public String getDescription ()

This transforms description.

Returns
  • the description of the listbox.

public void initializeCss ()

Initialize the CSS information to be used by this transform.
It invokes parent method so shared CSS get initialized as well.

public boolean isAnswerComplex ()

Determines whether a prompt has a default answer, and if it has, if the default answer is complex. Complex answers are those that cannot be displayed by the prompt answer input interface, so they need to be rendered in a separate window

Returns
  • true if the prompt has a default answer and it is complex.

public void renderAvailable (MarkupOutput out)

Renders the list of available items.

Parameters
out MarkupOutput the transform output

public void renderCloseSelect (MarkupOutput out)

Renders closing HTML tag for Select list.

Parameters
out MarkupOutput where to write closing HTML tag.

public void renderEmptyOption (MarkupOutput out)

Renders empty HTML option tag.
It invokes overloaded function renderEmptyOption where new parameter availableSize is passed. THis parameter value corresponds to value defined in FP selectSize.

Parameters
out MarkupOutput where to write empty option.

public void renderEmptyOption (MarkupOutput out, int availableSize)

Renders empty HTML option tag.
Empty option gets rendered only if availableSize is greater or equal than 1 and if 'None' option hasn't been displayed yet (isNoneOptionRendered() method).

Parameters
out MarkupOutput where to write empty option.
availableSize int indicating lenght of the list.

public void renderListOption (MarkupOutput out, WebDisplayUnit item)

Renders HTML option tag populated with data from WebDisplayUnit instance.
This is an overloaded method which acts as wrapper method. It determines whether or not current prompt answer is complex and passes it as parameter to wrapped method renderListOption().

Parameters
out MarkupOutput where to write HTML option tag.
item WebDisplayUnit} data structure where necessary data is obtained.

public void renderListOption (MarkupOutput out, WebDisplayUnit item, boolean isComplexAnswer)

Renders HTML option tag populated with data from WebDisplayUnit instance.
It parses WebDisplayUnit item in order to get data to be used when creating HTML option tag. It uses HTMLHelper to create HTML option. It selects given HTML option if item isn't marked as selected and prompt answer isn't complex.

Parameters
out MarkupOutput where to write HTML option tag.
item WebDisplayUnit data structure where necessary data is obtained.
isComplexAnswer boolean true if prompt answer is complex.

public void renderOpenSelect (MarkupOutput out)

Renders open HTML tag for Select list.
Its size is defined by FP selectSize.

Parameters
out MarkupOutput where to write open select tag.

public void renderPromptContent (MarkupOutput out)

Renders prompt's content in Question area.

Parameters
out MarkupOutput the transform output

Protected Methods

protected boolean isNoneOptionRendered ()

Indicates whether or not 'none' options needs to be rendered as part of the available list.

Returns
  • true if '-none-' is to be displayed

protected void setExtraArguments ()

Sets extra arguments for this prompt.
These arguments will be render later as hidden inputs.