-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
1Replies
Conditonal Visualforce - display fields based on criteria
Hi, I have a VisualForce page with two columns. In one of those columns I have a field that does not display a value for every contact based on the field. In cases where the field is not displayed the layout of the column shifts and screws up the layout. Ideally, I'd like to have if..else situation where the field is displayed based on the fields I have now and if they don't meet the criteria to just enter a blank value or a , or anything to hold that cell. So my question is, is there a way in a VisualForce page to do something like:
IF (criteria are met) <apex:outputField value="{!con.Access__c}" rendered="{!NOT(con.Do_Not_Show_Birthdate__c) && (con.Deceased__c == 'No')}"/> <apex:outputField value="{!con.Access__c}" rendered="{!con.Do_Not_Show_Birthdate__c && bViewBirthdate && (con.Deceased__c == 'No')}"/> Else Enter text such as "It doesn't exist" or a blank space.Thanks
-
- SF_Gh0st
- March 02, 2022
- Like
- 0
- Continue reading or reply
Output field question
Hi, I am working on the Account VisualForce page, and on that page I have a custom field that is from a different object. I am able to display that field from the different object but right now it is in a table. Is there a way to output the field value without a table, but just a single line of text? Below is what I have now, but only want the output to be a line of text, not in a table or anything else. The line below is already within an ouputPanel.Thanks.
<apex:pageBlockTable width="100%" cellpadding="1" cellspacing="1" value="{!contactList}" var="con" border="0" frame="none" id="table1"> <apex:column> <apex:outputField value="{!con.CustomField__c}" rendered="{!con.CustomField__c != NULL}" /> </apex:column> </apex:pageBlockTable>
-
- SF_Gh0st
- July 29, 2021
- Like
- 0
- Continue reading or reply
Add field from another object
Hi,
I have a visualforce page that is mainly related to the account object in the sense that all the fields on the page are from the account object. However there is one field on a custom object (address) that I want to add to this VF page. What is the best way to do that? I thought I could add a lookup field from account to address (address__c is the lookup field) but that doesnt seem to work, I tried something like this:
I have a visualforce page that is mainly related to the account object in the sense that all the fields on the page are from the account object. However there is one field on a custom object (address) that I want to add to this VF page. What is the best way to do that? I thought I could add a lookup field from account to address (address__c is the lookup field) but that doesnt seem to work, I tried something like this:
<apex:outPutText value="{!acct.address__r.customField__c"/>Is it possible to do something like this or do I need to do anything to the controller? Thanks.
-
- SF_Gh0st
- July 23, 2021
- Like
- 0
- Continue reading or reply
What is the tab ID?
Hi,
In my VF page, I see the following code. 'Research' is a custom object. Where or how do I find out how they got that id for the tab?
In my VF page, I see the following code. 'Research' is a custom object. Where or how do I find out how they got that id for the tab?
<apex:tab label="Research" style="white-space:nowrap" name="research" id="tab17".......
-
- SF_Gh0st
- September 09, 2020
- Like
- 0
- Continue reading or reply
Add field from another object
Hi,
I have a visualforce page that is mainly related to the account object in the sense that all the fields on the page are from the account object. However there is one field on a custom object (address) that I want to add to this VF page. What is the best way to do that? I thought I could add a lookup field from account to address (address__c is the lookup field) but that doesnt seem to work, I tried something like this:
I have a visualforce page that is mainly related to the account object in the sense that all the fields on the page are from the account object. However there is one field on a custom object (address) that I want to add to this VF page. What is the best way to do that? I thought I could add a lookup field from account to address (address__c is the lookup field) but that doesnt seem to work, I tried something like this:
<apex:outPutText value="{!acct.address__r.customField__c"/>Is it possible to do something like this or do I need to do anything to the controller? Thanks.
- SF_Gh0st
- July 23, 2021
- Like
- 0
- Continue reading or reply