Can anybody help me...

Am calling a javascript method from the HTML body, but am getting an error as under, can anybody resolve my plroblem
GENERIC: Javascript error: "setClass is not defined". b:comboBox anonymous()
GENERIC: Javascript error: "GENERIC: Javascript error: "setClass is not defined".". b:comboBox btl_comboBoxBase_setValue()

<!-- -->
<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Strict/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

        <head>
                <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
                <script type="text/javascript" src="../Backbase_4_2_1/engine/boot.js"></script>
                <style type="text/css">
                        xmp { display:none; }
                        body {
                                font-family:"Lucida Grande",Verdana,Helvetica,sans-serif;
                                font-size:12px;
                </style>
                <script type="text/javascript">
                    function setClass() {
                       alert("hi....");
                           var oTree = bb.document.getElementById('myTreeId');    // get tree grid by id
                   alert(oTree.selectNodes("view()/div[3]/table/tbody/tr[property::clientWidth gt 0]/td["+ sXpath +"]/div/property::innerHTML");
                    }
            </script>
            <title>sBrowser(View Schema Browser)</title>
        </head>
       
        <body>
                <script xmlns="http://www.w3.org/1999/xhtml"
                        xmlns:b="http://www.backbase.com/2006/btl"
                        xmlns:e="http://www.backbase.com/2006/xel"
                        xmlns:d="http://www.backbase.com/2006/tdl"
                        xmlns:bda="http://www.backbase.com/2006/bda"
                        xmlns:xi="http://www.w3.org/2001/XInclude"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="application/backbase+xml">

                        <xi:include href="../Backbase_4_2_1/bindings/config.xml" />
                        <!--Modify href path to point to your installation of Backbase Client Framework-->

                        <b:dataSource name="data" e:behavior="b:localData">
                                <b:dataSchema>
                                        <b:dataField name="identifier" select="@id"></b:dataField>
                                        <b:dataField name="parent" select="@parentId"></b:dataField>
                                        <b:dataField name="expandable" select="@hasChildren"></b:dataField>
                                </b:dataSchema>

                                <b:dataContainer>
                                        <xi:include href="help.xml"/>
                                </b:dataContainer>
                        </b:dataSource>
                       
                        Find : <b:comboBox width="600px">
                                           <b:comboBoxOption value="" selected="selected"> </b:comboBoxOption>
                                           <b:comboBoxOption value="1">1</b:comboBoxOption>
                                           <b:comboBoxOption value="2">2</b:comboBoxOption>
                                           <b:comboBoxOption value="3">3</b:comboBoxOption>
                                           <b:comboBoxOption value="4">4</b:comboBoxOption>
                                                   <e:handler event="change" type="text/javascript">
                                                       var aOptions = this.getProperty("options");
                                                       alert(aOptions);
                                                       for(var i=0,j=aOptions.length; i&lt; j; i++) {
                                                                alert(aOptions[i].getProperty("value"));
                                                                setClass();
                                                       }
                                                       var sXpath = this.getProperty("value");
                                                       setClass(sXpath);                                               
                                                   </e:handler>
                                        </b:comboBox>
                       
                        <b:treeGrid dataSource="data" width="640px">
                                <b:treeGridCol label="Name" select="name"></b:treeGridCol>
                                <b:treeGridCol label="Surname" select="surname"></b:treeGridCol>
                                <b:treeGridCol label="Email" select="*[3]"></b:treeGridCol>
                        </b:treeGrid>
                </script>
        </body>
</html>
I appriciate your help

Can anybody help me...

Hi Prasad,
You are almost there. I am not sure what are you doing with the for loop in the change option.The for loop also causes some errors so just deleted it.Some of remarks:
add sXpath because there is an argument in the function
the alert is not well closed
Don't forget to add id in the tree grid otherwise setClass function can not get the tree grid

function setClass(sXpath){   //  add argument because there is an argument in the function              
     var oTree = bb.document.getElementById('myTreeId');    // get tree grid by id
     alert(oTree.selectNodes("view()/div[3]/table/tbody/tr[property::clientWidth gt 0]/td["+ sXpath +"]/div/property::innerHTML"));
     }
..............other code .......
<e:handler event="change" type="text/javascript">                                                    
    var sXpath = this.getProperty("value");
    setClass(sXpath);                                              
</e:handler>
..............other code .......
<b:treeGrid id="myTreeId" > // id tree grid

~yudi

Hi Yudi, Thanks for your response

Now the javascrit function is being called but, getting an error as under
XPATH: parsing error in "view()/div[3]/table/tbody/tr[property::clientWidth gt 0]/td[]/div/property::innerHTML". [ undefined]
GENERIC: Javascript error: "XPATH: parsing error in "view()/div[3]/table/tbody/tr[property::clientWidth gt 0]/td[]/div/property::innerHTML".". b:comboBox [ undefined]

I modified my code as under

<!-- -->
<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Strict/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
        <head>
                <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
                <script type="text/javascript" src="../Backbase_4_2_1/engine/boot.js"></script>
                <style type="text/css">
                        xmp { display:none; }
                        body {
                                font-family:"Lucida Grande",Verdana,Helvetica,sans-serif;
                                font-size:12px;
                </style>
                <script>
                        function setClass(sXpath){   //  add argument because there is an argument in the function  
                                alert("hi.....;")          
                        var oTree = bb.document.getElementById('myTreeId');    // get tree grid by id
                        alert(oTree.selectNodes("view()/div[3]/table/tbody/tr[property::clientWidth gt 0]/td["+ sXpath +"]/div/property::innerHTML"));
                }
        </script>
            <title>sBrowser(View Schema Browser)</title>
        </head>
       
        <body>
                <script xmlns="http://www.w3.org/1999/xhtml"
                        xmlns:b="http://www.backbase.com/2006/btl"
                        xmlns:e="http://www.backbase.com/2006/xel"
                        xmlns:d="http://www.backbase.com/2006/tdl"
                        xmlns:bda="http://www.backbase.com/2006/bda"
                        xmlns:xi="http://www.w3.org/2001/XInclude"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" type="application/backbase+xml">

                        <xi:include href="../Backbase_4_2_1/bindings/config.xml" />
                        <!--Modify href path to point to your installation of Backbase Client Framework-->

                        <b:dataSource name="data" e:behavior="b:localData">
                                <b:dataSchema>
                                        <b:dataField name="identifier" select="@id"></b:dataField>
                                        <b:dataField name="parent" select="@parentId"></b:dataField>
                                        <b:dataField name="expandable" select="@hasChildren"></b:dataField>
                                </b:dataSchema>

                                <b:dataContainer>
                                        <xi:include href="help.xml"/>
                                </b:dataContainer>
                        </b:dataSource>
                       
        Find : <b:comboBox width="600px">
                           <b:comboBoxOption value="" selected="selected"> None </b:comboBoxOption>
                           <b:comboBoxOption value="1">1</b:comboBoxOption>
                           <b:comboBoxOption value="2">2</b:comboBoxOption>
                           <b:comboBoxOption value="3">3</b:comboBoxOption>
                           <b:comboBoxOption value="4">4</b:comboBoxOption>
                                   <e:handler event="change" type="text/javascript">
                                       var aOptions = this.getProperty("options");
                                       for(var i=0,j=aOptions.length; i&lt; j; i++) {
                                                setClass(aOptions[i].getProperty("value"));
                                       }
                                       var sXpath = this.getProperty("value");
                                       setClass(sXpath);                                               
                                   </e:handler>
                        </b:comboBox>
                       
                        <b:treeGrid dataSource="data" width="640px" id="myTreeId">
                                <b:treeGridCol label="Name" select="name"></b:treeGridCol>
                                <b:treeGridCol label="Surname" select="surname"></b:treeGridCol>
                                <b:treeGridCol label="Email" select="email"></b:treeGridCol>
                        </b:treeGrid>
                </script>
        </body>
</html>

Hi Yudi, Thanks for your response

Hi Prasad,
The error is because of the loop in comboBox change event. If you remove them , then it would work fine.

<e:handler event="change" type="text/javascript">                                      
     var sXpath = this.getProperty("value");
     setClass(sXpath);                                              
</e:handler>

~Yudi

Thanks Yudi

Its working fine, please help me with one more doubt, now am "alerting" the particular colomn, but i want to fill some "different color" for the selected colomn rather then alerting it, how can i do it can u just modify my code.

Thanks a lot Yudi, for helping me then and there.

Am very Beginner to the Backbase.

Thanks Yudi

Hi Prasad,
Yes it is possible. Actually, there are two ways.First, using iterating way and the second, using fieldCreator. If the first one , then just change XPath to get the div color style and using loop to change one by one. The second way is using fieldCreator and easier.If you want to change color , then just get it by viewNode.style.color you can also check other style or viewNode property in the firebug or BB debugger For more information , check fieldCreator in the reference guide.The example of using fieldCreator:

// you can change myFontStyle variable from somewhere else like button or select option
<b:treeGridCol select="rating" label="Rating" width="70px" align="right">
      <b:fieldCreator>
          viewNode.innerHTML = value;
          viewNode.style.fontStyle = myFontStyle ; // change all row's fontStyle in this column
          viewNode.style.fontSize = '8';
          return viewNode;
      </b:fieldCreator>
</b:treeGridCol>

~yudi