Hi Michael,

the behavior you describe seems to be normal for JSF (in the moment I doesn't now that this has changed from JSF 1.1 to JSF 1.2).

When readonly is false the value will be submitted, but not written into the model. After an action with outcome "null" the same view root will be rendered again.
So the local value will be used instead of the actual value from the model.

If the action was completed and you do not need old value of other forms on that page, you should return an outcome different from "null" to create a new view.

Hope that helps.

Udo

Am 16.10.10 23:04, schrieb Michael Kakuschky:
Hello, I stripped down my tx:in update problem. In a simple JSP page I have have to forms. If I click the button in the first form I want to update the tx:in element in the second form. The update does only works if the readonly attribute of the tc:in element is set to "true". But them I'm not able to edit the value. Is this a bug or is there a way fix this behaviour?

Regards Michael

I use tobago 1.0.30 and Myfaces 1.1.18 with tomcat 6.0.18

Here is the page JSP Page

<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tobago/component"; prefix="tc"%>
<%@ taglib uri="http://myfaces.apache.org/tobago/extension"; prefix="tx"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<f:view>
<tc:page>

<f:facet name="layout">
<tc:gridLayout columns="1*" rows="fixed;fixed;*" />
</f:facet>

<tc:form>
<tc:cell>
<tc:button label="addone" action="#{myTestBean.addOne}" />
</tc:cell>
</tc:form>

<tc:form>
<tc:cell>
<tc:in value="#{myTestBean.theNumber}" readonly="false" />
</tc:cell>
</tc:form>

<tc:cell />

</tc:page>
</f:view>

and the Bean looks like the following

public class MyTestBean {

    Integer number = 11880;

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String addOne()  {
        number += 1;

        return null;
    }

}



Reply via email to