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...

    Lymath-Oracle

      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...
          Lymath-Oracle

          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...

           

                 Thanks

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

            Hi,

             

            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

             

            thanks

             

            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}"

                                                                           shortDesc="#{bindings.CashEndValue.hints.tooltip}"

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

             

            However:

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

             

            <af:outputText value="1001"

                                                                           shortDesc="#{bindings.CashEndValue.hints.tooltip}"

                                                                           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>

            <input:text>

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

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

            </input:text>