Skip to end of banner
Go to start of banner

Pages

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 61 Next »

Getting Started

How to create a page

First of all, create a page in XHTML file format, a file with a .xhtml extension and declared the necessary Namespaces.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
	  xmlns:crm="http://java.sun.com/jsf/composite/crm">

</html>

Define the template of the page in a ui:composition tag.

<ui:composition template=""></ui:composition>

By default a template provides the base interface layout of the page (header, footer, topbar, main menu, content) as well as the following tags:

  • "managedBean" parameter - contains the name of the managed bean that will be used from template
<ui:param name="managedBean" value=""></ui:param>
  • "back-button" placeholder - defines the back button of the page that will be inserted in the left side of the topbar before the title
<ui:define name="back-button"></ui:define>
  • "title" placeholder -  defines the title of the page that will be inserted n the left side of the topbar

<ui:define name="title"></ui:define>	
  • "viewname" placeholder -  defines the view name in breadcrumb of the page

<ui:define name="viewname"></ui:define>	
  • "actions" placeholder - defines the actions of the page that will be inserted in the right side of the topbar

<ui:define name="actions"></ui:define>	
  • "content" placeholder - defines the actual content of the page

<ui:define name="content"></ui:define>	

Namespaces

The following namespaces should be defined in html root element of a page.

Tag Library

URI

Prefix

Contents

XHTML namespacehttp://www.w3.org/1999/xhtml
Tags for xhtml
JavaServer Faces Facelets Tag Libraryhttp://xmlns.jcp.org/jsf/facelets

ui:

Tags for templating
PrimeFaces componentshttp://primefaces.org/ui

p:

Tags for PrimeFaces components
JavaServer Faces Core Tag Libraryhttp://java.sun.com/jsf/core

f:

Tags for JavaServer Faces custom actions that are independent of any particular render kit
Pass-through Attributes Tag Libraryhttp://xmlns.jcp.org/jsf/passthrough

p:

Tags to support HTML5-friendly markup
JavaServer Faces HTML Tag Libraryhttp://java.sun.com/jsf/html

h:

JavaServer Faces component tags for all UIComponent objects
JSTL Functions Tag Libraryhttp://java.sun.com/jsp/jstl/functions

fn:

JSTL 1.2 Functions Tags
JSTL Core Tag Libraryhttp://java.sun.com/jsp/jstl/core

c:

JSTL 1.2 Core Tags
CRM Composite Components Tag Libraryhttp://java.sun.com/jsf/composite/crm

crm:

Tags for CRM Components

Templates

The available templates are:

  • summary_template.xhtml - it is used for a summary page
  • data_entry_template.xhtml - it is used for a data entry page

Managed Bean

A typical JavaServer Faces application includes one or more managed beans, each of which can be associated with the components used in a particular page. 

A managed bean for summary pages must extend SummaryView class and for data entry pages must extend DataEntryView class.

@ManagedBean(name = "summaryManagedBeanView", eager = true)
@ViewScoped
public class SummaryManagedBeanView extends SummaryView {

}

@ManagedBean(name = "dataEntryManagedBeanView", eager = true)
@ViewScoped
public class DataEntryManagedBeanView extends DataEntryView{

}

Class SummaryView 

SummaryView class implements commonly used functions for summary pages.

Class DataEntryView

DataEntryView class implements commonly used functions for data entry pages.

The below list shows functions that can be used from data entry pages:

 public void addCustomFields()

This method add custom fields on the page

 public List<SelectItem> getDefinedLanguageOptions()

This method loads the language options.

 public String getEditorSuggestions(String entityID,String entityTags)

This method 

 public String getEditorSuggestions(String entityID,String entityTags)

This method 

 public List<SelectItem> getOptionsFromString(String options)

This method 

 public List<SelectItem> getOptionsFromString(String options)

This method 

 public List<SelectItem> getOptionsFromString(String options)

This method 

 public Boolean isGooglePlacesAutocompleteEnable()

This method 

 public Boolean isInternationalAddressFormatEnabled()

This method 

 public Boolean isModuleRestricted(String moduleid)

This method 

 public void onload()

This method 

 public List<CRMDO> searchCountry(String searchValue)

This method 

 public void setGoogleAddress(CRMDOContactInfoAddress contactInfoAddress)

This method 

 public CRMDO setMandatoryField(CRMDO dto, String xPath, String value)

This method 

 public void setTranslations()

This method 

 public void setTranslations(CRMDO dto)

This method 

Commonly used functions

The below list shows functions that can be used both from summary and data entry pages:

 public void createArchivedFile(String id)

This method ...

 public Boolean exists(ArrayList<CRMDO> dtoList, CRMDO dto)

This method indicates if the specified data object exists in the specified list.

 public ArrayList<CRMDO> filterDeleted(ArrayList<CRMDO> records)

This method 

 public Set filterDeletedSet(Set records)

This method 

 public void findNode(TreeNode node,CRMDO crmdo)

This method 

 public String formatAmount(CRMDOCurrency currency, BigDecimal amount)

This method 

 public String formatAmount(CRMDOCurrency currency, BigDecimal amount, Boolean showCurrency, Integer scale)

This method 

 public Object formatDate(Object date)

This method 

 public Object formatDateTime(Object date)

This method 

 public Object formatDateTime(Object date, String format)

This method 

 public String formatSearchFilter(String searchFilter)

This method 

 public TreeNode generateTree(ArrayList<CRMDO> categories)

This method 

 public TreeNode generateTree(ArrayList<CRMDO> categories)

This method 

 public List<Object> getActiveInactiveOptions()

This method loads the active/inactive options.

 public String getAllowedFileTypes()

This method 

 public List<SelectItem> getApplicationServerScopeOptions()

This method loads the allowed application server scope options.

 public List<SelectItem> getApplicationServersOptions()

This method loads the application server options

 public List<SelectItem> getBillingTermSchemeCodeOptions()

This method loads the billing term scheme code options.

 public List<SelectItem> getBillingTermSchemeCodeOptions(BillType billType)

This method 

 public ArrayList<CRMDO> getBillingTermSchemeOptions()

This method loads the billing term scheme code options.

 public List<SelectItem> getCountryOptions()

This method loads the country options

 public List<SelectItem> getCurrencyOptions()

This method loads the currency options

 public Date getCurrentDate()

This method returns the current date without milliseconds;

 public String getCurrentYear()

This method returns the current year.

 public String getDateFormat()

This method 

 public String getDateTimeFormat()

This method 

 public String getDayOfWeekLabel(Integer dayOfWeek)

This method 

 public List<SelectItem> getDaysOfMonthOptions()

This method 

 public String getDecimalSeperatorSymbol()

This method 

 public String getDefaultHomePageName(String defaultHomePageId)

This method 

 public List<SelectItem> getHomePageOptions()

This method loads the home page options.

 public List<SelectItem> getHourOptions()

This method loads the hour options.

 public List<SelectItem> getJobTypeOptions()

This method  loads the job type options

 public List<SelectItem> getLanguageOptions()

This method  loads the language options.

 public String getMaxFileSize()

This method 

 public String getMenuoption(List<Menuoption> menuoptions, String menuoptionid)

This method 

 public List<SelectItem> getMinuteOptions()

This method loads the minute options.

 public List<SelectItem> getMinuteOptions(Integer number)

This method loads the minute options.

 public String getMonthLabel(Integer month)

This method

 public List<SelectItem> getMonthNumberOptions()

This method

 public List<SelectItem> getMonthOptions()

This method

 public List<SelectItem> getNormalBillingTermSchemeCodeOptions()

This method loads the normal billing term scheme code options.

 public String getNumberOfDecimalDigits()

This method 

 public String getPath(CRMSession ejbSession)

This method 

 public String getPaymentGatewayCardBrandIcon(String brand)

This method 

 public String getPeriodOrdinalIndicator(String period)

This method 

 public ArrayList<SelectItem> getProductCriterionTypeOptions()

This method returns the product criterion type options.

 public List<SelectItem> getRecurrenceScopeOptions()

This method 

 public ArrayList<CRMDO> getSubscriptionTypeOptions()

This method loads the subscription type options

 public String getThousandSeperatorSymbol()

This method 

 public String getTimeLabel(Integer hour, Integer minutes)

This method 

 public String getTimeLabel(Integer hour, Integer minutes, Integer seconds)

This method 

 public String getTimestamp()

This method 

 public List<SelectItem> getTimezoneOptions()

This method loads the available timezone options.

 public String getTranslation(String label)

This method

 public List<SelectItem> getUnitOfTimeOptions()

This method

 public String getValueTranslation(String value)

This method

 public List<SelectItem> getWeekdayOptions()

This method

 public List<SelectItem> getYearOptions()

This method

 public List<Object> getYesNoOptions()

This method loads the yes/no options.

 public List<SelectItem> loadMonthNumberOptions()

This method loads the month (number) options.

 public List<SelectItem> loadPrintoutExportTypeOptions()

This method list of printout export type options.

 public ArrayList<SelectItem> loadYearOptions()

This method loads the year options.

 public void navigateToHomePage()

This method 

 public void refresh()

This method 

 public List<CRMDOCommunity> searchCommunities(String searchValue)

This method 

 public List<CRMDO> searchGroups(String searchValue)

This method 

 public List<CRMDO> searchUnits(String searchValue)

This method 

 public List<CRMDO> searchUsers(String query)

This method 

 public String setContactOrderBy()

This method 


Template Pages






  • No labels