You need to sign in to do that
Don't have an account?
Multiple Conditions for Rendered Attribute
Hi,
I am currently having an issue with the rendered attribute for an outputpanel. I currently have it check against an inputfield to see if it is blank.
It works with 1 condition: <apex:outputPanel rendered="{!LEN(address)<1}" >
But if I want to add in an additional OR || statement to check for {!LEN(city)<1} than it breaks.
I tried the following:
<apex:outputPanel rendered="{!LEN(address)<1} || {!LEN(city)<1}">
<apex:outputPanel rendered="{!LEN(address)<1} OR {!LEN(city)<1}">
<apex:outputPanel rendered="{!LEN(address) || !LEN(city) <1}">
<apex:outputPanel rendered="{!LEN(address) OR !LEN(city) <1}">
I am probably missing something super simple. Any help would be greatly appreciated.
Thanks in advance!
Hey Bob,
Thanks for the quick response.
Unfortunately that makes it so when both inputs are populated it will cause the panel to disappear.
It just popped into my head, by adding the LEN of the 2 values together and checking if it is lower than 1 it works.
So this worked to show the panel only when both inputs were blank:
Again, thanks for your help!
All Answers
I think the following should work:
Hey Bob,
Thanks for the quick response.
Unfortunately that makes it so when both inputs are populated it will cause the panel to disappear.
It just popped into my head, by adding the LEN of the 2 values together and checking if it is lower than 1 it works.
So this worked to show the panel only when both inputs were blank:
Again, thanks for your help!
Hi bob.
I have written a vf page in which i am comparing 2 fieldset and have one more condition
I tried to rendered the inputfield based on condition , Its working fine but the problem is it simply hide the field.
and showing me blank row for the condition which didn't met the condition.
I have pasted the code below.
Is there a way to avoid this thing.
It will do, as you have only changed the rendering on the individual fields, but the table rows and cells are still being outout.
You should put the entire table row inside an outputpanel and conditionally render that I'd say - make sure to set the layout attribute to 'none' or it will output markup that will mess up the table.
Thanks bob.
Its been head ache for me for the past 2 days and its working fine.
Thank you so much.
Hi bob.
I need some assistance on this.
I have been working on json parsing which came from my google analytics via webservice .
I got the response from google analytics and json file is little confusing me.
It doesn't seem like json and rows are like
{
"totalsForAllResults":
{
"ga:visitors":"31",
"ga:newVisits":"25"
},
"rows":
[
["20130401","0","0"],
["20130402","0","0"],
["20130403","0","0"] ]
}
Incase of totalforallresult node we can refer the no of visitors and newvisits through the nodeName ga:visitors and ga:newVisits respectively .
But what can we do in case of parsing the rows .
I tried in many ways but couldn't get the solutions.
Can you please assist me on this.
Thanks in advance
<apex:outputPanel rendered="{AND(!errorCheck == true, !luserFail != true)}" >
This did not work:
<apex:outputPanel rendered="{!errorCheck == true && !luserFail != true}" >
Hope this helps anyone that was trying to get "rendered" to look at multiple values from the custom controller.