• Michael Benson 4
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I have a VisualForce page using only the standard apex markup  <Knowledge:ArticleList>.

How can you know how many articles will be displayed?

How can you know if it returned no articles at all?

Visualforce Page:
<apex:page >
    <!-- User Guides Content section-->
User Guides
<knowledge:articleList articleVar="article" categories="Knowledge_Categories:AccuDate_9700" keyword="warranty" articleTypes="KB_Article__kav" pageSize="10">
<li>
<apex:outputLink target="_self" value="{!URLFOR($Action.KnowledgeArticle.View, article.id, ['popup' = 'true'])}">{!article.title}</apex:outputLink>
</li>
</knowledge:articleList> 
<!-- User Guides Content section-->    
    
</apex:page>

 
I have a webpage(vsualforce page) that has a search. I wish to pass the search text, and another variable set by the called function which redirect to a new webpage. On that new second webpage these parameters are used to list knowledge base articles.

My controller has the below:

public String searchstring { get; set; }
public String searchparm { get; set; }


public pagereference Results_PRO_Pageredirect_new() {
      PageReference pageRef = new PageReference('http://sctest-transact-tech.cs51.force.com/SearchResultsPage');
      searchparm = 'Knowledge_Categories:AccuDate_Pro';
      refreshSearchResult();
      pageRef.setRedirect(false);
      return pageRef;
}    


The first page (search page) has this for input with search button:

<apex:form >
<apex:inputText value="{!searchstring}" id="theSearchstring" maxlength="100" size="110" onkeypress="if (event.keyCode == 13) {refreshSearchResult();return false;} "/> 
&nbsp;
<apex:commandButton id="submitButton" style="width:40" action="{!Results_PRO_Pageredirect_new}" value="Search" />
<apex:messages />
</apex:form>


And the SearchResultsPage (visualforce page) I'm trying to pass to is:


<apex:page controller="myFSTController" standardStylesheets="false" sidebar="false" title="KB Search" showheader="false" doctype="HTML-5.0">

<!-- Search Results-->

<apex:panelGroup id="theSearchResults"   >                    
                    <apex:panelGrid width="100%">
                        <table width="99%">
                            <tr>
                                <th width="33%">Title</th>
                                <th width="33%">Article Type</th>
                                <th width="33%">Summary</th> 
                            </tr>
                        </table>
                        <knowledge:articleList articleVar="article" categories="{!searchparm}" Keyword="{!searchstring}" pageNumber="{!currentPageNumber}" hasMoreVar="false" pageSize="10">
                        <table width="99%">
                            <tr>
                                <td width="33%">
                                    <apex:outputLink target="_blank" value="{!URLFOR($Action.KnowledgeArticle.View,article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink>
                                </td>
                            <td width="33%"><apex:outputText >{!article.articleTypeLabel}</apex:outputText></td>
                                <td width="33%"><apex:outputText >{!article.abstract}</apex:outputText></td> 
                            </tr>
                        </table>
                        </knowledge:articleList>
                    </apex:panelGrid>
  
<apex:form >

The parameters are not being passed, and I get results as if the parameters are blank.

What am I doing wrong?

Thanks!

Michael

 
I have a VisualForce page using only the standard apex markup  <Knowledge:ArticleList>.

How can you know how many articles will be displayed?

How can you know if it returned no articles at all?

Visualforce Page:
<apex:page >
    <!-- User Guides Content section-->
User Guides
<knowledge:articleList articleVar="article" categories="Knowledge_Categories:AccuDate_9700" keyword="warranty" articleTypes="KB_Article__kav" pageSize="10">
<li>
<apex:outputLink target="_self" value="{!URLFOR($Action.KnowledgeArticle.View, article.id, ['popup' = 'true'])}">{!article.title}</apex:outputLink>
</li>
</knowledge:articleList> 
<!-- User Guides Content section-->    
    
</apex:page>

 
I have a webpage(vsualforce page) that has a search. I wish to pass the search text, and another variable set by the called function which redirect to a new webpage. On that new second webpage these parameters are used to list knowledge base articles.

My controller has the below:

public String searchstring { get; set; }
public String searchparm { get; set; }


public pagereference Results_PRO_Pageredirect_new() {
      PageReference pageRef = new PageReference('http://sctest-transact-tech.cs51.force.com/SearchResultsPage');
      searchparm = 'Knowledge_Categories:AccuDate_Pro';
      refreshSearchResult();
      pageRef.setRedirect(false);
      return pageRef;
}    


The first page (search page) has this for input with search button:

<apex:form >
<apex:inputText value="{!searchstring}" id="theSearchstring" maxlength="100" size="110" onkeypress="if (event.keyCode == 13) {refreshSearchResult();return false;} "/> 
&nbsp;
<apex:commandButton id="submitButton" style="width:40" action="{!Results_PRO_Pageredirect_new}" value="Search" />
<apex:messages />
</apex:form>


And the SearchResultsPage (visualforce page) I'm trying to pass to is:


<apex:page controller="myFSTController" standardStylesheets="false" sidebar="false" title="KB Search" showheader="false" doctype="HTML-5.0">

<!-- Search Results-->

<apex:panelGroup id="theSearchResults"   >                    
                    <apex:panelGrid width="100%">
                        <table width="99%">
                            <tr>
                                <th width="33%">Title</th>
                                <th width="33%">Article Type</th>
                                <th width="33%">Summary</th> 
                            </tr>
                        </table>
                        <knowledge:articleList articleVar="article" categories="{!searchparm}" Keyword="{!searchstring}" pageNumber="{!currentPageNumber}" hasMoreVar="false" pageSize="10">
                        <table width="99%">
                            <tr>
                                <td width="33%">
                                    <apex:outputLink target="_blank" value="{!URLFOR($Action.KnowledgeArticle.View,article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink>
                                </td>
                            <td width="33%"><apex:outputText >{!article.articleTypeLabel}</apex:outputText></td>
                                <td width="33%"><apex:outputText >{!article.abstract}</apex:outputText></td> 
                            </tr>
                        </table>
                        </knowledge:articleList>
                    </apex:panelGrid>
  
<apex:form >

The parameters are not being passed, and I get results as if the parameters are blank.

What am I doing wrong?

Thanks!

Michael