Bug #1006

<layout:optionsDependent> tag not working [Unknown user]

Added by Old User almost 12 years ago. Updated about 1 month ago.

Status:Nouveau Start date:
Priority:Medium Due date:
Assignee:Old User % Done:

0%

Category:-
Target version:-

Description

[Unknown user]
I want to create two interdependent combo boxes . I am using the example from "struts.application-servers.com" , but i got the following error

javax.servlet.ServletException: No method to get the property cities of fr.improve.struts.taglib.layout.field.ajax.select.Option@e6f970 (fr.improve.struts.taglib.layout.field.ajax.select.Option)

My source code is

<layout:form action="/select.do" reqCode="init" key="Select Example" styleClass="FORM">
<layout:select key="Country" property="country" styleClass="FIELD">
<layout:option value=""/>
<layout:options collection="countries" name="name" sourceOf="city" />
</layout:select>

&lt;layout:select key="City" property="city" styleClass="FIELD"&gt;
&lt;layout:optionsDependent collection="cities" dependsFrom="country"/&gt;
&lt;/layout:select&gt;
&lt;/layout:form&gt;

and my actionform class is
public class SelectForm extends ActionForm {
private String city = "";
private String country = "";

public void setCountry(String country){this.country=country;}  
public String getCountry(){return this.country;}
public void setCity(String city){this.city=city;}  
public String getCity(){return this.city;}
private String name;
private ArrayList cities = new ArrayList();
public SelectForm(String in_name) {
name = in_name;
}
public SelectForm() { }
public String getName() { return name; }
public ArrayList getCities() { return cities; }
public void addCity(String in_city) { cities.add(in_city); }
}

Please help....

History

Updated by Nehemiah James 3 months ago

If you really don't understand how to use tags while doing programming then learn it first. The careerperfect.com share a list of tags which you easily read and use it in your daily base work.

Updated by Salvatore Titan about 1 month ago

I can help you to solve this issue. I think that if you click here now, then you will see what I mean as there are so many solutions already out there and all of them have something great that we can look onto.

Updated by Roswell Rory about 1 month ago

Once I was trying to make two interdependent combo boxes. Something like "struts.application-servers.com" but all of a sudden I got the following issue and was unable to fix it. javax.servlet.ServletException: No method to get the property cities of fr.improve.struts.taglib.layout.field.ajax.select.Option@e6f970 (fr.improve.struts.taglib.layout.field.ajax.select.Option) If anyone can help me out regarding this error then it would be a great help. I actually want resume writers review and there are a lot of good stuff regarding coding here.

Also available in: Atom PDF