Link to home
Start Free TrialLog in
Avatar of rusco
rusco

asked on

STRUTS: Tags inside innerHTML

Hi!

I seem to be having problems using struts tags inside an innerHTML. The design of the page (in this case, it's a popup) is that I have a dropdown (let's say it's DropDown1 for now) box and beside it will be either a textbox or another dropdown(let's call this DropDown2 for now) box (depending on the value selected on DropDown1, it will either show a textbox of DropDown2). All the values for the dropDown boxes are taken from a db and stored in a collection(in my action for initializing the popup). I decided to use innerHTML for this one, but I seem to always get an error with the javascript code I have below. If I don't use struts tags (I tried it out with the regular html tags just to see test) it works fine...any help would be greatly appreciated. =)

I have the following declaration on my page:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

Here's my javascript function:

function changeField()
{
      var value = document.advanceFilterForm.field.selectedIndex.value;
      
      if ( value == "Release Dates")
      {
            
          document.getElementById( 'valuediv' ).innerHTML =  '<html:select property="value" style="width:116px"><html:options collection="values" property="value" labelProperty="description" /> <html:select>'
      }
      
      else
      {
          document.getElementById( 'valuediv' ).innerHTML = '<html:text property="value" style="width:200px" />'
      }
}

</script>

Here's the error:

org.apache.jasper.JasperException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
ASKER CERTIFIED SOLUTION
Avatar of searlas
searlas

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial