on 06-19-2007 1:01 PM
Hello Friends,
I have a navigation block in a web report. I want to track the filter values of a particular characteristic(ZC_FLTFLG) that the user sets, because based on the value of this filter I would be activatng the respective hierarchy. For that I am using a Text Element. Given below is the text element:
<SPAN id="ZC_FLTFLG" style="DISPLAY: none">
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="TEXTELEMENTS_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_TEXT_ELEMENTS"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="SHOW_COMMON_ELEMENTS" value=""/>
<param name="SHOW_VARIABLES" value=""/>
<param name="ELEMENT_TYPE_1" value="FILTER"/>
<param name="ELEMENT_NAME_1" value="ZC_FLTFLG"/>
<param name="ONLY_VALUES" value="X"/>
ITEM: TEXTELEMENTS_1
</object>
</SPAN>
In the Javascript i am trying the following code:
var flag = document.getElementById("ZC_FLTFLG").innerHTML;
alert(flag.value);
But I am getting blank(nothing) values in the alert.
Please help in this issue. Its really important and urgent. Thanks!
Regards,
Prem.
Hello Prem,
I am not sure but anyhow try giving the below code,
Javascript: function myFunction() { var flag = document.getElementById('FILTER_1').innerHTML; alert(flag); }
hope it helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Karthik,
This code will not work as FILTER_1 is not the Id of the object. We need to specifically set the Id in the <P id="someId"> tag and wrap it around the object tag. Then we can find the element in the page by getElementByID().
Anyway, thanks for you assistance. I will try some other stuff and will update the thread if I find the solution.
Regards,
Prem.
Hello Carlos,
This is what I did. I dragged and dropped a 'Filter' web item and these are the values I set for it:
<P id="myfilter" >
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="FILTER_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="PRESENTATION" value="KEY"/>
<param name="ITEM_FILTER_IOBJNM_1" value="ZC_FLTFLG"/>
<param name="PRESENTATION_1" value="KEY"/>
<param name="ONLY_VALUES" value="X"/>
ITEM: FILTER_1
</object>
</P>
If you want to hide the value of this flter on the web page then use this as the first line:
<P id="myfilter" style="DISPLAY: none; VISIBILITY: hidden">
Now to access this value in JavaScript, this is the function:
function myFunction()
{
var x = document.getElementById('myfilter').innerHTML;
alert(x);
}
Hope this helps!
Regards,
Prem.
Hello,
Try the code below you can get the filtered value for that charac using the below text elemenet.
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="FILTER_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="WIDTH" value="376"/>
<param name="ITEM_FILTER_IOBJNM_1" value="ZC_FLTFLG"/>
<param name="PRESENTATION_1" value="TEXT"/>
hope it helps,
assign points if useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Karthik,
YOU ROCK MAN!!!! Thanks a lot for the help!!!
But the problem is not yet resolved fully. I am able to see the set filter value in the web report. However I would like to access this value in Javascript. When I try to do it I am not able to do it. I am using alert() to see what the value is and what I get is <table> tags
Given below is the filter item and the Javascript code:
<P id="myfilter"><object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="FILTER_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="PRESENTATION" value="KEY"/>
<param name="ITEM_FILTER_IOBJNM_1" value="ZC_FLTFLG"/>
<param name="PRESENTATION_1" value="KEY"/>
<param name="ONLY_VALUES" value="X"/>
ITEM: FILTER_1
</object></P>
Javascript:
function myFunction()
{
var flag = document.getElementById('myfilter').innerHTML;
alert(flag);
}
Waiting eagerly for your reply. Thanks!
Regards,
Prem.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.