• Mike Schumacher 2
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I have a wrapper class defined and a method that is expecting a <list> of the wrapper class.  I get the error 'method does not exist or incorrect signature: void methodname<list>.......

Here is the simple class:
public class Test_ClassWrapper {
    public static void miketest3(List<MikeRecordWrapper> mRecord) {
        System.debug('....in miketest3 routine');
    }
    
    public class MikeRecordWrapper {
        public String Mike1;
        public String Mike2;
    }

}

When I create a test class to pass a wrapper list I receive my compliation error message.

Test Script:
@isTest (SeeAllData=true)
public class Test_ClassWrapper_Test {

    static testMethod void Test_ClassWrapper_Test() {
        
        MikeRecordWrapper mr = new MikeRecordWrapper();
        mr.Mike1 = 'test';
        mr.Mike2 = 'test2';
        //create my wrapper list
        List<MikeRecordWrapper> mikerecordList = new List<MikeRecordWrapper>();
        mikerecordList.add(mr);
        Test_ClassWrapper.miketest3( mikerecordList);
    }
   
    public class MikeRecordWrapper {
        public String Mike1;
        public String Mike2;
    }

}

I get the error on line "Test_ClassWrapper.miketest3( mikerecordList);"

Error:
Method does not exist or incorrect signature: void miketest3(List<Test_ClassWrapper_Test.MikeRecordWrapper>) from the type Test_ClassWrapper

If I change the classes to just pass a simple list of strings no error message.  I thought I could then pass a list of my custom wrapper.

Any asistance is appreciated.

Thanks
Mike
 
I am trying to display all the invitees from an event in a visualforce page.  I am using the EventRelations query in the Event as shown in other posts.  That seems to be working ok.   I have been able to reference the information from the EventRelations queryresult but had to list the array value.  I want to simply list the Names of the Invitees to an event on a separate row like this:

Mike Schumacher
Kristen Bazin
Olivier Kerdiles

I am struggling with the best practice and syntax to reference data from a SOQL where the WSDL defines a field as a 'tns:QueryResult'

**apex class**
public class Provi_VisitReport_SOQL {
public List<Event> Events2 {get; set;}
public Provi_VisitReport_SOQL(){

Events2 =
[select e.Id,e.Subject,e.Type,e.EndDateTime,e.CreatedBy.Full_Name__c,e.Account.Name,e.WhatId,
 e.What.Name,e.WhoId,e.AccountId,
 (Select Id, RelationId, EventId, Status, Relation.Name From EventRelations)
 from Event e where e.WhatId = :lVRId and IsChild = false and
EndDateTime > Today];
}  
}


**Visualforce page code**
        <apex:pageBlockTable value="{!Events2}" var="Event2">
            <apex:column >
                <apex:facet name="header">Active Event Subject</apex:facet>
                <apex:outputText value="{!Event2.Subject}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">Id</apex:facet>
                <apex:outputText value="{!Event2.Id}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">EventRelations Info</apex:facet>
                <apex:outputText value="{!Event2.EventRelations[0].Relation.Name}"/>
            </apex:column>
        </apex:pageBlockTable>



 
I created a VF page with javascript to set a date field as disabled when a checkbox is unchecked.  I then wanted to function to also execute onload so the date field would be disabled if the checkbox was unchecked or enabled when the checkbox was checked.  

I noticed in the window.onload event accessing $component.xxx returned null.  If I move a field outside the apex:form tags, I can get the $component.xxx ID as expected.

I am able to pass the VF $component.id to the javascript routine but how do I get the form field ID during the onload event?  I must be missing something basic at this point.  Any assistance is appreciated.

*** Here is the VF code. ***

<apex:page standardController="OpportunityLineItem" showHeader="true" sidebar="true">
    <apex:form id="myForm" >

        <script type="text/javascript">
            function ToggleInput(theId,overrideId)
            {
                var e = document.getElementById(theId);
                var a = document.getElementById(overrideId).checked;
               
                if(e != null)
                {
                    if(a === true)
                    {
                    e.disabled = false;
                    } else
                    {
                    //e.disabled = (e.disabled ? false : "disabled");
                    e.disabled = true;
                    }
                }
            }
           
            //window.onload = function () {document.getElementById('{!$Component.liItemShipDate}').disabled= "disabled"; }
            window.onload = function()
            {
                alert(document.getElementById('{!$Component.liItemShipDate}'));
            }
 
        </script>

        <apex:sectionHeader id="pgSection" title="Opportunity Product Edit" subtitle="{!OpportunityLineItem.Name}" />
        <apex:pageBlock id="pgBlock" mode="edit" title="Opportunity Product Edit">

            <apex:pageBlockButtons location="both">
                <apex:commandButton value="Save" action="{!Save}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageBlockButtons>
        <apex:pageBlockSection id="pgBlockSectionAcctInfo" title="" collapsible="false" columns="2" >
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Opportunity</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.OpportunityId}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Machine #</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Machine__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Product</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.Product2Id}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Quantity</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Quantity}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Product Family</apex:outputLabel>
                <apex:inputField id="actOwner" value="{!OpportunityLineItem.Product_Family__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Sales Price</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.UnitPrice}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Product Type</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.Product_TypeTEXT__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Discount Percentage</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Discount}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >List Price</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.ListPrice}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Total Price</apex:outputLabel>
                <apex:outputField id="actRating" value="{!OpportunityLineItem.TotalPrice}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Serial Number</apex:outputLabel>
                <apex:inputField id="actOwner" value="{!OpportunityLineItem.Serial_Number__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Asset</apex:outputLabel>
                <apex:inputField id="actOwner" value="{!OpportunityLineItem.Asset__c}" />
            </apex:pageBlockSectionItem>

        <!--
        <apex:inputCheckbox onclick="ToggleInput('{!$Component.textInput}');" value="{!OpportunityLineItem.Override_Opp_Ship_Date__c}"/>
        <apex:inputField id="textInput" value="{!OpportunityLineItem.Ship_Date__c}"/>
        -->
       
                <apex:inputCheckbox id="liItemOverride" onclick="ToggleInput('{!$Component.liItemShipDate}','{!$Component.liItemOverride}');" value="{!OpportunityLineItem.Override_Opp_Ship_Date__c}" />
                <apex:inputField id="liItemShipDate" value="{!OpportunityLineItem.Ship_Date__c}" />
       
          
        </apex:pageBlockSection>
          
        <apex:pageBlockSection id="pgBlockSectionAdditionalInformation" title="Description" collapsible="false" columns="2">
            <!--ANY CUSTOM FIELDS / ADDITIONAL INFORMATION CAN GO HERE-->
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Line Description</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Description}" />
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form> 
</apex:page>
 
I have a wrapper class defined and a method that is expecting a <list> of the wrapper class.  I get the error 'method does not exist or incorrect signature: void methodname<list>.......

Here is the simple class:
public class Test_ClassWrapper {
    public static void miketest3(List<MikeRecordWrapper> mRecord) {
        System.debug('....in miketest3 routine');
    }
    
    public class MikeRecordWrapper {
        public String Mike1;
        public String Mike2;
    }

}

When I create a test class to pass a wrapper list I receive my compliation error message.

Test Script:
@isTest (SeeAllData=true)
public class Test_ClassWrapper_Test {

    static testMethod void Test_ClassWrapper_Test() {
        
        MikeRecordWrapper mr = new MikeRecordWrapper();
        mr.Mike1 = 'test';
        mr.Mike2 = 'test2';
        //create my wrapper list
        List<MikeRecordWrapper> mikerecordList = new List<MikeRecordWrapper>();
        mikerecordList.add(mr);
        Test_ClassWrapper.miketest3( mikerecordList);
    }
   
    public class MikeRecordWrapper {
        public String Mike1;
        public String Mike2;
    }

}

I get the error on line "Test_ClassWrapper.miketest3( mikerecordList);"

Error:
Method does not exist or incorrect signature: void miketest3(List<Test_ClassWrapper_Test.MikeRecordWrapper>) from the type Test_ClassWrapper

If I change the classes to just pass a simple list of strings no error message.  I thought I could then pass a list of my custom wrapper.

Any asistance is appreciated.

Thanks
Mike
 
I created a VF page with javascript to set a date field as disabled when a checkbox is unchecked.  I then wanted to function to also execute onload so the date field would be disabled if the checkbox was unchecked or enabled when the checkbox was checked.  

I noticed in the window.onload event accessing $component.xxx returned null.  If I move a field outside the apex:form tags, I can get the $component.xxx ID as expected.

I am able to pass the VF $component.id to the javascript routine but how do I get the form field ID during the onload event?  I must be missing something basic at this point.  Any assistance is appreciated.

*** Here is the VF code. ***

<apex:page standardController="OpportunityLineItem" showHeader="true" sidebar="true">
    <apex:form id="myForm" >

        <script type="text/javascript">
            function ToggleInput(theId,overrideId)
            {
                var e = document.getElementById(theId);
                var a = document.getElementById(overrideId).checked;
               
                if(e != null)
                {
                    if(a === true)
                    {
                    e.disabled = false;
                    } else
                    {
                    //e.disabled = (e.disabled ? false : "disabled");
                    e.disabled = true;
                    }
                }
            }
           
            //window.onload = function () {document.getElementById('{!$Component.liItemShipDate}').disabled= "disabled"; }
            window.onload = function()
            {
                alert(document.getElementById('{!$Component.liItemShipDate}'));
            }
 
        </script>

        <apex:sectionHeader id="pgSection" title="Opportunity Product Edit" subtitle="{!OpportunityLineItem.Name}" />
        <apex:pageBlock id="pgBlock" mode="edit" title="Opportunity Product Edit">

            <apex:pageBlockButtons location="both">
                <apex:commandButton value="Save" action="{!Save}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageBlockButtons>
        <apex:pageBlockSection id="pgBlockSectionAcctInfo" title="" collapsible="false" columns="2" >
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Opportunity</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.OpportunityId}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Machine #</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Machine__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Product</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.Product2Id}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Quantity</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Quantity}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Product Family</apex:outputLabel>
                <apex:inputField id="actOwner" value="{!OpportunityLineItem.Product_Family__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Sales Price</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.UnitPrice}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Product Type</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.Product_TypeTEXT__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Discount Percentage</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Discount}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >List Price</apex:outputLabel>
                <apex:outputField id="actOwner" value="{!OpportunityLineItem.ListPrice}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Total Price</apex:outputLabel>
                <apex:outputField id="actRating" value="{!OpportunityLineItem.TotalPrice}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Serial Number</apex:outputLabel>
                <apex:inputField id="actOwner" value="{!OpportunityLineItem.Serial_Number__c}" />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Asset</apex:outputLabel>
                <apex:inputField id="actOwner" value="{!OpportunityLineItem.Asset__c}" />
            </apex:pageBlockSectionItem>

        <!--
        <apex:inputCheckbox onclick="ToggleInput('{!$Component.textInput}');" value="{!OpportunityLineItem.Override_Opp_Ship_Date__c}"/>
        <apex:inputField id="textInput" value="{!OpportunityLineItem.Ship_Date__c}"/>
        -->
       
                <apex:inputCheckbox id="liItemOverride" onclick="ToggleInput('{!$Component.liItemShipDate}','{!$Component.liItemOverride}');" value="{!OpportunityLineItem.Override_Opp_Ship_Date__c}" />
                <apex:inputField id="liItemShipDate" value="{!OpportunityLineItem.Ship_Date__c}" />
       
          
        </apex:pageBlockSection>
          
        <apex:pageBlockSection id="pgBlockSectionAdditionalInformation" title="Description" collapsible="false" columns="2">
            <!--ANY CUSTOM FIELDS / ADDITIONAL INFORMATION CAN GO HERE-->
            <apex:pageBlockSectionItem >
                <apex:outputLabel >Line Description</apex:outputLabel>
                <apex:inputField id="actRating" value="{!OpportunityLineItem.Description}" />
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form> 
</apex:page>