posts - 431,  comments - 344,  trackbacks - 0
          1.Suppose i have 50 records in a matrix and using mapping i want to send only those records to BW which are selected.. how can we do this?
             appname.getCache().getDocument('MTX_DATA_XML').selectNodes('//record[@jsxselected="1"]');
          2.
          format 1:
          <data jsxid="jsxroot">
          <record jsxtext="Jame Paulis" jsxid="1" office="1018" status="Interview" experience="3" longivity="1" ></record>
          <record jsxtext="James" jsxid="2" office="1019" status="GD" experience="3" longivity="2" ></record>
          <data/>

           format 2:
          <data>
          <record>
          <ID>1</ID>
          <office>1018</office>
          <status>Interview</status>
          <experience>3</experience>
          <longivity>1</longivity>
          </record>
          <record>
          <ID>2</ID>
          <office>1019</office>
          <status>Group Discussion</status>
          <experience>0</experience>
          <longivity>3</longivity>
          </record>
          </data>
          var nodeValueExp = objDoc.selectSingleNode("http://record[ID='1']/experience").getValue();

          The following XSL will produce the output you wanted in format 2:
          <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
          <xsl:template match="/">
          <xsl:element name="data">
          <xsl:for-each select="http://record">
          <xsl:element name="record">
          <xsl:for-each select="@*">
          <xsl:choose>
          <xsl:when test="name()='jsxid'"><xsl:element name="ID"><xsl:value-of select="."/></xsl:element></xsl:when>
          <xsl:when test="name()='jsxtext'"></xsl:when>
          <xsl:otherwise><xsl:element name="{name()}"><xsl:value-of select="."/></xsl:element></xsl:otherwise>
          </xsl:choose>
          </xsl:for-each>
          </xsl:element>
          </xsl:for-each>
          </xsl:element>
          </xsl:template>
          </xsl:stylesheet>



          You can use this XPath for format1:

          //record[@jsxid='1']/@experience


          3.Is there a way to select items in a Select by pressing keys? For example I have a alphabetized list of States. I want to be able to press 'A' 4 times to move from Alabama, to Alaska, to Arizona, to Arkansas. Then I want to be able to press tab and move on to a zip code field. This should leave Arkansas selected.

          This is the normal behavior for a simple html select box and I want to stick to what people are familiar with.

          function handleKeyPress(objSelect,objEvent) {
            //resolve the key the pressed;only listen for numbers and letters
            var intKey = objEvent.keyCode();
            var strKey = String.fromCharCode(intKey);
            if(strKey.search(/[a-z0-9]/i) == -1) return true;
            var objKey = new RegExp(strKey,"i");
          
            //get list of options for the select
            var objXML = objSelect.getXML();
            var objTextNodes = objSelect.getXML().selectNodes("http://record[@jsxtext]");
          
            //query the select box to see if the same key was pressed before; if so begin searching at he correct index
            var objState = objSelect.custom_index || {};
            objState[strKey] = (objState[strKey] != null) ? objState[strKey] : 0;
            var intIndex = (objState[strKey] < objTextNodes.getLength()) ? objState[strKey] : 0;
            jsx3.log("index: " + objState[strKey]);
          
          
            objState[strKey] = 0;
            return true;
          };
          
          
          function handleKeyPress(objSelect,objEvent) {
            //resolve the key the pressed;only listen for numbers and letters
            var intKey = objEvent.keyCode();
            var strKey = String.fromCharCode(intKey);
            if(strKey.search(/[a-z0-9]/i) == -1) return true;
            var objKey = new RegExp(strKey,"i");
          
            //get list of options for the select
            var objXML = objSelect.getXML();
            var objTextNodes = objSelect.getXML().selectNodes("http://record[@jsxtext]");
          
            //query the select box to see if the same key was pressed before; if so begin searching at he correct index
            var objState = objSelect.custom_index || {};
            objState[strKey] = (objState[strKey] != null) ? objState[strKey] : 0;
            var intIndex = (objState[strKey] < objTextNodes.getLength()) ? objState[strKey] : 0;
            jsx3.log("index: " + objState[strKey]);
          
            //loop to find the next item in the list that begins with the given key
            for(var i=intIndex;i<objTextNodes.getLength();i++) {
              if(objTextNodes.getItem(i).getAttribute("jsxtext").search(objKey) == 0) {
                objSelect.custom_index = {};
                objSelect.custom_index[strKey] = i+1;
                objSelect.setValue(objTextNodes.getItem(i).getAttribute("jsxid"));
                return false;
              }
            }
          
            //loop from 0 to current index to find the first item in the list that begins with the given key.(wrap around)
            //following was added by dlehman
            for(var i=0;i<intIndex;i++) {
              if(objTextNodes.getItem(i).getAttribute("jsxtext").search(objKey) == 0) {
                objSelect.custom_index = {};
                objSelect.custom_index[strKey] = i+1;
                objSelect.setValue(objTextNodes.getItem(i).getAttribute("jsxid"));
                return false;
              }
            }
            
            objState[strKey] = 0;
            return true;
          };
          



          posted on 2007-03-27 12:03 周銳 閱讀(341) 評論(0)  編輯  收藏 所屬分類: TIBCO
          主站蜘蛛池模板: 宁明县| 江阴市| 涞水县| 正阳县| 云梦县| 察哈| 绥化市| 泽州县| 彭山县| 三河市| 晴隆县| 天祝| 梅河口市| 丰宁| 临夏县| 无为县| 汉寿县| 澳门| 乐都县| 佳木斯市| 牙克石市| 萝北县| 永城市| 芜湖市| 姜堰市| 崇文区| 石泉县| 庆云县| 凌源市| 孝义市| 自治县| 龙川县| 平遥县| 洛川县| 驻马店市| 昭通市| 固安县| 桓台县| 蒲城县| 通海县| 盐山县|