You need to sign in to do that
Don't have an account?
How to pass the value of variable in to condition of rendering?
i have simple problem but i dont know how to solve..
here it is
<apex:outputLabel rendered="{!(agenda.Committed__c== false && agenda.Employee__r.Name == 'Vishal Thoriya' )}" ><span><apex:outputLink onclick="editAgendaPopUp('{!agenda.Id}');return false;" styleClass="Links">Edit</apex:outputLink></span> | <span><apex:outputLink onclick="commitAgenda('{!agenda.Id}');return false;" styleClass="Links">Commit</apex:outputLink></span> | <span><apex:outputLink onclick="deleteAgenda('{!agenda.Id}');return false;" styleClass="Links">Del</apex:outputLink></span></apex:outputLabel>
i am rendering the elements based on conditions
here in my code i have passed 'Vishal Thoriya'
which is a value of userName in my code
userName is
like
public string UserName{get;set;}
i am getting the value of userName as 'Vishal Thoriya'
but my problem is that how to pass it to my code like
rendered="{!(agenda.Committed__c== false && agenda.Employee__r.Name == !userNAme)}"
but this is giving me syntax error........
any suggestions for this kind of problem....
any kind of help will be appriciated..............
Thanks in Advance
Vishal Thoriya
hello friends........
good news.......... there was small mistake in my code........
i have shown it above........
your idea worked thanks
Chamil and Rahul For the help......
much much appriciated....
All Answers
Vishal,
When you use IF condition then you have to use == as operator,
but if you dont use a If statement then you have to use sungle ('=') sign,
Try changing your code from:
to
thanks for the help buddy
but i want to pass the userName value but
with 'Vishal Thoriya' code works well......
Use following
rendered="{!(agenda.Committed__c== false && agenda.Employee__r.Name == userNAme)}"
instead of
rendered="{!(agenda.Committed__c== false && agenda.Employee__r.Name == ! userNAme)}"
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
oops, i didn't read your whole post,
Try this:
rendered="{!(agenda.Committed__c== false && agenda.Employee__r.Name != userNAme)}"
your ideas are not working guys
suggest me something else
thanks for the help
hello friends........
good news.......... there was small mistake in my code........
i have shown it above........
your idea worked thanks
Chamil and Rahul For the help......
much much appriciated....