-
1. Regression from CR1: ELResolver problem
ilya_shaikovsky Mar 31, 2011 4:20 AM (in response to vrelits)please past complete page code.
-
2. Regression from CR1: ELResolver problem
vrelits Mar 31, 2011 4:22 AM (in response to ilya_shaikovsky)Complete page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core">
<ui:composition template="/template/layout.xhtml">
<ui:define name="title">#{dps_msgs['adminlog.title']}</ui:define>
<ui:define name="body">
<h:form>
<rich:collapsiblePanel header="#{dps_msgs['filter']}" switchType="ajax" expanded="false">
<rich:graphValidator value="#{adminLogController.form}" id="gv">
<rich:messages for="gv"/>
<h:panelGrid columns="2">
<h:outputLabel value="#{dps_msgs['from']}" for="from"/>
<h:panelGroup>
<rich:calendar id="from" value="#{adminLogController.form.from}" enableManualInput="true"
datePattern="dd.MM.yyyy"/>
<rich:message for="from"/>
</h:panelGroup>
<h:outputLabel value="#{dps_msgs['to']}" for="to"/>
<h:panelGroup>
<rich:calendar id="to" value="#{adminLogController.form.to}" enableManualInput="true"
datePattern="dd.MM.yyyy"/>
<rich:message for="to"/>
</h:panelGroup>
<h:outputLabel value="#{dps_msgs['level']}"/>
<h:panelGroup id="levels">
<ui:repeat value="#{adminLogController.form.allLevels}" var="level">
<h:selectBooleanCheckbox id="level" value="#{adminLogController.form.levels[level]}"/>
<h:outputLabel value="#{level}" for="level"/>
</ui:repeat>
<h:graphicImage value="/gfx/checkall.png">
<f:ajax event="click" listener="#{adminLogController.form.selectLevelsListener}" render="levels"
execute="@this" immediate="true"/>
</h:graphicImage>
<h:graphicImage value="/gfx/uncheckall.png">
<f:ajax event="click" listener="#{adminLogController.form.unSelectLevelsListener}" render="levels"
execute="@this" immediate="true"/>
</h:graphicImage>
</h:panelGroup>
<h:outputLabel value="#{dps_msgs['environment']}" for="environment"/>
<h:panelGroup>
<h:selectOneMenu id="environment" value="#{adminLogController.form.environment}">
<f:selectItems value="#{environmentHelper.allEnvironments}"/>
</h:selectOneMenu>
<rich:message for="environment"/>
</h:panelGroup>
</h:panelGrid>
</rich:graphValidator>
<h:commandButton value="#{dps_msgs['update']}" action="#{adminLogController.updatedFilter}"/>
</rich:collapsiblePanel>
</h:form>
<rich:dataTable value="#{adminLogController.adminLogs}" var="deployment">
<rich:column>
<f:facet name="header">
<h:outputText value="#{dps_msgs['timestamp']}"/>
</f:facet>
<h:outputText value="#{deployment.timestamp}">
<f:convertDateTime pattern="#{dps_msgs['timestamp.format']}"/>
</h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="#{dps_msgs['level']}"/>
</f:facet>
<h:outputText value="#{deployment.level}"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="#{dps_msgs['environment']}"/>
</f:facet>
<h:outputText value="#{deployment.environment}"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="#{dps_msgs['message']}"/>
</f:facet>
<h:outputText value="#{deployment.message}"/>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="#{dps_msgs['user']}"/>
</f:facet>
<h:outputText value="#{deployment.user}"/>
</rich:column>
</rich:dataTable>
</ui:define>
</ui:composition>
</html>
-
3. Regression from CR1: ELResolver problem
ilya_shaikovsky Mar 31, 2011 7:05 AM (in response to vrelits)<h:form>
<ui:repeat var="lev" value="#{userBean.allLevels}">
<h:selectBooleanCheckbox value="#{userBean.levelsMap[lev]}" />
</ui:repeat>
<h:commandButton value="Submit" />
</h:form>
and
private Map<String, Boolean> levelsMap;
private List<String> allLevels;
public UserBean() {
super();
allLevels = new ArrayList<String>();
levelsMap = new HashMap<String, Boolean>();
allLevels.add("error");
allLevels.add("warn");
levelsMap.put("error", true);
levelsMap.put("warn", true);
}
works for me with latest code.
Double-check that no other changes were made togetehr with RF update.
-
4. Regression from CR1: ELResolver problem
vrelits Mar 31, 2011 8:12 AM (in response to ilya_shaikovsky)I have reverified that if only change is from CR1 to Final it does not work.
The funny thing is that I have very similar code in another page and that works fine.
It is difficult for me too see any difference between the one that works and the one that doesn't.
-
5. Regression from CR1: ELResolver problem
vrelits Mar 31, 2011 9:01 AM (in response to ilya_shaikovsky)See screen dump below:
In first iteration base of LocalRef is HashMap (size 4) representing my 4 checkboxes.
But in next interation localReference.next() will return "level" as you can see in screendump.
Level has base=null and the will exit in next iteration (return null) and I will get error.
It seems to me the "level" comes from ui:repeat.
Still confused about what's really going on because I have code like this that works.
-
6. Regression from CR1: ELResolver problem
vrelits Apr 7, 2011 8:05 AM (in response to vrelits)A little bump here. Still not sure if I'm doing anything wrong as it worked in CR1 and the code seems to have changed a lot between CR1 and Final.
-
7. Regression from CR1: ELResolver problem
lfryc Apr 7, 2011 8:14 AM (in response to vrelits)Hi Jesper, have you tried to see differences when debugging the same code location causing errors when using CR1 and when using Final?
-
8. Regression from CR1: ELResolver problem
vrelits Apr 7, 2011 8:43 AM (in response to lfryc)Yes, I've tried that but the codebase seems so different that it didn't make me any wiser. Just again showed that it works in CR1.
-
9. Regression from CR1: ELResolver problem
vrelits Apr 7, 2011 9:18 AM (in response to vrelits)The problem only arises if I use rich:grapValidator. If I remove that it works.
-
10. Regression from CR1: ELResolver problem
ilya_shaikovsky Apr 8, 2011 4:29 AM (in response to vrelits)A little bump here. Still not sure if I'm doing anything wrong as it worked in CR1 and the code seems to have changed a lot between CR1 and Final.
version could not be the reason if we talking about
The funny thing is that I have very similar code in another page and that works fine.
It is difficult for me too see any difference between the one that works and the one that doesn't.
if you will create small localized sample to run locally - it will be very helpfull to resolve faster.
-
11. Re: Regression from CR1: ELResolver problem
vrelits Apr 14, 2011 9:00 AM (in response to ilya_shaikovsky)I've now made a small example to show error. Just deployed to Tomcat 7. src and libs are seperate (and need to be build into war)
Again: the error only show when graphValidator is used.
-
rf4elerror.zip 7.2 MB
-
-
12. Re: Regression from CR1: ELResolver problem
laszlovandenhoek Feb 13, 2014 10:01 AM (in response to vrelits)Hi Jesper,
I think I'm running into this problem myself right now, with RF 4.3.2.Final. Like yourself I am using a rich:graphValidator around a ui:repeat around a Map<? extends Enum,Boolean>.
Have you found a way around this?
Edit: my workaround has been to simply remove the rich:graphValidator and use programmatic validation:
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
final Set<ConstraintViolation<T>> violations = validator.validate(object);
Thanks,
László