Tags:
create new tag
, view all tags
-- JoaoCarreira - 22 Dec 2009

Message Box

The MessageBox component allows the creation of dialog boxes to ask the application user what decission to take about some applicational circunstances.

This component allows the reation of the following boxes:
Error:
messageBoxError.PNG
Question:
messageBoxQuestion.PNG
Info:
messageBoxInfo.PNG
Warning:
messageBoxWarning.PNG

Message Box Component
Declaration

<xvw:messageBox ... >

Properties
Property Type Description
id string Component Id
messageBoxType

Enumeration

MessageBox.MessageBoxType

Type of icon to be shown in the Dialog Box. The options are:

WARNING - Warning box

QUESTION - Interogation Box

INFO - Info Box

ERROR - Error Box

title string / EL The title of the message box
defaultConfirmButton string Confirm button Id. Sellected by default, if the user presses ENTER the button action is executed
defaultCancelButton string Cancel button Id. Sellected by default, if the user presses ESC, the button action is executed
message string / EL The content of the message box
buttons

Enumeration

MessageBox.MessageBoxButtons

Predefined button Template. Valid values are:

YES - Box with only one button with label YES

OK - Box with only one button with label OK

OKCANCEL - Box with two buttons, one with label OK and another one with label CANCEL

YESNO - Box with two buttons, one with label YES and another one with label NO

YESNOCANCEL - Box with 3 buttons, one with label YES, another with NO and one with CANCEL

actions JSON Array with EL Methods JSON Array with same number of possitions as buttons defined in "buttons". Example, if in buttons is defined OKCANCEL a array with two possitions should be build, one for the action OK and one for CANCEL. eg: ['#{viewBean.myOkAction}','#{viewBean.myCancelAction}'].
minWidth int The minimum width of the MessageBox
maxWidth int The maximum width of the MessageBox
Childs

This compont can have as childs the components xvw:menu or Childs.

Examples of use
MessageBox Declaration in a viewer using the predefined buttons.
<xvw:viewer (...)>
 <xeo:form id='formUser'>
  (...)
        <xvw:messageBox 
   id='myMessageBox' 
   messageBoxType='QUESTION'
   title='Message Box Title' 
   message='My Message Box text'
   buttons='OKCANCEL' 
   actions="['#{viewBean.ok}','#{viewBean.cancel}']"
  />
  (...) 

Show the dialog Box starting from a action of a viewer Bean:

 // Action which is necessary to be confirmed b the user
 public void arquivarQuestion() {
  Dialogs.showDialog( getViewRoot(), "formUser:myMessageBox" );
 }
 public void ok() {
  // The user pressed ok
  // Do Work
 }
 public void cancel() {
  // The user pressed cancel
  // Do Work
 }

If there is no action associated to the button, the action can be empty. If so happens, the button only closes the dialog box, without executing any action.

Declaring a MessageBox in a viewer using customized buttons.

The behavior is the same, but the attributes buttons and actions do not have to be defined in the MessageBox component, but in the childs of type xvw:menu

<xvw:messageBox 
  id='myMessageBox' 
  messageBoxType='WARNING'
  title='Message Box Title' 
  defaultConfirmButton='btn2'
  defaultCancelButton='btn3'
  message='My Message Box text' 
>
 <xvw:menu text='Button 1' id='btn1' serverAction='#{viewBean.btn1Action}' />
 <xvw:menu text='Button 2' id='btn2' serverAction='#{viewBean.btn2Action}' />
 <xvw:menu text='Button 3' id='btn3' serverAction='#{viewBean.btn3Action}' />
</xvw:messageBox>

Topic attachments
I Attachment Action Size Date Who Comment
Unknown file formatPNG messageBoxError.PNG manage 3.9 K 2011-02-09 - 15:02 NicolauGrosskopf  
Unknown file formatPNG messageBoxInfo.PNG manage 3.8 K 2011-02-09 - 15:03 NicolauGrosskopf  
Unknown file formatPNG messageBoxQuestion.PNG manage 4.4 K 2011-02-09 - 15:03 NicolauGrosskopf  
Unknown file formatPNG messageBoxWarning.PNG manage 4.2 K 2011-02-09 - 15:03 NicolauGrosskopf  
Edit | Attach | Print version | History: r10 | r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r5 - 2011-03-23 - NicolauGrosskopf
 

No permission to view TWiki.WebTopBar

This site is powered by the TWiki collaboration platform Powered by Perl

No permission to view TWiki.WebBottomBar