-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
27Questions
-
15Replies
PDF Rendering Problem - Overlapping Text in PDF
<apex:outputText value="Open Activities" styleClass="subtitle"/> <apex:dataTable value="{!OpenActivities}" var="lines" styleClass="dataTable" columnclasses="lineitems" headerClass="dataTableHeader" id="OpenActivitiesSection" width="100%"> <apex:column style="width: 250px" > <apex:facet name="header"><b>Open Activity Subject</b></apex:facet> <apex:outputText value="{!lines.Subject}"/> </apex:column> <apex:column style="width: 100px" > <apex:facet name="header"><b>Assigned To</b></apex:facet> <apex:outputText value="{!lines.AssignedToName}"/> </apex:column> <apex:column style="width: 150px" > <apex:facet name="header"><b>Due Date</b></apex:facet> <apex:outputText value="{!lines.ActivityDate_Formatted}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Comments</b></apex:facet> <apex:outputText styleClass="item" escape="true" value="{!lines.Comments}"/> </apex:column> </apex:dataTable> <apex:outputText value="Call Reports" styleClass="subtitle"/> <apex:outputText value="{!CallReports_Desc}" styleClass="subtitle2"/> <apex:dataTable value="{!CallReports}" var="lines" styleClass="dataTable" columnclasses="lineitems" headerClass="dataTableHeader" id="CallReportsSection" width="100%"> <apex:column style="width: 150px" > <apex:facet name="header"><b>Call Report Date</b></apex:facet> <apex:outputText value="{!lines.callReportDate_Formatted}" /> </apex:column> <apex:column style="width: 100px" rendered="{!Not(CallReports_LimittoOwner)}"> <apex:facet name="header"><b>Created By</b></apex:facet> <apex:outputText value="{!lines.CallReportCreatedByName}"/> </apex:column> <apex:column style="width: 250px"> <apex:facet name="header"><b>Subject</b></apex:facet> <apex:outputText value="{!lines.Subject}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Comments</b></apex:facet> <apex:outputText styleClass="item" escape="true" value="{!lines.Comments}"/> </apex:column> </apex:dataTable> <apex:outputText value="Opportunities" styleClass="subtitle" rendered="{!IF(Opportunities_Count>0,'true','false')}"/> <apex:dataTable value="{!Account.Opportunities}" var="lines" styleClass="dataTable" columnclasses="lineitems" headerClass="dataTableHeader" id="OpportunitiesSection" width="100%" rendered="{!IF(Opportunities_Count>0,'true','false')}"> <apex:column > <apex:facet name="header"><b>Opportunity Name</b></apex:facet> <apex:outputField value="{!lines.Name}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Stage</b></apex:facet> <apex:outputField value="{!lines.StageName}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Close Date</b></apex:facet> <apex:outputField value="{!lines.CloseDate}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Amount</b></apex:facet> <apex:outputField value="{!lines.Amount}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Probability %</b></apex:facet> <apex:outputField value="{!lines.Probability}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Competition</b></apex:facet> <apex:outputField value="{!lines.Competition__c}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Target Price</b></apex:facet> <apex:outputField value="{!lines.Target_Price__c}"/> </apex:column> </apex:dataTable>
- Jon Keener
- January 06, 2009
- Like
- 0
- Continue reading or reply
SOQL question on returning tasks directly and indirecty related to an Account in a single query
SELECT Id, Name, OwnerID, Owner.Name, RecordTypeId, RecordType.Name, Type, (SELECT Id, FirstName, LastName, Title, Phone, Fax, Email, OwnerId, Owner.Name FROM Contacts ORDER BY LastName ASC, FirstName ASC), (SELECT Id, Subject, ActivityDate, Description, Status, Type, OwnerId, Owner.Name, CreatedById, CreatedBy.Name FROM Tasks ORDER BY ActivityDate DESC) FROM Account WHERE id = :accountId
- Jon Keener
- January 06, 2009
- Like
- 0
- Continue reading or reply
Best Practices Ideas for Supporting Multi-Language in Visualforce
- Jon Keener
- June 26, 2008
- Like
- 0
- Continue reading or reply
Questions Regarding Eclipse around a warning and maximum timeout value
Refresh error: Unable to retrieve file for id Case of type Workflow due to an internal error:1659875132-10 (370857700) Sandbox/src/unpackaged package.xml line 1 1214436401828 129
- Jon Keener
- June 26, 2008
- Like
- 0
- Continue reading or reply
Summer 08 rerendering issue with items inside a pageBlockSectionItem
<apex:page controller="TestController1" tabStyle="Account"> <apex:form> <apex:pageBlock id="block" title="My Content"> <apex:pageBlockSection title="My Content Section" columns="1"> <apex:commandButton id="ShowTests" value="Show Tests" action="{!RunShow}" rendered="{!if(TestsVisible=false,'true','false')}" rerender="block,Test1,Test2,ShowTests,HideTests"/> <apex:commandButton id="HideTests" value="Hide Tests" action="{!RunHide}" rendered="{!if(TestsVisible=true,'true','false')}" rerender="block,Test1,Test2,ShowTests,HideTests"/> <apex:outputText id="Test1" value="Test 1" rendered="{!if(TestsVisible=true,'true','false')}"/> <apex:pageBlockSectionItem> <apex:outputText id="Test2" value="Test 2" rendered="{!if(TestsVisible=true,'true','false')}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Controller
public class TestController1 { Boolean TestsVisible = false; public boolean getTestsVisible() { return TestsVisible; } public void RunShow() { TestsVisible = true; } public void RunHide() { TestsVisible = false; } }
- Jon Keener
- May 29, 2008
- Like
- 0
- Continue reading or reply
Creating a Visualforce Popup window that operates similar to the Lookup popup windows
- Jon Keener
- April 02, 2008
- Like
- 0
- Continue reading or reply
Best way to link to Visualforce page from a custom detail page button
parent.frames.location.replace("/apex/Sample_Request_Assign_Task_to_CSR_to_Enter_Order—sampleRequestId={!Sample_Request__c.Id}");
This is the typical way I've done this in the past for s-controls, etc, so that the outer frames render correctly and you don't get the dual Salesforce tabs.
- Jon Keener
- April 01, 2008
- Like
- 0
- Continue reading or reply
Internet Explorer 6 rendering issue with dataTable and Field Help Hovers
<apex:dataTable value="{!sampleMaterials}" var="lines" styleClass="list" id="MaterialGrid" rendered="{!IF(ErrorMessage!='','False','True')}"> <apex:column> <apex:facet name="header"><b>Shipping Location <FONT COLOR="#C00" SIZE="4">*</FONT></b></apex:facet> <apex:inputField value="{!lines.Shipping_Plant__c}"/> </apex:column> <apex:column> <apex:facet name="header"><b>Material Must Ship from Shipping Location</b></apex:facet> <apex:inputField value="{!lines.Material_Must_Ship_from_Shipping_Plant__c}"/> </apex:column> <apex:column> <apex:facet name="header"><b>Estimated Ship Date <FONT COLOR="#C00" SIZE="4">*</FONT></b></apex:facet> <apex:inputField value="{!lines.Estimated_Ship_Date__c}"/> </apex:column> </apex:dataTable>
Jon Keener
- Jon Keener
- February 21, 2008
- Like
- 0
- Continue reading or reply
Reproducing Standard "New" object functionality in Visualforce
- Jon Keener
- February 15, 2008
- Like
- 0
- Continue reading or reply
Setting how a Collapsible PageBlockSection is rendered
Message Edited by Jon Keener on 02-14-2008 01:06 PM
- Jon Keener
- February 14, 2008
- Like
- 0
- Continue reading or reply
avoiding required="true" check on inputFields when rerendering a section of a page.
- Jon Keener
- February 01, 2008
- Like
- 0
- Continue reading or reply
Accessing the Index of a List within a dataTable and use of parameters in a commandButton action
- Enabling the "Delete" button on each line. To enable this, what would be the optimum answer is having a commandButton Action like:
<apex:commandButton action="{!RemoveMaterial(lines.index)}" value="Delete" styleClass="btn" rerender="MaterialGrid" immediate="true"/>
The key difference, the RemoveMaterial(lines.index).
So the first question, is there any way to access the actual index of the List in a column of a dataTable?
The second question is passing parameters in the action parameter of the commandButton. From previous attempts, I've found that I could pass a parameter in an action call, like shown above. However, the current documentation (Spring 08) states on page 100 - "To add query string parameters to a commandButton, specify them in the associated action method". Assuming this is true, how do you do this if not like above, and how would you set up the code in the class to access these parameters.
A third item that I ran into, however I'm planning to work around it for now, is if I make any of the inputFields required, when I add a second+ line, when a required field on a previous line is blank, I get the error message popping up stating that the field is required. I'd rather not yell :smileyhappy: at the user to they hit the "next" button (not shown in screenshot, but it's part of a multistep wizard)
I've got some less elegant alternatives for deleting a row that I might try, like placing regular html input buttons instead of commandButtons, etc., but I'm hoping to solve this without resorting to that, because then the code will be a bit bulkier to support this. Based on the code involved so far, it should be pretty reusable for other grids.
Thanks for any assistance!
Jon Keener
, without resorting to Javascript onclick events(which I'm going to be investigating after this, but I foresee some of the same issues there also)
<apex:pageBlockSection title="Material(s) to be included in Sample:" collapsible="false"> <apex:dataTable value="{!sampleMaterials}" var="lines" styleClass="list" id="MaterialGrid"> <apex:column> <apex:facet name="header"><CENTER><b>Actions</b></CENTER></apex:facet> <apex:commandButton action="{!RemoveMaterial}" value="Delete" styleClass="btn" rerender="MaterialGrid" immediate="true"/> </apex:column> <apex:column> <apex:facet name="header"><b>Material Name</b></apex:facet> <apex:inputField value="{!lines.name}"/> </apex:column> <apex:column> <apex:facet name="header"><b>Sample Quantity</b></apex:facet> <apex:inputField value="{!lines.Sample_Quantity__c}"/> </apex:column> <apex:column> <apex:facet name="header"><b>UOM</b></apex:facet> <apex:inputField value="{!lines.Sample_UOM__c}"/> </apex:column> </apex:dataTable> </apex:pageBlockSection> <apex:panelGrid columns="1"> <apex:commandButton action="{!AddNewMaterial}" value="Add Another Material" styleClass="btn" rerender="MaterialGrid" immediate="true"/> </apex:panelGrid>
Controller Snippet
List<Sample_Material__c> sampleMaterials; public List<Sample_Material__c> getSampleMaterials() { if (sampleMaterials == null) { //Initialize the Object sampleMaterials = new List<Sample_Material__c>(); sampleMaterials.add(new Sample_Material__c()); } return sampleMaterials; } public void AddNewMaterial() { if (sampleMaterials != null) { sampleMaterials.add(new Sample_Material__c()); } } public void RemoveMaterial() { }
- Jon Keener
- January 31, 2008
- Like
- 0
- Continue reading or reply
Picklist Fields and Recordtypes - Having InputField show the correct list of picklist values
- Jon Keener
- December 20, 2007
- Like
- 0
- Continue reading or reply
Returning Visualforce markup from an APEX call and having it render correctly
<apex:outputLabel value="Shipping Plant" for="Shipping_Plant__c"/> <apex:panelGroup> <apex:outputLabel value="Potential Annual Volume" for="Potential_Annual_Volume__c"/> <apex:outputLabel value="UOM" for="Potential_Annual_Volume_UOM__c"/> </apex:panelGroup> {!TectylLabel} <apex:outputLabel value="AD Compound—" for="AD_Compound__c"/> <apex:outputLabel value="OEM" for="OEM__c"/>
For testing, in my Controller, I put the following:
public String getTectylLabel() { return '<apex:outputLabel value="Tectyl Product—" for="Tectyl_Product__c"/>'; }
<TD><LABEL for=j_id0:j_id3:j_id4:j_id10:Potential_Annual_Volume__c>Potential Annual Volume</LABEL><LABEL for=j_id0:j_id3:j_id4:j_id10:Potential_Annual_Volume_UOM__c> UOM</LABEL></TD> <TD><APEX:OUTPUTLABEL for="Tectyl_Product__c" value="Tectyl Product—" /></TD> <TD><LABEL for=j_id0:j_id3:j_id4:j_id10:AD_Compound__c>AD Compound–</LABEL></TD>
What's interesting is that it did wrap the returned string in a <TD></TD>, but it just treated it as a string.
- Jon Keener
- December 19, 2007
- Like
- 0
- Continue reading or reply
Accessing selected values of fields prior to page change or save
<apex:page id="step1" controller="testFieldChangeCheck" tabstyle="Contact"> <apex:form> <apex:pageBlock title="test"> <apex:pageBlockSection title="Test 1"> <apex:inputField id="picklist1" value="{!testing.LeadSource}" /> </apex:pageBlockSection> <apex:pageBlockSection title="Test Button" id="TestButton" columns="1"> <apex:commandButton id="showValues" value="Show Values" immediate="true" rerender="TestPanel"> </apex:commandButton> </apex:pageBlockSection> <!-- Test 1 - Test Results --> <apex:outputPanel id="TestPanel"> <apex:pageBlockSection title="Test Results" id="TestResults" columns="1"> <apex:outputText value="LeadSource Populated— {!Now()} : {!LeadSourcePopulated} {!testing.LeadSource}"> </apex:outputText> </apex:pageBlockSection> </apex:outputPanel> <!-- End of Test 1 - Test Results --> </apex:pageBlock> </apex:form> </apex:page>
Controller Code:
public class testFieldChangeCheck { Contact testing; public Contact getTesting() { if (testing == null) testing = new Contact(); return testing; } public String getleadSourcePopulated() { if (testing.LeadSource == null) {return 'No';} else {return 'Yes';} } }
- Jon Keener
- December 13, 2007
- Like
- 0
- Continue reading or reply
Use of the actionSupport tag with the "onchange" event
<apex:page id="step4" controller="testpage" tabstyle="Contact"> <apex:form> <apex:pageBlock title="test"> <!-- Test 1 - Using Picklist --> <apex:pageBlockSection title="test 1"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Picklist 1" for="picklist1" /> <apex:outputPanel> <apex:actionSupport event="onchange" action="{!ToggleTrue}" rerender="details" /> <apex:inputField id="picklist1" value="{!testing.LeadSource}" /> </apex:outputPanel> </apex:panelGrid> </apex:pageBlockSection> <!-- End of Test 1 - Using Picklist --> <!-- Test 2 - Using Account --> <apex:pageBlockSection title="test 2"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Parent Account" for="Acct" /> <apex:outputPanel> <apex:actionSupport event="onchange" action="{!ToggleTrue2}" rerender="details2" /> <apex:inputField id="Acct" value="{!testing.Account}" /> </apex:outputPanel> </apex:panelGrid> </apex:pageBlockSection> <!-- End of Test 2 - Using Account field --> <apex:outputPanel id="details"> <apex:pageBlockSection title="Details" rendered="{!hideshow}"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Name" for="personname" /> <apex:inputField id="personname" value="{!testing.Ownerid}" required="false" /> </apex:panelGrid> </apex:pageBlockSection> </apex:outputPanel> <apex:outputPanel id="details2"> <apex:pageBlockSection title="Details 2" rendered="{!hideshow2}"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Email" for="Email" /> <apex:inputField id="Email" value="{!testing.Email}" required="false" /> </apex:panelGrid> </apex:pageBlockSection> </apex:outputPanel> </apex:pageBlock> </apex:form> </apex:page>
public class testpage { Contact testing; boolean testval = false; boolean testval2 = false; public String ToggleTrue() { if ( testing.LeadSource =='Web') { testval = true; } else { testval = false; } return null; } public Contact gettesting() { if (testing == null) testing = new Contact(); return testing; } public Boolean gethideshow() { return testval; } public String ToggleTrue2() { if ( testing.Account != null) { testval2 = true; } else { testval2 = false; } return null; } public Boolean gethideshow2() { return testval2; } }
Message Edited by Jon Keener on 12-12-2007 11:14 AM
- Jon Keener
- December 12, 2007
- Like
- 0
- Continue reading or reply
Question on column spanning in inputFields on a form
<apex:page standardController="Sample_Request__c"> <apex:sectionHeader title="New Sample Request" subtitle="Step 1 of 3"/> <apex:form> <apex:pageBlock title="Sample Information"> <apex:pageBlockSection title="Ship To Address for Sample" columns="1" collapsible="false"> <apex:inputField id="addressLine1" value="{!Sample_Request__c.Address_Line_1__c}"/> <apex:inputField id="addressLine2" value="{!Sample_Request__c.Address_Line_2__c}"/> <apex:inputField id="addressLine3" value="{!Sample_Request__c.Address_Line_3__c}"/> <apex:inputField id="addressLine4" value="{!Sample_Request__c.Address_Line_4__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
- Jon Keener
- December 03, 2007
- Like
- 0
- Continue reading or reply
Maximum Length of SessionId
- Jon Keener
- March 02, 2007
- Like
- 0
- Continue reading or reply
Determining in trigger for before delete (or before update) whether Merge is the cause
- Jon Keener
- February 27, 2007
- Like
- 0
- Continue reading or reply
Error with trigger trying to stop Account ownership change
if (Trigger.old.OwnerId != Trigger.new.OwnerId)
{
Trigger.new.OwnerId.addError('Customer ownership is managed by SAP. Please contact Master Data to make this change.');
}
}
An internal server error has occurred |
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact support@salesforce.com. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. Thank you again for your patience and assistance. And thanks for using Salesforce! Error ID: 1788794875-117 |
Click here to return to the previous page. |
- Jon Keener
- February 27, 2007
- Like
- 0
- Continue reading or reply
PDF Rendering Problem - Overlapping Text in PDF
<apex:outputText value="Open Activities" styleClass="subtitle"/> <apex:dataTable value="{!OpenActivities}" var="lines" styleClass="dataTable" columnclasses="lineitems" headerClass="dataTableHeader" id="OpenActivitiesSection" width="100%"> <apex:column style="width: 250px" > <apex:facet name="header"><b>Open Activity Subject</b></apex:facet> <apex:outputText value="{!lines.Subject}"/> </apex:column> <apex:column style="width: 100px" > <apex:facet name="header"><b>Assigned To</b></apex:facet> <apex:outputText value="{!lines.AssignedToName}"/> </apex:column> <apex:column style="width: 150px" > <apex:facet name="header"><b>Due Date</b></apex:facet> <apex:outputText value="{!lines.ActivityDate_Formatted}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Comments</b></apex:facet> <apex:outputText styleClass="item" escape="true" value="{!lines.Comments}"/> </apex:column> </apex:dataTable> <apex:outputText value="Call Reports" styleClass="subtitle"/> <apex:outputText value="{!CallReports_Desc}" styleClass="subtitle2"/> <apex:dataTable value="{!CallReports}" var="lines" styleClass="dataTable" columnclasses="lineitems" headerClass="dataTableHeader" id="CallReportsSection" width="100%"> <apex:column style="width: 150px" > <apex:facet name="header"><b>Call Report Date</b></apex:facet> <apex:outputText value="{!lines.callReportDate_Formatted}" /> </apex:column> <apex:column style="width: 100px" rendered="{!Not(CallReports_LimittoOwner)}"> <apex:facet name="header"><b>Created By</b></apex:facet> <apex:outputText value="{!lines.CallReportCreatedByName}"/> </apex:column> <apex:column style="width: 250px"> <apex:facet name="header"><b>Subject</b></apex:facet> <apex:outputText value="{!lines.Subject}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Comments</b></apex:facet> <apex:outputText styleClass="item" escape="true" value="{!lines.Comments}"/> </apex:column> </apex:dataTable> <apex:outputText value="Opportunities" styleClass="subtitle" rendered="{!IF(Opportunities_Count>0,'true','false')}"/> <apex:dataTable value="{!Account.Opportunities}" var="lines" styleClass="dataTable" columnclasses="lineitems" headerClass="dataTableHeader" id="OpportunitiesSection" width="100%" rendered="{!IF(Opportunities_Count>0,'true','false')}"> <apex:column > <apex:facet name="header"><b>Opportunity Name</b></apex:facet> <apex:outputField value="{!lines.Name}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Stage</b></apex:facet> <apex:outputField value="{!lines.StageName}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Close Date</b></apex:facet> <apex:outputField value="{!lines.CloseDate}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Amount</b></apex:facet> <apex:outputField value="{!lines.Amount}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Probability %</b></apex:facet> <apex:outputField value="{!lines.Probability}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Competition</b></apex:facet> <apex:outputField value="{!lines.Competition__c}"/> </apex:column> <apex:column > <apex:facet name="header"><b>Target Price</b></apex:facet> <apex:outputField value="{!lines.Target_Price__c}"/> </apex:column> </apex:dataTable>
- Jon Keener
- January 06, 2009
- Like
- 0
- Continue reading or reply
SOQL question on returning tasks directly and indirecty related to an Account in a single query
SELECT Id, Name, OwnerID, Owner.Name, RecordTypeId, RecordType.Name, Type, (SELECT Id, FirstName, LastName, Title, Phone, Fax, Email, OwnerId, Owner.Name FROM Contacts ORDER BY LastName ASC, FirstName ASC), (SELECT Id, Subject, ActivityDate, Description, Status, Type, OwnerId, Owner.Name, CreatedById, CreatedBy.Name FROM Tasks ORDER BY ActivityDate DESC) FROM Account WHERE id = :accountId
- Jon Keener
- January 06, 2009
- Like
- 0
- Continue reading or reply
Identifying what server the code is on (cs1, na3, eu0, etc)
What I am doing is build a string that is a hyperlink but I need the server instance (na3, cs1) so I can build out the correct link.
opp is a Opportunity object.
String link = 'https://na3.salesforce.com/'+ opp.id;
Hard coding the na3 is not a good solution. Maybe there is some other way to do this?
Perhaps:
String link = opp.getLink();
but I didn't see anything like this.
Thanks for the help.
-Jason
- TehNrd
- July 03, 2008
- Like
- 0
- Continue reading or reply
Questions Regarding Eclipse around a warning and maximum timeout value
Refresh error: Unable to retrieve file for id Case of type Workflow due to an internal error:1659875132-10 (370857700) Sandbox/src/unpackaged package.xml line 1 1214436401828 129
- Jon Keener
- June 26, 2008
- Like
- 0
- Continue reading or reply
Summer 08 rerendering issue with items inside a pageBlockSectionItem
<apex:page controller="TestController1" tabStyle="Account"> <apex:form> <apex:pageBlock id="block" title="My Content"> <apex:pageBlockSection title="My Content Section" columns="1"> <apex:commandButton id="ShowTests" value="Show Tests" action="{!RunShow}" rendered="{!if(TestsVisible=false,'true','false')}" rerender="block,Test1,Test2,ShowTests,HideTests"/> <apex:commandButton id="HideTests" value="Hide Tests" action="{!RunHide}" rendered="{!if(TestsVisible=true,'true','false')}" rerender="block,Test1,Test2,ShowTests,HideTests"/> <apex:outputText id="Test1" value="Test 1" rendered="{!if(TestsVisible=true,'true','false')}"/> <apex:pageBlockSectionItem> <apex:outputText id="Test2" value="Test 2" rendered="{!if(TestsVisible=true,'true','false')}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
Controller
public class TestController1 { Boolean TestsVisible = false; public boolean getTestsVisible() { return TestsVisible; } public void RunShow() { TestsVisible = true; } public void RunHide() { TestsVisible = false; } }
- Jon Keener
- May 29, 2008
- Like
- 0
- Continue reading or reply
Creating a Visualforce Popup window that operates similar to the Lookup popup windows
- Jon Keener
- April 02, 2008
- Like
- 0
- Continue reading or reply
Use of the actionSupport tag with the "onchange" event
<apex:page id="step4" controller="testpage" tabstyle="Contact"> <apex:form> <apex:pageBlock title="test"> <!-- Test 1 - Using Picklist --> <apex:pageBlockSection title="test 1"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Picklist 1" for="picklist1" /> <apex:outputPanel> <apex:actionSupport event="onchange" action="{!ToggleTrue}" rerender="details" /> <apex:inputField id="picklist1" value="{!testing.LeadSource}" /> </apex:outputPanel> </apex:panelGrid> </apex:pageBlockSection> <!-- End of Test 1 - Using Picklist --> <!-- Test 2 - Using Account --> <apex:pageBlockSection title="test 2"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Parent Account" for="Acct" /> <apex:outputPanel> <apex:actionSupport event="onchange" action="{!ToggleTrue2}" rerender="details2" /> <apex:inputField id="Acct" value="{!testing.Account}" /> </apex:outputPanel> </apex:panelGrid> </apex:pageBlockSection> <!-- End of Test 2 - Using Account field --> <apex:outputPanel id="details"> <apex:pageBlockSection title="Details" rendered="{!hideshow}"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Name" for="personname" /> <apex:inputField id="personname" value="{!testing.Ownerid}" required="false" /> </apex:panelGrid> </apex:pageBlockSection> </apex:outputPanel> <apex:outputPanel id="details2"> <apex:pageBlockSection title="Details 2" rendered="{!hideshow2}"> <apex:panelGrid columns="2" columnClasses="labelCol,dataCol"> <apex:outputLabel value="Email" for="Email" /> <apex:inputField id="Email" value="{!testing.Email}" required="false" /> </apex:panelGrid> </apex:pageBlockSection> </apex:outputPanel> </apex:pageBlock> </apex:form> </apex:page>
public class testpage { Contact testing; boolean testval = false; boolean testval2 = false; public String ToggleTrue() { if ( testing.LeadSource =='Web') { testval = true; } else { testval = false; } return null; } public Contact gettesting() { if (testing == null) testing = new Contact(); return testing; } public Boolean gethideshow() { return testval; } public String ToggleTrue2() { if ( testing.Account != null) { testval2 = true; } else { testval2 = false; } return null; } public Boolean gethideshow2() { return testval2; } }
Message Edited by Jon Keener on 12-12-2007 11:14 AM
- Jon Keener
- December 12, 2007
- Like
- 0
- Continue reading or reply
Question on column spanning in inputFields on a form
<apex:page standardController="Sample_Request__c"> <apex:sectionHeader title="New Sample Request" subtitle="Step 1 of 3"/> <apex:form> <apex:pageBlock title="Sample Information"> <apex:pageBlockSection title="Ship To Address for Sample" columns="1" collapsible="false"> <apex:inputField id="addressLine1" value="{!Sample_Request__c.Address_Line_1__c}"/> <apex:inputField id="addressLine2" value="{!Sample_Request__c.Address_Line_2__c}"/> <apex:inputField id="addressLine3" value="{!Sample_Request__c.Address_Line_3__c}"/> <apex:inputField id="addressLine4" value="{!Sample_Request__c.Address_Line_4__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
- Jon Keener
- December 03, 2007
- Like
- 0
- Continue reading or reply
Toggle display based on Picklist selection
Basically, I have a picklist on a page I have created and when the user changes the selection on the picklist I want to either show or hide parts of the screen (using ajax). My code below almost works (i.e.: the javascript function works but for some reason the variable I am storing the current state in appears to lose its value).
I have tried this a variety of ways but it always ends up with the same problem - I can see the value being assigned to the variable testval but when I want to render the section of the screen and make a call to get the testval value, the value has changed to being true all the time.
Can anybody assist?
<apex:page id="step4" controller="testpage" tabstyle="Enquiry__c">
<apex:form>
<script>
function currentval(id) {
var newval = document.getElementById(id).value;
switch (newval) {
case "1" :
var chgVal = '{!ToggleFalse}';
break;
default :
var chgVal = '{!ToggleTrue}';
break;
}
}
</script>
<apex:pageBlock title="test">
<apex:pageBlockSection title="test">
<apex:panelGrid columns="2" columnClasses="labelCol,dataCol">
<apex:outputLabel value="Picklist 1" for="picklist1"></apex:outputLabel>
<apex:inputField id="picklist1" value="{! testing.xyz__c}"></apex:inputField>
<apex:actionSupport event="onchange" onsubmit="currentval('{!$Component.picklist1}')" rerender="details"></apex:actionSupport>
</apex:panelGrid>
</apex:pageBlockSection>
<apex:outputPanel id="details">
<apex:pageBlockSection title="Details" rendered="{! hideshow}">
<apex:panelGrid columns="2" columnClasses="labelCol,dataCol">
<apex:outputLabel value="Name" for="personname"></apex:outputLabel>
<apex:inputField id="personname" value="{! testing.abcd__c}"></apex:inputField>
</apex:panelGrid>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>
public class testpage {
testing123__c testing;
boolean testval = false;
public String getToggleTrue() {
testval = true;
return null;
}
public String getToggleFalse() {
testval = false;
return null;
}
public testing123__c gettesting() {
if (testing == null) testing = new testing123__c();
return testing;
}
public Boolean gethideshow() {
return testval;
}
}
- AussieBattler
- December 02, 2007
- Like
- 0
- Continue reading or reply
Determining in trigger for before delete (or before update) whether Merge is the cause
- Jon Keener
- February 27, 2007
- Like
- 0
- Continue reading or reply
Creating a Web Link that calls a report, including a dynamic filter
I was wondering if it was possible to pass an "override" parameter to a report through a weblink. For example:
I'd like to create a web link on the Account Tab that runs a report that displays all opportunities for that Account. To do this, I'd have to pass the Account Number as a merge field to the report, and have the report utilize it.
If anyone has done something like this, please let me know!
Thanks!
Jon Keener
jhkeener@ashland.com
- Jon Keener
- November 29, 2004
- Like
- 0
- Continue reading or reply