How do I test if Dataset is empty or not

I want to use the Spry:states, with the Spry:State="ready"
div, holding a couple of Spy:if's, to display content, based on
whether my dataset is empty or not. If it is empty I want to show a
message. If the dataset has data, I will show my dynamic table.
What is the syntax used to test whether I have data in my
dataset? When Spry recieves a Dataset with empty values in the
tags(XML) it still assumes the dataset is ready, so I need to test
further, the contents.
I have tried the following variations to no avail:
<div spry:if="insSearchResults==0"> //testing if it is
empty
<div spry:if="insSearchResults!=0"> //testing if it is
not empty
<div spry:if="insSearchResults==''"> //testing if it is
empty
<div spry:if="insSearchResults!=''"> //testing if it is
not empty
<div spry:if="insSearchResults=0"> //testing if it is
empty
<div spry:if="insSearchResults>0"> //testing if it
is not empty
<div spry:if="insSearchResults=='null'"> //testing if
it is empty
<div spry:if="insSearchResults!='null'"> //testing if
it is not empty

I ended up just using one spry:if on a TR element, and the
leaving the other TR element as is, as it would either be empty or
filled with dynamic data. The Spry:if would only show if there wre
no pagecounts inthe dataset. Below is a snippet of my code:
<tr spry:if="insSearchResultsPaged.getPageCount()==0"
align="left" >
<td colspan="4" align="center"><br
/><h5>No search results for that particular search. Please
refine your search.</h5></td>
</tr>
<tr align="left" spry:repeat="insSearchResultsPaged"
class="{ds_EvenOddRow}">
<td>{insSearchResultsPaged::LastModifiedDateWithoutTime}</td>
<td><a
href="{Properties/Property/Value}">{insSearchResultsPaged::Title}</a></td>
<td>{insSearchResultsPaged::Type} \
{insSearchResultsPaged::Category} \
{insSearchResultsPaged::Group}</a></td>
<td><img
src="../..{insSearchResultsPaged::IconUrl}" /></td>
</tr>

Similar Messages

  • How to check whether the Resultset is empty or not ??

    I wanna check whether my Result set is empty or not ( I don't want the no of rows it contains..) i'm using this function...
    boolean result=myResultSet.isAfterLast() | myResultSet.isBeforeFirst() ;
    if (result == true)
    {//Result Set is populated
    else
    {//ResultSet Blank
    Is it ok to do like this ?? Or is there any other functanality to do this, since in big appl..i'm using it more than 10-15 times & it's working fine evrywhere except for one jsp where it is returing TRUE everytime ...
    Help Appreciated !!

    try,
    rs = pstmt.executeQuery();
    boolean b = false;
    if( b = rs.next() ) {
    while( b ) {
    //... rs.getXXX( YYY );
    b = rs.next();
    else {
    //...empty rs processing
    or,
    ResultSet rs = ps.executeQuery();
    if(rs.next()) {
    do {
    System.out.println(rs.getString(1));
    } while(rs.next());
    } else {
    System.out.println('empty result set');
    but I usually avoid using do...while although this may be an exception.

  • HOW TO RESOLVE(Test failed: The Network Adapter could not establish the connection)

    Hii
    I want to create new databse as sysdba in jdev.I followed the steps as given in
    Oracle JDeveloper 11g Release 2 Tutorials - Designing and Building Database Tables
    In step 7 create database user and database connection, I am not able to do that and getting the error
    (Test failed: The Network Adapter could not establish the connection).
    Please help me.

    Hi,
    Could you please provide all value you pass to the connection properties on the connection creation panel? First of all, you should choose "Generic JDBC" as the connection type in order to use BDB SQL JDBC driver.
    Regards,
    Cindy

  • How to check a xml data is empty or not

    Hi All,
    I am building a BPEL process. I want to make a check on empty xml. Can anyone please suggest How can I make that check.

    Hi.
    another way, is to use the countNodes function. For example:
    ora:countNodes('inputVariable','payload','/ns1:mensajeEmail/ns1:cuerpoAttachment') = 0
    If that is true, then I know that the element is not present, and that could mean that ur XML is empty.
    Hope this helps
    best

  • How to determine whether a recordset is Empty or not ?

    Please see my snippet code below :
    <%     
         String sql="";
         String username="CDS";
         try
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection con = DriverManager.getConnection("jdbc:odbc:Employees","","");
                Statement stmt = con.createStatement();
                ResultSet rs=null;
                   sql = "Select * from Employee where code='" + username + "'";
                   rs = stmt.executeQuery(sql);
                   rs.next();
                   if (rs==null)
                   %>
                        <jsp:forward page="Login.jsp?msg=Username not recognized"></jsp:forward>     
                   <%     
                else
                   %>
                        <jsp:forward page="Login.jsp?msg=Halo"></jsp:forward>
                   <%
              catch(ClassNotFoundException e)
                   out.println("Driver not found");
                    catch(SQLException e2)
                            out.println(e2.getMessage());
                            out.println("<BR>");
                            out.println("Wrong SQL Statement");
                            out.println("<BR>");
                            out.println(sql);
                            out.println("<BR>");
         %>How to determine whether a recordset has no result ?
    From the above code, i use if (rs==null) and that's not worked.
    Help me, guys.

    ResultSet rs = stmt.executeQuery(sql);
    if (rs.next()) {
    %>
        <jsp:forward page="Login.jsp?msg=Halo"/>
    <%
    } else {
    %>
        <jsp:forward page="Login.jsp?msg=Username not > recognized"/>
    <%
    }

  • How can i test Site to site VPN in Azure

    Hi,
    i have create site to site vpn in Azure. Now i want to test the connection from my local network. How can i test the connection is established or not from my local network 
    Thanks

    Hi,
    Please refer the following links :
    http://azure.microsoft.com/en-us/documentation/articles/virtual-networks-create-site-to-site-cross-premises-connectivity/
    http://azure.microsoft.com/en-us/documentation/articles/virtual-networks-create-site-to-site-cross-premises-connectivity/
    Or
    You can take network traces to make sure traffic is going to, and making is across, the VPN tunnel.
    Regards,
    Bharath

  • How to Extract Test Cases from TFS 2013 to Excel

    How to extract test cases from 2013 Team Foundation Server to excel.
    Yuvaraj G

    Hi Yuvaraj,
    To export test cases in TFS 2013 to an Excel file, you can follow the steps as below:
    Create a query for the test cases that you want to export in Team Explorer
    Open an empty Excel file, click the tab of "Team"
    Click "New List" and then select the TFS server and the detailed team project
    In query list, select the query you created before, then click OK to export the test cases
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can i test the actual app on my devices?

         First off let me start by saying that i would post on the actual dev forums but it takes forever to get an answer on them. Id also like to point out that im new to the apple dev center and testing apps on my actual device as i just got my dev account today.
         Anyways, ive figured out how to run the app on my phone itself with a cable after much trial and error. The way im currently doing it is by going to the app settings in xcode then selecting build settings and then finding where it says debug and release then selecting the profiles and stuff there, i feel this is the incorrect way to do it but it worked. Ive tried to read the written tutorials on apple's dev site but i get lost and confused. So am i doing this right for a wired connection to test it on my iPhone or not?
         My second part of this is the video tutorials ive been watching on how to do it and in a lot of documents ive been reading i always pass by a part about wirelessly doing this, basically without a cable or anything. Ive done a lot of searching for it and found nothing related to it or atleast that was helpful.
         Something im also confused on and itd help is can somone explain to me in non technical meaning but descriptive ways of what all these mean:
    this is whats in the dev center i mean i know what the devices is and how to add them but i dont really have a solid understanding of what provisioning profiles, the identifers or the certificates do, so itd help if you could tell me what each one means/does.
         Something else that ive been reading and seeing in video tutorials is that you can send an app in xcode or something to one of your developers apps on your dev account, this would be useful for me to send to my family and friends so that they can see the app and use it and tell me what i should do/work on with the app.
         Once again like i said im new to developing with xcode and developing in general and im still leaning so bear with me if i asked a lot of questions or im talking to much . Also itd be great if you didnt talk so technical when responding it can help me out like 100% more!

    iBooks only syncs purchased books. Others must be synced in iTunes.

  • How can I test my thunderbolt port? It's not working after the update to 10.10.1

    I have been using my computer with the Thunderbolt Port for a while and after updating to 10.10.1 and after I while of using my computer I tried to use the thunderbolt port with my external monitor.. and it doesn't work at all.. video doesn't come out.. I tried a different screen with the mini adapter from thunderbolt to HDMI and another with thunderbolt to VGA and in both adapters I don't get video from my mac.
    Any idea how can I test my Thunder bolt port?
    This is what I have done:
    1 cable adapter thunder bolt to mini HDMI to an LCD screen with HDMI : No video, but my computer detects that there is something connected
    2 cable adapter thunder bolt to VGA to an LCD screen with VGA : No video, but my computer detects that there is something connected
    3 cable adapter thunder bolt to mini HDMI to an 40' TV with HDMI : No video, but my computer detects that there is something connected
    All the test pass from the Hardware test at the startup (press D at boot time).
    Any ideas? my guarantee it's expired and no coverage. Due the nature of where the port it's installed, if this is a hardware problem seems that I will (may be) have to buy the Logic Board.. no good. No bueno!!
    Thanks!!!

    restore iPhone

  • How can I test a RTP(send&receive) application on the same computer?

    I an writing an application that lets one computer (A) sends a media file to another computer (B) and B receives it and play it.
    But how can I test this application on the same computer
    Eg.Transmitter: localhost 43000
    Receiver: localhost 43000
    It will retuen an error since the port number is alreeady used by another program.
    I know if I test it on different computers, it should be fine, but how can I test it on the same computer?

    JMStudio sends RTP packets from the same UDP port as the specified in the destination port, so you can't try it in the same computer. The examples provided in http://java.sun.com/products/java-media/jmf/2.1.1/solutions/index.html follow this rule aswell, but it's easy to modify it:
    rtpMgrs[streamid]=RTPManager.newInstance();
    localAddr = new SessionAddress( InetAddress.getLocalHost(),localDataPort);
    //By deafault, in the examples, they use  remote DataPort instead of localDataPort.
    //You can specify localDataPort to any different free port number, or to
    //SessionAddress.ANY_PORT if you don't mind the port number
    remoteAddr  = new SessionAddress(destIpAddr,remoteDataPort);
    rtpMgrs[streamid].initialize(localAddr);
    rtpMgrs[streamid].addTarget(remoteAddr);

  • How can you test the video card?

    I just got a cinema display and I am having trouble calibrating it.
    I just notice that when I open up bridge CS4 it takes awhile for it to refresh. When I go to film strip view and click on a picture it will not diplay it.
    Then I change views and there is a line down the middle of the display where it gets update but the left side does not.
    Any thoughts on what it could be?
    Video card of is it the monitor?
    How can I test it?

    The only ways I can think of to test the card are XBench and the Apple Hardware Tests (insert Install DVD and restart while holding down 'd')

  • How do I test a Java card applet with different AIDs on the fly?

    ... Like sweeping cards from employees in a queue of people lining up in the morning?
    When I created my applet, the aid is a fixed value inside the class.
    Whenever I wanted to test it with another value, I changed that AID and rerun the applet.
    I find it very cumbersome that needs to be rerun and rerun, over and over again.
    How do I test the applet easily with any values of AIDs that I'd like to put in, on the fly.
    I know I can't simulate the sweeps of card in the applet because I can't have a main method with a signature
    of Strings[] args or String[] args. I can only have JUnit to help me out, but still java card doesn't allow either
    main(Strings[] args) or TestCase to inherit from.
    Thanks
    Jack

    your question is hard to understand but:
    an applet always has one definite AID and you cant change it after install as far as i know
    a) you want to test many cards with diffrent AIDs?
    ->send a list of select commands and check the return values
    b)you want one card with the same applet to be available for many AIDs?
    ->install many dummy applets forwarding the commands to one core applet
    c)i think i didnt get your point :/

  • How can i test if i'm in the EOF of my file text in applescript?

    hello
    i want to known how can i test my EOF of my file text or if i meet "Plan N°" when i read each linesdxhezdcxezkchcochzhejc
    my file text :
    Plan N°1
    94.64%
    MDF_280;;3050;1850;1
    piece;0;0;500;500;0;AAA
    piece;0;504;500;500;0;AAA
    piece;0;1008;500;500;0;AAA
    piece;0;1512;500;500;0;AAA
    piece;0;2016;500;500;0;AAA
    piece;0;2520;500;500;0;AAA
    chute;0;3024;26;500
    piece;504;0;500;500;0;AAA
    piece;504;504;500;500;0;AAA
    piece;504;1008;500;500;0;AAA
    piece;504;1512;500;500;0;AAA
    piece;504;2016;500;500;0;AAA
    piece;504;2520;500;500;0;AAA
    chute;504;3024;26;500
    piece;1008;0;500;500;0;AAA
    piece;1008;504;500;500;0;AAA
    piece;1008;1008;500;500;0;AAA
    piece;1008;1512;500;500;0;AAA
    piece;1008;2016;500;500;0;AAA
    piece;1008;2520;500;500;0;AAA
    chute;1008;3024;26;500
    piece;1512;0;700;300;1;BBB
    piece;1512;704;700;300;1;BBB
    piece;1512;1408;700;300;1;BBB
    piece;1512;2112;700;300;1;BBB
    chute;1512;2816;234;300
    chute;1816;0;3050;34
    Plan N°2
    93.58%
    MDF_280;;3050;1850;1
    piece;0;0;300;700;0;BBB
    piece;0;304;300;700;0;BBB
    piece;0;608;300;700;0;BBB
    i want test
    i : line 1 ok next
    i <- 94... ok -< next
    if i == MDF_280 => loop (exit while EOF or when i == Plan N°)
    do ....
    end loop
    soory but i'm novice in apple script
    and i'm french
    i need to improve my english
    this is my applescript
    repeat with l in lesLignes
    if (l as text) starts with "MDF_280" then
    while ???? (!= EOF or "MDF_280") do ....
    if (l as text) starts with "piece" then .....
    end if
    end if
    end repeat
    THANKS

    property sString01 : "Plan N" -- String to search for.
    property sString02 : "MDF_280" -- String to search for.
    set uFile to (choose file) -- Select file to process.
    set tText to read uFile -- Read contents of selected file.
    repeat -- Cycle through contents of 'tText'.
    set {offset01, offset02} to {offset of sString01 in tText, offset of sString02 in tText} -- Obtain offset locations of 'sString01' and 'sString02'.
    if (offset01 = 0) then exit repeat -- If 'sString01' does not exist, exit repeat loop.
    -- Adjust content of 'tText' as to position of 'offset02' relative to 'offset01'.
    if (offset02 > offset01) then set tText to get (characters (offset02 + (count sString02)) through (count tText) of tText) as string
    set offset01 to (offset of sString01 in tText) - 1 -- Obtain next offset of 'String01'.
    if (offset01 < 1) then set offset01 to (count tText) -- Correct 'offset01' to obtain remaining contents of 'tText'.
    set tmpText to get (characters 1 through offset01 of tText) as string -- Obtain subset content of 'tText' - between 'sString02' and next 'sString01', of end of 'tText'.
    display dialog tmpText -- Display obtain subset of content of 'tText'.
    end repeat
    Since you posted 'how can i read a file text by applescript', and have not replied to others posts; nor marked any reply as 'answered' or even 'helpful'; and, I anticipate you creating a new post asking how to incorporate one of the 'how can i read a file text by applescript' replies into the above (or similar) code - a revised version of 'how can i read a file text by applescript' incorporated within the above code is provided below.
    property sString01 : "Plan N" -- String to search for.
    property sString02 : "MDF_280" -- String to search for.
    property sString03 : "piece" -- String to search for.
    property sString04 : "chute" -- String to search for.
    set uFile to (choose file) -- Select file to process.
    set tText to read uFile -- Read contents of selected file.
    repeat -- Cycle through contents of 'tText'.
    set {offset01, offset02} to {offset of sString01 in tText, offset of sString02 in tText} -- Obtain offset locations of 'sString01' and 'sString02'.
    if (offset01 = 0) then exit repeat -- If 'sString01' does not exist, then exit the repeat loop.
    -- Adjust content of 'tText' as to position of 'offset02' relative to 'offset01'.
    if (offset02 > offset01) then set tText to get (characters (offset02 + (count sString02)) through (count tText) of tText) as string
    set offset01 to (offset of sString01 in tText) - 1 -- Obtain next offset of 'String01'.
    if (offset01 < 1) then set offset01 to (count tText) -- Correct 'offset01' to obtain remaining contents of 'tText'.
    set tmpText to get (characters 1 through offset01 of tText) as string -- Obtain subset content of 'tText' - between 'sString02' and next 'sString01', of end of 'tText'.
    set tPars to paragraphs of tmpText -- Obtain list of 'piece' entries.
    repeat with i in tPars -- Cycle through list.
    if (i begins with sString03) then
    set {var01, var02, var03, var04, var05, var06} to my handle_List(i) -- Obtain individual values.
    -- Your code here.
    display dialog ("Piece: " & var01 & " ... " & var02 & " ... " & var03 & " ... " & var04 & " ... " & var05 & " ... " & var06) -- Code sample.
    else if (i begins with sString04) then
    set {var01, var02, var03, var04} to my handle_List(i)
    -- Your code here.
    display dialog ("Chute: " & var01 & " ... " & var02 & " ... " & var03 & " ... " & var04) -- Code sample.
    end if
    end repeat
    end repeat
    on handle_List(localList) -- Extract values, from each line of data, and place into a list.
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ";"}
    set tItems to text items 2 through -1 of localList
    set AppleScript's text item delimiters to oAStid
    return tItems -- Return a list of values.
    end handle_List

  • How do I test for the presence of an active open document in Photoshop?

    I’m new to Adobe scripting, and one of my first scripts deals with the activeDocument in Photoshop.
    If there is no activeDocument, I want to display a message and terminate the script.  My efforts
    so far have been met with frustration.  While developing the script in ExtendScript Toolkit,
    I used the  test expression "activeDocument in app", and everything worked as expected. And when I installed the script
    in the Photoshop scripts folder and ran it from Photoshop with a document open, it also worked.
    But when I ran the script from Photoshop with no document open, it failed.
    Moreover, after that,the script failed when I tried to run it in ESTK.
    I did some testing and found that my test expression, "activeDocument in app"
    was returning true, even though no document was open.
    Still in ESTK, I replaced the “app” with ”Application” in the test expression.  That worked when
    I stepped through the script.  But when I tried to run it without stopping, it stopped at the
    test expression, and displayed the error message, “Application is undefined.”
    So how do I test for the presence of an open document in Photoshop ??

    After posting this, I discovered the Photoshop Scripting Forum, and I found my answer there.—
    I should have used “app.Documents.length” as my test expression.

  • How old is test/dev environment?

    Hi,
    How can I check, How old is test/dev environment which was cloned from PROD in past.
    by the creation time of control file?
    Thanks

    Just for the pourpose of sharing knowledge, even if your regular backup strategy does not include rman, you can still issue this command. I have created a just recently cloned database out of the seed, it works too.
    [oracle@cursocfe log]$ rman target /
    Recovery Manager: Release 10.2.0.1.0 - Production on Tue Apr 24 14:03:49 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: DEMO (DBID=3364817245)
    RMAN> list incarnation of database;
    using target database control file instead of recovery catalog
    List of Database Incarnations
    DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
    1 1 DEMO 3364817245 PARENT 1 30-JUN-05
    2 2 DEMO 3364817245 CURRENT 446075 24-APR-07

Maybe you are looking for