com.wewebu.ow.server.ui
Class OwScriptTable

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwScriptTable

public class OwScriptTable
extends Object

Utility class for Java Script supported HTML tables with selection and context menu.
In addition java script code needs to be included into the page. See uilevel<x>.js.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
protected static String CHECKBOX_PREFIX
           
protected static String CONTEXT_MENU_ICON_POSTFIX
           
protected static String CONTEXT_MENU_LABEL_POSTFIX
           
protected static String ROW_PREFIX_MULTISELECT
           
protected static String ROW_PREFIX_SINGLESELECT
           
 
Constructor Summary
OwScriptTable()
           
 
Method Summary
static String getSelectableListCheckBoxName(String sTableId_p)
          get the name of the checkbox in the selectable table
static String getSelectableListContextMenuID(String sTableId_p)
          get the ID of the context menu in the table
static void writeSelectableListContextMenuEnd(String sTableId_p, Writer w_p)
          end context menu
static void writeSelectableListContextMenuStart(String sTableId_p, Writer w_p, String strClass_p)
          write the start tag enclosing a context menu HTML
static void writeSelectableListContextMenuTREntry(String sTableId_p, Writer w_p, String sClassNamePrefix_p, int iIndex_p, String sEventURL_p, String sFormName_p, String sIcon_p, String sLabel_p)
          insert a menu item for the context menu
static void writeSelectableListEnableScript(String sTableId_p, Writer w_p, OwAppContext context_p)
          enable the java script driven table
static void writeSelectableListHandlerScript(String sTableId_p, Writer w_p, String sJavaScriptCode_p)
          insert a handler code that will be called if the user clicks a row Use the following parameters inside your code fIndex_p index of selected row rownode_p selected TR tag fSelected_p true = row was selected
static void writeSelectableListHeaderStart(String sTableId_p, Writer w_p, String strHeaderClass_p, OwAppContext context_p)
          write a TR table row start tag for the header that supports script driven table
static void writeSelectableListRowStart(Locale locale_p, String sTableId_p, Writer w_p, int iIndex_p, String strRowClass_p, boolean fMultiselect_p)
          write a TR table row start tag for each row that supports script driven table
static void writeSelectableListRowStart(Locale locale_p, String sTableId_p, Writer w_p, int iIndex_p, String strRowClass_p, String strSelectedRowClass_p, boolean fMultiselect_p, boolean fSelected_p)
          write a TR table row start tag for each row that supports script driven table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_MENU_LABEL_POSTFIX

protected static final String CONTEXT_MENU_LABEL_POSTFIX
See Also:
Constant Field Values

CONTEXT_MENU_ICON_POSTFIX

protected static final String CONTEXT_MENU_ICON_POSTFIX
See Also:
Constant Field Values

ROW_PREFIX_MULTISELECT

protected static final String ROW_PREFIX_MULTISELECT
See Also:
Constant Field Values

ROW_PREFIX_SINGLESELECT

protected static final String ROW_PREFIX_SINGLESELECT
See Also:
Constant Field Values

CHECKBOX_PREFIX

protected static final String CHECKBOX_PREFIX
See Also:
Constant Field Values
Constructor Detail

OwScriptTable

public OwScriptTable()
Method Detail

getSelectableListCheckBoxName

public static String getSelectableListCheckBoxName(String sTableId_p)
get the name of the checkbox in the selectable table

Parameters:
sTableId_p - String the ID that identifies the table if more tables are in one page
Returns:
String check box ID

getSelectableListContextMenuID

public static String getSelectableListContextMenuID(String sTableId_p)
get the ID of the context menu in the table

Parameters:
sTableId_p - String the ID that identifies the table if more tables are in one page
Returns:
String check box ID

writeSelectableListHandlerScript

public static void writeSelectableListHandlerScript(String sTableId_p,
                                                    Writer w_p,
                                                    String sJavaScriptCode_p)
                                             throws IOException
insert a handler code that will be called if the user clicks a row Use the following parameters inside your code fIndex_p index of selected row rownode_p selected TR tag fSelected_p true = row was selected

Parameters:
sTableId_p - String the ID that identifies the table if more tables are in one page
w_p - Writer
sJavaScriptCode_p - java script code to call
Throws:
IOException

writeSelectableListEnableScript

public static void writeSelectableListEnableScript(String sTableId_p,
                                                   Writer w_p,
                                                   OwAppContext context_p)
                                            throws IOException
enable the java script driven table

Parameters:
sTableId_p - String the ID that identifies the table if more tables are in one page
w_p - Writer
context_p - OwAppContext
Throws:
IOException

writeSelectableListRowStart

public static void writeSelectableListRowStart(Locale locale_p,
                                               String sTableId_p,
                                               Writer w_p,
                                               int iIndex_p,
                                               String strRowClass_p,
                                               boolean fMultiselect_p)
                                        throws IOException
write a TR table row start tag for each row that supports script driven table

Parameters:
locale_p - current locale
sTableId_p - String the ID that identifies the table if more tables are in one page
w_p - Writer
iIndex_p - int row index
strRowClass_p - String class name
fMultiselect_p - boolean true = table will allow multi selection, false = single selection only
Throws:
IOException

writeSelectableListRowStart

public static void writeSelectableListRowStart(Locale locale_p,
                                               String sTableId_p,
                                               Writer w_p,
                                               int iIndex_p,
                                               String strRowClass_p,
                                               String strSelectedRowClass_p,
                                               boolean fMultiselect_p,
                                               boolean fSelected_p)
                                        throws IOException
write a TR table row start tag for each row that supports script driven table

Parameters:
locale_p - current locale
sTableId_p - String the ID that identifies the table if more tables are in one page
w_p - Writer
iIndex_p - int row index
strRowClass_p - String class name
strSelectedRowClass_p - String class name
fMultiselect_p - boolean true = table will allow multi selection, false = single selection only
fSelected_p - true = line is rendered as checked
Throws:
IOException

writeSelectableListHeaderStart

public static void writeSelectableListHeaderStart(String sTableId_p,
                                                  Writer w_p,
                                                  String strHeaderClass_p,
                                                  OwAppContext context_p)
                                           throws Exception
write a TR table row start tag for the header that supports script driven table

Parameters:
sTableId_p - String the ID that identifies the table if more tables are in one page
w_p - Writer
strHeaderClass_p - String class name
context_p - OwAppContext
Throws:
Exception

writeSelectableListContextMenuStart

public static void writeSelectableListContextMenuStart(String sTableId_p,
                                                       Writer w_p,
                                                       String strClass_p)
                                                throws Exception
write the start tag enclosing a context menu HTML

Parameters:
sTableId_p - String the ID that identifies the table if more tables are in one page
w_p - Writer
strClass_p - classname
Throws:
Exception

writeSelectableListContextMenuEnd

public static void writeSelectableListContextMenuEnd(String sTableId_p,
                                                     Writer w_p)
                                              throws Exception
end context menu

Parameters:
w_p -
Throws:
Exception

writeSelectableListContextMenuTREntry

public static void writeSelectableListContextMenuTREntry(String sTableId_p,
                                                         Writer w_p,
                                                         String sClassNamePrefix_p,
                                                         int iIndex_p,
                                                         String sEventURL_p,
                                                         String sFormName_p,
                                                         String sIcon_p,
                                                         String sLabel_p)
                                                  throws Exception
insert a menu item for the context menu

Parameters:
sTableId_p - String the ID that identifies the table if more tables are in one page
w_p - Writer
sClassNamePrefix_p - String classname prefix will be extended with __Item, _Icon,_Label
iIndex_p - int index of entry
sEventURL_p - event URL to call
sFormName_p - HTML form name
sIcon_p - icon HTML for entry
sLabel_p - label for entry
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.