How to refresh data in a listgrid

Hi,

i try to refresh data in a listgrid but although there's some topic like this one on this forum, and i tried several way, no way for me. So help !!! I want to refresh my listgrid after user logged in, here's my code :

looking forward to read a piece of solution quickly ;)))

        <b:panelSet columns="* 250px" splitter="false">
          // Panel Bandeau titre
          <b:panel backgroundColor="#A4C1E7">
            <div id="idinfo">
              <e:handler event="LoginTried" type="text/javascript">
              </e:handler>

              // HERE I TRY REFRESHING WHEN I CLICK ON THE LOGIN NAME
              <e:handler event="click">
                <e:call with="id('ds_listebordereaux')" method="refresh" />
                <e:call with="id('lg_listebordereaux')" method="reset" />
                <e:call function="alert" argument1="'Refresh et Reset passes'"/>
              </e:handler>
            </div>
            <div>
            </div>
          </b:panel>
          // Panel Bandeau identification
          <b:panel backgroundColor="#FFFFFF">
            <b:panelSet rows="25px *" splitter="false">
              // Panel d'identifiation titre
              <b:panel backgroundColor="#82AADF">
                (...)
              </b:panel>
              // Panel d'identification corps
              <b:panel backgroundColor="#C6D8F0">
                <form action="include/db/_conn_x.php" method="POST" bf:destination="id('idinfo')">
                (...)
                </form>
              </b:panel>
            </b:panelSet>
          </b:panel>
        </b:panelSet>
        // Panel Corps d'affichage
        <b:panel backgroundColor="#82AADF">
         <e:variable name="varBordereaux">
            <e:data type="application/xml">
              <xi:include href="include/db/gridListBordereaux.php" />
            </e:data>
          </e:variable>

          // HERE I TRIED WITH BEHAVIOR LOCALDATA AND REMOTEDATA BUT SAME RESULT
          // FOR INSTANCE, REMOTEDATA SEEM TO BE BUGGED
          <b:dataSource id="ds_listebordereaux" e:behavior="b:remoteData" dataSelect="$varBordereaux" />

          <b:listGrid id="lg_listebordereaux" datasource="ds_listebordereaux" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2">
            <b:listGridCol select="datejour" label="Date" width="200px" />
            <b:listGridCol select="numtiers" label="<?echo utf8_decode ('N° Tiers')?>" width="200px" />
            <b:listGridCol select="rib" label="RIB" width="100px" />
            <b:listGridCol select="montant" label="Montant" width="70px" align="right" />
          </b:listGrid>
        </b:panel>
      </b:panelSet>

How to refresh data in a listgrid

Hi,

Could you try to using url="include/db/gridListBordereaux.php" in your data source instead of using xi:include. For instance

<b:dataSource id="ds_listebordereaux" e:behavior="b:remoteData" url="include/db/gridListBordereaux.php" />

~Yudi

Strange strange

Hi,

It doesn'n work like that. It works no more with a behavior b:localdata. Here's what i try

<b:dataSource id="ds_listebordereaux" e:behavior="b:localData" dataType="application/xml">
  <b:dataContainer>
    <xi:include href="include/db/gridListBordereaux.php" />
  </b:dataContainer>
</b:dataSource>

It doesn't work if this part of code is outside the listgrid tags. If i put it inside, it loads my data. But the refresh event still not working. Arrghhh !!!

How to refresh data in a listgrid

Hi,

Have you try using url attribute in the data source ?

        <b:panel backgroundColor="#82AADF">
          <b:dataSource id="ds_listebordereaux" e:behavior="b:remoteData" url="include/db/gridListBordereaux.php" />
          <b:listGrid id="lg_listebordereaux" datasource="ds_listebordereaux" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2">
            <b:listGridCol select="datejour" label="Date" width="200px" />
            <b:listGridCol select="numtiers" label="<?echo utf8_decode ('N° Tiers')?>" width="200px" />
            <b:listGridCol select="rib" label="RIB" width="100px" />
            <b:listGridCol select="montant" label="Montant" width="70px" align="right" />
          </b:listGrid>
        </b:panel>

~yudi

I tried with the url

I tried with the url attribute but same result IF... the b:datasource tag is outside the listgrid tag.

Here's the code that works fine, i dont know why :

<b:listGrid id="lg_listebordereaux" datasource="ds_listebordereaux" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2">
            <b:dataSource id="ds_listebordereaux" e:behavior="b:remoteData" url="include/db/gridListBordereaux.php" />
            <b:listGridCol select="datejour" label="Date" width="200px" />
            <b:listGridCol select="numtiers" label="<?echo utf8_decode('N° Tiers')?>" width="200px" />
            <b:listGridCol select="rib" label="RIB" width="100px" />
            <b:listGridCol select="montant" label="Montant" width="70px" align="right" />
          </b:listGrid>

And most of all, the following code allow me refreshing my listgrid :

<e:handler event="click">
  <e:call with="id('lg_listebordereaux')" method="refresh" />
</e:handler>

So my problem is solved. I just have to find the event that will allow me to refresh automatically after a success logging.

Thank's for all

How to refresh data in a listgrid

Hi,

I know why my example does not work because I forgot to put data source name because in this case list grid needs data source name to access data source (otherwise it does not know which data source should it access). After adding data source name :

<b:dataSource id="ds_listebordereaux" name="ds_listebordereaux" e:behavior="b:remoteData" url="include/db/gridListBordereaux.php" />
<b:listGrid id="lg_listebordereaux" datasource="ds_listebordereaux" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2">

There are two way of using remote data:
1. Use the data source outside list grid.
2. Use the data source inside list grid. In this case , it is not necessary to give a name to data source and to use dataSource attribute in list grid.
<b:listGrid id="lg_listebordereaux" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2">
            <b:dataSource id="ds_listebordereaux" e:behavior="b:remoteData" url="include/db/gridListBordereaux.php" />
            ...
</b:listGrid>

~Yudi

Hi, the refresh method keep

Hi,

the refresh method keep not working if i put my datasource outside the listgrid. Even when i cut/paste your code including the name property.

i didn't try with localData type. For now, i'm working with the datasource inside the listgrid tag. I'll work on it later. At this time i'm trying to center a panelset... Seem not to be quite easy

Case sensitive

This might be off the wall.... but the attribute might be case sensitive.

datasource != dataSource ?

Try it with the capital letter S

<b:listGrid id="lg_listebordereaux" dataSource="ds_listebordereaux" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2">

Case sensitive

That's it. How can i have not seen it ? We're so used writing dirty code...