Guest
Welcome login


TIBCOmmunity > Blogs > General Interface Blog > 2009
Home   Members Communities

General Interface Blog





Previous Next
0

I had this in the draft for a while.. It is actually no longer relavant in 3.7.1. However, I think it may be relavant in a different context of how to create your own custom log handler. So I'm post this now..

 

While GI always had its own log monitor, it is still useful to be able to log to Firebug which is the single most useful development tool for web devlopers. This is a new log handle introduced in GI 3.7.1, however, what if you're not using 3.7.1? Well the code will still work previous version of GI

 

It is important that this class be loaded at the very beginning, so you want to add this to the JSX/js/fx/jsx.js file

 

/**
 * Handles a logging record by sending it to the Firebug console.
 */
jsx3.Class.defineClass('jsx3.util.ConsoleHandler', jsx3.util.Logger.FormatHandler,  nul l,
    function(ConsoleHandler, ConsoleHandler_prototype) {
 
  // maps logger levels to console method names
  var methods = [nul l, "error", "error", "warn", "info", "debug", "debug"];
 
  ConsoleHandler_prototype.handle = function(objRecord) {
    if (window.console) {
      var method = methods[objRecord.getLevel()];
      if (method) {
        try {
          console[method](this.format(objRecord));
        } catch (e) {}
      }
    }
  };
 
});

 

 

Logger.xml

 


  <!-- Logs messages to the Firebug console, when available. -->
  <handler name="console" class="jsx3.util.ConsoleHandler"/>

 <!-- The global logger. -->
  <logger name="global" level="INFO">
    <handler-ref name="memory"/>
    <handler-ref name="console"/>
    <handler-ref name="ide"/>
    <handler-ref name="fatal"/>
    <!--<handler-ref name="appMonitor1"/>-->
  </logger>

 

0 Comments Permalink
0

To disable edit masks for the entire row in a Matrix - Grid, set event property "Before Edit" with following code fragment (follwing sample disables the non-always on edit mask ,such as menu and select/combo.

 

Always on edit mask, such as checkbox and button, are disabled by the jsxdisabled="1" in the record row. E.g.

]]>

 

 


if (this.getRecord(strRECORDID).jsxdisabled == 1) false;

 

To disable Non-always-on edit mask of an entire column in a Matrix - Grid, set event property "Before Edit" (Following code disables the "comboColumn" by evaluating to false in "Before Edit" event handler).

NOTE

These sample code fragment goes into the event handler it self, but the code fragment is not part of a function, so should not use return statement. It should simply evaluate to true or false.


if (objCOLUMN.getName() == "comboColumn") false; else {jsx3.log('EVENT: (jsxbeforeedit). Record: ' + strRECORDID); }

 

Follow similar logic to disable edit mask of a cell based on different factors such as the value of the another column. In "Befor Edit" event property, this code


if (this.getRecord(strRECORDID).status == "Deployed" && objCOLUMN.getName() == "selectMachine" ) false;

 

will disable the "selectMachine" cell (column) if status cell (column) has the value "Deployed".

 

Update

I realized that this blog post was not clear enough regarding how different Edit Mask are disabled. First there are two types of edit masks in Matrix (editable grid Matrix control).

 

The first type is the "always-on" edit mask such as : button, checkbox, radio button, etc. An always-on edit mask is always displayed without user action.

 

The second type is the "non-always-on" edit mask such as : textbox, select, datepicker, etc. These editmask are display only when user focus on the cell.

 

0 Comments Permalink

General Interface Blog

General Interface Blog