You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "H. Swaczinna" <sw...@wlp-systems.de> on 2007/05/10 17:34:30 UTC

[Tobago] Another problem with myFaces 1.1.5

Hi,

I've discovered another problem after switching to myFaces 1.1.5. The value 
of an input field is not restored
when a button with immediate="true" is clicked. The action method of the 
bean resets the value of the property
to a standard value and returns an outcome != null so the component tree 
should be rebuild. But the input field
still shows the entered value. Even when I switch to another page and back. 
This input field resides on tab of tabgroup.
With an input field which is not on a tab it works.

It works with myFaces 1.1.4 and it works in a simple example but not if 
things get a little more comlex. So I can't give you example code to 
reproduce this. Because it works with 1.1.4 my code can't be wrong.

I'm using Tobago 1.0.11 from 23.4.

Regards
Helmut

Re: [Tobago] Another problem with myFaces 1.1.5

Posted by Helmut Swaczinna <sw...@wlp-systems.de>.
Hi,

I'm glad to provide a realy simple example to you to reproduce this problem. 
It's the binding of tc:tabGroup.
Without a binding it works, with a binding it doesn't. Please have a look at 
it.

Here's the code:

reset.jsp

<f:view>
  <tc:page id="resetPage" width="400px" height="200px">
    <tc:button label="Reset"
      immediate="true"
      action="#{controller.reset}"/>
    <tc:tabGroup switchType="reloadTab"
      binding="#{controller.tabGroup}">
      <tc:tab id="tab1" label="Tab1">
        <tc:in value="#{controller.value}"/>
      </tc:tab>
    </tc:tabGroup>
  </tc:page>
</f:view>

Controller.java

private String value;

public String reset() {
  value = null;
  return "reset";
}

public String getValue() {
    return value;
}
public void setValue(String value) {
    this.value = value;
}

private UITabGroup tabGroup;

public UITabGroup getTabGroup() {
    return tabGroup;
}
public void setTabGroup(UITabGroup tabGroup) {
    this.tabGroup = tabGroup;
}

faces-config.xml

  <navigation-rule>
    <from-view-id>/reset.jsp</from-view-id>
    <navigation-case>
    <from-outcome>reset</from-outcome>
    <to-view-id>/reset.jsp</to-view-id>
    </navigation-case>
  </navigation-rule>


Regards
Helmut

----- Original Message ----- 
From: "H. Swaczinna" <sw...@wlp-systems.de>
To: <us...@myfaces.apache.org>
Sent: Thursday, May 10, 2007 5:34 PM
Subject: [Tobago] Another problem with myFaces 1.1.5


> Hi,
>
> I've discovered another problem after switching to myFaces 1.1.5. The 
> value
> of an input field is not restored
> when a button with immediate="true" is clicked. The action method of the
> bean resets the value of the property
> to a standard value and returns an outcome != null so the component tree
> should be rebuild. But the input field
> still shows the entered value. Even when I switch to another page and 
> back.
> This input field resides on tab of tabgroup.
> With an input field which is not on a tab it works.
>
> It works with myFaces 1.1.4 and it works in a simple example but not if
> things get a little more comlex. So I can't give you example code to
> reproduce this. Because it works with 1.1.4 my code can't be wrong.
>
> I'm using Tobago 1.0.11 from 23.4.
>
> Regards
> Helmut
>