cancel
Showing results for 
Search instead for 
Did you mean: 

Text Element not working...Please Help!!!!

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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,

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Prem,

Did you solve this point?, if you will be great if you could share the solution.

Kind regards

Former Member
0 Kudos

Hello Carlos,

Just give me some time, I am little tied up with some work. I'll try to find out what we had done and post you the solution.

Regards,

Prem.

Former Member
0 Kudos

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.

Former Member
0 Kudos

#NOTE: This is the second part of the message

(style="DISPLAY: none; VISIBILITY: hidden") in the first line

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.

Former Member
0 Kudos

Hi Prem,

Thanks a lot for sharing your solution, works just fine for me as well.

Will be great if we can share other points, I'm sure within our projects there are a lot of WAD issues/funtionalities in common.

my email is carlos.caceres@telefonica.net.

Best regards,

CCH

Former Member
0 Kudos

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

Former Member
0 Kudos

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.