IBM R1 manual Editing existing JSP tags, Changing the functionality of an individual JSP

Page 44

}

To customize the Help icon to align left instead of right, either:

Replace the class attribute with static HTML to define the alignment of the text as follows:

<td align=”left”>

This option works for quick fixes, but requires that you edit each individual setting any time you want to update an alignment style. Alternatively, if you reference a CSS class, by changing the setting in one place only -- the CSS class entry, you can update all references at once.

Create a new entry to the general.css file or in a custom CSS file* included in the general.css file, called hdrHelpILeft and define it as follows:

TD.hdrHelpILeft{ text-align:left;

}

Reference the new entry in the page using the following syntax:

<td class=”hdrHelpILeft”>

(*For information on creating a custom CSS file, see “Adding your own CSS file.”)

A third option is to edit the existing hdrHelpIcon class entry in the CSS to contain the following description:

TD.hdrHelpIcon{ text-align:left;

}

However, this option would change the definition of the class globally instead of changing it within the scope of a single JSP. For more information on global style changes, see “Changing the application style.”

Changing the functionality of an individual JSP

You can change how an individual JavaServer Page functions by editing or removing its JSP tags.

Editing existing JSP tags

You can change how a JavaServer Page functions by editing its JSP tags. You can change the values set for a JSP’s attributes, remove non-required attributes, or add attributes that are attributed to the tag in the TLD file, but are not included in the tag.

For example, editing the attributes of the lms:button tag drastically changes the behavior of the resulting button on a JSP. Depending on the attributes supplied, the lms:button tag can navigate through the application, submit forms or cancel form submission. Likewise, the attributes you supply with an lms:hidden tag can determine whether you are setting or getting values from the JSP’s associated form Bean.

Specifying the next page to display

This code, for a Continue button on the catalogCreateCourseConfirm JSP, uses the nav attribute to define the next action to perform.

<lms:button captionKey="button.continue" nav="<%=setFolderKey%>" tooltipKey="button.alt.continue"/>

Once clicked, this button launches the page defined in the setFolderKey variable on the current page.

Chapter 5: Customizing JavaServer Pages 39

Image 44
Contents Customization Guide List of Trademarks DisclaimerLicensed Materials Property of IBM Page Table of Contents Index Customization setsCreating a tab Customizing the user interface Disclaimer and a word about conventions Acronyms and abbreviationsAcronym or What it stands for Abbreviation Page Chapter Changing settings through the user interface or XML Changing settingsPage Chapter Controlling access to features through permissions To add a role to the systemTo modify permissions settings for an existing role To assign a role to a userTo automatically assign a role to a user To explicitly assign a role to a userControlling access to features Page Chapter Customizing Help Anatomy of a Help topicScript Mosaic-bg Background-repeat repeat-xScript Head Lmsform action=/prefSubmit.do % Editing an existing Help topicReplacing a context-sensitive Help topic Adding your own Help topic HREF=shnotifications.html target=topNotifications/Abr HREF=shenrolled.html target=topEnrolled courses/AbrChapter Customizing JavaServer Pages OverviewServerNameWEB-INFtld Anatomy of a TLD fileLMS JSP tag libraries Defining the url tag in the TLD file Referencing the url tag in a JSPString formName = request.getParameterformName Rtexprvaluetrue/rtexprvalue Attribute Tag ServerNameWEB-INFclassescomlotuselearntaglibDefining a page as a JSP Learning Management System serverAnatomy of a JSP Referencing Struts tags Localizing page contentIncluding tag library descriptor files Including JavaScript source code Including the JSPs that comprise the main templateTd class=formBoxTitleBg colspan=3 valign=middle nowrap LogicnotPresent LogicnotMatchDiv class=formBoxPositionInner DivLogicnotPresent logicpresent name=invalidForm LogicpresentDelivery server Localizing page textPopulating a frameset in a JSP Displaying errors to the userScript language=JavaScript src=js/delivery.js/script Defining resizable frames Making global changes Frameset HtmlApplying customization sets Changing the application styleEditing existing CSS files ServerNamecsslanguageCodebrowserTypeLanguage-version Browser-versionAdding your own CSS files Replacing CSS filesChanging the font size or font style of the application @import urlmyStyles.cssUpdating page text ServerNameWEB-INFclassesresourcesserverNamepropertiesTitlelmsmessage key=application.title //title Application.title = IBM Lotus Learning Management SystemAdding and replacing graphics Lmslinklmsimg src=images/name.gif… //lmslinkReplacing the application logo Learning Management System serverImage.alt.logo = IBM Lotus Learning Management System Delivery serverChanging individual JSPs Replacing a reference to a CSS styleDeliverylogoURL resource=images/myCompanyLogo.gif Changing the style of an individual JSPSpecifying the next page to display Editing existing JSP tagsChanging the functionality of an individual JSP Editing form Bean values with the lmshidden tag Canceling the submission of a formSubmitting a form Removing JSP tags Lmshidden name=%=formName% property=unmodifiedKeywordsLmshidden property=userEvent Custom fieldsIt then checks to see if its a text box type field LogicnotPresent Logicequal Page Chapter Customizing Search Customizing user searchesAdding Ldap attributes to User Search pages Attribute name=HealthPlanChoice type=java.lang.StringHealthPlanChoice = Employees Health Plan Removing fields from User Search pagesCustomizing Offerings Catalog searches Customizing course management and resource searchesAdding custom fields to the Offerings Catalog Removing fields from Offerings Search pagesRemoving fields from the Search pages Chapter Customization sets Creating a customization setLMM De en etc. SalesCS De en EtcPage Attribute Name Type Modified Size Path Customization sets Page Chapter Creating a tab UsersUsers.jsp @ taglib uri=/WEB-INF/tld/lms.tld prefix=lms %Td width=1 valign=top Page Users.rosterUsers.subtitle = Roster Users Navigation.xml Users.rosterUsers.search Users.rosterUsers.search.confirmTrail Trail TrailManageRolesTrail TrailManageProfiles Trail TrailManageUsersContent tag JSP file names Name tag page names and resourced textTarget tag struts action-mapping Label tag breadcrumbsUsers.rosterUsers.search.confirm Adding custom permissions Title tag title bar textPermissions tag permission to display HelpPage tag context-sensitive HelpUpdatetime OidName Permid0000000000000000PERM 0000000000003000PERM 0000000000009300PERM Example Copy the JSPsPage Creating a tab END Index Content Area Creating a tab Div Second linked page customGoodbye.jsp looks like this Page Customtab.html Create Help filesCustomtabb.html Add permissions to the LMS database Select Maxpermid from PermissionEdit ApplicationResources.properties Edit navigation.xml NavigationNamestudenthome/name Assign permissionsCreating a tab Page Index