Show a message if the search result is 0

Hi all,
I have html jspbean , html for enter , jsp for display, bean for business.
i want to handle if the search is not match display a message. i not how to handle in servlet just is
whiler(rs.next(){
count ++
if (count<=1)
display message.
but how to deal in bean
public boolean Mysearch() {
boolean anyRecords = false;
        rowCount = 0;
        while (rs.next()) {
          fieldNumberList.add(rs.getString("FieldNumber"));
          nameList.add(rs.getString("Name"));
          hiTiterList.add(rs.getString("HiTiter"));   
          subTypeList.add(rs.getString("SubType"));
          rowCount++;
          anyRecords = true;
        }//end while
      }//end try
      catch (Exception e) {
        System.out.println("Error populating productBean: " + e.toString());
        return false;
    }//end if
    /* Return status of operation (assume success if it made it this far) */
    return true;
  }//end function[ /code]
how can I display some message in jsp, if the match is not find?
Thank you

shouldn't u be returning
  return anyRecords;instead of
  return true; // after the endif????ur method name is confusing I hope this Mysearch() is a TYPO :)
now that mySearch() returns a boolean depending on whether the query returns something or else u can compare it in jsp using jstl: tags c:equal or c:choose c:when test="" etc etc or as u have done before escape into java itselt using <% // some code in here to get the value from method mySearch()%>

Similar Messages

  • In iTunes 11.0.2.26, an Albums search by track names returns albums as if they only have one track on them, but I still want to access the entire album. How can I have the search results show the entire album (with just the searched for name highlighted)?

    Hello, all.
    In iTunes 11.0.2.26, an Albums search by track names returns albums as if they only have one track on them, but I still want to access the entire album. How can I have the search results show the entire album (with just the searched for name highlighted)? For instance, I'm wanting to play an album with a particular track on it or I'm searching for albums that include that track. iTunes incorrectly assumes that all I'm after is that one track and then incorrectly displays the album as if there is only one ttrack on it. This is a bonkers default setting. Can I change this?

    Click the search magnifying glass and uncheck "Search entire library".
    Type in the name of the track.
    Click the album of interest to show tracks.
    Select the track.
    Press the X in the search box to clear the search.
    Double click the track you want to start playing first.
    tt2

  • How do you delete all the messages in your search results in Thunderbird 31.2?

    I'm trying to clean out my inbox. When I search for a given term in the global search box and get my results, then I choose "Select All." Then I choose "Move to Trash," and nothing happens.
    How do you delete all the messages in your search results in Thunderbird 31.2?

    I'm trying to clean out my inbox. When I search for a given term in the global search box and get my results, then I choose "Select All." Then I choose "Move to Trash," and nothing happens.
    How do you delete all the messages in your search results in Thunderbird 31.2?

  • How do I get rid of the tips messages that show up just underneath the search box?

    I have google as my home page. I am trying to figure out how to get rid of the tip or brief FYI message that shows up just underneath the search box. Can you help? Thanks

    Do you mean the snippets that you see on the about:home Home page?
    You can hide the box that shows the snippets with code in userContent.css
    * http://kb.mozillazine.org/userContent.css
    <pre><nowiki>@-moz-document url(about:home){
    /* hide snippet container on the about:home page */
    #snippetContainer { display: none !important; }
    </nowiki></pre>
    * http://kb.mozillazine.org/Editing_configuration
    You can use the ChromEdit Plus or Stylish extension to have easier access to the customization files.
    * ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html

  • Show properties in the Search Result window

    Hello all,
    I would like to add few properties in the Search Result window such that the corresponding values are visible at a glance rather than checking the same in the respective Details wondow.
    Example: Ia have created new Properties like ReqNo, ReqDate... and would like them to appear in the Search Result window.
    Please help me solve this.
    Im also reading the UI topic given in help.sap.com but am unable to find the answer.
    Awaiting Reply.
    Thanks and Warm Regards,
    Ritu

    Hi Ritu,
    Go to KM Config > Content Management > User Interface > Settings > Layout Set and put "Search" in the filter.   You should see "SearchResultLayoutSet" and this is the Layout Set that is used to display Search Results.   Within the Collection Renderer there is Displayed Properties, this is what you need to focus on.
    There are some other threads and documents associated with your question here on SDN.   If you do a search for "SearchResultLayoutSet" in the SDN search you should get enough information to achieve your objective.
    Sorry for the brief reply but I have one foot out the door heading for the airport and won't be back online for another couple of days.
    Let me know how you go
    Paul

  • Folder name showing in the search result in SharePoint 2013

    Hello,
    In SharePoint 2013, when user search for a document within a folder, Search content along with Folder name and icon getting displayed in the search result. I am trying to hide Folder name from search result. Please suggest some way to achieve this.
    Thank you
    Jyotiraaditya

    Hi,
    As I understand, you want to search without folders in SharePoint 2013.
    You can do the steps to achieve your request:
    In search center in results page, click Edit page.
    In search results web part, click dropdown in the upper right corner -> click Edit Web Part.
    Click Change query -> in Property filter field -> choose contenttype, not contains, folder  -> click Add property filter -> ok.
    Thanks,
    Dean Wang

  • Phantom messages appear in search results

    Hello. When I search for a message in Mail, the search results often include three instances of the same message. One is the correct message. The other two, however, are phantoms. There is no mailbox listed for these phantoms, and if I click on a phantom in the search results window, nothing in the message pane, just a "show in mailbox" link. If I click on "show in mailbox" link for these phantoms, Mail does nothing.
    Has anyone else experienced anything like this?
    I'm using IMAP to a server at my university, so perhaps could this be a problem with the mail server?
    Any advice is appreciated.

    How long has this been going on? Are these "phantoms" messages that you deleted before and still showing up, or are they all the same message, with the same date and time?
    Have you tried rebuilding your Mail index? It could be corrupted. To do that:
    1. Quit Mail if it's running.
    2. Go to Home/Library/Mail and remove (do not delete) the Envelope Index file(s) to your Desktop.
    3. Restart Mail and allow it to import your existing messages. When that's finished, try searching for those same messages again and see if the phantoms still show up; you can also delete the Envelope Index file on your Desktop.
    Post back with results.

  • How to modify  the search results of the GUI for subscribing to calendars

    How to modify the search results of the GUI for subscribing to calendars
    Note:
    <OL>
    <LI>The following information applies only to iPlanet Calendar Server 5.0
    Patch 3.
    <LI>All of the cases for which the XSLT changes will work have not been
    verified.
    <LI>The following is only an example of an XSLT customization.
    </OL>
    The example below shows a sample customization of the
    search_for_calendars
    dialog. This customization will result in the Display Name being included as
    part of the search results in the GUI, which would normally show just the
    calendar ID. It will render the returned calendars in the following format:
    <P>
    Display Name - <I>description</I>
    <P>
    Normally, the format would be as follows:
    <P>
    Calendar-ID - <I>description</I>
    <P>
    </A>
    The example consists of the following two files:
    <P>
    <OL>
    <LI>search_for_calendars_common.xsl
    (the entire XSLT file)
    <P>
    <LI>diffctx.txt
    (the context sensitive diff patch file,
    which basically shows only the changes that need to be made)
    </OL>
    <P>
    <HR>
    </A><B>
    search_for_calendars_common.xsl</B>
    <?xml version="1.0" ?>
    <!DOCTYPE xsl:stylesheet (View Source for full doctype...)>
    - <!--
    set the output properties
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
    result-ns="http://www.w3.org/TR/REC-html40">
    -->
    - <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
    - <!-- set the output properties
    -->
    <xsl:output method="html" encoding="ISO-8859-1" />
    <xsl:include href="data/common.xsl" />
    <xsl:include href="data/i18n.xsl" />
    <xsl:include href="data/date_format.xsl" />
    <xsl:include href="data/dialog_tabs.xsl" />
    - <xsl:template match="/">
    <xsl:apply-templates select="calendar" />
    </xsl:template>
    - <xsl:template match="calendar">
    - <xsl:choose>
    - <xsl:when test="@top='true'">
    - <xsl:variable name="Frame1">
    <xsl:value-of select="frame[1]" />
    </xsl:variable>
    - <xsl:variable name="Frame2">
    <xsl:value-of select="frame[2]" />
    </xsl:variable>
    - <xsl:variable name="Frame3">
    <xsl:value-of select="frame[3]" />
    </xsl:variable>
    - <xsl:variable name="tab_value">
    <xsl:value-of select="@tab" />
    </xsl:variable>
    - <HTML>
    - <HEAD>
    <xsl:call-template name="contextJavascript" />
    <TITLE>Calendars Search: Calendar Express - iPlanet</TITLE>
    </HEAD>
    - <FRAMESET border="0" frameborder="0" rows="77,*,71">
    <FRAME name="tab" marginheight="0" marginwidth="0" scrolling="no"
    scrollbars="no" src="{$Frame1}" />
    <FRAME name="main" frameborder="0" src="{$Frame2}" />
    <FRAME name="button" marginheight="0" marginwidth="0" scrolling="no"
    scrollbars="no" frameborder="0" src="{$Frame3}" />
    </FRAMESET>
    </HTML>
    </xsl:when>
    - <xsl:when test="@view='searchProperties'">
    - <xsl:for-each select="group">
    - <xsl:if test="@name='searchProperties'">
    <xsl:call-template name="search_toolbar" />
    </xsl:if>
    </xsl:for-each>
    </xsl:when>
    - <xsl:when test="@view='main'">
    - <xsl:for-each select="group">
    - <xsl:if test="@name='main'">
    <xsl:call-template name="main" />
    </xsl:if>
    </xsl:for-each>
    </xsl:when>
    - <xsl:when test="@view='button'">
    - <xsl:for-each select="group">
    - <xsl:if test="@name='button'">
    <xsl:call-template name="button_root" />
    </xsl:if>
    </xsl:for-each>
    </xsl:when>
    - <xsl:otherwise>
    - <html>
    What's this view? (search_for_cals.xsl) -
    <xsl:value-of select="@view" />
    </html>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    - <xsl:template name="search_toolbar">
    - <HTML>
    <xsl:call-template name="emit_frame_head_tag" />
    - <BODY bgcolor="{$bgcolor_background}" background="imx/tdbg.gif"
    marginwidth="0" marginheight="0" onload="window.focus()">
    - <FORM>
    - <xsl:attribute name="action">
    <xsl:value-of select="./formdata@action" />
    </xsl:attribute>
    <xsl:attribute name="name">form</xsl:attribute>
    <xsl:attribute name="onSubmit">document.forms[0]['find'].click(); return false;
    </xsl:attribute>
    <xsl:apply-templates select="formdata" />
    - <CENTER>
    - <TABLE border="0" cellpadding="2" cellspacing="0" width="100%" height="100%">
    - <TR>
    - <TD align="center">
    - <TABLE border="0" cellpadding="3" cellspacing="1">
    - <TR>
    - <TD colspan="4">
    <FONT size="{$font_size_big_2}" face="{$font_name}">Find all calendars where
    the calendar</FONT>
    </TD>
    </TR>
    - <TR>
    - <TD valign="baseline">
    - <FONT size="{$font_size_big_2}" face="{$font_name}">
    - <SELECT name="which">
    <OPTION value="name;calid">name or ID</OPTION>
    <OPTION value="name">name</OPTION>
    <OPTION value="primaryOwner">primary owner</OPTION>
    <OPTION value="calid">ID</OPTION>
    </SELECT>
    </FONT>
    </TD>
    - <TD valign="baseline">
    - <FONT size="{$font_size_big_2}" face="{$font_name}">
    - <SELECT name="how">
    <OPTION value="0">contains</OPTION>
    <OPTION value="1">begins with</OPTION>
    </SELECT>
    </FONT>
    </TD>
    - <TD valign="baseline">
    <INPUT type="text" name="what" />
    </TD>
    - <TD valign="baseline">
    - <FONT size="{$font_size_big_2}" face="{$font_name}">
    - <INPUT type="button" name="find" value="Find">
    - <xsl:attribute name="onClick">
    <xsl:value-of select="./button[@name='find']" />
    </xsl:attribute>
    </INPUT>
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    </TABLE>
    </CENTER>
    </FORM>
    </BODY>
    </HTML>
    </xsl:template>
    - <xsl:template name="main">
    - <HTML>
    <xsl:call-template name="emit_frame_head_tag" />
    - <BODY bgcolor="{$bgcolor_background}" background="imx/tdbg.gif"
    marginwidth="0" marginheight="0">
    - <FORM name="form" method="post">
    - <xsl:attribute name="action">
    <xsl:value-of select="./formdata@action" />
    </xsl:attribute>
    <xsl:attribute name="name">form</xsl:attribute>
    <xsl:apply-templates select="formdata" />
    <INPUT type="hidden" name="how" value="0" />
    <INPUT type="hidden" name="which" value="name;calid" />
    <INPUT type="hidden" name="what" value=" />
    <INPUT type="hidden" name="selectedGroup" />
    - <xsl:if test="(./calsearchresults/nomatch)">
    - <!-- print no match found
    -->
    &#38;nbsp;
    &#38;nbsp;
    No Match Found
    </xsl:if>
    - <xsl:for-each select="./calsearchresults/searchresultcal">
    - <P>
    &#38;nbsp;
    &#38;nbsp;
    - <FONT size="{$font_size_big_2}" face="{$font_name}">
    - <FONT size="{$font_size_big}" face="{$font_name}">
    Owner:
    <xsl:value-of select="@owner" />
    <FONT size="{$font_size_big}" face="{$font_name}" color="{$bgcolor_wend_mid}">|
    </FONT>
    Calendar ID:
    <xsl:value-of select="@id" />
    <BR />
    </FONT>
    - <FONT size="{$font_size_big_2}" face="{$font_name}">
    - <xsl:choose>
    - <xsl:when test="@subscribed='false'">
    &#38;nbsp;
    &#38;nbsp;
    - <INPUT type="checkbox" name="calendar">
    - <xsl:attribute name="value">
    <xsl:value-of select="@name" />
    </xsl:attribute>
    </INPUT>
    &#38;nbsp;
    &#38;nbsp;
    - <A target="_blank">
    - <xsl:attribute name="href">
    <xsl:value-of select="@viewCommand" />
    </xsl:attribute>
    <xsl:value-of select="@name" />
    </A>
    </xsl:when>
    - <xsl:otherwise>
    &#38;nbsp;
    &#38;nbsp;
    - <A target="_blank">
    - <xsl:attribute name="href">
    <xsl:value-of select="@viewCommand" />
    </xsl:attribute>
    <xsl:value-of select="@name" />
    </A>
    &#38;nbsp;
    (Subscribed)
    </xsl:otherwise>
    </xsl:choose>
    - <xsl:if test="string-length(@description) > 0">
    &#38;nbsp;
    &#38;nbsp;
    - <FONT size="{$font_size_big}" face="{$font_name}">
    <xsl:value-of select="@description" />
    </FONT>
    </xsl:if>
    </FONT>
    </FONT>
    </P>
    </xsl:for-each>
    </FORM>
    </BODY>
    </HTML>
    </xsl:template>
    </xsl:stylesheet>
    <P>
    <A HREF="#back">Back</A>
    <P>
    <HR>
    </A>
    <B>diffctx.txt</B>
    Index: search_for_calendars_common.xsl
    ===================================================================
    RCS file: /m/src/ns/server/msg/calendar/core/html/search_for_calendars_common.xsl,v
    retrieving revision 1.1.2.14
    diff -c -r1.1.2.14 search_for_calendars_common.xsl
    *** search_for_calendars_common.xsl 2000/12/12 23:10:43 1.1.2.14
    --- search_for_calendars_common.xsl 2001/03/15 23:55:19
    *** 182,188 ****
    &#38;nbsp; &#38;nbsp;
    <INPUT type="checkbox" name="calendar">
    <xsl:attribute name="value">
    ! <xsl:value-of select="@id"/>
    </xsl:attribute>
    </INPUT>
    &#38;nbsp; &#38;nbsp;
    --- 182,188 ----
    &#38;nbsp; &#38;nbsp;
    <INPUT type="checkbox" name="calendar">
    <xsl:attribute name="value">
    ! <xsl:value-of select="@name"/>
    </xsl:attribute>
    </INPUT>
    &#38;nbsp; &#38;nbsp;
    *** 190,196 ****
    <xsl:attribute name="href">
    <xsl:value-of select="@viewCommand"/>
    </xsl:attribute>
    ! <xsl:value-of select="@id"/>
    </A>
    </xsl:when>
    <xsl:otherwise>
    --- 190,196 ----
    <xsl:attribute name="href">
    <xsl:value-of select="@viewCommand"/>
    </xsl:attribute>
    ! <xsl:value-of select="@name"/>
    </A>
    </xsl:when>
    <xsl:otherwise>
    *** 199,205 ****
    <xsl:attribute name="href">
    <xsl:value-of select="@viewCommand"/>
    </xsl:attribute>
    ! <xsl:value-of select="@id"/>
    </A>
    &#38;nbsp;(Subscribed)
    </xsl:otherwise>
    --- 199,205 ----
    <xsl:attribute name="href">
    <xsl:value-of select="@viewCommand"/>
    </xsl:attribute>
    ! <xsl:value-of select="@name"/>
    </A>
    &#38;nbsp;(Subscribed)
    </xsl:otherwise>
    <P>
    <A HREF="#back">Back</A>

    Maybe on the Google API s page?

  • Snow Leopard version of Preview:  Enable lines of text in the search results?

    In Preview 4 on OS X 10.5.8 Leopard and Preview 3 on OS X 10.4.11 Tiger, when a search of a PDF file was conducted, the search term would appear in context in the drawer on the side of the main Preview window.  The multiple lines of text in the search results could then be quickly scanned visually.
    In Preview 5 on OS X 10.6.8 Snow Leopard, the search result display options do not seem to include the lines of text found in Preview 4 and Preview 3.  Is there a setting somewhere, maybe even performed via the command line in the Terminal application, that can enable Preview 5 to display such lines of text in the search results?

    It's either that or finding other software for your scanning needs. For example, Image Capture comes with OS X, VueScan 9.2.09, ExactScan Pro 2.24.
    Alternatively, partition your hard drive and install Snow Leopard on another volume.
    To resize the drive do the following:
    1. Open Disk Utility and select the drive entry (mfgr.'s ID and size) from the left side list.
    2. Click on the Partition tab in the DU main window. You should see the graphical sizing window showing the existing partitions. A portion may appear as a blue rectangle representing the used space on a partition.
    3. In the lower right corner of the sizing rectangle for each partition is a resizing gadget. Select it with the mouse and move the bottom of the rectangle upwards until you have reduced the existing partition enough to create the desired new volume's size. The space below the resized partition will appear gray. Click on the Apply button and wait until the process has completed.  (Note: You can only make a partition smaller in order to create new free space.)
    4. Click on the [+] button below the sizing window to add a new partition in the gray space you freed up. Give the new volume a name, if you wish, then click on the Apply button. Wait until the process has completed.
    You should now have a new volume on the drive. Use the Snow Leopard installer DVD to install Snow Leopard on your new volume.
    It would be wise to have a backup of your current system as resizing is not necessarily free of risk for data loss.  Your drive must have sufficient contiguous free space for this process to work.

  • How can I show shipping costs in my search results? Where is "Customize view" link?

    Ebay has this help page: http://pages.ebay.ca/help/search/questions/shipping-column.html It says "Click the 'Customize view' link located at the top of your search results." I can't find the "Customize view" link, and there call center person wasn't much help.  Does the ability top see the shipping cost in the search results still exist? 

    quixotix wrote:
    Ebay has this help page: http://pages.ebay.ca/help/search/questions/shipping-column.html It says "Click the 'Customize view' link located at the top of your search results." I can't find the "Customize view" link, and there call center person wasn't much help.  Does the ability top see the shipping cost in the search results still exist?  Are you viewing on a mobile device or desktop? My search results on a desktop computer shows shipping on a line under the price for the item. 

  • Different Files Returned when using the Drop Down list on the Search Results Page

    Hi
    I have a result set of 22 documents when I select Date (Newest) from the drop down on the search results page.  The third document down is called "LL".
    If I now select Date (Oldest) I have a result Set of 22 documents. However, when I move to the second page.  The number of documents has reduced to 20 documents and my document "LL" which I would have expected to be the third from bottom document
    is not there.
    Am I doing something wrong here ?  Search is OOTB.  I have added some refiner columns.
    Regards
    Nigel
    Nigel Price NJPEnterprises

    Hi Nigel,
    It is by design. The "About x results" is presented when the total number of results is uncertain, and that is when collapsing (i.e. duplicate detection in this case) is enabled and the result set is partially processed. By default, a result page
    shows 10 results at the time. Therefore, for result sets with less than or equal to 10 results you will always get an accurate number of results and hence “About” is omitted. For more than 10 results you will get the “About x results” on the first page until
    you get to the last page of results and only then we know the exact number of results and hence can omit the “About”.
    Note that when you page out in the result set you will notice that the X in the “About X results” can vary quite a lot. That is because the total number of results is estimated based on the collapsing done so far. This is a common way of doing it by other
    search engines as well.
    Here is a simlar post for your reference:
    http://spbreed.wordpress.com/2013/09/14/sharepoint-2013-solution-to-inconsistent-search-results-count/
    I hope this helps.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Can't access the search results I get on Finder after the system is updated to Mavericks.

    Hi there guys, how are you?
    I work everyday with my 21.5' iMac and it had OS Lion before I updated to Mavericks last month. As I work with lots of files, I have also a 1TB Lacie external drive pluged into it via firewire and I constantly access these files. After I updated though, I'm experiencing a strange problem. Everytime I search for a file on Finder, all the results that come up can't be edited or even selected. This is driving me crazy because I must open another tab and go all the way through the file I want as I can't select any file from the searches. All the search results come up written in gray color and with a empty circle on its left side. I can't even click on them! For better explanation, here is a picture of what happens:
    Before the update, I used to normally access every result the search came up to.
    I have another iMac here in the network with Mavericks too and all the searches returns with selectable and editable results. Can anyone help me with this, I am having a really hard time here as I am losing much much time. Thanks a lot and sorry for the bad english!

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your documents or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this behavior; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Please take this step regardless of the results of Step 1.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

  • WebPart: Display the search result in an spgridview with filter and sort

    hi,
    For explain more in details.
    I need the search result in a table displaying some meta common in the different library.
    I've to have the possibility to filter and sort the grid.
    i'm trying to extend Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart
    i can have the result from the textbox search with: SharedQueryManager.GetInstance(this.Page).QueryManager
    My queryManager is populate in the method: CreateChildControls
    I put the sample code i use. and in the populateData method, my querymanager is null while in the createChildContriol, it's correctly populate with : this.queryManager = SharedQueryManager.GetInstance(this.Page).QueryManager;
    using System;
    using System.ComponentModel;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.Search.Internal.WebControls;
    using Microsoft.Office.Server.Search.Query;
    using Microsoft.Office.Server.Search.WebControls;
    using System.Data;
    using System.Xml;
    namespace CustomSearchResultWebPart.CustomCoreResultWebPart
    [ToolboxItemAttribute(false)]
    public class CustomCoreResultWebPart : Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart
    private ObjectDataSource objDS;
    private const string ObjectDataSourceID = "gridViewDataSource";
    private QueryManager queryManager;
    private SPGridView gridView = new SPGridView();
    protected override void CreateChildControls()
    //here is correctly populate
    this.queryManager = SharedQueryManager.GetInstance(this.Page).QueryManager;
    try
    LoadSearchGrid();
    catch (Exception ex)
    Page.Response.Write(ex.Message + " - " + ex.StackTrace);
    //base.CreateChildControls();
    protected override void OnInit(EventArgs e)
    base.OnInit(e);
    protected override void OnLoad(EventArgs e)
    base.OnLoad(e);
    protected override void OnPreRender(EventArgs e)
    //gridView.DataBind();
    base.OnPreRender(e);
    protected override void Render(HtmlTextWriter writer)
    base.Render(writer);
    public DataTable populateData()
    DataSet dtSet = null;
    DataTable dtTable = null;
    //here is my query manager is null
    if (queryManager != null && queryManager.Count > 0)
    XmlDocument xdoc = new XmlDocument(); //We are using XmlDocument
    xdoc = queryManager.GetResults(queryManager[0]);//xml returned by search
    if (xdoc != null)
    XmlReader xmlReader = new XmlNodeReader(xdoc);
    dtSet = new DataSet();
    dtSet.ReadXml(xmlReader);
    if (dtSet.Tables.Count > 1)
    dtTable = dtSet.Tables["Result"];
    return dtTable;
    private void LoadSearchGrid()
    this.objDS = new ObjectDataSource();
    this.objDS.ID = ObjectDataSourceID;
    this.objDS.SelectMethod = "populateData";
    this.objDS.TypeName = this.GetType().AssemblyQualifiedName;
    this.objDS.ObjectCreating += new ObjectDataSourceObjectEventHandler(objDS_ObjectCreating);
    this.Controls.Add(objDS);
    gridView.ID = "_gridView";
    gridView.AutoGenerateColumns = false;
    gridView.Width = new Unit(100, UnitType.Pixel);
    gridView.EnableViewState = false;
    gridView.AllowPaging = true;
    gridView.PageSize = 5;
    gridView.DataSourceID = ObjectDataSourceID;
    this.Controls.Add(gridView);
    void objDS_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
    //e.ObjectInstance = objDS;
    protected void gridView_RowDataBound(object sender, GridViewRowEventArgs e)
    //throw new NotImplementedException();
    Do you have a sample that i can use or some tutorial?
    thanks for your help

    I added this in my class
    public class CustomResultsDatasource : CoreResultsDatasource
    public CustomResultsDatasource(Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart parentWebPart)
    : base(parentWebPart)
    View = new CustomResultsDatasourceView(this, GetType().Name);
    public class CustomResultsDatasourceView : CoreResultsDatasourceView
    public CustomResultsDatasourceView(SearchResultsBaseDatasource dataSourceOwner, string viewName)
    : base(dataSourceOwner, viewName)
    //make sure we have a value for the datasource
    if (DataSourceOwner == null)
    throw new ArgumentNullException("DataSourceOwner");
    CustomResultsDatasource datasource = this.DataSourceOwner as CustomResultsDatasource;
    this.QueryManager = SharedQueryManager.GetInstance(datasource.ParentWebpart.Page).QueryManager;
    And this in my customSearchResultWebPart
    protected override void CreateDataSource()
    //base.CreateDataSource();
    this.DataSource = new CustomResultsDatasource(this);
    How can i use queryManager in populateData?
    thanks for your help

  • When using the search bar, is it possible to get the search results in a new tab?

    In the old Google toolbar, it was possible to view the search results in a new tab. Google toolbar is compatible with Firefox 7, so I have to use the Firefox Search Bar. However, it always gets the search results in the current tab. Can this be modified?

    Yes. Open a new tab and type or paste ''about:config'' into the location bar, hit enter, and hit enter again to get past the warning. Then paste ''browser.search.openintab'' into the filter box that shows, then double-click on the ''browser.search.openintab'' line to toggle it (it will switch to bold).
    If you'd rather an addon just do the above for you and add a menu option for it, try this:
    https://addons.mozilla.org/firefox/addon/searchontab/
    Alternatively, you can type a search into the search bar and press ''alt+enter'' instead of just enter to open your search in a new tab.

  • Can I customize the standard columns for the search results (list view) specifically?

    When searching for emails I would like to adjust the columns in the search results list view, e.g. add the sender's address. This I would like to save as standard columns specifically for the search results list view, since in other contexts I do not need it. However, I can only set standard columns for existing folders, not for the context of "search results".

    re :When searching for emails
    what method are you using?
    Are you talking about 'Quick filter' or 'Global Search' or via 'Edit' > 'Find' > 'Search Messages' ?
    '''If you used the Global Search:'''
    Typed in a word: eg: Birthday and selected 'Messages mentioning birthday'
    Then a search is returned in a new tab.
    You click on 'open email as list' - to open in a new tab.
    Is this the search results list view that you are refering to?
    the default columns should be:
    From, Subject, Date, Location
    If you only want to see eg: From and Date
    click on the icon 'select columns to display' located to far right of header column name.
    deselect Subject and Location
    next time you run a global search then only those columns appear in the 'open email as list' view.
    '''If via 'Edit' > 'Find' > 'Search Messages' ?'''
    enter search parameters and click on 'Search'
    Is this the search results list view that you are refering to?
    the default columns should be:
    From, Subject, Date, Location
    Subject and Location cannot be edited.
    Other column headers can be selected in the same way using the far right 'Select columns to display' icon.
    Any column headers you select will not be remembered if you close and later peform another search.
    If you click on 'Save as Search folder'
    This will create a folder in your Folder Pane and you can select column(s) you wish to display.
    Any Column headers you choose to display are selected for that saved search folder.
    The column headers only change if you select to reset defaults on that folder or from another folder you select to apply to other folders for either the search folder or all folders in the account.
    '''If using Quick Filter:'''
    The QuickFilter type of search is done on the folder that is selected.
    You are still in the same folder, it has simply ''filtered'' what it is displaying, so it will obviously still display the same column headers.

Maybe you are looking for

  • Query in BEx

    Hello, I have a report which shows the spend amount for the vendors for the last 12 months. I am trying to add a column which shows summation of the amounts by vendor. Now it shows only the total for each month. How can I also show the totals for the

  • Exchange Rate to be picked up from MIGO Document Date

    Dear Friends, During MIGO for a foreign purchase order the exchange rate is picked up from table OB08 based on the MIGO posting date.Is it possible for it to be picked up based on MIGO document date using exit.We are not using  Material Ledger. TIA S

  • Importing dvd into finalcut

    What is the best way to import a dvd into finalcut? This is not a copywrited disc but personal video that has been put on dvd. Is there anyother way than going through software like handbrake? Tried handbrake and 2 hours was going to take over 10 hou

  • Appropriate windows platform for developer suit 10g release 2

    hi i've installed developer suit 10g on windows xp sp2 but it does not work properly can anyone tell me which is appropriate windows platform for developer suit 10g release 2 thank U

  • Doubt about RESOURCE Role

    Hi Granting resource role to a user gives unlimited quota on default tablespace. Then why it's not shown when i query like this BANNER Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production PL/SQL Release 11.2.0.1.0 - Production CORE