• xn
  • NEWBIE
  • 55 Points
  • Member since 2009


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies

Right now it seems that anything with the <apex:selectCheckboxes> wont work (regardless of version since I did try bumping it back on both the page and controller). See blog entry for full debugging steps:http://salesforcegirl.blogspot.hu/2013/05/bug-with.html

when trying to use a repeat to populate the Lists via maps it fails as well for both<apex:selectCheckboxes> and <apex:selectList>. But if you do it the long way(like shown bellow), you can get<apex:selectList> to work at the very least, however not the <apex:selectCheckboxes> (which is what i need).

Here is the code:

public class sfg_testBugWithActionButton {

  public String fGrade {get; set;}
  public List<SelectOption> soGrade {get; set;}
  public String resultString {get; set;}

  public sfg_testBugWithActionButton() {
    createfilterMap();
    resultString = 'on Load of page';
  }

  public PageReference preformAction() {
    system.debug('Grade: ' + fGrade);//this wont be hit unless you use selectList
    resultString = 'button action preformed';
    return null;
  }

  private void createfilterMap() {
    soGrade = new List<SelectOption>();
    soGrade.add(new SelectOption('A', 'A'));
    soGrade.add(new SelectOption('B', 'B'));
    soGrade.add(new SelectOption('C', 'C'));
  }

}

Page:

<apex:page showHeader="true" sidebar="true" controller="sfg_testBugWithActionButton">
  <apex:form>
  <apex:outputpanel id="mainWrap">

    <h2>Grade</h2>
    <apex:selectCheckboxes value="{!fGrade}" layout="pageDirection">
      <apex:selectOptions value="{!soGrade}" />
    </apex:selectCheckboxes>

    <apex:commandButton action="{!preformAction}" rerender="renderWrap" value="Submit Action" />
    <br />

    <apex:outputpanel id="renderWrap">
      {!resultString}
    </apex:outputpanel>

  </apex:outputpanel>
  </apex:form>
</apex:page>

I just ran in to a problem where I was trying to reference Apex code that lived in a Managed Package, and even though I had the correct syntax, I just couldn't get my code to compile properly. I'd like to share the solution with you.

 

 Here's a simplified version of the code that was frustrating me:

 

public class PackageExtenderClass{

public PackageExtenderClass(){
}

public String myExtenderMethod(){
String temp = myNamespace.UtilityClass.getRandomString();

return temp;
}
}

 

 The above code is correct in every way, but I couldn't get it to compile - I kept getting this error:

Error: Compile Error: Package Visibility: Type is not visible: utilityclass at line 7 column 26

 

It turns out that in order to solve this problem, I needed to update the Version Settings for my PackageExtenderClass so that it referenced the 1.6 version of the 'myNamespace' Managed Package instead of the older 1.3 version. This is becuase the 1.3 version of the Managed Package didn't include a definition for the getRandomString() method. The getRandomString() method was only added in the 1.6 version of the Managed Package.

 

  • October 21, 2009
  • Like
  • 0

Is there a way to attach a non-error message to an inputField?  We want to render a message like the messages within span.updateMsg tags on the Stay-in-Touch confirmation page (/cntc/cntcupdate/contactverify.jsp).  Should we just use outputText or is there a better way to do this, e.g. something like sObject.field.addMessage(
ApexPages.Message)?

 

Thanks,

Christian

  • August 06, 2009
  • Like
  • 0
Trying to run below code in Developer Console & getting error:
public class Test{
    String abc;
    Integer i;    
       Double d;
        public Test(){
            abc= null;
            i=0;
            d=0.0;
        }
    public Test(String abc,Integer i, Double d){
            this.abc=abc;
            this.i=i;
            this.d=d;
        }
}
Test t = new Test('Test',45,450);
System.debug(t);

Error :UNKNOWN ERROR: apex.bytecodeinterpreter.InterpreterRuntimeException: Unable to load class: esw/anon$Test Error Id: 923405943-75655 (-539347543)

What does it mean?

Right now it seems that anything with the <apex:selectCheckboxes> wont work (regardless of version since I did try bumping it back on both the page and controller). See blog entry for full debugging steps:http://salesforcegirl.blogspot.hu/2013/05/bug-with.html

when trying to use a repeat to populate the Lists via maps it fails as well for both<apex:selectCheckboxes> and <apex:selectList>. But if you do it the long way(like shown bellow), you can get<apex:selectList> to work at the very least, however not the <apex:selectCheckboxes> (which is what i need).

Here is the code:

public class sfg_testBugWithActionButton {

  public String fGrade {get; set;}
  public List<SelectOption> soGrade {get; set;}
  public String resultString {get; set;}

  public sfg_testBugWithActionButton() {
    createfilterMap();
    resultString = 'on Load of page';
  }

  public PageReference preformAction() {
    system.debug('Grade: ' + fGrade);//this wont be hit unless you use selectList
    resultString = 'button action preformed';
    return null;
  }

  private void createfilterMap() {
    soGrade = new List<SelectOption>();
    soGrade.add(new SelectOption('A', 'A'));
    soGrade.add(new SelectOption('B', 'B'));
    soGrade.add(new SelectOption('C', 'C'));
  }

}

Page:

<apex:page showHeader="true" sidebar="true" controller="sfg_testBugWithActionButton">
  <apex:form>
  <apex:outputpanel id="mainWrap">

    <h2>Grade</h2>
    <apex:selectCheckboxes value="{!fGrade}" layout="pageDirection">
      <apex:selectOptions value="{!soGrade}" />
    </apex:selectCheckboxes>

    <apex:commandButton action="{!preformAction}" rerender="renderWrap" value="Submit Action" />
    <br />

    <apex:outputpanel id="renderWrap">
      {!resultString}
    </apex:outputpanel>

  </apex:outputpanel>
  </apex:form>
</apex:page>

I just ran in to a problem where I was trying to reference Apex code that lived in a Managed Package, and even though I had the correct syntax, I just couldn't get my code to compile properly. I'd like to share the solution with you.

 

 Here's a simplified version of the code that was frustrating me:

 

public class PackageExtenderClass{

public PackageExtenderClass(){
}

public String myExtenderMethod(){
String temp = myNamespace.UtilityClass.getRandomString();

return temp;
}
}

 

 The above code is correct in every way, but I couldn't get it to compile - I kept getting this error:

Error: Compile Error: Package Visibility: Type is not visible: utilityclass at line 7 column 26

 

It turns out that in order to solve this problem, I needed to update the Version Settings for my PackageExtenderClass so that it referenced the 1.6 version of the 'myNamespace' Managed Package instead of the older 1.3 version. This is becuase the 1.3 version of the Managed Package didn't include a definition for the getRandomString() method. The getRandomString() method was only added in the 1.6 version of the Managed Package.

 

  • October 21, 2009
  • Like
  • 0

Is there a way to attach a non-error message to an inputField?  We want to render a message like the messages within span.updateMsg tags on the Stay-in-Touch confirmation page (/cntc/cntcupdate/contactverify.jsp).  Should we just use outputText or is there a better way to do this, e.g. something like sObject.field.addMessage(
ApexPages.Message)?

 

Thanks,

Christian

  • August 06, 2009
  • Like
  • 0