function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prasanth kumarprasanth kumar 

rendered condition not working please help

rendered condition with if statement not wokring.   I want to show only records which are matching with the account owner emails. 
 
<apex:page controller="inputfieldsexample1" showHeader="false">
<apex:form >

 <apex:variable var="coo" value="{!$User.Email}" />   .......... {!coo}
<apex:pageblock >

<apex:pageblocktable value="{!accs}" var="a">
<apex:column value="{!a.id}"  rendered="{ !If(a.owner.email == 'coo' ,true,false) }" />
<apex:column value="{!a.name}" />
<apex:column value="{!a.industry}" />

<apex:column value="{!a.owner.email}" />


</apex:pageblocktable>


n merge field, like {!$User.Email}..........{!$User.Id}.



</apex:pageblock>
</apex:form>

</apex:page>

controller code:-
 
public class inputfieldsexample1 {


public account acc{set;get;}
public string email1 {set;get;}
public list<account> accs{Set;get;}
public inputfieldsexample1 ()
{
email1='prasanth523001@gmail.com';
accs=[select id,name,industry,owner.email,owner.id from account where name='anmesh' or name='anmesh1' ];
}

}

 
Mahesh DMahesh D
Hi Prashanth,

Please use below code:
 
<apex:page controller="inputfieldsexample1" showHeader="false">
<apex:form >

 <apex:variable var="coo" value="{!$User.Email}" />   .......... {!coo}
<apex:pageblock >

<apex:pageblocktable value="{!accs}" var="a">
<apex:column value="{!a.id}"  rendered="{!IF(a.owner.Email == 'coo@gmail.com', true, false)}" />
<apex:column value="{!a.name}" />
<apex:column value="{!a.industry}" />

<apex:column value="{!a.owner.email}" />


</apex:pageblocktable>


n merge field, like {!$User.Email}..........{!$User.Id}.



</apex:pageblock>
</apex:form>

</apex:page>

I tested the above code and it is working fine in my DE environment.

Please do let me know if it helps you.

Regards,
Mahesh