users@glassfish.java.net

Re: How to hold the selected value of a JSF selectOneMenu ...

From: <forums_at_java.net>
Date: Thu, 27 Mar 2014 18:03:34 -0500 (CDT)

Hi, This is what I wanted from 'The BalusC Code',
http://balusc.blogspot.com.es/2013/01/composite-component-with-multiple-input.html
In my case the question is that having four components in the same jsf page,
the selection of one of them do the reload of the page and putting the other
three components in their default values. So I need to bind the jsf tag of
the component to an UIInput property in the backing bean to set the selected
values and an ajax call to a method that has AjaxBehaviorEvent event as
parameter. The code should be for one of this selectOneMenu component and
ajax method as follows, being the UIInput property 'teams' public void
updateTeamsIfNecessary(AjaxBehaviorEvent event) { if((null != idTeam) &&
(!"".equals(idTeam))) { teams.setValue(idTeam); FacesContext context =
FacesContext.getCurrentInstance(); context.getPartialViewContext()
.getRenderIds() .add(teams.getClientId(context)); } } and now it works fine.
Regards, jose

--
[Message sent by forum member 'josealvarezdelara']
View Post: http://forums.java.net/node/901657