Hi Julien Martin

   Thank you for your replay. I used both MyFaces1.1.5 and 
MyFaces1.1.5-SNAPSHOT but
it did not work. My code is as below:

<[EMAIL PROTECTED] contentType="text/html; charset=Shift_JIS" %>
<[EMAIL PROTECTED] uri="http://java.sun.com/jsf/core"; prefix="f" %>
<[EMAIL PROTECTED] uri="http://java.sun.com/jsf/html"; prefix="h" %>
<[EMAIL PROTECTED] uri="http://myfaces.apache.org/tomahawk"; prefix="t" %>

<html>
<head>
<title>jsfsample1</title>
</head>
<body bgcolor="#ffffff">
<h1>JSF sample</h1>
<f:view>
        <h:form id="form1">
                <h:outputText
                id="text1" 
                binding="#{SampleJsfBean.text1}"/>
                <br />
                <h:selectBooleanCheckbox 
                id="check1"
                immediate="true"
                onchange="this.form.submit();"
                binding="#{SampleJsfBean.check1}"
                valueChangeListener="#{SampleJsfBean.check1_valueChanged}" />
                <h:messages/>
                <h:outputText   
                value="check"/>
        </h:form>

</f:view>
</body>
</html>

package jp.tuyano.eclipsebook3;

import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlSelectBooleanCheckbox;
import javax.faces.event.ValueChangeEvent;

/**
 * @author 王
 *
 */
public class SampleJsfBean {
        private HtmlOutputText text1;
        private HtmlSelectBooleanCheckbox check1;
        
        /**
         * @return check1 を戻します。
         */
        public HtmlSelectBooleanCheckbox getCheck1() {
                return check1;
        }
        /**
         * @param check1 設定する check1。
         */
        public void setCheck1(HtmlSelectBooleanCheckbox check1) {
                this.check1 = check1;
        }
        /**
        /**
         * @return text1 を戻します。
         */
        public HtmlOutputText getText1() {
                return text1;
        }
        /**
         * @param text1 設定する text1。
         */
        public void setText1(HtmlOutputText text1) {
                this.text1 = text1;
        }
        
        
        public void check1_valueChanged(ValueChangeEvent valueChangeEvent){
                Boolean neu =(Boolean)valueChangeEvent.getNewValue();
                text1.setValue("check is " + neu.toString());
        }
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4">
        <display-name>JSFSample</display-name> 
                <servlet>
                        <servlet-name>Faces Servlet</servlet-name> 
                        
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
                        <load-on-startup>1</load-on-startup> 
                </servlet>
                <servlet-mapping>
                        <servlet-name>Faces Servlet</servlet-name> 
                        <url-pattern>*.jsf</url-pattern> 
                </servlet-mapping>
</web-app>

I don't know why it is not work. Hope you can help me. Thank you very much.

wang suya




Julien Martin さんは書きました:
>Hello,
>
>Thank you all for your feedback. I realized after posting this email that
>the internet is replete with posts of people having had the same problem as
>me i.e. multiple components trying to trigger each its value change listener
>and that no one has got the solution...
>
>Wang, for you info, I use MyFaces 1.1.4.
>
>Post your code and I'll tell you how to get it working.
>
>Best regards,
>
>Julien.
>
>2007/2/22, wang suya <[EMAIL PROTECTED]>:
>>
>>
>> Hello Julien Martin
>>
>>    Why your valueChangeListener worked and my valueChangeListener does not
>> work?
>> Which version of myfaces and tomahawk and tomahawk-sandbox do you use and
>> which
>> OS do you use?
>>
>> Wang suya
>>
>>
>> Julien Martin さんは書きました:
>> >Hello,
>> >
>> >I have several components in my jsf page each having a
>> valuechangelistener
>> >attribute and each attribute having a corresponding  methods in my
>> backing
>> >bean.
>> >
>> >public void attributeAChanged(ValueChangeEvent evt){
>> >public void attributeBChanged(ValueChangeEvent evt){
>> >
>> >in the jsp:
>> >
>> >valueChangeListener="#{PopulateListsBean.attributeAChanged}"
>> >valueChangeListener="#{PopulateListsBean.attributeBChanged}"
>> >
>> >Does anyone know why the first declared method is always called even if
>> >attributeB is changed??
>> >
>> >I was not able to find anywhere in the spec anything related to that.
>> >
>> >Can anyone help?
>> >
>> >Thanks in advance,
>> >
>> >Julien.
>>
>> wang suya
>>

wang suya

Reply via email to