Skip to Content
author's profile photo Former Member
Former Member

Problem getting HTML ID of HTMLB element on JSP page

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.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2004 at 12:48 PM

    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).

    Add comment
    10|10000 characters needed characters exceeded