+ Start a Discussion
aebenaeben 

Problem with rendered attribute

My page looks like this
 

<apex:commandButton value="Search" rerender="noresults" status="searchStatus" action="{!query}"/>

<apex:outputPanel id="noresults">

<apex:actionStatus id="searchStatus">

<apex:facet name="start">

<apex:outputText >Working......</apex:outputText>

</apex:facet>

<apex:facet name="stop">

<apex:outputText rendered="{!showTable}">Found</apex:outputText>

<apex:outputText rendered="{!showNoRecFound}">No Records Found</apex:outputText>

</apex:facet>

</apex:actionStatus>

</apex:outputPanel>

getShowTable() and getShowNoRecFound() cannot return true at the same time. Even if getShowTable() returns true, the text "Found" does not get displayed. When getShowNoRecFound() returns true the corresponding text is getting displayed.

I tried moving one of the outputText to a different outputPanel. Then it works perfectly fine. But the status gets messed up!!

Am I missing something?

kyleRochekyleRoche
Why not just do something like this? And bind to a string to represent status? No reason to mess w/ rendering for what you are trying to accomplish.

<
apex:facet name="stop">

<apexutputText >{!statusOfRecords}</apexutputText>

</apex:facet>

aebenaeben
Thanks for the reply.
 
I could do that if I want to display a simple text on stop. I am actually trying to display a table when the records are found and a simple text if not found.
 
The code in my previous post is just an example to get the point across. Sorry.