new things..

  • Ati Rosselet

    Ati Rosselet - 2008-09-16

    Maybe of use...  I added a TableRefreshListener and associated functions around the TableCompent.  I also then allow the chart component to register as a listener, and when the TableComponent is refreshed (set to dirty) I fire the refreshEvent.  Why? well.. currently the chart object would respond to is the modelchanged, or formchanged to redraw the chart.  SInce I have other components such as a NumberFormat and CurrencyExRate UI components, which only act on the VISIBLE elements of the table (no mdx is run etc, only the formatted value is altered), I  needed to get the chart to redraw itself (=dirty) whenever I enable/disable any of these visual filters.   

    There may have been an easier way, but this works just fine...
    also I modified the ChartComponentTag to allow the specification of a table="#{table}"  value, in which case the chart registers itself to the Table as a listener for tableRefreshed events.  Works fine.   

    I also have the exchrate and numberformat working happily with xls/pdf export and chart generation now - if num format is specified, the raw value is obtained by parsing the formattedstring with the given format, otherwise the default (as before) cell.getValue() is used.  If the exchrate is also "on", then it generates the formatted "value" output to the document by dividing by the rate given (if not 0 of course).  That is used in conjunction with the numberformat

    I do have a small itsy bitsy problem...   and I hope someone has an idea.
    I need to "find" if there is a NumberFormatComponent defined in the session, and/or if there is a CurrencyConfigComponent etc... which I can currently only do by doing:

      e.g. (CurrencyConfigComponent )context.getSession().getAttribute("currency01");

    But I would rather this be dynamic...  I could add one to the other as I did for the chart object, but I was wondering if there is any way to iterate over that Attribute collection on initialization and look for an object of the correct type? (I couldn't find any... :(( )

    Let me know if anyone might be interested in these changes - the CurrencyUI could easily be changed to allow presentation in any of a set of selected currency exchange rates etc (currently just the one used). Out client likes that he can switch between viewing mdx results in local currency and Euros with push of a button.


    • Ati Rosselet

      Ati Rosselet - 2008-09-16

      found a solution: 

             if (enabled){
                  Enumeration attNames =context.getSession().getAttributeNames();
                  while (attNames.hasMoreElements()){
                      String name = (String)attNames.nextElement();
                      if (context.getSession().getAttribute(name) instanceof CurrencyConfigComponent ){
                         scs= (CurrencyConfigComponent) context.getSession().getAttribute(name);

      works fine as long as only one object is defined... I guess I can count on that :)
      thnx... finally got rid of the last hardcoded component name :)))


    • Ati Rosselet

      Ati Rosselet - 2008-09-16

      This is what it looks like..

      sorry about the Hungarian... I'll get English resources ASAP :)))
      Actually, I', redoing all the forms to be multilingual, it seems just silly to have separate forms for different languages such as :
      chartpropertiesform.xml and chartpropertiesform_no.xml


    • Dinesh Simkhada

      Dinesh Simkhada - 2008-09-25

      hi Rosselet,
      Can you share the code of the changed files,


      • Ati Rosselet

        Ati Rosselet - 2008-09-26

        sure... I'm not going to add them to the core src tree until Andreas says yay or nay, but I can make a zip of my changes and post them to our webserver.  I'll try to get that done by monday or do and post a link here.  Any questions after that, feel free to ask.   The exchange rate part should probably be modified to make it more ... general, but use/change it freely of course.

      • Ati Rosselet

        Ati Rosselet - 2008-10-07

        I put the files here:

        hope you can get some use out of them.
        be warned, that the exchangerate component, and some of the user components get data from hibernate datasources not included.. so you'll probably want to ignore those parts..
        also.. from the WEBAPP section, the real changes are in the WEB-INF directory (somehow everyhing got the same timestamp, so i just included all files.. just in case).

        any questions, feel free to ask!


Log in to post a comment.