Hi guys

I've got a simple form bean and a simpler JSP. I can get the JSP to pull some values from the form bean but not others, and I cannot figure out why.

I want to display Select menus in a variable number of rows. I managed to figure out indexed properties (at loooooooooong last) and so the html:select tags are working. It's just the html:optionsCollection tag that I can't figure out.

Here's the Form (trimmed for brevity; the two private members are populated okay by other methods):
8<-----------------------------------------------------
public class MyForm extends ActionForm
{
private Integer selectedIdTvSystem[];
private List picklistTvSystem;


  // return the user's previously selected TV system
  public Integer getSelectedIdTvSystem(int loopIndex) {
    ...
  }

  // set the user's newly selected TV system
  public void setSelectedIdTvSystem(int loopIndex, Integer selectedId) {
    ...
  }

  // get the drop-down list of TV choices for the user
  public List getPicklistTvSystem() {
    return this.picklistTvSystem;
  }

  // set the list of possible TV choices for the user
  public void setPicklistTvSystem(List picklistTvSystem) {
    this.picklistTvSystem = picklistTvSystem;
  }
}
8<-----------------------------------------------------


Here's the JSP tester. It's a Mickey Mouse loop to display two drop-down picklists. The indexed property referenced in the 'html:select' seems to work fine. But the 'html:optionsCollection' tag isn't finding the 'picklistTvSystem' property on the form.


8<-----------------------------------------------------
<c:forEach begin="0" end="1" varStatus="status">

  <jsp:useBean id="status"
               type="javax.servlet.jsp.jstl.core.LoopTagStatus"/>

<html:select property="selectedIdTvSystem[${status.count - 1}]" >

    <html:optionsCollection name="picklistTvSystem"
                            value="id"
                            label="value" />
  </html:select>
</c:forEach>
8<-----------------------------------------------------


Tomcat throws this exception: javax.servlet.jsp.JspException: Cannot find bean picklistTvSystem in any scope at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)


Any help will be gratefully received. -- Sean.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to