New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bean call on ajax event with facelet ui:include + ui:param seems not to work ? #541
Comments
Hi, i answer to my own question :
ui:include could help in code mutualization, but it implies less flexibility when we encounter such problems... (i.e. also dynamic tabs with ui:include) |
Hi again, Have you any solution to the problem ? i'm really embarrassed with this problem which prevent me to push the final release in prod. i give some code to tests : test.xhtml : <h:body>
<b:container fluid="true">
<h:form>
<b:row>
<b:column>
<ui:include src="test_include.xhtml">
<ui:param name="beanCtrl" value="#{test}" />
</ui:include>
<b:commandButton disabled="#{test.disabled}" value="OK"></b:commandButton>
</b:column>
</b:row>
</h:form>
</b:container>
</h:body> test_include.xhtml : <ui:composition ...><b:inputText value="#{beanCtrl.value}" onchange="ajax:beanCtrl.onChange()" update="@(.btn)"></b:inputText></ui:composition> TestAction.java : import java.io.Serializable;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Named("test")
@ViewScoped
public class TestAction implements Serializable {
private String value = "Default";
private static final long serialVersionUID = 745232242454805589L;
final static Logger logger = LoggerFactory.getLogger(TestAction.class);
boolean b = true;
public TestAction() {
super();
}
public void onChange(){
logger.debug("##### > OK");
b = false;
}
public boolean isDisabled(){
return b;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}```
Many thanks in advance for any answer
Regards |
Oh, sorry, I've read your question, but I didn't find some spare time to answer it yet. I guess it's my job to fix your bug. I'm afraid it's going to be a difficult one. If I'm lucky, I'm just using the wrong "EL context", and it's just a matter of choosing the correct one. But that's something I'm not familiar with, so I'll probably need some time to investigate the issue. BTW, there's no need to be embarrassed: obviously, you've found a profound error in BootsFaces. You don't happen to have a workaround so you can push your application into production? |
I'd also like to express my gratitude for providing a reproducer. That helps us a lot! Merci et a tout a l'heur |
No worry, Christophe |
Confirmed the issue and added a test case to the showcase (/BootsFacesWeb/issues/issue541.jsf) |
Hi,
With a simple facelet inclusion :
The ajax bean call 'onchange' works perfectly when using directly the bean name ('profilCtrl') :
But if we use instead the include param 'beanCtrl' in the ajax call :
(Note of course that value="#{beanUser.prenom}" is done correctly)
the call is not triggered and the following message appears in logs :
Please check your EL expression - intermediate term beanCtrl is null
Any idea ?
Many thanks in advance
(CDI context ; Wildfly 9.0.2 imports for bean are :
@javax.inject.Named(value="profilCtrl")
@javax.faces.view.ViewScoped (not javax.faces.bean.ViewScoped which doesn't work in CDI context)
The text was updated successfully, but these errors were encountered: