3 Replies Latest reply: Jul 7, 2014 9:20 PM by Lymath-Oracle RSS

    Use Javascript to locate a adf table cell value, got NULL...


      Dear All,


                  I am trying to use javascript to locate table cell to do some client side calculating (i refer to Calculating Sum of columns in adf table using javascript), most of the line works fine except below which is to get the cell, I debug the scripts, nbRows is correct (in my case is 5), and colId is correct (in my case is c7),  so when the script try to get t1[4]:c7 with findComponentByAbsoluteLocator, I got NULL...


      var rowCol = AdfPage.PAGE.findComponentByAbsoluteLocator(tableAbsLocator + '[' + nbRows + ']:' + colId);


                  What is the correct practice to get a ADF table cell with custom java script? I search around but could not find a quick runable one, thanks for help in advance.


      -Liang Yi

        • 2. Re: Use Javascript to locate a adf table cell value, got NULL...

          Hi Rohan,


                I read your blog before, for server side calculation, it works fine, thanks


                This time I am specificly looking for client side (javascript) solution, the blog you ask me to refer does not work for me either, it seem use t1:4:c7 to get the cell value, which really confused me...



          • 3. Re: Use Javascript to locate a adf table cell value, got NULL...



            I also find that I have problem to get value from component if the value is data bindings, does anyone come across this, I guess it is some dummy mistake I made, check beblow for detail or this post Problem with Javascript in ADF




            I am trying javascript in ADF, and encounter a problem when getting component value, if the component value is from data bindings, then I could not get the value (null),  here is the comparison


            If the outputText component value is {bindings.XX.XXXX} somgthing, then when I try to get component value, I would get null

            <af:outputText value="#{bindings.CashEndValue.inputValue}"


                                                                           id="ot19" clientComponent="true"/>



            if the outputText component does not using data bindings, the I could get the value (in my case is 1001)


            <af:outputText value="1001"


                                                                           id="ot19" clientComponent="true"/>


                      Anything I need to be aware when I try to use component.getValue() with ADF, I am new to this, thanks in advance.


            the javascript code for your reference, very simple actually

            <javascript part>

            var outId = inputTxt.getProperty('outId');

                alert ("outId: " + outId); --->got 'ot19' here

                var outputText = inputTxt.findComponent(outId);

                alert("Cash Sum is: " + outputText.getValue()); ---->got null with data bindings, got 1001 with simple value


            <adf code>


            <af:clientListener method="doSum" type="valueChange"/>

            <af:clientAttribute name="outId" value="ot19"/>