edu.internet2.middleware.grouper.ui.tags
Class GrouperUiFunctions

java.lang.Object
  extended by edu.internet2.middleware.grouper.ui.tags.GrouperUiFunctions

public class GrouperUiFunctions
extends Object

EL functions


Constructor Summary
GrouperUiFunctions()
           
 
Method Summary
static String escapeJavascript(String input)
          Escapes XML ( ampersand, lessthan, greater than, double quote), and single quote with slash
static String hideShowButtonText(String hideShowName)
           print out the button text for a hide show Each hide show has a name, and it should be unique in the app, so be explicit, below you see "hideShowName", that means whatever name you pick First add this css class to elements which should show when the state is show: shows_hideShowName Then add this to things which are in the opposite toggle state: hides_hideShowName Then add this to the button(s): buttons_hideShowName In the business logic, you must init the hide show before the JSP draws (this has name, text when shown, hidden, if show initially, and if store in session): GuiHideShow.init("simpleMembershipUpdateAdvanced", false, GrouperUiUtils.message("simpleMembershipUpdate.hideAdvancedOptionsButton"), GrouperUiUtils.message("simpleMembershipUpdate.showAdvancedOptionsButton"), true); Finally, use these EL functions to display the state correctly in JSP: Something that is hidden/shown style="${grouper:hideShowStyle('hideShowName', true)} Button text: ${grouper:hideShowButtonText('hideShowName')} In the button, use this onclick: onclick="return guiHideShow(event, 'hideShowName');"
static String hideShowStyle(String hideShowName, boolean showWhenShowing)
           print out the style value for a hide show Each hide show has a name, and it should be unique in the app, so be explicit, below you see "hideShowName", that means whatever name you pick First add this css class to elements which should show when the state is show: shows_hideShowName Then add this to things which are in the opposite toggle state: hides_hideShowName Then add this to the button(s): buttons_hideShowName In the business logic, you must init the hide show before the JSP draws (this has name, text when shown, hidden, if show initially, and if store in session): GuiHideShow.init("simpleMembershipUpdateAdvanced", false, GrouperUiUtils.message("simpleMembershipUpdate.hideAdvancedOptionsButton"), GrouperUiUtils.message("simpleMembershipUpdate.showAdvancedOptionsButton"), true); Finally, use these EL functions to display the state correctly in JSP: Something that is hidden/shown style="${grouper:hideShowStyle('hideShowName', true)} Button text: ${grouper:hideShowButtonText('hideShowName')} In the button, use this onclick: onclick="return guiHideShow(event, 'hideShowName');"
static String message(String key, boolean escapeHtml, boolean escapeSingleQuotes)
          prints out a message, assumes it is there
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrouperUiFunctions

public GrouperUiFunctions()
Method Detail

escapeJavascript

public static String escapeJavascript(String input)
Escapes XML ( ampersand, lessthan, greater than, double quote), and single quote with slash

Parameters:
input -
Returns:
the escaped string

message

public static String message(String key,
                             boolean escapeHtml,
                             boolean escapeSingleQuotes)
prints out a message, assumes it is there

Parameters:
key -
escapeHtml - (true to escape html)
escapeSingleQuotes - if escaping html, should we also escape single quotes?
Returns:
the message string

hideShowStyle

public static String hideShowStyle(String hideShowName,
                                   boolean showWhenShowing)
 print out the style value for a hide show
 
 Each hide show has a name, and it should be unique in the app, so be explicit, 
 below you see "hideShowName", that means whatever name you pick
 
 First add this css class to elements which should show when the state is show:
 shows_hideShowName
 
 Then add this to things which are in the opposite toggle state: hides_hideShowName
 
 Then add this to the button(s):
 buttons_hideShowName
  
 In the business logic, you must init the hide show before the JSP draws (this has name,
 text when shown, hidden, if show initially, and if store in session):
 GuiHideShow.init("simpleMembershipUpdateAdvanced", false, 
    GrouperUiUtils.message("simpleMembershipUpdate.hideAdvancedOptionsButton"), 
       GrouperUiUtils.message("simpleMembershipUpdate.showAdvancedOptionsButton"), true);

 Finally, use these EL functions to display the state correctly in JSP:
 Something that is hidden/shown
 style="${grouper:hideShowStyle('hideShowName', true)}
 
 Button text:
 ${grouper:hideShowButtonText('hideShowName')}
 
 In the button, use this onclick:
 onclick="return guiHideShow(event, 'hideShowName');"
 

Parameters:
hideShowName -
showWhenShowing - true if the section should show when the hide show is showing
Returns:
the style

hideShowButtonText

public static String hideShowButtonText(String hideShowName)
 print out the button text for a hide show
 
 Each hide show has a name, and it should be unique in the app, so be explicit, 
 below you see "hideShowName", that means whatever name you pick
 
 First add this css class to elements which should show when the state is show:
 shows_hideShowName
 
 Then add this to things which are in the opposite toggle state: hides_hideShowName
 
 Then add this to the button(s):
 buttons_hideShowName
  
 In the business logic, you must init the hide show before the JSP draws (this has name,
 text when shown, hidden, if show initially, and if store in session):
 GuiHideShow.init("simpleMembershipUpdateAdvanced", false, 
    GrouperUiUtils.message("simpleMembershipUpdate.hideAdvancedOptionsButton"), 
       GrouperUiUtils.message("simpleMembershipUpdate.showAdvancedOptionsButton"), true);

 Finally, use these EL functions to display the state correctly in JSP:
 Something that is hidden/shown
 style="${grouper:hideShowStyle('hideShowName', true)}
 
 Button text:
 ${grouper:hideShowButtonText('hideShowName')}
 
 In the button, use this onclick:
 onclick="return guiHideShow(event, 'hideShowName');"
 

Parameters:
hideShowName -
Returns:
the text