You need to sign in to do that
Don't have an account?
Simrin
hiding field based on condition
Hello,
I have a pageBlockTable on visualForce like below.
I have a pageBlockTable on visualForce like below.
<apex:pageblock id="PB2"> <apex:pageblocktable value="{!pList}" var="item"> <apex:column headervalue="User with Skill"> {!item.User.FirstName} {!item.User.LastName} </apex:column> <apex:column headervalue="Skill Name"> {!item.ProfileSkill.Name} </apex:column> </apex:pageblocktable> </apex:pageblock>
I will have many Users. I am ordering it as per user name. I want to just display the first name and hid the repeated names.
Is there way to achieve my use case using CSS or javascript.
Thank you
You can copy pase this code and give it a try in your Org. I have just hidden the First names i.e. first column. Whenever there is a duplicate values in Row that gets automatically hidden from the Jquery.
Thanks
Prady01
All Answers
This is possible through javascript , but doing it through its controller is way easy .
Please paste your controller code.
Please look into below link as well.
http://salesforce.stackexchange.com/questions/30522/how-to-avoid-duplicates-in-visualforce-page
Let us know if it helps you
Thanks for reply.
My code like this..
public void initSearchTable() {
pList = [SELECT User.FirstName, User.LastName, ProfileSkill.Name
FROM ProfileSkillUser ORDER BY UserId ];
displayOrNot();
}
public void displayOrNot()
{
for(Integer i=1;i<pList.size();i++)
{
if(pList[i].User.FirstName==pList[i-1].User.FirstName && pList[i].User.LastName==pList[i-1].User.LastName){
pList[i].User.FirstName='';
pList[i].User.LastName=";
}
}
}
if you still need to use the pList in the future, I recommand you can create another variable to store the whole value~
Let me know if this helpes~
It works for some users and not for some. I will check what is going wrong. but indeed a nice start to what i needed
You can copy pase this code and give it a try in your Org. I have just hidden the First names i.e. first column. Whenever there is a duplicate values in Row that gets automatically hidden from the Jquery.
Thanks
Prady01