Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Javascript call on status Indicator

Abhik Kumar DeyJan 9 2018 — edited Jan 10 2018

Hello Experts,

I am using Jdeveloper 12.1.3.0.

I have to implement a javascript code on "status indicator" component. Below is the code snippet that I am writing but is not working:

For javascript code:

<af:resource type="javascript">

              function triggerAlert(event) {

                  alert("In triggerAlert ");

              }

</af:resource>

In status Indicator Section:

<af:statusIndicator id="si1">

    <af:clientListener method="triggerAlert" type="propertyChange"/>

</af:statusIndicator>

But if I keep the type as "click" and then click on the statusIndicator, then the alert is getting displayed.

Kindly can you please suggest how to achieve the same on propertyChange of statusIndicator from suppose say Idle to Busy state

Regards,

Abhik

Comments

290833

How about something like this?

  1  with t as (
  2     select rownum as rn1
  3     , row_number() over (order by rownum desc) rn2
  4     , trunc(count(*) over () / 2) as mid
  5     from all_objects where rownum <= 6
  6  )
  7  select rn1 as leftside
  8  , rn2 as rightside
  9  from t
 10  where rn1 <= mid
 11* order by rn1
SQL> /

  LEFTSIDE  RIGHTSIDE
---------- ----------
         1          6
         2          5
         3          4

cheers,
Anthony

121256
with t as ( select level*101 as x from dual connect by level <= 7),
    tt as ( select x, row_number() over (order by x) - 1 as rn, ceil(count(*) over () / 2) as win from t)
select min(decode(trunc(rn/win), 0, x)) as x1,
       min(decode(trunc(rn/win), 1, x)) as x2
  from tt
  group by mod(rn, win)
  order by mod(rn, win)
;

           X1            X2
------------- -------------
          101           505
          202           606
          303           707
          404
Sven W.
It seems to me as if you try to force a client issue (layout thingie) onto the database server.

The displaying of select results should be handled by the client. Most client tools have enough capabilities to do such a thing. It is generally a bad idea to do the whole layouting in the select already.

Split the result set and print the second part in reversed order.

btw: Same idea goes for stuff like pivot querys.
450441
Currently your MOD(t1.rn, ...) = MOD(t2.rn,...)

is what is giving you

1 4
2 5
3 6

because that's what you asked me for when I supplied this query in your previous thread.

Now MOD is the wrong approach. You want

1 COUNT
2 COUNT-1
3 COUNT-2

So replace the MOD comparison with

AND t2.rn(+) = (SELECT count(1) from member) - ( t1.rn - 1 )
ORDER BY t1.rn

The outer join is so that if there are an odd number of rows, t1 value will be present and t2 value will be null for the last row.

Message was edited by:
Dave Hemming

Using aketi's test table query would be
with t as
(SELECT val as nom, row_number() over (order by val ASC) as rn from testT)
select t1.nom as leftside, decode(t2.nom,t1.nom,null,t2.nom) as rightside
from t t1, t t2
where rownum < (SELECT COUNT(val) / 2 + 1 AS table_length FROM testt) 
AND t2.rn(+) = (SELECT count(1) from testt) - ( t1.rn - 1 )
Aketi Jyuuzou

This is an interesting question.

create table testT(Val) as
select RowNum*10 from all_catalog
 where RowNum <=7;
select Left,Right
from (select Rn,Cnt,Val as Left,
      case when Rn <= Cnt/2
           then Lead(Val,abs(Cnt-2*Rn+1)) over(order by Val) end as Right
      from (select Val,
            Row_Number() over(order by Val) as Rn,
            count(*) over() as Cnt
            from testT))
where Rn <= ceil(Cnt/2);
LEFT  RIGHT
----  -----
  10     70
  20     60
  30     50
  40   null
121256
Oops :( Misread
with t as ( select level*101 as x from dual connect by level <= 7),
    tt as ( select x, row_number() over (order by x) - 1 as rn, (count(*) over () - 1) / 2 as median_rn from t)
select min(case when rn <= median_rn then x end) as x1,
       min(case when rn >  median_rn then x end) as x2
  from tt
  group by abs(rn - median_rn)
  order by abs(rn - median_rn) desc
;

           X1            X2
------------- -------------
          101           707
          202           606
          303           505
          404
121256
>   group by abs(rn - median_rn)

Another variation of odd count:

  group by abs(trunc(median_rn - rn + 0.1))

           X1            X2
------------- -------------
          101
          202           707
          303           606
          404           505
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 7 2018
Added on Jan 9 2018
3 comments
211 views