You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by elyes sallem <el...@gmail.com> on 2009/03/11 11:52:14 UTC

select problem

Hello,
i have a select component associated with a property selectedProject
the problem is after calling the action (with an onchange event), in the
action i get the correct project id , but i lost the project label
so , after the action call, it displays the wrong project (as i said but the
project id is corect)
here is the code in the jsp and the getter and the setter of the properties


<nested:nest property="selectedProject">					<nested:select property="prjId"
onchange="form.action='EditSaisiProv.do?do=refreshProjet';form.submit();">
<html:optionsCollection property="projetList" value="prjId" label="prjLib" />
</nested:select>
</nested:nest>


	public Projet getSelectedProject() {
		return selectedProject;
	}

	public void setSelectedProject(Projet selectedProject) {
		this.selectedProject = selectedProject;
	}
java.util.List<Projet> projetList = new ArrayList<Projet>();
	public java.util.List<Projet> getProjetList() {
		return projetList;
	}

	public void setProjetList(java.util.List<Projet> projetList) {
		this.projetList = projetList;
	}




Any one has an idea why?

Thanks
Regards
Elyes.

Re: select problem

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Elyes,
which html field should post that label? There is only a select which
will post id. Also the name element of the optionsCollection is
missing.

Best greetings,
Pawel Wielgus.

2009/3/11, elyes sallem <el...@gmail.com>:
> Hello,
> i have a select component associated with a property selectedProject
> the problem is after calling the action (with an onchange event), in the
> action i get the correct project id , but i lost the project label
> so , after the action call, it displays the wrong project (as i said but the
> project id is corect)
> here is the code in the jsp and the getter and the setter of the properties
>
>
> <nested:nest property="selectedProject">					<nested:select property="prjId"
> onchange="form.action='EditSaisiProv.do?do=refreshProjet';form.submit();">
> <html:optionsCollection property="projetList" value="prjId" label="prjLib"
> />
> </nested:select>
> </nested:nest>
>
>
> 	public Projet getSelectedProject() {
> 		return selectedProject;
> 	}
>
> 	public void setSelectedProject(Projet selectedProject) {
> 		this.selectedProject = selectedProject;
> 	}
> java.util.List<Projet> projetList = new ArrayList<Projet>();
> 	public java.util.List<Projet> getProjetList() {
> 		return projetList;
> 	}
>
> 	public void setProjetList(java.util.List<Projet> projetList) {
> 		this.projetList = projetList;
> 	}
>
>
>
>
> Any one has an idea why?
>
> Thanks
> Regards
> Elyes.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org