Bean is reinitialized after request from jsFunction 
----------------------------------------------------

                 Key: RF-9287
                 URL: https://jira.jboss.org/browse/RF-9287
             Project: RichFaces
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: component-a4j-core
    Affects Versions: 4.0.0.Milestone2
         Environment: v.4.0.0-SNAPSHOT SVN r.19031
            Reporter: Pavol Pitonak


If a composite component contains EL in id attribute, bean is re-initialized 
after each ajax request despite the fact that it is a view-scoped bean.

page: 

<h:form id="form"> 
    <table width="400"> 
        <tbody> 
            <tr> 
                <td><span onmouseover="updateName('Kate')" 
onmouseout="updateName('')">Kate</span></td> 
                <td><span onmouseover="updateName('John')" 
onmouseout="updateName('')">John</span></td> 
                <td><span onmouseover="updateName('Alex')" 
onmouseout="updateName('')">Alex</span></td> 
            </tr> 
            <tr> 
                <td colspan="3"> 
                    <h:outputText value="#{bean.text}" id="showname"/>          
   
                </td> 
            </tr> 
        </tbody> 
    </table> 

    <a4j:jsFunction name="updateName" render="showname"> 
        <a4j:param name="name" assignTo="#{bean.text}"/> 
    </a4j:jsFunction> 
            
    <compositecomponent:output value="#{bean.text}" id="showname"/> 
</h:form> 

composite component (focus on id): 

<composite:interface> 
    <composite:attribute name="value" type="java.lang.String" required="true" 
/> 
</composite:interface> 

<composite:implementation> 
    Name: <b><h:outputText id="#{cc.attrs.value}name" 
value="#{cc.attrs.value}"/></b> 
</composite:implementation> 

managed bean:
@ManagedBean
@ViewScoped
public class Bean implements Serializable {

    @PostConstruct
    public void init() {
        System.out.println("initializing bean");
    }
   ...
}


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

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to