if warning message displayed onclick of Button, then updated search result list not displaying
<p>When I click on <code>search</code> button, it will display search results based on conditions we entered or in total, so that time if search results are more than 100 it will display a warning message and will update search results based on conditions we entered.</p>

<h2>MyForm.java</h2>

<pre><code>public String findList() {

    try {
        vwList = null;
        String ret = "self";
        rendered = false;

        long count = myEntryListService.findHistMasterCount(entryJyokenVO,formMode);

        System.out.println("count: " + count);
        if (count &gt; CommonConst.MAX_ROW) {
            List msgList = new ArrayList();
            String params[] = new String[]{"WW000001", String.valueOf(CommonConst.MAX_ROW), String.valueOf(count)};
            msgList.add(params);
            ShowErrMsg.saveErr(msgList);
            System.out.println("warning message: " + FacesContext.getCurrentInstance().getMessages().next().getDetail()); // here getting warning message
    //      ret = "self"; //updated list is displaying but warning message not displaying
            ret = null; // warning message displaying but updated search results not displaying
        }

        vwList = myEntryListService.findHistMasterList(entryJyokenVO, formMode);
        rendered = true;
        System.out.println("vwList size: " + vwList.size());

        return ret;
    } catch (Exception e) {
        System.out.println("System error");

        return "error";
    }
}
</code></pre>

<h2>agent.xhtml</h2>

<pre><code>&lt;h:commandButton id="search" value="#{msgs['label.button.search']}" action="#{myForm.findList}" onclick="openLoadingWindow();"/&gt;
</code></pre>

<h2>faces-config.xml</h2>

<pre><code>&lt;navigation-rule&gt;   
    &lt;from-view-id&gt;/jsp/agency/agent.xhtml&lt;/from-view-id&gt;
    &lt;navigation-case&gt;
        &lt;from-outcome&gt;self&lt;/from-outcome&gt;
        &lt;to-view-id&gt;/jsp/agency/agent.xhtml&lt;/to-view-id&gt;
        &lt;redirect/&gt;
    &lt;/navigation-case&gt;
&lt;/navigation-rule&gt;
</code></pre>

<p>Now the problem is,</p>

<ul>
<li><p>If I am returning <code>self</code> and selected value from drop-down in screen, then updated search results are displaying corresponding to drop-down value, but warning message not displaying ...<br/></p></li>
<li><p>If I am returning <code>null</code> and selected value from drop-down in screen, then warning message displaying but updated search results are not displaying corresponding to drop-down value (if I clicked search button 2 times after selecting value from dropdown then updated results list is displaying)...</p></li>
</ul>