No announcement yet.

cache issue with control app OK bottun malfunction

  • Filter
  • Time
  • Show
Clear All
new posts

  • cache issue with control app OK bottun malfunction

    hi guys, i have control app that has 2 blocks, first block 2files date/start date/end, second block has fields to display data that calculated in onValidateSucess Event - this ok

    p.s. i hided the block when application starts not to give values until the dates are filled through sc_block_display(block2, 'off'); thing - this ok

    query works fine, retrieves data in second block fields, but data is being cached! - not ok

    i have to click OK 2 times in order to refresh them! if changed the dates values i have to click ok again and again in order to get the right query results

    db is my sql, using sc7.1

    is there a way to prevent this cache?? am i missing something?

    i tried adding refresh code to onLoad and onRefresh, also tried onValidateSuccess but keeps looping.. so removed it back, here is the code in onValidateSuccess

    $start={startdate}; //my control app field date1
    $end={enddate}; //field date2
    sc_lookup(mydata, " SELECT count(distinct(field1)) as field1,
           count(distinct case when rs1 = 1 then field1 end) as rs1,
           count(distinct case when rs2 = 2 then field1 end) as rs2,
           count(distinct case when rs3 = 3 then field1 end) as rs3,
           count(distinct case when rs4 = 4 then field1 end) as rs4,
    FROM mytable
    WHERE date(date) BETWEEN '$start' AND '$end'");
    if ({mydata} === false)
    echo "Error";
    elseif (empty({mydatadata}))
    echo "Null";
    [rs0] ={mydata[0][0]};
    [rs1] ={mydata[0][1]};
    [rs2] ={mydata[0][2]};
    [rs3] ={mydata[0][3]};
    [rs4] ={mydata[0][4]};
    // now these rs0, rs1..etc are in the block2 to display the data
    any hint or alternative?