You need to sign in to do that
Don't have an account?
Simrin
Logically, for options, One should be displayed and Two should not be displayed, but both of them are not displayed.
Rendered condition not getting evaluated for selectOptions in selectList
<apex:variable value="{!user1 !=''}" var="op1"/> <apex:outputText value="{!op1}"/> //o/p True <apex:variable value="{!user2 !=''}" var="op2"/> <apex:outputText value="{!op2}"/> //o/p False
<apex:selectList value="{!rSelected}" > <apex:selectOption itemValue="Select"/> <apex:selectOption itemLabel="One" itemValue="One" rendered="{!op1}" /> <apex:selectOption itemLabel="Two" itemValue="One" rendered="{!op2}"/> </apex:selectList>
Logically, for options, One should be displayed and Two should not be displayed, but both of them are not displayed.
The problem you face here is that both {!op1} and {!op2} are npt being set to true / false based on teh copde you have provided above. Rather than using '{!user1 !=''}', try simply setting this directyl to True or False and you will then be able to test this accordingly.
Please remember to mark this thread as solved with the answer that best helps you.
Regards
Stephen
All Answers
The problem you face here is that both {!op1} and {!op2} are npt being set to true / false based on teh copde you have provided above. Rather than using '{!user1 !=''}', try simply setting this directyl to True or False and you will then be able to test this accordingly.
Please remember to mark this thread as solved with the answer that best helps you.
Regards
Stephen
It works correctly, but try
'{!user1 !=''}
or
IsBlank, IsNull, IsEmpty, fails
Precisly my point. I believe the user1 variable is not returning the value that you expect. Add a debug statement or a simple output text to confirm what value is being stored to this variable.
I have output it just beofore the SelectList, and it displyas correct result
rendered="{!(op1 == true)}"
rendered="{!(op1 == true)}"
rendered="{!(op1)}"
rendered="op1"
I tried above, but it alwyas renders false.
And, Also If i display in itemLabel="{!(op1)}" it displays true but when i use rendered="{!(op1)}", it doesnto diaplay the option.
Its very strange
https://developer.salesforce.com/forums/ForumsMain?id=906F000000095kBIAQ
I came across this link, which says that there was bug in redered="false" , but which was fixed in Spring 10. I use Winter 15.
Is this thing related to me, or absolutely not.
I dont believe this bug is the cause as this will have been fixed some time ago. Hmm strange one indeed. When these scenarios occur for me I tend to start again and start simple. The first thing to understand is what value is being assigned to the User1 & User2 variables. I presume this is being set in the controller. Once you can undersatnd this, you can then use this as part of you renderded conditions
Regards,
Stephen