You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Murat Hazer <mu...@gmail.com> on 2006/05/23 15:27:44 UTC
MethodBinding
Hi,
I have a s:subform and selectOneMenu in this form, onchange i submit the
form and in the valueChangeListener method of the backing bean i am calling
another backing beans method using methodBinding and i want this method to
navigate another page (bean2.callMe excuted but it doesn't navigates or
updates the view), and #{sessionScope.code} value is not updated with the
selected items value, here is the code;
<h:form>
....
<s:subForm id="changeFORM">
<t:selectOneMenu value="#{sessionScope.code}" valueChangeListener="#{
changer.change}" onchange="changeFORM_submit();">
<f:selectItems value="#{changer.list}" />
<f:converter converterId="javax.faces.Long" />
</t:selectOneMenu>
</s:subForm>
....
</h:form>
public class Change{
....
public void change(ValueChangeEvent valueChangeEvent) {
facesContext.getApplication().createMethodBinding(
"#{bean2.callMe}", new Class[] {}).invoke(
facesContext, new Object[] {});
}
....
}
regards....
--
Murat HAZER
Re: MethodBinding
Posted by Matthias Wessendorf <ma...@apache.org>.
You are "just" calling a method.
JSF doesn't now about your navigation rules at this time.
Use the NavigationHandler for this kind of use-case
facesContext.getApplication().getNavigationHandler().handleNavigation(
facesContext, null, outcome);
"outcome" is the string returned by #{bean2.callMe}
-Matthias
On 5/23/06, Murat Hazer <mu...@gmail.com> wrote:
> Hi,
>
> I have a s:subform and selectOneMenu in this form, onchange i submit the
> form and in the valueChangeListener method of the backing bean i am calling
> another backing beans method using methodBinding and i want this method to
> navigate another page ( bean2.callMe excuted but it doesn't navigates or
> updates the view), and #{sessionScope.code} value is not updated with the
> selected items value, here is the code;
>
> <h:form>
> ....
> <s:subForm id="changeFORM">
> <t:selectOneMenu value="#{sessionScope.code}"
> valueChangeListener="#{changer.change}"
> onchange="changeFORM_submit();">
> <f:selectItems value="#{changer.list}" />
> <f:converter converterId="javax.faces.Long" />
> </t:selectOneMenu>
> </s:subForm>
> ....
> </h:form>
>
> public class Change{
> ....
> public void change(ValueChangeEvent valueChangeEvent) {
> facesContext.getApplication().createMethodBinding(
> "#{bean2.callMe}", new Class[] {}).invoke(
> facesContext, new Object[] {});
> }
> ....
> }
>
>
> regards....
>
> --
> Murat HAZER
>
>
--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com