You need to sign in to do that
Don't have an account?
sfdc18
Dynamically assign the value to "Rendered" attribute
Hi,
I have List<User> and its count.
I am iterating over a user count to display outputPanels for each and every user.
How to dynamically assign the value to "Rendered" attribute. i.e. In place of ABC in below example.
for eg.
<apex:repeat value="lstuser" var="u">
<apex:repeat value="list2" var="v">
<apex:outputPanel rendered="{!If(v.Name == 'ABC', true, false)}">
</apex:outputPanel>
</apex:repeat>
</apex:repeat>
Thanks.
I have List<User> and its count.
I am iterating over a user count to display outputPanels for each and every user.
How to dynamically assign the value to "Rendered" attribute. i.e. In place of ABC in below example.
for eg.
<apex:repeat value="lstuser" var="u">
<apex:repeat value="list2" var="v">
<apex:outputPanel rendered="{!If(v.Name == 'ABC', true, false)}">
</apex:outputPanel>
</apex:repeat>
</apex:repeat>
Thanks.
<apex:outputPanel rendered="{!If(v.Name == u.Name, true, false)}">
<apex:outputPanel rendered="{!If(v.Name == u.Name, true, false)}">
Did you try invoking a controller method from with the IF statement of the Rendered attribute. And within this method check whatever condition you wish to check and return True or False.
Thanks
No.
How to invoke a controller method from with the IF statement of the Rendered attribute?
Thanks
Just create a getter within the Controller and call it from the Rendered attribute within the IF statement.
So if you create a getter method in the Controller like -
Within the IF statement you can write -
This VF page will call the getter method from the IF statement and return True or False depending on whether the logic was satisfied. This will display or hide the respective component from the page.
Thanks
AR
If the reply resolves your problem then please mark it as best answer.
public class userWrapper{
public user aUser {get;set;}
public boolean isShowColumn {get;set;}
public userWrapper(User theUser, boolean Isvalue){
this.aUser=theUser;
this.isShowColumn= isValue;
}
and use this wrapper in your constructor or your action methods and pass your values to this wrapper class.
public class userController{
public list<userWrapper> lstUsers {get;set;}
public void getUserlists(){
//write your logic and get the lstUsers data.
}
}
Hope this helps you.