cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying the masthead par

Former Member
0 Kudos
163

Hi all,

I want to create a show the time across different locations in the masthead.

My question is how can i call custom javascript for modifying the par. I am getting the system time and writing using document.write. But when i added the code to header jsp it is not coming.

Answers will be generously rewarded

Regards

Venkat

Message was edited by:

venkat ramana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Venkat ,

I have done this same 1 day back , it work fine .I am sorry to paste the code over here.



<%@ page import = "java.util.ResourceBundle" %>
<%@ page import = "com.sapportals.htmlb.*" %>
<%@ page import = "com.sapportals.portal.prt.session.IUserContext" %>
<%@ page import = "com.sapportals.portal.prt.component.*" %>
<%@ page import = "com.sapportals.portal.prt.service.laf.*" %>
<%@ page import = "com.sap.security.api.UMFactory" %>
<%@ page import = "com.sapportals.portal.prt.service.license.ILicenseService"%>
<%@ page import = "com.sapportals.portal.navigation.*" %>
<%@ page import = "com.sapportals.portal.prt.runtime.PortalRuntime" %>
<%@ page import = "com.sapportals.portal.prt.util.StringUtils" %>
<%@ taglib uri="prt:taglib:tlhtmlb" prefix="hbj" %>
<%!


final String PERSONALIZE_PAGE_EVENT_URN         = "urn:com.sapportals:navigation";
final String PERSONALIZE_PAGE_EVENT_NAME        = "PersonalizePage";
final String PERSONALIZE_PAGE_EVENT_PARAMS      = "";
final String PERSONALIZE_PORTAL_EVENT_URN       = "urn:com.sapportals:navigation";
final String PERSONALIZE_PORTAL_EVENT_NAME      = "PersonalizePortal";
final String PERSONALIZE_PORTAL_EVENT_PARAMS    = "";
final String LOGOFF_CONFIRM_MSG_COMPONENT		= "logoffConfirmMsg";
final String LOGON_REDIRECT_COMPONENT			= "logInComponent";
final String LOGOFF_REDIRECT_COMPONENT			= "LogOutComponent";
final String LOGOFF_CONFIRM_MSG_ARGS_IE         = "dialogHeight: 170px; dialogWidth: 350px; edge: Raised; center: Yes; help: No; resizable: No; status: No";
final String LOGOFF_CONFIRM_MSG_ARGS_NS         = "Height=170,Width=350";
final String LOGOFF_CONFIRM_WINDOW_NAME         = "LOG_OFF_WINDOW";
final String HELP_URL                           = "HelpUrl";
final String HELP_WINDOW_NAME                   = "HELP_WINODW";
final String SHOW_PERSONALIZE_LINK              = "ShowPersonalizeLink";
final String SHOW_HELP_LINK              		= "ShowHelpLink";
final String SHOW_NEW_WINDOW_LINK               = "ShowNewWindowLink";
final String SHOW_LOG_OFF_LOG_ON_LINK           = "ShowLogInLogOffLink";


//String constants for NLS
final String WELCOME_CLAUSE = "WELCOME_CLAUSE";
final String HELP_TEXT = "HELP_TEXT";
final String LOG_OFF_TEXT = "LOG_OFF_TEXT";
final String LOG_ON_TEXT = "LOG_ON_TEXT";
final String PERSONALIZE_TEXT = "PERSONALIZE_TEXT";
final String PERSONALIZE_PORTAL_TEXT = "PERSONALIZE_PORTAL_TEXT";
final String NEW_WINDOW_TEXT = "NEW_WINDOW_TEXT";

final String HELP_TOOLTIP = "HELP_TOOLTIP";
final String LOG_OFF_TOOLTIP = "LOG_OFF_TOOLTIP";
final String LOG_ON_TOOLTIP = "LOG_ON_TOOLTIP";
final String PERSONALIZE_TOOLTIP = "PERSONALIZE_TEXT";
final String PERSONALIZE_PORATL_TOOLTIP = "PERSONALIZE_PORATL_TOOLTIP";
final String NEW_WINDOW_TOOLTIP = "NEW_WINDOW_TOOLTIP";
final String BEGINNING_OF_PAGE = "BEGINNING_OF_PAGE";
final String MASTHEAD_ENTER_TOOLTIP = "MASTHEAD_ENTER_TOOLTIP";
final String MASTHEAD_EXIT_TOOLTIP = "MASTHEAD_EXIT_TOOLTIP";
final String UNLOAD_MSG = "UNLOAD_MSG";


private String GetWelcomeMsg(IPortalComponentRequest request, String welcomeClause)
{
    IUserContext userContext = request.getUser();
    if (userContext != null)
    {
		String firstName = userContext.getFirstName();
		String lastName = userContext.getLastName();
		String salutation = userContext.getSalutation();
		
		if ((firstName != null) && (lastName != null))
		{
			
			if(salutation != null)
			{
				return java.text.MessageFormat.format(welcomeClause, new Object[] {firstName, lastName, salutation}).toString();
			}
			else
			{
				return java.text.MessageFormat.format(welcomeClause, new Object[] {firstName, lastName, " "}).toString();
			}
		}
		else
		{
			return java.text.MessageFormat.format(welcomeClause, new Object[] {userContext.getDisplayName()," ", " "}).toString();		
		}
	}
    return "";
}

private String GetLicenseText(IPortalComponentRequest request){
	ILicenseService license = (ILicenseService)request.getService(ILicenseService.KEY);
	if (license.sapInternalUsageOnly()) 
	{
		return "<FONT color=orangeRed size=4><STRONG> Licensed For SAP Internal Usage</STRONG></FONT>";
	}
	else	
	{
		return " ";
	}
}
	
private boolean getParameter(IPortalComponentRequest request, String param)
{
	String value = (String)request.getNode().getValue(param);
	return new Boolean(value).booleanValue();
}

private String getHelpUrl(IPortalComponentRequest request)
{
	String value = (String)request.getNode().getValue(HELP_URL);
	return value;
}

private String GetLogoffConfirmMsgURL(IPortalComponentRequest request)
{
    String componentName = request.getComponentContext().getComponentName();
    componentName = componentName.substring(0, componentName.lastIndexOf(".") + 1);

    IPortalComponentURI msgURI = request.createPortalComponentURI();
    msgURI.setContextName(componentName + LOGOFF_CONFIRM_MSG_COMPONENT);
    return msgURI.toString();
}

// Attaching the "UnsavedData=true" flag to the Confirm logoff message
private String GetLogoffConfirmUnsavedMsgURL(IPortalComponentRequest request)
{
   String basicUrl  = GetLogoffConfirmMsgURL(request);
   String separator = (basicUrl.indexOf("?") >=0) ?  "&" : "?";
   return basicUrl + separator + "UnsavedData=true";
}

private String GetLogoffURL(IPortalComponentRequest request)
{
    /*IPortalComponentURI logoffURI = request.createPortalComponentURI();
    return logoffURI.toString();*/
    String componentName = request.getComponentContext().getComponentName();
    componentName = componentName.substring(0, componentName.lastIndexOf(".") + 1);
    IPortalComponentURI msgURI = request.createPortalComponentURI();
    msgURI.setContextName(componentName + LOGOFF_REDIRECT_COMPONENT);
    return msgURI.toString();
}


private boolean isAccessabilityOn(IPortalComponentRequest request)
{	
	//End: Temporary, till there's a way to set the accessibility for a user
    IUserContext user = request.getUser();
    //if((user.getAccessibilityLevel() != IUserContext.DEFAULT_ACCESSIBILITY_LEVEL) ||(isAccessibility == true) ) // 508 is on
    if (user.getAccessibilityLevel() != IUserContext.DEFAULT_ACCESSIBILITY_LEVEL) // 508 is on
    	return true;
    return false;
}

private String GetLoginURL(IPortalComponentRequest request)
{
    INavigationGenerator navigationService = (INavigationGenerator)PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);
	StringBuffer URL = new StringBuffer(200).append(navigationService.getPortalURL(request , null));
    return URL.append("/login").toString();
}


private String GetPortalUrl(IPortalComponentRequest request)
{
    INavigationGenerator navigationService = (INavigationGenerator)PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);
	return navigationService.getPortalURL(request , null);
}

private String getNLSString(IPortalComponentRequest request, String resource_key)
{
	try
	{
	    ResourceBundle bundle = request.getResourceBundle();
		if(bundle != null)
		{
			return bundle.getString(resource_key);
	    }
		return resource_key;
	 }
	 catch(MissingResourceException e)
	 {
		return resource_key;
	 }
}
private String GetThemeURLPath(IPortalComponentRequest request)
{
	ILAFService iLAFService = (ILAFService)request.getService(ILAFService.KEY);

    String currentTheme = iLAFService.getCurrentTheme(request).getThemeName();

    String url = iLAFService.getRelativeThemeRootURLPath(request, ILAFService.PORTAL_THEME) + "/" + currentTheme + "/prtl";
	return url;
}

//Get the external logoff URL
private String getExternalLogOffUrl()
{
     
   return UMFactory.getProperties().get("ume.logoff.redirect.url");    
}
 
//Get the external logoff Mode (silent / not silent)
private boolean getExternalLogOffMode()
{
    return  UMFactory.getProperties().getBoolean("ume.logoff.redirect.silent" , false); 
}

private boolean isAnonymous(IPortalComponentRequest request)
{
	NavigationEventsHelperService helperService = (NavigationEventsHelperService)
				PortalRuntime.getRuntimeResources().getService(NavigationEventsHelperService.KEY);
	return helperService.isAnonymousUser(request);
}


%>

<%
boolean isPreview = false;
// initializaing the labels with the localized labels
String welcomeClauseStr = getNLSString(componentRequest, WELCOME_CLAUSE);
String helpTextStr = getNLSString(componentRequest, HELP_TEXT);
String logOffTextStr = getNLSString(componentRequest, LOG_OFF_TEXT);
String logInTextStr = getNLSString(componentRequest, LOG_ON_TEXT);
String personalizeTextStr = getNLSString(componentRequest, PERSONALIZE_TEXT);
String newWindowTextStr = getNLSString(componentRequest, NEW_WINDOW_TEXT);
String helpTooltipStr = getNLSString(componentRequest, HELP_TOOLTIP);
String logOffTooltipStr = getNLSString(componentRequest, LOG_OFF_TOOLTIP);
String logInTooltipStr = getNLSString(componentRequest, LOG_ON_TOOLTIP);
String personalizeTooltipStr = getNLSString(componentRequest, PERSONALIZE_TOOLTIP);
String personalizePortalTooltipStr = getNLSString(componentRequest, PERSONALIZE_PORATL_TOOLTIP);
String beginningOfPageStr = getNLSString(componentRequest, BEGINNING_OF_PAGE);
String newWindowStr = getNLSString(componentRequest, NEW_WINDOW_TOOLTIP);
String mastheadEnterTable = getNLSString(componentRequest, MASTHEAD_ENTER_TOOLTIP);
String mastheadExitTable = getNLSString(componentRequest, MASTHEAD_EXIT_TOOLTIP);
String unLoadMsg = getNLSString(componentRequest, UNLOAD_MSG);


boolean showPersonalizeLink = getParameter(componentRequest, SHOW_PERSONALIZE_LINK);
boolean showHelpLink = getParameter(componentRequest, SHOW_HELP_LINK);
boolean showNewWindowLink = getParameter(componentRequest, SHOW_NEW_WINDOW_LINK);
boolean ShowLogInLogOffLink = getParameter(componentRequest, SHOW_LOG_OFF_LOG_ON_LINK);

String mode = (String)componentRequest.getNode().getValue("mode");
if ((mode != null) && (mode.equals("preview")))
{
    isPreview = true;
}
	
String themeRootURLPath = GetThemeURLPath(componentRequest);
boolean isAnonymous = isAnonymous(componentRequest);
boolean isAccessabilityOn = isAccessabilityOn(componentRequest);

if (isAccessabilityOn)
{
	helpTooltipStr = helpTextStr+", "+helpTooltipStr;
	logOffTooltipStr = logOffTextStr+", "+logOffTooltipStr;
	logInTooltipStr = logInTextStr+", "+logInTooltipStr;
	newWindowStr = newWindowTextStr+", "+newWindowStr;
	personalizePortalTooltipStr = personalizeTextStr+", "+personalizePortalTooltipStr;
}

%>
<script>
function openLogoffMsg()
{
<%if (!isPreview){%>
    if (EPCM.getUAType() == EPCM.MSIE)
    {
    	releaseProducerSessions();
    	if(EPCM.getGlobalDirty())
    	{
    		 // unsaved data on the page, display modified dialog
	        var val = window.showModalDialog('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');
    	    if (val == 'logoff')
        	{
        		disableWorkProtectCheck = true;
	        	logoff();
    	    }
		}
		else //no unsaved data
		{
			// data saved, nothing get lost on the page, display normal dialog
           var val = window.showModalDialog('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '', '<%=LOGOFF_CONFIRM_MSG_ARGS_IE%>');
           if (val == 'logoff')
              logoff();
        }		
    }
    else
    {
    	if(EPCM.getGlobalDirty())
    	{
           window.open('<%=GetLogoffConfirmUnsavedMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');
        }
        else
        {
           window.open('<%=GetLogoffConfirmMsgURL(componentRequest)%>', '<%=LOGOFF_CONFIRM_WINDOW_NAME%>', '<%=LOGOFF_CONFIRM_MSG_ARGS_NS%>');
        }
    }
<%}%>
}

var isLogoffFinalAllowed = true;
var logoffStartTime = (new Date).getTime();

function logoff()
{
    EPCM.raiseEvent("urn:com.sapportals.portal:user", "logoff", "");
    logoffStartTime = (new Date).getTime(); 
    window.setTimeout("logoffDelay()", "50");
}

function logoffDelay()
{
  var isLogoffDelayElapsed = ((new Date).getTime() - logoffStartTime) > (60*1000);
  if(isLogoffFinalAllowed || isLogoffDelayElapsed) { 
     logoffFinalCall();
  } else {
     window.setTimeout("logoffDelay()","50"); 
  }
}

function logoffFinalCall()
{
    logoffThirdParty();
    document.forms["logoffForm"].submit();
}

function logIn()
{
    location.replace("<%=GetLoginURL(componentRequest)%>");
}

function runPersonalizePage()
{
    EPCM.raiseEvent("<%=PERSONALIZE_PAGE_EVENT_URN%>", "<%=PERSONALIZE_PAGE_EVENT_NAME%>", "<%=PERSONALIZE_PAGE_EVENT_PARAMS%>");
}

function runPersonalizePortal()
{
<%if (!isPreview){%>
    EPCM.raiseEvent("<%=PERSONALIZE_PORTAL_EVENT_URN%>", "<%=PERSONALIZE_PORTAL_EVENT_NAME%>", "<%=PERSONALIZE_PORTAL_EVENT_PARAMS%>");
<%}%>
}

function onPersonalizePortalDisable()
{
	var linkElem = document.getElementById("personalizePortal");
	var linkSepElem = document.getElementById("personalizePortalSep");
	var linkLogoffSepElem = document.getElementById("logoffsep1");	
	
	if(linkElem != null)
		linkElem.style.display = "none";
	if(linkSepElem != null)
		linkSepElem.style.display = "none";
	if(linkLogoffSepElem != null)
		linkLogoffSepElem.style.display = "none";
	
}

EPCM.subscribeEvent("urn:com.sapportals:navigation", "PersonalizePortalDisable", onPersonalizePortalDisable);


function openNewPortalWindow()
{
	<%if (!isPreview){%>
		var navTarget = EPCM.getSAPTop().gHistoryFrameworkObj.GetActiveTrackingEntryValue().URL;
		var context = EPCM.getSAPTop().gHistoryFrameworkObj.GetActiveTrackingEntryValue().context;
		if (context != null && context.length > 0)
    	   EPCM.doNavigate(navTarget, 2, null, null, null, null, context);
    	else  
  		   EPCM.doNavigate(navTarget, 2);
	<%}%>
}

function openHelp()
{
<%if (!isPreview){%>
    window.open('<%=getHelpUrl(componentRequest)%>', '<%=HELP_WINDOW_NAME%>');
<%}%>
}

function setFocusOnHeader() {
	var melcomeMessage = document.getElementById("welcome_message");
	var headerNotch    = document.getElementById("header_notch");
	if(EPCM.getUAType()==EPCM.MOZILLA) {
	   // No focus
	} else {
		if(melcomeMessage!=null && melcomeMessage.currentStyle.display!="none") {
			melcomeMessage.focus();
		} else if(headerNotch!=null && headerNotch.currentStyle.display!="none") {
			headerNotch.focus();
		}
	}
}

		

function logoffThirdParty()
{
	<% if(getExternalLogOffUrl()!= null){ %> 
	var logOffUrl = '<%=getExternalLogOffUrl()%>';
	var silent =  <%=getExternalLogOffMode()%>;
   
	if(silent)
	{
		var newIFrame = document.getElementById("externalLogOffIframe");
		if(newIFrame == null)
		{
			 newIFrame = document.createElement("IFRAME");
			 newIFrame.style.visibility = "hidden";
			 newIFrame.width=0;
			 newIFrame.height=0;
			 newIFrame.id = "externalLogOffIframe";
			 newIFrame.src = logOffUrl;
			 document.body.appendChild(newIFrame);
		}
		else
		{
			newIFrame.src = "javascript:void(0)";
			newIFrame.src = logOffUrl;
		}
	}
	<% } %>
}

</script>


<hbj:content id="PageContext">
 <hbj:page title="Header Area">
 	<hbj:form id="HeaderForm" > 
  <!--<a href="#" tabindex=0 title= "<%=beginningOfPageStr%>" accesskey="m">
  <img src="<%=themeRootURLPath%>/../common/1x1.gif" border="0" style="display:none">
  </a>-->
  <% if (isAccessabilityOn)
  {%>
  	  <TABLE width="100%" border="0" id="myTable" ti="0" tabindex="0" title="<%=mastheadEnterTable%>" onkeydown="nav_skip('myTable',event)" ct="PortalMasthead" cellspacing="0" cellpadding="0" <% if (isPreview) {%>ondragover="window.event.cancelBubble = true;" ondragleave="window.event.cancelBubble = true;"<%}%>>
  <%} else
  {%>
	  <TABLE width="100%" border="0" cellspacing="0" cellpadding="0" class="prtlHdrWhl" id="myTable" ti="0" tabindex="0" onkeydown="nav_skip('myTable',event)" <% if (isPreview) {%>ondragover="window.event.cancelBubble = true;" ondragleave="window.event.cancelBubble = true;"<%}%>>
 <%}%>
 	<tbody>
		<TR>
	    	<TD class="prtlHeaderNotch" id="header_notch" nowrap><img src="<%=themeRootURLPath%>/../common/1x1.gif" class="prtlHeaderNotchImgWidth"></TD>
			<TD nowrap ti="0" tabIndex="0" class="prtlHdrWelcome" id="welcome_message"><%=StringUtils.escapeToHTML(GetWelcomeMsg(componentRequest, welcomeClauseStr))%></TD>
			<TD nowrap ti="1" tabIndex="1" class="prtlHdrWelcome" id="welcome_message">			
						<SCRIPT LANGUAGE="JavaScript">



								<!-- Begin
								var months=new Array(13);
								months[1]="January";
								months[2]="February";
								months[3]="March";
								months[4]="April";
								months[5]="May";
								months[6]="June";
								months[7]="July";
								months[8]="August";
								months[9]="September";
								months[10]="October";
								months[11]="November";
								months[12]="December";
								var time=new Date();
								var lmonth=months[time.getMonth() + 1];
								var date=time.getDate();
								var year=time.getYear();
								
								// Y2K Fix by Isaac Powell
								// <a href="http://onyx.idbsu.edu/~ipowell" TARGET="test_blank">http://onyx.idbsu.edu/~ipowell</a>
								
								if ((navigator.appName == "Microsoft Internet Explorer") && (year < 2000))
								year="19" + year;
								if (navigator.appName == "Netscape")
								year=1900 + year;
								document.write("<center>" + lmonth + " ");
								document.write(date + ", " + year + "</center>");
								// End -->
								</SCRIPT>
			</TD>
			<% if (showHelpLink || showPersonalizeLink || showNewWindowLink || ShowLogInLogOffLink)
		    {%>
				<TD class="prtlHeaderFunctionsTable">
					<TABLE border="0" cellspacing="0" cellpadding="0"  
						   class="prtlHeaderFunctionsContainer" height="100%">
						<TR>
							<%
							if (showHelpLink)
							{ %>
								<TD nowrap >
									<!--<hbj:link id="HelpLink" tooltip="<%=helpTooltipStr%>" linkDesign="FUNCTION" reference="javascript:openHelp();"><hbj:textView nested="true" text="<%=helpTextStr%>"/></hbj:link> -->
									<hbj:link id="HelpLink" tooltip="<%=helpTooltipStr%>" 
										linkDesign="FUNCTION" reference="#">
                                      <% if (!isPreview) { HelpLink.setOnClientClick("javascript:openHelp();");} %>
                                      <hbj:textView nested="true" text="<%=helpTextStr%>"/>
                                    </hbj:link>									
								</TD>
								<TD nowrap>
							<%}%>
							<%
							if (!isAnonymous)
							{
								if (showPersonalizeLink)
								{ 
									if (showHelpLink)
									{ %>
										<TD nowrap id="personalizePortalSep" class="prtlHdrSep"></TD>
								  <%} %>
								   	<TD nowrap id="personalizePortal">
								   		<hbj:link id="PersonalizeLink" 
								   			      tooltip="<%=personalizePortalTooltipStr%>"
								   			      linkDesign="FUNCTION"
								   			      reference="#">
								   			<%  if (!isPreview) {PersonalizeLink.setOnClientClick("javascript:runPersonalizePortal();");}%>
								   			<hbj:textView nested="true" text="<%=personalizeTextStr%>"/>
								   		</hbj:link>
								   	</TD>
									<TD nowrap></TD>
						    	<%}
						    	if (showNewWindowLink)
								{	
									if (showHelpLink || showPersonalizeLink)
                                    { %>
                                    	<TD nowrap id="newWindowSep" class="prtlHdrSep"> </TD>
								  <%}
								    else
									{%>
										<TD nowrap> </TD>
								  <%}%>
								    <TD nowrap id="newWindow">
								    	<hbj:link id="newWindowLink" tooltip="<%=newWindowStr%>" 
								    	           linkDesign="FUNCTION" 
								    	           reference="#">
								    	<%  if (!isPreview) {newWindowLink.setOnClientClick("javascript:openNewPortalWindow();");}%>
								    	<hbj:textView nested="true" text="<%=newWindowTextStr%>"/>
								    </hbj:link>
								    </TD>
							 <%}%>
        	        	 <%}%>
            	            <TD>
                	        <%if (ShowLogInLogOffLink)
                    	    	{%>
								<TABLE cellspacing="0" cellpadding="0" border="0" class="prtlHeaderFunctionsContainer" height="100%">
									<TR><%
									    if (showHelpLink || showPersonalizeLink || showNewWindowLink) 
								    	{%>
									    	<%
								    		if(!showHelpLink && !showNewWindowLink)
								    		{%>
												<TD nowrap id="logoffsep1" class="prtlHdrSep"> </TD>
											<%
									    	}else
									    	{%>
									    		<TD nowrap id="logoffsep2" class="prtlHdrSep"> </TD>
									    	<%}%>
									    	
											<TD nowrap>
										<%
									    }else
									    {%>
									    	<TD nowrap >  </TD>
									    <%
									    }
									    if (isAnonymous) 
								    	{%>
										    <TD nowrap>
    										<!--<hbj:link id="LoginLink" tooltip="<%=logInTooltipStr%>" linkDesign="FUNCTION" reference="javascript:logIn();"><hbj:textView nested="true" text="<%=logInTextStr%>"/></hbj:link>-->
    										<hbj:link id="LoginLink" 
    												  tooltip="<%=logInTooltipStr%>"
    											      linkDesign="FUNCTION" 
    											      reference="#">
                                                  <% LoginLink.setOnClientClick("javascript:logIn();"); %>
                                                  <hbj:textView nested="true" text="<%=logInTextStr%>"/>
                                            </hbj:link>
    										</TD>
	    							  <%}	
    								  	else
    								  	{%>
    										<TD nowrap>
    										<!--<hbj:link id="LogoffLink" tooltip="<%=logOffTooltipStr%>" linkDesign="FUNCTION" reference="javascript:openLogoffMsg();"><hbj:textView nested="true" text="<%=logOffTextStr%>"/></hbj:link>-->
    										 <hbj:link id="LogoffLink"
    										 	       tooltip="<%=logOffTooltipStr%>" 
    										 	       linkDesign="FUNCTION"
    										 	       reference="#">
                                                  <%if (!isPreview) { LogoffLink.setOnClientClick("javascript:openLogoffMsg();");} %>
                                                  <hbj:textView nested="true" text="<%=logOffTextStr%>"/>
		                            	     </hbj:link>
    										</TD>	    							  	
    								   <%}%>
									</TR>
								</TABLE>
							<%} %>
						</TD>
					</TR>
				</TABLE>
			</TD>
			<%}%>
  		    <TD nowrap class="prtlHdrLogoContainer"> 
  		    	<% if (isAccessabilityOn)
  		    	{%>
  		    		<span tabindex="0" id="myTable-skipend" ti="0" onkeydown="sapUrMapi_skip('myTable',event);" title="<%=mastheadExitTable%>" ></span>
  		    	<%}%>
  		    </TD>
		</TR>
		</tbody>
	</TABLE>
	</hbj:form>
 </hbj:page>
</hbj:content>

<form name="logoffForm" style="display:none;position:absolute;top:-5000;left:-5000" action="<%=GetLogoffURL(componentRequest)%>" method="POST">
	<input type="hidden" name="logout_submit" value="true"/>
</form>

<script>
 <% if (!isPreview) {%>
 		if (disablePersonalize) {
			EPCM.raiseEvent("urn:com.sapportals:navigation", "PersonalizePortalDisable", "");
 		}
  <%}%>
setFocusOnHeader();
EPCM.subscribeEvent("urn:com.sapportals.portal:browser","load",setFocusOnHeader);
</script>

Refer to these links

https://www.sdn.sap.com/irj/sdn/thread?threadID=67073

https://www.sdn.sap.com/irj/sdn/thread?threadID=216064

https://www.sdn.sap.com/irj/sdn/thread?threadID=120553

You will get lot of Threads like this in SDN .I hope you are using NWDS to change the masthead.Feel Free to ask me

Thanx

Pankaj

Former Member
0 Kudos

i will try to implement the code, and get back to you.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the snippet,

Actually there is some problem with the javascript code

I have opened a new query for that

Regards

Venkat

Former Member
0 Kudos

HI Venkat,

Let me know whether you have achieved the functionality or not.

Thanx

Pankaj