jiri hanus - 2006-02-08

Hi all,
i'm using jpivot api to execute mdx queries and for some custom rendering. It works fine for MondrianModel class, but when tried to use XMA_Model, there is a problem: when expanding/collapsing a node, the model doesn't refresh. More precisely, when the model's 'result' field is null (as it is set during model changes - expand/collapse, etc..), the MDX query doesn't change in XMLA_Model, but the MondrianModel regenerates it.
It seems to be working with following code for getCurrentMdx() method for XMLA_Model (taken exactly from MondrianModel):

public String getCurrentMdx() {
      if (result != null)
          return currentMdx;
        else if (queryAdapter == null) {
          return mdxQuery;
        } else {
          // get new result, this will update the mdx
          try {
            getResult();
          } catch (Exception e) {
            logger.error("unexpected Exeption getResult ", e);
            throw new RuntimeException(e.getMessage());
          }
          return currentMdx;
        }
  }