• Gino Basso
  • NEWBIE
  • 0 Points
  • Member since 2008

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

The following VF page will not compile with the reRender attribute specified as shown below. The specific error is that cmd is not a property of the standard controller. If I remove the reRender attribute the page compiles successfully. Note that details have been removed for brevity.

 

<apex:page standardController="MyObj__c" extensions="MyController" > ... <apex:repeat value="{!commands}" var="cmd"> <apex:commandLink action="{!cmd.execute}" value="{!cmd.label}" rendered="{!cmd.enabled}" styleClass="actionLink" title="{!cmd.label}" reRender="{!IF(cmd.isDmlCommand,'myPanel','')}" /> <apex:outputText value=" | " /> </apex:repeat> ... </apex:page> public class MyController {

... public ICommand[] commands {get; set;} } public interface ICommand { String getlabel(); Boolean getenabled(); Boolean getisDmlCommand(); PageReference execute(); }

 

 
Message Edited by Gino Basso on 08-17-2009 09:35 AM

I have a component that accepts a Boolean attribute. Certain combinations of inline functions generate the error message shown in the subject line. See code below for details:

 

<!-- this produces the error --> <c:myComponent myBooleanValue="{!LEN(myObj__c.myField__c) == 0}" .../> <!-- this produces the error --> <c:myComponent myBooleanValue="{!LEN(myObj__c.myField__c) = 0}" .../> <!-- this works! --> <c:myComponent myBooleanValue="{!NOT(LEN(myObj__c.myField__c) > 0)}" .../>

 

Obviously I have a workaround (the last example) but I'm curious to know why the other two do not work.

This doesn't seem to be allowed. I've tried inline functions, controller properties, custom component attributes - in all cases the binding is ignored.

 

Is there a restriction on using bindings for this attribute?

I can't seem to access this property either through the $ObjectType global variable or through Apex describe calls.

 

Any suggestions?

 

Clicking the label in the following VF page does not set the focus to the inputText component. When you examine the generated HTML you observe that the id of the for attribute in the outputLabel is incorrect.

 

 

apex:page standardController="MyObj__c"> <apex:form > <apex:pageBlock mode="edit"> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> </apex:pageBlockButtons> <apex:pageMessages ></apex:pageMessages> <apex:pageBlockSection title="Information" showHeader="true"> <apex:pageblockSectionItem > <apex:outputLabel for="typeInput" value="Type"/> <apex:outputPanel id="typePanel"> <apex:actionStatus id="typeStatus"> <apex:facet name="start"> </apex:facet> <apex:facet name="stop"> <c:inputPanel fieldLabel="Type" fieldRequired="true" errorVar="typeError"> <apex:inputText id="typeInput" value="{!MyObj__c.Type__c}" styleClass="{!typeError.errorStyleClass}"/> </c:inputPanel> </apex:facet> </apex:actionStatus> </apex:outputPanel> </apex:pageblockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

If I remove the inputPanel custom component then it works. If I move the inputPanel custom component (and its content) outside of the actionStatus but inside outputPanel (id=typePanel) it also works (which suggests to me that there is not an issue with the custom component).

 

It almost seems that if the component you want to associate the label with is far enough away the id does not generate correctly.

 

This behaviour was observed in API 16.

 

I have a VF edit page where changing one input value affects another (e.g. region and city select lists where selecting the regions filters the selectable list of cities). This was accomplished with actionSupport components as shown:

 

<!-- region --> <apex:pageBlockSectionItem > <apex:outputLabel for="regionSelectList" value="{!$ObjectType.Gem_Event__c.Fields.Region__c.Label}"/> <apex:outputPanel id="regionPanel" layout="none"> <apex:actionStatus id="regionStatus"> <apex:facet name="start"> <img src="{!$Resource.ActionStatusLoading}"/> </apex:facet> <apex:facet name="stop"> <apex:selectList id="regionSelectList" value="{!region}" size="1"> <apex:selectOptions value="{!regionOptions}"/> <apex:actionSupport event="onchange" rerender="cityPanel,formMessages" status="cityStatus" action="{!clearCity}"/> </apex:selectList> </apex:facet> </apex:actionStatus> </apex:outputPanel> </apex:pageBlockSectionItem> <!-- city --> <apex:pageBlockSectionItem > <apex:outputLabel for="citySelectList" value="{!$ObjectType.Gem_Event__c.Fields.Gem_City__c.Label}"/> <apex:outputPanel id="cityPanel" layout="none"> <apex:actionStatus id="cityStatus"> <apex:facet name="start"> <img src="{!$Resource.ActionStatusLoading}"/> </apex:facet> <apex:facet name="stop"> <apex:selectList id="citySelectList" value="{!Gem_Event__c.Gem_City__c}" size="1"> <apex:selectOptions value="{!cityOptions}"/> <apex:actionSupport rendered="{!ISNULL(region)}" event="onchange" rerender="cityPanel,regionPanel,formMessages" status="regionStatus"/> </apex:selectList> </apex:facet> </apex:actionStatus> </apex:outputPanel> </apex:pageBlockSectionItem>

 

 

Then I had need to rerender the entire section when another input field was changed, so I wrapped the entire page block section inside an actionStatus component. Only when I did all this all the start facets of the inner actionStatus components stopped working (the re-rendering continued to work however).

 

Eventually I had to abandon wrapping the entire section within an actionStatus component.

 

Is there a restriction on having nested actionStatus components? 

 

 

 

 

 

 

<apex:form> <apex:actionStatus id="loadingFormDefaultsStatus"> <apex:facet name="start"> <apex:image url="{!$Resource.ActionStatusLoading}"/> <apex:outputText value=" loading defaults..."/> </apex:facet> <apex:facet name="stop"/> </apex:actionStatus> ... </apex:form>

 

 

In the above VF page snippet only the outputText component of the start facet gets rendered. If I switch the order then only the image component gets rendered.

 

I eventually got around this by using standard HTML tags but I was wondering if there was some limitation as to what one could include in an actionStatus facet.

 

This behaviour was observed in API 16.

 

If you create a pageBlockSection the mouseover help for the show/hide icon should include the section title, as in:

 

Show Section - My Section, or

Hide Section - My Section

 

However, after the first mouse click the section title text vanishes and you're left with:

 

Show Section - , or

Hide Section -

 

I believe the root cause of this is that the <img ...> tag in the resulting HTML does not include a name attribute which has the value of the title text (e.g. <img name="My Section" ... />)

 

If you contrast the VF HTML to that of a section on a standard page you'll note this difference.

 

We have Apex code that connects with a 3rd-party web service using 2-way SSL. As such, we're specifing values for clientCert_x and clientCertPasswd_x.
 
We're getting the exception specified in the subject line. My understanding is that the Salesforce servers are rejecting the SSL connection (or communication) because the hostname in the certiificate returned by the 3rd-party server does not match the hostname in the endpoint URL.
 
There are numerous posts on the web about how to overcome this in Java (i.e. server-side), such as replacing the default hostname verifier on the connection object, though obviously such a solution is not available in this particular case.
 
Is there anything that can be done on the Salesforce side to overcome this problem? For example, can additional hostname values be specified that will be allowed in addition to the one in the endpoint?
 
Though neither the retrieve nor the deploy tasks report any errors, the Flex app on the destination instance does not run correctly. On the deployed scontrol I've noticed the following differences (from the source):
 
1. The filename is different (it uses the name of the scontrol).
2. The filename extension is missing.
3. The binary length is slightly smaller.
 
Should one be able to deploy such an scontrol using ANT (i.e. using the Force.com Migration Tool)?
 
I'm deploying a series of Apex classes using the Force.com Migration Tool (i.e. ANT). However, when I specify an explicit test class I get all errors for classes that already exist (the target instance is a sandbox), and have no bearing on the Apex classes I'm deploying. In short, it seems to be running all tests.
 
The classes I'm deploying aren't packaged, and neither are the existing classes which produce the errors.
 
Here's is my ANT task:
 
Code:
    <target name="deployWebSvcPkg">
      <sf:deploy username="${dest.username}" password="${dest.password}" serverurl="${dest.serverurl}" deployRoot="webSvcPkg">
        <runTest>WebSvcTest</runTest>
      </sf:deploy>
    </target>

 
Any ideas as to why these other (existing) classes end up being tested run I run the above task?
 
I've setup a simple S-control (see below) that shows me the current session id (as provided by {!$Api.Session_ID}).
 
When I logout and log back in through the UI (i.e. clicking on the Logout link at the top of the page) I'm seeing the same session id.
 
This happens even after I close my browser (though I do have other browser windows open to other sites).
 
Not only that, but I even went so far as to login (with the same username) on a co-worker's machine and ended up with the same session id!
 
I'm using a Developer sandbox if that makes any difference.
 
My expectation is that if the user explicitly clicks the logout link and then logs back in that a new session id should result...
 
Thanks in advance.
 
S-Control:
 
Code:
<html> 
<head> 
<script src="/soap/ajax/14.0/connection.js"></script> 
<script src="/soap/ajax/14.0/apex.js"></script> 
<script language="JavaScript" type="text/javascript"> 

function init() 
{ 
var session = "{!$Api.Session_ID}"; 
document.write('<font face="Arial" font size="1"/>'); 
document.write("<p>"); 
document.write(session); 
document.write("</p>"); 
} 
</script> 
</head> 
<body onload=init()> 
<p>blah</p> 
</body> 
</html
I have a Flex widget (application) that performs specific SOQL queries rather than the 'broader' query provided by the standard sidebar search (in essence it compliments the standard sidebar search).
 
I've added the Flex widget to the sidebar (using a Home Page component) such that the application is running in the sidebar (i.e. it's not a link).
 
If I enable the option to Show Custom Sidebar Components on All Pages (Setup - User Interface) the application realoads each time you click on a different tab (e.g. Home then Accounts then Contacts).
 
So my question is: Is there any way to prevent this constant reloading?
 
Thanks in advance,
Gino
 
When generating Apex code from a WSDL, if the schema is specified implicitly through a URL (rather than being explicitly included in the WSDL document), will the Salesforce parser be able to successfuly process such a WSDL (assuming the URL is publicly accessible)?
 
We have to integrate with a 3rd-party web service whose WSDL does not define a response message for an operation. More specifically, the message element is provided as follows:
 
<wsdl:message name="OutputMessage" />
 
Salesforce will not generate Apex code from such a WSDL, insisting that a response message be specified.
 
Any suggestions as to possible workarounds? To date I have mocked up a simple response message to at least generate the Apex code, but I'm concerned that Salesforce may reject/fail the empty response returned by the third-party web service as a result.
 
Neither positiveInteger nor nonNegativeInteger seems to be supported by the processor that generates Apex code from a WSDL document. I believe there's another post that complains about the short type as well.
 
Somewhat contrarily, if the integral type has a restriction everything works fine, though if you look at the generated Apex code it would appear that this is just treated as a custom type whose semantics are unknown.
 
This lack of support for these standard types is somewhat onerous in that one is forced to manually alter a third-party WSDL in order to generate the corresponding Apex code.
 
Are there any plans to enhance the WSDL support for Apex?
 
-Gino
 
The WebService method compiles successfully (the access modifier had to be global). But when I view the WSDL the type associated with the class name is an empty sequence. I can invoke the method, but I get nothing back (which one would expect given the WSDL).
 
Thanks,
Gino
 

I was wondering if somebody could help me. I have create a dynamic picklist controller that collects it select list from a custom lookup table

I have a custom field called Municapaly on the Account object and I would like to link and update this field from this new controller 

 

<apex:page standardController="Account" >  <apex:form >  <tr><td>Municapaly</td><td>   <c:Municapaly_Dynamic_Picklist myvalue="1"> </c:Municapaly_Dynamic_Picklist>   </td>  <tr>

  </apex:form></apex:page>  <apex:page standardController="Account" >

  <apex:form >  <tr><td>Municapaly</td><td>   <c:Municapaly_Dynamic_Picklist myvalue="1"> </c:Municapaly_Dynamic_Picklist>   </td>  <tr>

  </apex:form></apex:page>  public class clsMuniciplayDynamicPicklist{    private List<SelectOption> items;       public List<SelectOption> getItems() {         List<SelectOption> items = new List<SelectOption>();         //default value         items.add(new SelectOption('','--Select Record Type --'));        

        for (Lookup_Tables__c lt: [Select l.Type__c, l.Start_Date__c, l.Name, l.End_Date__c, l.Code__c From Lookup_Tables__c l]){           items.add(new SelectOption( lt.Code__c,lt.Name));                 }            return items;     }

}

 
 

I have a javascript function (using Protovis) that draws a dynamic pie chart in my Visualforce page. The pie chart is contained within an outputPanel, and a button at the top of the page rerenders that outputPanel. The javascript works perfectly the first time the page is loaded. However, after the button is pressed and the section rerenders, the javascript never executes a second time -- the pie chart disappears and the alert on line 16 does not fire. How can I make sure my function executes after the rerender event?

 

 

<apex:page controller="devTracking" > <script type="text/javascript" src="{!URLFOR($Resource.Protovis, 'protovis-r3.1.js')}"></script> <apex:form > <apex:commandButton id="goButton" value="Go" action="{!start}" rerender="container"></apex:commandButton> </apex:form> <apex:outputPanel id="container"> <apex:pageBlock title="Sample Protovis Graph"> <script type="text/javascript+protovis"> function renderMe() { alert('debug #1'); var data = pv.range(10).map(Math.random).sort(pv.reverseOrder), w = 400, h = 400, r = w / 2, a = pv.Scale.linear(0, pv.sum(data)).range(0, 2 * Math.PI); var vis = new pv.Panel() .width(w) .height(h); vis.add(pv.Wedge) .data(data) .bottom(w / 2) .left(w / 2) .outerRadius(r) .angle(a) .title(function(d) d) .add(pv.Wedge) // invisible wedge to offset label .visible(function(d) d > .15) .innerRadius(2 * r / 3) .outerRadius(r) .fillStyle(null) .anchor("center").add(pv.Label) .textAngle(0) .text(function(d) d.toFixed(2)); vis.render(); } renderMe(); </script> </apex:pageBlock> </apex:outputPanel> </apex:page>

 

 

 

  • December 27, 2010
  • Like
  • 0

Is there a way to get description information for a custom object field in Visualforce? I have a need to iterate over fields of a custom object and create a layout in 3 columns, column 1 - Label , column 2 - Input field, column 3- description information for that input field.

 

Is this possible in Visualforce? I am trying to replicate a 3 column word document in Salesforce.com.

Hi all,

 

I'm attempting to add to the default page layout of a case object with a Visual Force page.

 

My supposrt staff have mentioned that case comments require too many clicks and page loads to get done, and would like a simple input field on the case page with a save button under it. Entering text, and then clicking save adds the comment to the case and clears the box for the next comment.

 

 

I've attempted to create this but without success. I can't figure out how to put an input field for a new child object on a visual force page.

 

My page looks like this:

 

<apex:page standardController="Case" extensions="caseLogisticsPageCtrlr" tabStyle="Case" > <apex:pageBlock> <apex:form > <apex:pageBlockTable rows="5" value="{!case.CaseComments}" var="cCom"> <apex:column> <apex:inputField value="{!cCom.CommentBody}"/> </apex:column> </apex:pageBlockTable> </apex:form> </apex:pageBlock> </apex:page>

 But as I'm sure you can tell... It just shows input fields from existing comments. 

 

My controller is this:

 

public class caseLogisticsPageCtrlr{ private final Case cse; public caseLogisticsPageCtrlr(ApexPages.StandardController stdController) { this.cse = (Case)stdController.getRecord(); } public Case getCase() { return [select id, CaseNumber, (select id, CommentBody, ParentId from CaseComments limit 5) from Case where id = :System.currentPageReference() .getParameters().get('id')]; } public String getName() { return 'caseLogisticsPageCtrlr'; } }

 

 I think I'm on the wrong track... Can anyone please help me out?

 

Thanks,

Jnic

 

 

 

  • August 07, 2009
  • Like
  • 0
Though neither the retrieve nor the deploy tasks report any errors, the Flex app on the destination instance does not run correctly. On the deployed scontrol I've noticed the following differences (from the source):
 
1. The filename is different (it uses the name of the scontrol).
2. The filename extension is missing.
3. The binary length is slightly smaller.
 
Should one be able to deploy such an scontrol using ANT (i.e. using the Force.com Migration Tool)?
 
// This class updates the Hello field on account records that are passed to it.
public class MyHelloWorld {
public static void addHelloWorld(Account1[] accs){
for (Account a:accs){
if (a.Hello__c != 'World') {
a.Hello__c = 'World';
}
}
}
}
I am a newbee to SF development trying to integrate our product with SF. I want to invoke a web service on a button click. This is what I have done so far:
  • I have added a custom button to Accounts form
  • I have set it up as a On-click javascript type and on-click I am invoking a wrapper class which will invoke the appropriate Apex Webservice class.
  • I have a wsdl which defines the webservice operations
I am trying to generate apex classes from my wsdl. Once I have them generated I can invoke it within the wrapper class.
While one of the namespace gets a class generated, it is giving a compilation error in the other one. As the error message does not have any clear indication, can anyone shed some light on what the issue may be? Feel free to generate from wsdl yourself to check out the error message. Here is a link to the wsdl, I am using: http://www.ascnet.com/~sarathy/CMSSoapService.wsdl
I've setup a simple S-control (see below) that shows me the current session id (as provided by {!$Api.Session_ID}).
 
When I logout and log back in through the UI (i.e. clicking on the Logout link at the top of the page) I'm seeing the same session id.
 
This happens even after I close my browser (though I do have other browser windows open to other sites).
 
Not only that, but I even went so far as to login (with the same username) on a co-worker's machine and ended up with the same session id!
 
I'm using a Developer sandbox if that makes any difference.
 
My expectation is that if the user explicitly clicks the logout link and then logs back in that a new session id should result...
 
Thanks in advance.
 
S-Control:
 
Code:
<html> 
<head> 
<script src="/soap/ajax/14.0/connection.js"></script> 
<script src="/soap/ajax/14.0/apex.js"></script> 
<script language="JavaScript" type="text/javascript"> 

function init() 
{ 
var session = "{!$Api.Session_ID}"; 
document.write('<font face="Arial" font size="1"/>'); 
document.write("<p>"); 
document.write(session); 
document.write("</p>"); 
} 
</script> 
</head> 
<body onload=init()> 
<p>blah</p> 
</body> 
</html
I have a VF Page with a custom controller. It contains a string with get and set methods. This value is passed as a String to a component. The attribute has an assignTo referencing a public string with {get;set;) in the components controller. The value is not available (is null) when acessed in the components constructor but is available shortly after within a command button action. I need the value within the constructor. Any ideas?
The WebService method compiles successfully (the access modifier had to be global). But when I view the WSDL the type associated with the class name is an empty sequence. I can invoke the method, but I get nothing back (which one would expect given the WSDL).
 
Thanks,
Gino