Another bug just found.

The Refresh method doesn't update changes in the Ejbql property.

My EntityQuery has a condition that can't be included as a restriction. It is:


  | @Name("mdrCases")
  | public class MdrCasesQuery extends EntityQuery {
  | 
  | private boolean allCases;
  | 
  | @Override
  | public String getEjbql() {
  |     String cond = allCases? "": " where (c.endingTreatmentDate is null)";
  |     
  |     return "from MdrCase c".concat(cond);
  | }

Since it doesn't contain any EL expression, it can't be included as a 
restriction. So the condition is placed on the fly when the user clicks a 
button to refresh the page:

        <s:decorate template="/layout/edit.xhtml">
  |             <ui:define 
name="label">#{messages['patients.allcases']}:</ui:define>
  |             <h:selectBooleanCheckbox 
value="#{mdrCases.allCases}"></h:selectBooleanCheckbox>
  |     </s:decorate>
  |     
  |             <h:commandButton action="#{mdrCases.refresh}" 
value="#{messages['form.search']}" styleClass="button" />
  | 

The problem is that after the refresh method is called the Ejbql is not rebuild.

I saw that in Query.refresh method, if I make a change like:

   public void refresh()
  |    {
  |       clearDataModel();
  | 
  |      // INCLUDE THIS LINE HERE
  |      parsedEjbql = null;
  |    }

recompile and regenerate SEAM, it works just fine.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083202#4083202

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083202
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to