cancel
Showing results for 
Search instead for 
Did you mean: 

Change document title according to profile on IC WebClient

Former Member
0 Kudos

Hello all,

I was wondering if it is possible to change the document title on IC WebClient according to the user's profile.

This is the scenario:

I want to change the document.title property of default2.htm page because this is de main page for the IC WebClient.

The problem is that when i click one of the profile's on profile_determ.htm page and i go to abap_Main.htm, after knowing which profile was selected how do i change the document title on the default2.htm page?

I can't do it with a simple document.title = "new title" in javascript because i won't be in the default2.htm page anymore.

Should i use Page Attributes?

Thanks,

Vasco Daniel

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vasco,

As u want to change the document title statement document.title is the key.

If u r going thru a simple link then u can pass it as string (say "str" ) in following way :

<htmlb:link reference = "abap.htm?str=abap" text = "Abap">

and on abap.htm make an AUTO page attribute type string.

and then use

document.title = "<%=str%>" ;

If u r going thru navigation then u can use

navigation->set_parameter( name ='str' value = str ).

Hope it will Help u.

Regards,

Ankur

Former Member
0 Kudos

Hello Ankur,

i'm using something like this on the side of profile_determ.htm page:

<crmic:tableViewColumn horizontalAlignment="LEFT" type="LINK" linkColumnKey="PROFILE_NAME" columnName="PROFILE_NAME"

title="<%= otr(CRM_IC_APPL/PROFILEDETERMPROFNAME) %>" onItemClick="selectprofile"/>

I have tried to create a javascript function to change the document.title but it doesn't work if i call it on the onItemClick event.

Message was edited by: Vasco Daniel

Former Member
0 Kudos

hi Vasco,

In this case , i feel that u can use onload function of HTML body tag to call the javascript function .

like.....

<head>

<script>

function changetitle()

{.....

.....

}

</script>

</head>

<body onload = "changetitle()">

'.......

</body>

in this way it shud trigger with load of new page .

however u may need to pass the titleas page attribute as i stated earlier.

Another way as u stated is u are calling javascript function after onItemClick event .

so there are 2 ways :

1. Either at onItemclick u can set a variable and check

its value in OnLayout and trigger javascript function.

suppose in Onitemclick it is

flag = 'X'.

"OnLayout"

<% if flag = 'X' . %>

<script>

document.title = "<%=str%>"

</script>

<% endif .%>

2. Another way is to Use BEE (BSP Element Expressions)

these are very simple and powerfull enough to help u.

for details check out this link:

/people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees

Hope this helps !

Regards,

Ankur