IlvPopupMenuFactory

IlvObject
  |
  +--IlvPopupMenuFactory
Category:
Common component
JavaScript File:
IlvAbstractPopupMenu.js
Description:

This class manages the pop-up menu communication between a thin client and the servlet.

The pop-up menu trigger event is the right-click.

See also:
IlvAbstractPopupMenu#isPopupTrigger
IlvAbstractPopupMenu#displayPopupMenu


Constructor Summary
IlvPopupMenuFactory()

Method Summary
asyncDisplayPopupMenu(data)
Second part of the displayPopupMenu method.
create(data)
Creates the pop-up menu by decoding the data sent by the servlet.
displayPopupMenu(view, event, modelId)
Sends a request to display a pop-up menu in a thin client.
getRequestType()
Returns the string used as the request type when the thin client requests a pop-up menu from the servlet.
onload(context)
Stores/retrieves IlvPopupMenuFactory instances in a static variable, and manages the onload event.
readAction(item, array)
Override this method to handle more action types.
readMenu(array, path)
Decodes the array to create a IlvMenu.
readMenuItem(array)
Decodes the array to create a IlvMenuItem.
setRequestType(requestType)
Sets the string used as the request type when the thin client requests a pop-up menu from the servlet.

Constructor Detail

IlvPopupMenuFactory

IlvPopupMenuFactory()
Creates an instance of IlvPopupMenuFactory.

Method Detail

asyncDisplayPopupMenu

asyncDisplayPopupMenu(data)
Second part of the displayPopupMenu method. As some tasks are synchronous and other are not displayPopupMenu contains the synchronous part, whereas asyncDisplayPopupMenu contains the asynchronous part.

create

create(data)
Creates the pop-up menu by decoding the data sent by the servlet.

The servlet response to the thin client request is in HTML format. If the response contains JavaScript variables, these can be accessed via data.variableName.

For example, if the servlet response is something like:

 <html>
   <body>
     <script>
       myString = "hello world";
     </script>
   </body>
 </html>
 
then the variable myString can be retrieved via data.myString.

This method should not be called directly as its implementation is synchronous and does not display any menu. You should always call displayPopupMenu instead of this method to display a pop-up menu.

This method only creates the pop-up menu by decoding the servlet response in HTML format.

Returns:
Nothing.

See also:
#displayPopupMenu
#getRequestType


displayPopupMenu

displayPopupMenu(view, event, modelId)
Sends a request to display a pop-up menu in a thin client.

This method returns immediately. It returns true if the event is not a pop-up menu trigger event; otherwise, it returnsfalse.

It performs the following tasks asynchronously:

Parameters:
view - The view with which the pop-up menu is associated.
event - The pop-up menu trigger event. An alert is shown if this event is not a pop-up menu trigger.

See also:
#create
IlvAbstractPopup#isPopupTrigger


getRequestType

getRequestType()
Returns the string used as the request type when the thin client requests a pop-up menu from the servlet.

The request type is sent to the server so that the servlet knows the kind of content it should send back to the client. This request type is used each time a pop-up menu is requested.

The default value is popupmenurequested.

See also:
#create


onload

onload(context)
Stores/retrieves IlvPopupMenuFactory instances in a static variable, and manages the onload event.

readAction

readAction(item, array)
Override this method to handle more action types. Supported types by this factory :

readMenu

readMenu(array, path)
Decodes the array to create a IlvMenu.

readMenuItem

readMenuItem(array)
Decodes the array to create a IlvMenuItem.

setRequestType

setRequestType(requestType)
Sets the string used as the request type when the thin client requests a pop-up menu from the servlet. The request type is sent to the server so that the servlet knows the kind of content it should send back to the client. This request type is used each time a pop-up menu is requested.

The default value is popupmenurequested.

See also:
#create

Inherited Methods from IlvObject
callDispose, dispose, getClassName, hashCode, inherits, instanceOf, invoke, registerDispose, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility