Hi.

We are currently facing and "interesting" problem:

We have a page that contains one form element with a couple of input
elements and one subform element, the backing bean is session scoped:

<tr:form>
  ...
  <tr.commandLink text="New" .../> (--> sets backing bean property that
lets the subform be rendered with value=null)
  <tr:subform rendered="#{backing.showSubform}">
    <tr:inputText value="#{backing.value}" required="true"/>
    <tr:commandButton text="Submit" action="......"/> (To save the value
and unrender the subform)
    <tr:commandButton text="Cancel" action="......" immediate="true"/>
(To cancel the editing and unrender the subform)
  </tr:subform>
  <tr:commandLink text="Edit" .../> (--> sets backing bean property that
lets the subform be rendered with value="current Value")
  <tr:commandLink text="Save".../> (Finally saves the changes)
</tr:form>

Now we have the following usecases:
A) OK
1. Form is started
2. "New" is clicked
3. subform is shown with empty inputText 

B) OK
1. Form is started
2. "Edit" is clicked
3. subform is shown with "current Value"

C) NOT OK
1. Form is started
2. "Edit" is clicked
3. "New" is clicked
4. subform is shown with "current Value"

D) NOT OK
1. Form is started
2. "New" is clicked
3. "Edit" is clicked
4. subform is shown with empty inputText


So what are we missing here? Why is the inputText not re-rendered (we
think because the events are not produced from within the subform)? Some
debugging in the backing bean shows that the "value" property is set
correctly - its just the subform that doesn't get updated


What we already tried (without success):
- set the subform as "default" -> no change
- remove the subform tags -> "New" or "Edit" is not clickable until the
text field is filled (required)
- set immediate="true" on all relevant links -> No update of the subform
content
- set an id and a binding on the subform element and call
requestContext.addPartialTarget(...) from the backing bean's "new" and
"edit" methods -> No update of the subform content


What we tried (with success):
- Programatically call resetValue() on all EditableComponents from the
backing bean
--> So this approach works but produces some overhead and is kind of a
"workaround"

Help is appreciated ;-)

Regards
Stefan Friedrich

Reply via email to