7 Replies Latest reply: May 6, 2014 2:56 AM by laknockni RSS

    apex 4.2.2    tree display

    laknockni

      hi:

        I created a tree region in Apex 4.2.2 ,It worked well first.

      Then I modify some data in the table which is the tree region resource, and the tree region display as null.

      I run the tree sql in SQL WorkShop and it's OK.

      I wonder if there are some limitation on tree region?

        • 1. Re: apex 4.2.2    tree display
          fac586

          laknockni wrote:

           

            I created a tree region in Apex 4.2.2 ,It worked well first.

          Then I modify some data in the table which is the tree region resource, and the tree region display as null.

          I run the tree sql in SQL WorkShop and it's OK.

          I wonder if there are some limitation on tree region?

          I wonder if you've run a debug trace to see if APEX is providing any information about the rendering of the region?

          • 2. Re: apex 4.2.2    tree display
            laknockni

            the error msg is "Logging exception in final_exception_handler: Sqlerrm: ORA-20987: APEX - error - ORA-01427: 单行子查询返回多个行 ORA-02063: 紧接着 line (起自 CRMTEST) Backtrace: ORA-06512: 在 "APEX_040200.WWV_FLOW_ERROR", line 861 ORA-06512: 在 "APEX_040200.WWV_FLOW_ERROR", line 896 ORA-06512: 在 "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3241 ORA-06512: 在 "APEX_040200.WWV_FLOW_PAGE", line 1788 ORA-06512: 在 "APEX_040200.WWV_FLOW_PAGE", line 1958 ORA-06512: 在 "APEX_040200.WWV_FLOW", line 6441"

            but I run the tree sql in SQL Commands, it's OK.

            • 3. Re: apex 4.2.2    tree display
              laknockni

              The follow is the sql:

               

              select case when connect_by_isleaf = 1 then 0

                          when level = 1             then 1

                          else                           0

                     end as status,

                     level,

                     item_name title,

                     null icon,

                     item_name as value,

                     item_attr1||':'||item_row_id as tooltip,

                     null as link

              from

              ct10000_profile_item

              where profile_id=:P16_PROFILE_ID

              start with par_item_id is null

              connect by prior item_id = par_item_id

              • 4. Re: apex 4.2.2    tree display
                laknockni

                I tried again, It's not show error, but the tree is still not show.

                0.203840.04369...Execute Statement: select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else 0 end as status, level, item_name title, null icon, item_name as value, item_attr1||':'||item_row_id as tooltip, null as link from ct10000_profile_item where profile_id=:P16_PROFILE_ID start with par_item_id is null connect by prior item_id = par_item_id order siblings by item_attr1
                • 5. Re: apex 4.2.2    tree display
                  Tom Petrus

                  I'd like to put a bet on the where-clause "where profile_id=:P16_PROFILE_ID"

                  You're destroying the connect-by output hierarchy. See for yourself: execute the query without the where clause and look at the level column. Execute with the where-clause and look at the level column. The level column will display the same levels no matter the where clause, since results are filtered on the query AFTER the connect by has occured. So while your output may look like this when there is no where clause:

                  level parent_id id

                  1      NULL      1

                  2      1             2

                  3      2             3

                   

                  It will look like this when you add where id=3

                  level parent_id id

                  3      2             3

                   

                  Obviously, no tree can be made with that kind of data. The json put out may be wrong, and jstree really can't handle it either.

                  If you want a limited set of data, you'll need to either contain the data before you do a connect by on it, eg by using an inline view, or use a different start with clause (but that only works from top to bottom, ie to reduce root nodes)

                  • 6. Re: apex 4.2.2    tree display
                    laknockni

                    I have tried to delete all the data and make the table have one distinct "PROFILE_ID",and delete the where clause. It still not work.

                    • 7. Re: apex 4.2.2    tree display
                      laknockni

                      hi,all:

                         I found what different when tree display correct and no display.

                       

                      With inspect element in browser ,when display correct, the code is something like  "<div id="tree10264929016857196" class="tree clearfix tree-default" style="direction: ltr;"><ul class="ltr"><li id="NIHAO2014050600655" class="last open"><a href="" style="" class="" tooltip="购物车:NIHAO2014050600655"><ins> </ins>购物车:NIHAO2014050600655</a><ul><li id="1-7Q0XFGI" class="last leaf"><a href="" style="" class="clicked" tooltip="主套餐1:1-7Q0XFGI"><ins> </ins>主套餐1:2011天翼乐享3G套餐全能版,129元/月</a></li></ul></li></ul></div>

                       

                      when no display ,it shows "Uncaught ReferenceError: l10264929016857196Data is not defined".

                       

                      I think it may be some charset problem to cause the tree display error.