Spry:State and PagedView

Dear Member,
hope that somebody can help me this time..
I am using spry, and a lot of trick to make it work.
The spry:state="loading" options don't wanna work for me
it's only work if i don't use the PagedView...
Here the simple code
I have a simple XMLdataset:
var dsmio = new Spry.Data.XMLDataSet("Xml/filexxx.asp", "Clienti/Cliente", {sortOnLoad: "RagioneSociale", sortOrderOnLoad: "ascending", useCache: false});
and a pagination on it:
var paginazione = new Spry.Data.PagedView( dsmio ,{ pageSize: 50 });
finally the code to show my data:
<div spry:region="paginazione">
<div spry:state="loading">Loading Data - Please stand by...</div>
<div spry:state="error">OPS, something went wrong!</div>
<div spry:state="ready">
  <table width="100%">
    <tr>
      <th width="25%" height="20" align="left" bgcolor="#CCCCCC" spry:sort="RagioneSociale">RagioneSociale</th>
      <th width="25%" height="20" align="left" bgcolor="#CCCCCC" spry:sort="Email">Email</th>
      <th width="25%" height="20" align="left" bgcolor="#CCCCCC" spry:sort="Telefono">Telefono</th>
      <th width="25%" height="20" align="left" bgcolor="#CCCCCC" spry:sort="PersonaRiferimento">PersonaRiferimento</th>
    </tr>
    <tr spry:repeat="paginazione" class="{ds_EvenOddRow}">
     <td width="25%" height="20">{RagioneSociale}</td>
      <td width="25%" height="20">{Email}</td>
      <td width="25%" height="20">{Telefono}</td>
      <td width="25%" height="20">{PersonaRiferimento}</td>
    </tr>
  </table>
</div>
Hope some Guru can help me

Hi guys!
This is easy to solve:
You have to work in two different regions!
<div spry:region="dsmio">
  --- Put the loader here...
</div>
<div spry:region="paginazione">
content
</div>
You can hide the "layout" of the content by :
<div id="content" spry:if="'{ds_PageTotalItemCount}' != ' ' ">
content...
</div>
ds_PageTotalItemCount is empty during loading.....
Have fun & keep coding

Similar Messages

  • Spry:state and dynamic accordion

    When I use a dynamic accordion (i.e. populated by a dataSet),
    the accordion functionality disappears. Here is my code. Am I doing
    something wrong, or is this just a bug?
    Thanks
    Andy
    <div spry:region="dsOrders">
    <div spry:state="loading">Data is
    loading...</div>
    <div spry:state="error">Error loading
    data...</div>
    <div spry:state="ready">
    <div id="orders" class="Accordion">
    <div class="AccordionPanel" spry:repeat="dsOrders">
    <div class="AccordionPanelTab"><h3
    spry:content="{ORDERNUM}"></h3></div>
    <div class="AccordionPanelContent"><span
    spry:content="{ORDERDATE}"></span></div>
    </div>
    </div>
    </div>
    </div>

    This might also be helpful to some. Not only do we have
    states in SPRY... but events! Here is how I did it on a site that
    has a dataset called dsOpportunities. The following HTML/Javascript
    was added to the head tags of the HTML. Then the on <body
    onload="afterReady()" > was used to make sure it was run.
    Remember that your section you are hiding needs to have a class
    with the same senario. (Or if it is unique you could do something
    simular with ID rather than class.
    <script>
    function afterReady() {
    $('pageContent').style.visibility = 'hidden';
    var iSPRY = new Object;
    iSPRY.onPostLoad = function(dataSet,data) {
    $('pageContent').style.visibility = 'visible';
    dsOpportunities.addObserver(iSPRY);
    </script>
    <style>
    .pageContent {
    visibility: hidden;
    </style>

  • Gallery and spry:state

    How do I make the spry:state="loading" work with your image
    gallery? I can get it to work just fine when its loading dataset
    but when you click a thumbnail it doesnt work the same. would the
    spry:state need to be added to the gallery.js since that has the
    function that handles the changing of the image?

    Hi,
    The spry:state="loading" attribute can be used only inside a
    spry:region or spry:detailregion - it's content is diplayed while
    the
    markup gets updated, but this doesn't include the time all
    the resources inside that markup are downloaded (for example, if
    there are images inside that region, when the spry:region gets
    updated, the "loading" content is displayed only for the time the
    markup containing <img src=".."> gets inside the page.
    Loading is not displayed while the image is actually downloaded by
    the browser).
    For the gallery demo, the markup for the big image is not
    inside a spry:region because the url for the image is set from
    custom functions inside gallery.js that uses data from the existing
    datasets. It's done this way because effects are added when the
    image is displayed.
    regards,
    Dragos

  • Spry:state not working properly

    Hi,
    I have the following code wrapped around my page:
    <div spry:state="loading"
    class="AjaxLoadingLarge">Loading...</div>
    <div spry:state="error">Sorry! An Error has
    occurred!</div>
    <div spry:state="ready">
    PAGE CODE HERE
    </div>
    Whilst the page is loading, the Loading State Appears on the
    screen normally but also has the Error State Content and the Ready
    State Content (unpopulated with Data) - ie it's the table with all
    the header row and 1 results row displaying the dataset field names
    {EventID} {EventDesc} etc.
    Once the page is loaded, everything displays perfectly, It
    just looks as though the "state" is not being handled properly
    until the state becomes ready.
    Anyone else seen this problem? and any ideas?
    Dom

    Hi - Thanks for the response.
    The previous line of code now reads:
    <div spry:region="ds1" class="SpryHiddenRegion">
    and I have closed the DIV off but it has made no difference
    whatsoever - but there is no class in any .css for this.
    Having Googled this, I found that some people have a class in
    the .css as display:none. I added this and nothing is then visible.
    Any further ideas?
    Dom

  • Using spry:state="loading" only after a certain interval

    Hi everyone ,
        I need a feature for spry regions. I want my loading spry state to show only loading of data takes 0.5 seconds and more.
    Is it possible with this version of spry?
    Ps1 : you can find a live example of my need in google webmaster tools' content section,content by title page. There is an ajax listview with paging on page and loading div only apeears if loading of data takes more than a certain milliseconds.
    Ps2 : Spry rulezzzz

    vw2ureg wrote:
    Hi,
    Go here and scroll down to ErrorState, LoadingState and ReadyState.
    I hope this helps.
    Ben
    That will only tell Spry that it should should use different "state" as loading state. But it doesn't display a loading state after a certain interval. This functionality does not exist in the Spry library. But you could create a custom "loading" state that you automatically trigger using setTimeout if your haven't gotten a onPostUpdate through your region observer.
    But i'm curious why you would wanna do create a have the loading state after a certain interval.

  • Spry:state  unexpected results

    I am using Spry/AJAX to populate a page, but whenever the
    page loads you see the dynamic content tags in the form fields and
    then it reloads with the data in the form fields. Is there any way
    to make it not show the dynamic content tags and just show the form
    once the data is in the form fields? Go to the following link to
    see what I mean:
    http://www.homesandagents.com/Members/contact_info.asp?userID=10000&sessionID=&contactID=1 0064
    I tried using spry:state="loading", but it still shows the
    form with the dynamic tags first (ie. {last_name}), then the
    loading state, and then finally the ready state.

    I'm not seeing the data references when I load your page. But
    that may be due to the fact that it looks like you've added the
    SpryHiddenRegion class to your region.
    --== Kin ==--

  • Spry Dataset and XML problem

    I think this problem is a result of my lack of knowledge regarding XML but hope someone can help set me straight.  I am using Spry datasets in several web pages all accessing HTML pages with data in tables format.  These work great.
    I would like to use XML files for some other data on another site I am working on and while the Spry Dataset wizard allows me to call the XML file the information I get in the Row Element panel and the Data Preview panel appear to have nothing to do with the XML file I am accessing.  I am expecting a list of US states and instead get a heading called Types with Default and Override as the two indented lines beneath type.
    I have tried several other xml files that I have created or downloaded as samples from the web and always get the same headings.
    I am trying to insert into a plain vanilla HTML page.
    What am I doing wrong? I have attached the XML file I am using
    Hope someone can help.
    Cheers
    les

    You cannot do cross domain requests with Ajax, you will need to use a server side transporter / proxy to get the file for you.
    Heres a nice proxy for PHP:
    http://webreflection.blogspot.com/2009/05/php-full-proxy-work-in-progress.html

  • Spry Regions and Selection of First Element

    I've done a little work with spry regions and am currently struggling with how to interact with the generated content via Javascript.
    Specifically (I'm not using a Spry DataGrid BTW) I'm trying to do something like document.getElementById("st").focus(); on the first anchor in the returned dataset. I haven't put the ID in yet because I'm not sure exactly what to use (maybe @id) but how to capture the first one for the reference in the final .focus() call.
    Anybody done this before?
    <!--- list panel --->
    <div spry:region="dsCompanies" style="clear:both;">
    <div spry:repeat="dsCompanies">
    <div class="card" >
    <p><b><a href="#" onclick="loadcompany('{@id}','contacts');searchpanel.displayPopupDialog(false);return false;">{name}</a></b>
    <br>{rectype}
    <br>{name}
    <br>{support}
    <br>{address1}
    <br>{address2}
    <br>{address3}
    <br>{city}, {state} {zip}
    </p>
    </div><!--- end of card --->
    </div> <!--- end of spry region --->
    <p spry:state="loading"> Please Wait...</p>
    </div> <!--- end of panel --->

    You can apply focus to form elements and anchors/links. In this case I am attempting to set the focus to the <a href> tag.. but only the first in the repeating region.
    <HTML>
    <BODY>
    <a id="foo1" href="#"> This</a>
    <a id="foo2" href="#"> That</a>
    <script type="text/javascript">
      // selects 'that'
      document.getElementById("foo2").focus();
    </script>
    </BODY>
    </HTML>

  • Forced spry:state

    Hello,
    I'm wondering if I can force the spry:state="error" from the
    server. Here's what I'm attempting to do:
    1. User logs in using a form.
    2. Login name / password verification script (in PHP) creates
    a session cookie with a randomly generated code and updates a user
    db with that code to track the session.
    3. When the user requests data, the server side script (in
    php) first validates the cookie against the session code in the
    database and returns the requested data if the code in the cookie
    matches the code in the db. (if exists).
    4. If the cookie does not exist or does not match, then I'd
    like the script to return a spry:state="error" and have the html in
    that state block displayed (requests the user to log in, or
    redirects them to a login page).
    I've seen a post where it was suggested to return an empty
    set, but this is a somewhat different behavior. Can you force a
    spry:state to "error"? Am I over complicating this whole process?

    You can force a region to display a specific state
    programatically like this:
    var rgn = Spry.Data.getRegion("myRgnName");
    if (rgn)
    rgn.setState("error");
    You can see this being done in this sample:
    http://labs.adobe.com/technologies/spry/samples/data_region/RegionStatesSample.html
    Also check out state mapping:
    http://labs.adobe.com/technologies/spry/samples/data_region/StateMappingSample.html
    --== Kin ==--

  • Spry:state="error" field is always visible?!

    I define layers to display the current spry:state, one for
    spry:state="loading", the second for spry:state="error" and the
    third for spry:state="ready". The problem is that
    spry:state="error" field is always visible along with
    spry:state="loading"?! Am I making some mistake or what? Here is a
    part of relevant code:
    <div id="vijesti" spry:region="pvVijestiMini"
    class="vijestimini">
    <div id="ucitavanjemini" spry:state="loading"
    class="indikator">
    <p>
    <span><img
    src="slike/pomocne/loader.gif"></span>
    <span>Podaci se učitavaju...</span>
    </p>
    </div>
    <div id="greskamini" spry:state="error"
    class="indikator">
    <p>
    <span><img
    src="slike/pomocne/loader2.gif"></span>
    <span>Podaci ne postoje ili su
    nedostupni...</span>
    </p>
    </div>
    <div id="podaci" spry:state="ready">
    <span class="vijestnaslov">Čikom vijesti
    [{ds_UnfilteredRowCount}]</span>
    <div id="redovimini" class="redovimini">
    <div class="red" spry:repeat="pvVijestiMini">
    <p class="podnaslov">
    <span>{datum}</span><br>
    <span class="naziv">{naziv}</span>
    </p>
    <p>
    <span>{ukratko}<a
    href="index.php?jezik=0&meni1=3&meni2=0&meni3=0"><img
    src="slike/pomocne/dalje.gif"
    class="dalje"></a></span>
    </p>
    </div>
    </div>
    <div id="navigacija">
    <div spry:if="{ds_UnfilteredRowCount} == 0">Nema
    podataka u tabeli "Vijesti"!</div>
    <div spry:if="{ds_UnfilteredRowCount} &gt; 0">
    <div><a href="#"
    onclick="pvVijestiMini.firstPage(); return
    false;">|&lt;</a><span> </span></div>
    <div><a href="#"
    onclick="pvVijestiMini.previousPage(); return
    false;">&lt;&lt;</a></div>
    <div> stranica {ds_PageNumber} od
    {ds_PageCount} </div>
    <div><a href="#" onclick="pvVijestiMini.nextPage();
    return
    false;">&gt;&gt;</a><span> </span></div>
    <div><a href="#" onclick="pvVijestiMini.lastPage();
    return false;">&gt;|</a></div>
    </div>
    </div>
    </div>
    </div>
    The second question: How do I hide region container until it
    gets filled with data?

    Look, you got me all wrong. I don't want to hide a main
    region, just the spry:state="error" appearing the same time as
    spry:state="loading"!!!
    <div id="ucitavanjemini" spry:state="loading"
    class="indikator">
    <p>
    <span><img
    src="slike/pomocne/loader.gif"></span>
    <span>Podaci se učitavaju...</span>
    </p>
    </div>
    <div id="greskamini" spry:state="error"
    class="indikator">
    <p>
    <span><img
    src="slike/pomocne/loader2.gif"></span>
    <span>Podaci ne postoje ili su
    nedostupni...</span>
    </p>
    </div>

  • Using states and still having a flash

    I'm using a loading/ready state for my region and I still get
    a flash. I can't use spry:content (I believe) because I'm using a
    drop down. Any suggestions? Here is the code I have currently.
    <span id="statesDIV" spry:region="dsStates">
    <span spry:state="loading"><img
    src="/images/ajax-loader.gif" height="16"
    width="16"></span>
    <span spry:state="ready">
    <select name="dd_state" id="dd_state"
    onChange="getData(this.options[this.selectedIndex].value)">
    <option value="">All States</option>
    <option spry:repeat="dsStates"
    value="{ID}">{ABBR}</option>
    </select>
    </span>
    </span>

    Hi Ray,
    I think this will solve the flash:
    Styly sheet:
    .SpryHiddenRegion {
    visibility: hidden;
    Code:
    <span id="statesDIV" spry:region="dsStates"
    class="SpryHiddenRegion">

  • Error in updating OBNK Table ( Bank Statements and Reconciliations,Manual)

    PLease advise ,
    Bank Statements and Reconciliations,Manual Reconciliation
    Client is receiving the following message:
    Error in updating OBNK Table
    Edited by: Philip Eller on May 20, 2008 9:03 AM

    Hi Darpal Thiarha,
    Please kindly refer to note 1132591 and note 1128677 to see if these are relevant to this issue. Upgrading to  2007A PL15 or above may avoid such issues relevant with the error 'Error in updating OBNK Table'.
    Regards,
    Candice Ren
    SAP Business One Forums Team

  • DAX - IF statement and filters within calculated column

    Hi all,
    I've got a bit of a complex formula I'm trying to run, but I'm not quite there yet.  I don't know where/how/if I can place a filter within my IF statement for a calculated column due to so many variables.  I either get errors or wrong numbers. 
    Hope the following makes sense. 
    Here is my formula for the calculated column [Years Since Last Task]:
    =IF (ISBLANK([Last Task Date]) && ([Current Role]<>BLANK()), DIVIDE([Quarters],4), FLOOR(1. * ( today() - [Last Task Date]) / 365, 0.25))
    Problem:  I am getting "114.25" for Ken....but I want a blank result instead.  Meaning, I need to also filter out any name (row) who has a blank [Current Role].  How do
    I add a filter to this current formula?  Is one more step of filtering possible in this IF statement?  (Maybe I shouldn't use an IF statement, and try CALCULATE instead?)
    Below is the table 'Work' for you to see what's happening.
    Name
    Quarters
    Last Task Date
    Current Role
    Years Since Last Task
    John
    1
    1
    0.25
    Mike
    4
    2/7/2011
    3
    3
    Todd
    5
    4/20/2009
    4
    5
    Jeff
    9/1/2013
    3
    0.5
    Ken
    0
    114.25
    Steve
    2
    12/3/2011
    2
    2.25
    Nate
    2
    1/1/2014
    2
    0.25
    Greg
    1
    8/11/2013
    1
    0.5
    Ross
    4
    11/9/2010
    4
    3.25
    Hope all this made sense.  Let me know if you have any thoughts.
    Thanks,
    ~UG1

    you can use nested IF-statements here:
    =IF (ISBLANK([Current Role]),
    BLANK(),
    IF(ISBLANK([Last Task Date]),
    DIVIDE([Quarters],4),
    FLOOR(1. * ( today() - [Last Task Date]) / 365,0.25)
    hth,
    gerhard
    Gerhard Brueckl
    blogging @ http://blog.gbrueckl.at
    working @ http://www.pmOne.com

  • Closing Statements and ResultSets

    I just recently realized that you need to close Statements and ResultSets in order to avoid getting the "Too many cursors"-message.
    My question is:
    Do you need to close both Statements and ResultSets?
    - not that it's a problem...
    if so:
    Does it matter which one you close first?

    I usually place the stmt.close() code in my finally block, to ensure that the statement gets closed, even if a SQLException occurs during the query/update. The ResultSet does not explicitly have to be closed, ... it is automatically closed when the Statement is closed, or if a new query is run on the same statement.

  • JDBC: Closing Connection does it close statement and resultset

    In my application I am facing ORA-0100 Maximum open cursors exceeded problem. We are executing quite a few queries and stored procedures before we close the connection object. But in few places statements and resultsets are not closed. Can these be a problem? Shouldn't they be automatically closed when the connection is closed?
    We are executing this block of code in a loop.

    in few places statements and
    resultsets are not closed. Can these be a problem?Yes.

Maybe you are looking for

  • What cables to use and SPDIF

    Hi. I currently have an Audigy 2 Gamer running Vista Premium. I have looked through the forums, but I a just not sure what type of cable I need to connect to either coax digital or optical from my audigy. Can I use a 3.5mm to RCA from my card and wil

  • Do Hard Shell cases protect your device?

    Hi, i'm looking to purchase the new ipad soon and i'm prioritising safety for the device (i.e. cases) I know silicone cases work well but there doesn't seem to be many of them that are compatible with the smart cover. On the other hand there are many

  • Need an hint on disposing a dialog.

    Hi there, Using: Netbeans 4.1 with the Sun JDK 1.5.0_06 on Linux. I recently started to study Java and so far I love it. Last evening (after my "daily tutorial section") I tried setting up a very basic program only armed with the JDK 1.5 documentatio

  • 0CalQuarter after upgrade issue

    Hi buddy, Thanks for this valuable  Note 1019513 - Conversion exit for 0CALQUARTER is missing . i solved my problem on 0calquarter. but i got one more issue on this. In 3.1c after inputting 1/2007 and check it would didplay as Q1 2007 on selection sc

  • Web Integration Developer: extracting data with regular exressions

    The WIDL Dev User Guide is pretty thin when discussing pattern matching and how to create complex regular expressions for data extraction. It apparently asssumes that one already knows how to do this. Does anyone have a reference for a more detailed