on 03-29-2006 9:29 PM
Hi,
I'm trying to dynamically change a Web item attribute value - to be specific, CAPTION of Role Menu - with JavaScript on page load, but I have a problem. I can't seem to flush the new value without calling SAPBWOpenURL().
I'm hoping to find a way to update the attribute value once the page load is done without refreshing the page using SAPBWOpenURL().
Does anyone know a way to do this?
Thank you in advance,
Hsiao-Chun Wu
hsiao ,
are you displaying the query through portal ? options to acheive what you want could be .
1. have a prequery page which takes the input of the role and then goes to the query page showing the relevant heading
2. autorefresh of the page
3. use client side eventing to event between two iviews on portal
4. use frames
If the query is large , it is better to go for the first option and the simpler ones of the above are 1 ,2 and 4.
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This might work if you've chosen to display your role menu as an IFRAME
add this code to the <head> of the document
<script>
var newRoleTitle = "New Role Title";//add desired role title here
var roleMenu = "ROLEMENU_1";//stores the name of the rolemenu item
function getRoleTitle(){
var prop = SAPBWGetItemProp( roleMenu );
if (prop != null){
for(i=1;i<prop.length;i++){
if ( prop<i>[0] == "CAPTION" ){
return prop<i>[1];
}//end if
}//end for
return null;
}//end if
}//end function
function updateRoleTitle( ){
var oldRoleTitle = getRoleTitle();
var tds = document.getElementsByTagName("td");
for( var i=0;i<tds.length;i++ ) {
if( tds<i>.innerText == oldRoleTitle ){
tds<i>.innerText = newRoleTitle;
break;
}
}
}//
window.attachEvent("onload",updateRoleTitle);
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Thank you for providing the codes. I tried your it, but no luck. The following call does not seem to work (and in Netscape, it complains window.attachEvent is not a function):
window.attachEvent("onload",updateRoleTitle);
My role menu display the new role title, then stops there, leaving the rest of the role menu blank.
How can I do to make this work?
Thank you in advance!
Hsiao-Chun Wu
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.