myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Ivankovits (JIRA)" <...@myfaces.apache.org>
Subject [jira] Reopened: (MYFACES-1351) Another valueChangeListener gets called in addition to the correct one
Date Mon, 03 Jul 2006 11:23:30 GMT
     [ http://issues.apache.org/jira/browse/MYFACES-1351?page=all ]
     
Mario Ivankovits reopened MYFACES-1351:
---------------------------------------


> Another valueChangeListener gets called in addition to the correct one
> ----------------------------------------------------------------------
>
>          Key: MYFACES-1351
>          URL: http://issues.apache.org/jira/browse/MYFACES-1351
>      Project: MyFaces Core
>         Type: Bug

>     Versions: 1.1.3
>  Environment: JBoss 4.0.4.GA, MyFaces 1.1.3, Tomahawk 1.1.3.
>     Reporter: RD

>
> This is a snippet from my JSF page:
> <h:selectOneMenu id="vertragid" required="true" value="#{rufnummerEditBean.vertragid}"
onchange="submit()" immediate="true" valueChangeListener="#{rufnummerEditBean.changeVertragid}">
> <f:selectItems value="#{rufnummerEditBean.vertragidList}"/>
> </h:selectOneMenu>
> <h:selectOneMenu id="tarifid" required="true" value="#{rufnummerEditBean.tarifid}"
onchange="submit()" immediate="true" valueChangeListener="#{rufnummerEditBean.changeTarifid}">
> <f:selectItems value="#{rufnummerEditBean.tarifidList}"/>
> </h:selectOneMenu>
> The associated code is:
> public List getVertragidList() {
> if(debugInfo) System.out.println("getVertragidList.1");
> List result=new ArrayList();
> for(Vertrag vertrag:vertragDAO.findAll()) {
> result.add(new SelectItem(vertrag.getId(),vertrag.getBezeichnung()));
> }
> if(debugInfo) System.out.println("getVertragidList.2");
> return result;
> }
> public void changeVertragid(ValueChangeEvent event) {
> Integer newval=(Integer)(event.getNewValue());
> if(debugInfo) System.out.println("changeVertragid "+newval);
> setVertragid(newval);
> List listTarifs=getTarifidList();
> if(listTarifs.isEmpty()) setTarifid(null);
> else setTarifid((Integer)(listTarifs.get(0).getValue()));
> }
> public Integer getVertragid() {
> if(debugInfo) System.out.println("getVertragid "+vertragid);
> return vertragid;
> }
> public void setVertragid(Integer vertragid) {
> if(debugInfo) System.out.println("setVertragid "+vertragid);
> this.vertragid = vertragid;
> }
> public Integer getTarifid() {
> if(debugInfo) System.out.println("getTarifid "+tarifid);
> return tarifid;
> }
> private void setTarifid(Integer tarifid) {
> if(debugInfo) System.out.println("setTarifid "+tarifid);
> this.tarifid = tarifid;
> }
> When I choose some value in the combo box Vertragid, the following messages are logged:

> 12:50:09,734 INFO  [STDOUT] getVertragidList.1
> 12:50:10,000 INFO  [STDOUT] getVertragidList.2
> 12:50:10,015 INFO  [STDOUT] getTarifidList.1 vertragid=10000010
> 12:50:10,921 INFO  [STDOUT] getTarifidList.2 size=7
> 12:50:10,937 INFO  [STDOUT] changeVertragid 10000050
> 12:50:10,937 INFO  [STDOUT] setVertragid 10000050
> 12:50:10,937 INFO  [STDOUT] getTarifidList.1 vertragid=10000050
> 12:50:11,015 INFO  [STDOUT] getTarifidList.2 size=0
> 12:50:11,015 INFO  [STDOUT] setTarifid null
> 12:50:11,015 INFO  [STDOUT] changeTarifid 10000250
> 12:50:11,015 INFO  [STDOUT] setTarifid 10000250
> 12:50:11,625 INFO  [STDOUT] getVertragidList.1
> 12:50:11,843 INFO  [STDOUT] getVertragidList.2
> 12:50:11,859 INFO  [STDOUT] getTarifidList.1 vertragid=10000050
> 12:50:11,953 INFO  [STDOUT] getTarifidList.2 size=0
> 12:50:11,953 INFO  [STDOUT] getTarifid 10000250
> As you can see, although I have only used the combo box Vertragid, also the valueChangeListener
of Tarifid gets called. This is, in my opinion, wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message