Guest
Welcome login


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

General Interface Blog

2 Posts tagged with the matrix tag
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
5

Author: Luke Birdeau

 

The XML Mapping utility does allow you to specify which records in your CDF document actually get mapped. There is a API call exposed by the jsx3.net.Service class called setCDFRecords that can be called from a mapping rule. For example, assume you have a CDF document in the XML Cache called myXML:

 


<data jsxid="jsxroot">
<record jsxid="a" checked="1" jsxtext="a"/>
<record jsxid="b" checked="0" jsxtext="b"/>
<record jsxid="c" checked="1" jsxtext="c"/>
<record jsxid="d" checked="1" jsxtext="d"/>
</data>

 

Next, Create a CDF Document mapping rule using the XML Mapping Utility for the outbound message you are creating. Set its path/value field to: myXML. Add an additional mapping rule (a Script type this time) and set the following as its path/value:

 

setCDFRecords("record[@checked='1']");

 

Here is what happened:

 

Any time a CDF Document mapping is encountered, all record nodes that are immediate children of the root node (data) are placed in a collection (jsx3.util.Collection). Then when a CDF Record mapping is encountered, the first record in the collection is assigned as the CDF Context and the ensuing rules are run. When a CDF Attribute mapping is encountered, the record referenced by the CDF Context is used. The mapper then repeats this as long as there are more records in the collection. By calling setCDFRecords, you effectively tell the system to not use its default query:

 

currentRecordContext.selectNodes("record");

rather, use a custom query. In your case:

 

currentRecordContext.selectNodes("record[@checked='1']");

 

 

NOTE setCDFRecords() goes with your CDF Document mapping as an additional script mapping rule.

 

 

Example We want to map the jsxtext attribute from record with jsxselected checked to WSDL Schema structure

 


<element name = "PersonSearch">
<complexType>
<sequence>
<element name = "QueryTarget" type = "xsd:string" maxOccurs = "unbounded"/>
</sequence>
</complexType>
</element>

 

In the Mapping utility, select the rule tree node PersonSearch.

  1. 1. Add a CDF Document mapping and enter the name of the CDF Document you wish to map to (its cache id).

  2. 2. Next add a Script mapping to the PersonSearch node and set its value to:

setCDFRecords("record[@jsxselected='1']");

 

Next, select the rule named, QueryTarget.

  1. 1. Add a CDF Record Mapping (records don't need a value).

  2. 2. Next, add a CDF Attribute mapping and enter jsxtext as the named CDF attribute on that record that you want to map to.

 

So to recap, you should have two mappings on the PersonSearch rule and two mappings on the QueryTarget rule.

 

5 Comments Permalink

General Interface Blog

General Interface Blog