Reputation: 11
I'm using JDeveloper 11.1.2.4 with JSF 1.2 and having issues with the selectOneChoice components that are being populated by JSF selectItems. Initially the problem was dealing with the selectOneChoice components in popups where if you clicked on the dropdown itself, it would recieve focus but the list would not populate unless you clicked anywhere on the page, outside of the component. I remedied that by changing from an ADF selectOneChoice to a JSF selectOneMenu and that fixed it.
This issue here, I have a selectOneChoice that's not in a popup but rather on a JSPX page that has a valueChangeListener on it. All it did initially was set a Long variable to the newValue (which is being casted to a Long) and then call the method that fills the list.
I added an if statement with a null check then a nested if-else that checks values to disable/enable buttons. So what happens now is I'll click the dropdown, select a value and everything is populated/triggered correctly. If I go and try to click the dropdown to select something else, nothing happens. It just highlights and I see the same value, until I click away and then try again and it works.
What am I missing? Why do I have to click outside of the component for it to fire?
public void templateValueChangeListener(ValueChangeEvent valueChangeEvent) {
myTemplateId = (Long)valueChangeEvent.getNewValue();
if(myTemplateId != null){
if (myTemplateId == 7){
adminButton.setDisabled(true);
notAdminButton.setDisabled(false);
setIsAdminRole(true);
} else if (myTemplateId != 7){
adminButton.setDisabled(false);
notAdminButton.setDisabled(true);
setIsAdminRole(false);
}
}
fillTemplates();
fillAvailablePositions();
}
protected void fillTemplates()
{
List<ContainerTO> list = bigSession.getTheTemplates();
templateList = new ArrayList<SelectItem>();
for(ContainerTO tem : list)
templateList.add(new SelectItem(tem.getId(), tem.getValue()));
}
and here is the JSPX code
<af:selectOneChoice label="Templates:" value="#{AdminBean.myTemplateId}"
valueChangeListener="#{AdminBean.templateValueChangeListener}"
id="soc1"
autoSubmit="true" binding="#{AdminBean.roleTemplateDropDown}"
partialTriggers="cb11 cb10"
immediate="true">
<f:selectItems value="#{AdminBean.templateList}" id="si1"/>
</af:selectOneChoice>
Thanks
Upvotes: 0
Views: 2003
Reputation: 11
So, I've found my answer. Had nothing to do with the code at all but the IDE and browser. Here, we use JDeveloper 11.1.2.4, JSF 1.2 ( -_- ) with an understood requirement to support IE. Long story short, I have to make sure the app works with IE8 because of the components used are broken in anything other than an IE 8 compatible browser. After researching everything, I had the fantastic idea to try it out in Chrome...and it worked. So thus, I re-routed my investigation.
I forced the meta to recognize the IE browser as IE7 then I suppressed the Compatibility warning in web.xml to get the annoyance away. So far so good. THIS IS JUST A WORKAROUND FOR NOW. We will be moving to JDeveloper 12c and JSF 2 as soon as possible.
To force the IE7 mode:
<context-param>
<param-name>User-Agent</param-name>
<param-value>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1;</param-value>
</context-param>
To suppress the Browser Compatibility Alerts:
<context-param>
<param-name>oracle.adf.view.rich.HIDE_UNSUPPORTED_BROWSER_ALERTS</param-name>
<param-value>IECompatibilityModes</param-value>
</context-param>
Upvotes: 1
Reputation: 1
Can you try the same code from fillTemplates() to getTemplateList().
Try to fill the select items inside the getter method of f:selectItems.
Thanks.
Upvotes: 0