• JoshVH
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 21
    Replies

I am using an apex:commandbutton to post some data to a Controller extension and rerender areas on the same page the commandbutton is on.  Also, I have some JavaScript that executes in the commandbutton's oncomplete attribute.  My question is how can I determine in my JavaScript if validation errors occurred when the button was clicked?  Basically I only want my oncomplete code to execute if there were no validation errors.  An example of a validation error in this case would be an inputfield marked as required that is not populated.

 

 

<apex:commandButton oncomplete="PrintContent();" action="{!Generate}" rerender="barcodes,pagemessages" value="Generate Coversheet"/>

 

 

Does anyone know of a way, either through url query parameters or some other mechanism, to display the Salesforce Content Detail screen by itself?  Basically I want to take away the sidebar and header and just have the detail screen for an individual content item.  The goal of this would be to display the item in an iframe on a Visualforce page.  Thanks for any insight.  I have the page working but want to hide the unnecessary parts and show only the detail.
  • March 03, 2010
  • Like
  • 0
I am trying figure out if it is possible to determine default field values using the Enterprise WSDL.  I am using the Describe calls and getting field information but I do not see any metadata that tells me what the default value of a specific field is.  For example I want to know if the default value of a boolean field is checked or not.  I see that you can determine default picklist values but don't see anything for any other field type.  Please advise.
  • December 17, 2009
  • Like
  • 0

Please help me understand what is going on here.  According to the documentation this code should work with no issues.  I am trying to cast a return value of type parent class to a child class variable.  This code compiles fine but throws 

 

System.TypeException: Invalid conversion from runtime type Class1Test to Class1ExtensionTest

 

Here is the sample code

 

 

public virtual class Class1Test {

private string sCopy;
public Class1Test(string s){
sCopy = s;
}

public class Class1ExtensionTest extends Class1Test{

public Class1ExtensionTest(string s){
super(s);
}
}
}

public class TestClass{

public static testmethod void testmethod(){
Class1Test.Class1ExtensionTest t = (Class1Test.Class1ExtensionTest)testCasting();
}

private Class1Test testCasting( ){
return new Class1Test('This Should work');
}
}

 

 

 

I am using the Pattern and Matcher classes to search text from an email.  Sometimes, I get an exception that says Regex too complicated.  I can't find any information on this.  Does anyone know what can cause?  I get the premise of the exception but don't know what to do to fix it.  If I put my regular expression and sample text into the tester on this site, http://www.fileformat.info/tool/regex.htm.  It works fine and returns what I want.  From what I understand Salesforce uses similar functionality as Java which the above site is using.  Any ideas?  Thanks.
Hopefully someone from force.com labs reads this or someone forwards it to them.  When I tried to install this into my production org there was an error in one of the test cases.  It said something about querying too many rows.  I imagine that a limit clause needs to be added to one of the queries in a test method.  If you are able to communicate with force.com labs or are reading this and work in the group please verify that this issue will be addressed.  Thanks.  Here is a link to the app iCalendar Export 1.1: https://sites.secure.force.com/appexchange/listingDetail?listingId=a0N300000016fTNEAY.
  • April 28, 2009
  • Like
  • 0
Can anyone tell me why the IsGroupEvent field on the Event object is always false in the After Insert/Update Trigger.  I am trying to perform logic only on events that are not group events.  This field is always false no matter what type of event I create.

trigger trgEvent on Event (after insert, after update) { if (Trigger.isAfter) { for(Event newRec : Trigger.new) { System.debug('Group Event: ' + newRec.isGroupEvent); //this is always false if (!newRec.isGroupEvent) //not working { } } } }

 

  • April 17, 2009
  • Like
  • 0
It appears that any links in a Visualforce page that is rendered as pdf are not hyperlinks in the pdf.  They have a line underneath them but you cannot click on them.  Is this standard functionality or am I missing something?  I simply put an outputlink component on the page and it was not clickabled.  Thanks for clarification.
  • February 03, 2009
  • Like
  • 0

I am getting this error sometimes after a postback from a actionsupport component.  It doesn't happen all of the time so I can't detect any patterns to look for.  It is so vague I don't know where to start looking.  I have quote a few components that are used on the page but I don't know which one to start looking in.  Thanks for any clarity anyone can provide.

 

Component reference found with more than one child

  • January 27, 2009
  • Like
  • 0
I was wondering if there was an easy way in an Apex test method to "fill up" a 32000 character string.  Basically I have some logic that handles when a string is over 32000 characters it will split it into 2 strings so it can store it in the database.  I don't see anyway to create a 32000 character string easily.  I am thinking something like a pad function.  A For loop would do it but wondered if there was a built in function to do it.  Thanks.
  • January 09, 2009
  • Like
  • 0
The documentation for Apex Email Service contains the following statement: "Associate a single Salesforce-generated email address with the email service, and write an Apex class that executes according to the user accessing the email service. For example, you can write an Apex class that identifies the user based on the user's email address, and creates records on behalf of that user."  I am interested in the part that talks about creating records on behalf of the emailing user.  Can someone point me to an example of this or at least what classes are involved?  I see System.RunAs but that says it only works in test methods.  I can create records and set the owner to the emailing user but the Created By field lists the Email Service's context user.  Thanks.
  • December 22, 2008
  • Like
  • 0
Why can I not put the standard Task/Event "Type" field on a custom report type that includes activities?  It seems like a no brainer that the Type field should be on there for filtering purposes.  I would use the standard report types for activities but I want to filter by contact id and that field is not available to me in the standard reports just the contact name.  When I say the standard reports I mean that ones that are called "Activities with Custom Object".  So my tasks are "Related To" the custom object and the "Who" is the contact id.  I can get all of the information I need with a custom report type except for the "Type" field it will not allow me to put that field on the report layout.  Any ideas? 
  • November 17, 2008
  • Like
  • 0
Is there any way to make this query only return the custom object records that have attachments?  When I run this query it returns all of the custom object instances for the specified account even if they don't have an attachment.  Then I have to loop through the list to actually find the attachments.

Select c.name, c.id, c.recordtype.name, (select a.name, a.createddate from attachments a)
from custom_object__c c
where c.accountid = 'xxxxxxxxxxxxxxx'
order by c.createddate desc
  • November 14, 2008
  • Like
  • 0
I am trying to build the sample projects in the Flex Toolkit.  I have download the Flex 3 sdk and the latest build of the Flex toolkit.  When I follow the steps in the readme and type ant at the command line I get an error about not being able to find build-master-targets.xml.  I cannot find this file anywhere on my system.  Is something missing from the flex toolkit build?  I also see references to a tools directory in these build.xml files and I don't see a tools directory in the Flex toolkit directories.  I just need to make a really simple change and don't have access to the Flex Builder, so I thought command line would be simple enough.  Any thoughts would be appreciated.  Thanks.
  • August 29, 2008
  • Like
  • 0
I am trying to build the sample projects in the Flex Toolkit.  I have download the Flex 3 sdk and the latest build of the Flex toolkit.  When I follow the steps in the readme and type ant at the command line I get an error about not being able to find build-master-targets.xml.  I cannot find this file anywhere on my system.  Is something missing from the flex toolkit build?  I also see references to a tools directory in these build.xml files and I don't see a tools directory in the Flex toolkit directories.  I just need to make a really simple change and don't have access to the Flex Builder, so I thought command line would be simple enough.  Any thoughts would be appreciated.  Thanks.
  • August 29, 2008
  • Like
  • 0
I am using Eclipse 3.3.2 with the latest version of the Force.com IDE 13.0.0.200806130415.  If any of the salesforce code is loaded, for example opening the force.com perspective, the help contents will not load anymore.  If I open up Eclipse and make sure that only the java perspective loads then the help contents opens fine.  I have pasted the exceptions that are written to the Eclipse error log below.  Right now the workaround is to close the force.com perspective and any code files that are open prior to closing Eclipse.  Then when Eclipse starts back up no salesforce code is loaded.  You can then launch the help before opening the force.com perspective and code files from your project.

!ENTRY com.salesforce.toolkit 1 0 2008-08-23 09:19:44.098
 !MESSAGE INFO [09:19:44] (ApexCodeEditor.java:doSetInput:222) - Set resource attributes on 'src/unpackaged/classes/clsAssociateMethods.cls'

!ENTRY org.eclipse.ui 4 0 2008-08-23 09:20:53.426
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ExceptionInInitializerError at org.eclipse.equinox.http.jetty.internal.HttpServerManager.updated(HttpServerManager.java:78) at org.eclipse.equinox.http.jetty.internal.Activator.startServer(Activator.java:208) at org.eclipse.equinox.http.jetty.JettyConfigurator.startServer(JettyConfigurator.java:60) at org.eclipse.help.internal.server.WebappManager.start(WebappManager.java:43) at org.eclipse.help.internal.base.BaseHelpSystem.ensureWebappRunning(BaseHelpSystem.java:187) at org.eclipse.help.internal.base.HelpDisplay.displayHelpURL(HelpDisplay.java:152) at org.eclipse.help.internal.base.HelpDisplay.displayHelp(HelpDisplay.java:42) at org.eclipse.help.ui.internal.DefaultHelpUI.displayHelp(DefaultHelpUI.java:125) at org.eclipse.ui.internal.help.WorkbenchHelpSystem.displayHelp(WorkbenchHelpSystem.java:833) at org.eclipse.ui.internal.actions.HelpContentsAction$1.run(HelpContentsAction.java:83) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.actions.HelpContentsAction.run(HelpContentsAction.java:81) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:546) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@deea66 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@deea66 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209) at org.mortbay.log.LogFactory.getLog(LogFactory.java:28) at org.mortbay.util.Container.<clinit>(Container.java:39) ... 40 more Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@deea66 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 44 more Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.getConstructor(Unknown Source) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410) ... 45 more Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Category at java.lang.ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:429) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 50 more

!ENTRY com.salesforce.toolkit 1 0 2008-08-23 09:20:57.035
!MESSAGE INFO [09:20:57] (ToolkitPlugin.java:stop:90) - Stopping com.salesforce.toolkit plugin
  • August 23, 2008
  • Like
  • 0
I have a very odd situation going on.  I have this query (
List<Task> TasksRemaining = [SELECT Id FROM Task WHERE Status != 'Completed' AND Status != 'Canceled' AND WhatId=:CustomObject[0].Id];)
in an apex script that is just trying to get the number of un-closed tasks related to an instance of a custom object.  The query works fine and correctly returns the number of un-closed tasks.  That is it works fine until I attach an email via the Outlook add-in to the instance of the custom object.  Once I do that this query always returns 0.  From the point of the call from the Outlook add-in forward this query always returns 0.  Even for different instances of the custom object that have un-closed tasks.  If I run the query from Eclipse it returns the id's of the un-closed task correctly.  Whenever the Apex runs though it returns 0 for the size.  The only way I can get it to return the correct number is to re-import the Apex code.  That process seems to reset whatever is causing this to return 0.  Any ideas why this is happening and why re-importing the Apex code into the org seems to fix it?  It makes no sense to me that the call from Outlook would actually make the code not function but I don't know what would result in this query returning 0 when there are un-closed task.  I ran this through the debug log and output the SOQL to the debug log and there is always a valid id in the whatid clause and if I copy the soql to eclipse and run it the correct number of tasks is returned.  Any help or insight would be appreciated.

I am using an apex:commandbutton to post some data to a Controller extension and rerender areas on the same page the commandbutton is on.  Also, I have some JavaScript that executes in the commandbutton's oncomplete attribute.  My question is how can I determine in my JavaScript if validation errors occurred when the button was clicked?  Basically I only want my oncomplete code to execute if there were no validation errors.  An example of a validation error in this case would be an inputfield marked as required that is not populated.

 

 

<apex:commandButton oncomplete="PrintContent();" action="{!Generate}" rerender="barcodes,pagemessages" value="Generate Coversheet"/>

 

 

Does anyone know of a way, either through url query parameters or some other mechanism, to display the Salesforce Content Detail screen by itself?  Basically I want to take away the sidebar and header and just have the detail screen for an individual content item.  The goal of this would be to display the item in an iframe on a Visualforce page.  Thanks for any insight.  I have the page working but want to hide the unnecessary parts and show only the detail.
  • March 03, 2010
  • Like
  • 0

Please help me understand what is going on here.  According to the documentation this code should work with no issues.  I am trying to cast a return value of type parent class to a child class variable.  This code compiles fine but throws 

 

System.TypeException: Invalid conversion from runtime type Class1Test to Class1ExtensionTest

 

Here is the sample code

 

 

public virtual class Class1Test {

private string sCopy;
public Class1Test(string s){
sCopy = s;
}

public class Class1ExtensionTest extends Class1Test{

public Class1ExtensionTest(string s){
super(s);
}
}
}

public class TestClass{

public static testmethod void testmethod(){
Class1Test.Class1ExtensionTest t = (Class1Test.Class1ExtensionTest)testCasting();
}

private Class1Test testCasting( ){
return new Class1Test('This Should work');
}
}

 

 

 

I am using the Pattern and Matcher classes to search text from an email.  Sometimes, I get an exception that says Regex too complicated.  I can't find any information on this.  Does anyone know what can cause?  I get the premise of the exception but don't know what to do to fix it.  If I put my regular expression and sample text into the tester on this site, http://www.fileformat.info/tool/regex.htm.  It works fine and returns what I want.  From what I understand Salesforce uses similar functionality as Java which the above site is using.  Any ideas?  Thanks.
Can anyone tell me why the IsGroupEvent field on the Event object is always false in the After Insert/Update Trigger.  I am trying to perform logic only on events that are not group events.  This field is always false no matter what type of event I create.

trigger trgEvent on Event (after insert, after update) { if (Trigger.isAfter) { for(Event newRec : Trigger.new) { System.debug('Group Event: ' + newRec.isGroupEvent); //this is always false if (!newRec.isGroupEvent) //not working { } } } }

 

  • April 17, 2009
  • Like
  • 0
It appears that any links in a Visualforce page that is rendered as pdf are not hyperlinks in the pdf.  They have a line underneath them but you cannot click on them.  Is this standard functionality or am I missing something?  I simply put an outputlink component on the page and it was not clickabled.  Thanks for clarification.
  • February 03, 2009
  • Like
  • 0

I am getting this error sometimes after a postback from a actionsupport component.  It doesn't happen all of the time so I can't detect any patterns to look for.  It is so vague I don't know where to start looking.  I have quote a few components that are used on the page but I don't know which one to start looking in.  Thanks for any clarity anyone can provide.

 

Component reference found with more than one child

  • January 27, 2009
  • Like
  • 0
Is there any way to make this query only return the custom object records that have attachments?  When I run this query it returns all of the custom object instances for the specified account even if they don't have an attachment.  Then I have to loop through the list to actually find the attachments.

Select c.name, c.id, c.recordtype.name, (select a.name, a.createddate from attachments a)
from custom_object__c c
where c.accountid = 'xxxxxxxxxxxxxxx'
order by c.createddate desc
  • November 14, 2008
  • Like
  • 0
I have a custom object with a 1-to-1 relationship with the Contact object via a lookup field.  I want to create a Visualforce page that shows the Contact detail section on top and the customObj__c detail section below it.  I know that I could work around it by using the Contact standard controller for the page and then lay out my custom object's fields by hand, but it would be fantastic if it were possible to do this using standard controllers for both, since that would allow the page layout tool to be used (and different layouts per record type, etc).
 
I'm still pretty new to Visualforce and custom controllers, extensions, and components.  I thought maybe I could get this to work by putting an <apex:detail> section in a custom component.  The first problem is that it appears there's no way to have a component use a standard controller.  Secondly, when the component is included in the main Contact page, the <apex:detail> section takes on the scope of the Contact record, rather than pull from the controller of the component.
 
I guess I'm essentially trying to put together a sort of "Console" type of functionality where multiple detail sections are present and they relate to the main Contact record.  Is this possible using Visualforce?
 
Thanks,
Jeff
 
I am using Eclipse 3.3.2 with the latest version of the Force.com IDE 13.0.0.200806130415.  If any of the salesforce code is loaded, for example opening the force.com perspective, the help contents will not load anymore.  If I open up Eclipse and make sure that only the java perspective loads then the help contents opens fine.  I have pasted the exceptions that are written to the Eclipse error log below.  Right now the workaround is to close the force.com perspective and any code files that are open prior to closing Eclipse.  Then when Eclipse starts back up no salesforce code is loaded.  You can then launch the help before opening the force.com perspective and code files from your project.

!ENTRY com.salesforce.toolkit 1 0 2008-08-23 09:19:44.098
 !MESSAGE INFO [09:19:44] (ApexCodeEditor.java:doSetInput:222) - Set resource attributes on 'src/unpackaged/classes/clsAssociateMethods.cls'

!ENTRY org.eclipse.ui 4 0 2008-08-23 09:20:53.426
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ExceptionInInitializerError at org.eclipse.equinox.http.jetty.internal.HttpServerManager.updated(HttpServerManager.java:78) at org.eclipse.equinox.http.jetty.internal.Activator.startServer(Activator.java:208) at org.eclipse.equinox.http.jetty.JettyConfigurator.startServer(JettyConfigurator.java:60) at org.eclipse.help.internal.server.WebappManager.start(WebappManager.java:43) at org.eclipse.help.internal.base.BaseHelpSystem.ensureWebappRunning(BaseHelpSystem.java:187) at org.eclipse.help.internal.base.HelpDisplay.displayHelpURL(HelpDisplay.java:152) at org.eclipse.help.internal.base.HelpDisplay.displayHelp(HelpDisplay.java:42) at org.eclipse.help.ui.internal.DefaultHelpUI.displayHelp(DefaultHelpUI.java:125) at org.eclipse.ui.internal.help.WorkbenchHelpSystem.displayHelp(WorkbenchHelpSystem.java:833) at org.eclipse.ui.internal.actions.HelpContentsAction$1.run(HelpContentsAction.java:83) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.actions.HelpContentsAction.run(HelpContentsAction.java:81) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:546) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@deea66 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@deea66 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209) at org.mortbay.log.LogFactory.getLog(LogFactory.java:28) at org.mortbay.util.Container.<clinit>(Container.java:39) ... 40 more Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@deea66 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 44 more Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.getConstructor(Unknown Source) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410) ... 45 more Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Category at java.lang.ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:429) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 50 more

!ENTRY com.salesforce.toolkit 1 0 2008-08-23 09:20:57.035
!MESSAGE INFO [09:20:57] (ToolkitPlugin.java:stop:90) - Stopping com.salesforce.toolkit plugin
  • August 23, 2008
  • Like
  • 0
Hi Everyone,
How can I add actionSupport to a custom component?
Thanks in advance
ana
  • July 15, 2008
  • Like
  • 0
I am having issues using the immediate attribute within actionSupport. The documentation says that "If set to true, the action happens immediately and any field validation rules are skipped." It doesn't mention anything about rerendering or data binding so I'm a little confused. Here is my problem:

I have a select list of contacts. When a contact is selected, a form with inputFields is rerendered to display the data of the selected contact. Some of these fields are required. If a field is null and you try to select a different contact you get an error message that the field is required. This is no good, so I added the immediate attribute to the actionSupport but now it does not appear to be rerendering the form.

Any ideas, suggestions?

Page:
Code:
<apex:page controller="input" >

<apex:form >
  <apex:selectList value="{!contactID}" size="5">
     <apex:selectOptions value="{!contacts}" />
     <apex:actionSupport event="onchange" action="{!updateContact}" rerender="form" immediate="true"/>
  </apex:selectList>
  <apex:pageBlock >
     <apex:panelGrid columns="2" id="form">
        Full Name: <apex:outputField value="{!c.Name}"/>
        Email: <apex:inputField value="{!c.Email}" required="true"/>
        Title: <apex:inputField value="{!c.Title}" required="true"/>
        Phone: <apex:inputField value="{!c.Phone}" required="true"/>
     </apex:panelGrid>  
  </apex:pageBlock>
</apex:form>

</apex:page>

Controller:
Code:
public class input {
    public String ContactId {set; get;}
    public Contact c {set; get;}
    private List<SelectOption> contacts;
    private Map<Id,Contact> contactMap = new Map<Id,Contact>();

    public List<SelectOption> getContacts(){
       if(contacts == null){
           Contact [] cons = [select Id, Name, Title, FirstName, LastName, Phone, Email from Contact limit 10];
           contactId = cons[0].Id;
           contacts = new List<SelectOption>();
    
           for(Contact c : cons){
              contacts.add(new SelectOption(c.ID,c.Name));
              contactMap.put(c.Id,c);
           }
       }
       return contacts;
    }
   
    public PageReference updateContact(){
        c = contactMap.get(ContactID);
        return null;
    }      
}