cancel
Showing results for 
Search instead for 
Did you mean: 

how to find the id of an htmlb component

Former Member
0 Kudos

Hello,

I have a bunch of htmlb components build in java code. I need the id of the components. I want to clearify that I need the id of the components not the value of the components. I know I can get the component id, if the component is created in jsp, as follows

<hbj:inputField

id="autoSave"

visible="false"

jsObjectNeeded="true"

value="FALSE">

<%

String jsAutoSave = myContext.getParamIdForComponent(autoSave);

%>

<SCRIPT>

var jsAutoSave = '<%=jsAutoSave%>';

</SCRIPT>

</hbj:inputField>

but, when the component is created in java code, I can't use the same logic to get to the component id.

If any one could help me, I really appreciate it.

Frank

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I finally found my answer.

In java code when creating the component use the getParamIdForComponent(Object o) as follows.

TextEdit heCs = new TextEdit("colorSpecifications");

String temp = p.getParamIdForComponent(heCs));

p is object of IPageContext. I pass it to the method that is building the components.

Former Member
0 Kudos

Kalyan,

Thanks for your reply.

Maybe I should give a little more information. The doProcessBeforeOutput() method sets the JSP to be forwarded. In the JSP, components are build by calling a method of an other class that builds the components. And I need the ids of some of the components in the JSP. Component ids are generated dynamically, so I as far as I am concerned, I can only access them in JSP, my question how in my situation?

If the component were build in JSP, I could have gotten the ids, like I showed above.

Regards,

Frank

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Frank

In your java code get the reference of the component and see wether the methods are present like getId() .So that you can get the ID of the component.

These links may help ful for you

/thread/62185 [original link is broken]

and

http://help.sap.com/saphelp_nw2004s/helpdata/en/44/471ce3617b14bce10000000a155369/frameset.htm

regards

kalyan