cancel
Showing results for 
Search instead for 
Did you mean: 

Problem getting HTML ID of HTMLB element on JSP page

Former Member
0 Kudos

Hi,

I have a problem trying to get HTML ID for an HTMLB button I have created on a JSP page.

I can retrieve the HTML ID when I use a static ID for the button.

<%String sbutton2;%>

<hbj:button id="ButtonNo2" text="Submit">

<%sbutton2=myContext.getParamIdForComponent(ButtonNo2);%>

</hbj:button>

But when I create the button using a dynamic ID I have a problem.

<%String sbutton2;

String b2 = "ButtonNo2";%>

<hbj:button id="<%=b2%>" text="Submit">

<%sbutton2=myContext.getParamIdForComponent(???);%>

</hbj:button>

What do I put in place of the ???.

I can not pass b2 as this is the string and not the button.

Any suggestions?

thanks,

Den.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I actually don't think there is a solution to this one since the generated class from the jsp needs the variable name at compile time, while it is actually determined at run-time.

You could try to add a onClientClick method and from there find the html id from the event (not sure if this is possible).