• Alexander Yhap
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
When swal() is called in a Lightning Component and error is thrown: Uncaught (in promise) TypeError: W.attributes.hasOwnProperty is not a function
User-added image

In my debug logs, I am trying to determine where this query is being called. It calls 3 times and causes a limit error. 

Any information will help!

Thanks
I'm trying to rerender an outputPanel when I click a apex:commandLink. 

The status on commadLink gets triggered. & the save() method gets called in the controller (seen in developer console) but the outputPanel does not rerender.

commandLink
<apex:commandLink id="addRoleButton" action="{!save}" value="Add Role" reRender="roleCreationForm" status="refreshstatus" styleclass="slds-button slds-button--neutral slds-col--bump-left" tabindex="99" />

outputPanel
<apex:outputPanel id="rolePanel" rendered="{!RoleList.size!=0}">

HELP ME PLEASE! I've been stuck on this for hours!!!!

I can offer full code, if necessary.

Visualforce
<apex:form id="roleCreationForm" styleclass="roleCreationForm" html-novalidate="novalidate">
    <apex:actionFunction name="rerenderRoleTable" rerender="roleCreationForm" status="refreshstatus"/>

              <!-- <button class="slds-button slds-button--neutral slds-col--bump-left">Add</button> -->

               <!-- <apex:commandButton value="Add Role" id="addRoleButton" styleclass="slds-button slds-button--neutral slds-col--bump-left" tabindex="99" >
                   <apex:actionSupport event="onclick" action="{!save}" rerender="rolePanel" status="refreshstatus"/>
               </apex:commandButton> -->

              <!-- <apex:commandbutton action="{!save}" reRender="roleCard" value="Add Role" id="addRoleButton" styleclass="slds-button slds-button--neutral slds-col--bump-left" tabindex="99" /> -->

              <apex:commandLink id="addRoleButton" action="{!save}" value="Add Role" reRender="roleCreationForm" status="refreshstatus" styleclass="slds-button slds-button--neutral slds-col--bump-left" tabindex="99" />              

<apex:outputPanel id="emptyRoleTable" rendered="{!RoleList.size==0}">
              <table class="slds-table slds-table--bordered slds-no-row-hover slds-table--cell-buffer">
                <thead>
                  <tr class="slds-text-heading--label">
                    <th class="slds-text-heading--label slds-size--3-of-12" scope="col">Name</th>
                    <th class="slds-text-heading--label slds-size--1-of-12" scope="col">Positions</th>
                    <th class="slds-text-heading--label slds-size--3-of-12" scope="col">Template</th>
                    <th class="slds-text-heading--label slds-size--4-of-12" scope="col">Locale</th>
                    <th class="slds-text-heading--label slds-size--1-of-12" scope="col">Days/Options</th>
                    <th class="row-action slds-cell-shrink" scope="col"></th>
                  </tr>
                </thead>
                <tbody></tbody>
              </table>
</apex:outputPanel>   

<apex:actionStatus id="refreshstatus" startstyle="color:green; text-align:center;" startText="Adding...."></apex:actionStatus>

<apex:outputPanel id="rolePanel" rendered="{!RoleList.size!=0}">
  
              <table class="slds-table slds-table--bordered slds-no-row-hover slds-table--cell-buffer">
                <thead>
                  <tr class="slds-text-heading--label">
                    <th class="slds-text-heading--label slds-size--3-of-12" scope="col">Name</th>
                    <th class="slds-text-heading--label slds-size--1-of-12" scope="col">Positions</th>
                    <th class="slds-text-heading--label slds-size--3-of-12" scope="col">Template</th>
                    <th class="slds-text-heading--label slds-size--4-of-12" scope="col">Locale</th>
                    <th class="slds-text-heading--label slds-size--1-of-12" scope="col">Days/Options</th>
                    <th class="row-action slds-cell-shrink" scope="col"></th>
                  </tr>
                </thead>
                <tbody>

  <apex:repeat id="roleRepeat" value="{!RoleList}" var="role">
                  <tr class="slds-hint-parent">
                        <td class="slds-size--3-of-12" data-label="Name">
                          <div class="slds-text-body--regular">{!role.roleName}</div>
                        </td>
                        <td class="slds-size--1-of-12" data-label="Positions">
                          <div class="slds-text-body--regular">{!role.numberOfPositions}</div>
                        </td>
                        <td class="slds-size--3-of-12" data-label="Role Template">
                          <div class="slds-text-body--regular">{!role.roleTemplateName}</div>                                       
                        </td>                                                        
                        <td class="slds-size--4-of-12" data-label="Role Locale">
                          <div class="slds-text-body--regular">{!role.roleLocaleSelected}</div>                                       
                        </td>  
                        <td class="slds-size--1-of-12 slds-text-align--center" data-label="Days/Options">
                          <div class="slds-text-body--regular">

                            <apex:repeat value="{!role.checkDays}" var="day">
                              {!IF(day.isChecked, day.day , "")}
                            </apex:repeat>                          
                             
                          </div>
                        </td>                                                                             
                        <td class="slds-cell-shrink" data-label="Actions">
                          <button class="slds-button slds-button--icon-border slds-button--icon-x-small" type="button" data-aljs="modal" data-aljs-show="modal-1">
                                <svg aria-hidden="true" class="slds-button__icon slds-button__icon--small">
                                      <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{!URLFOR($Resource.SLDS202, '/assets/icons/utility-sprite/svg/symbols.svg#settings')}"></use>
                                </svg>
                                <span class="slds-assistive-text">Days/Options</span>
                          </button>
                        </td>
                  </tr>

  </apex:repeat> 
                </tbody>
              </table>
</apex:outputPanel>

Controller
public RecurringRoleCreation2Controller() {
        RoleList = new List<role>();
    }    

    public void save() {
        role r = new role(roleName, roleLocaleSelected, roleTemplateID, numberOfPositions, isRestoreVolunteer, isCrewLeader, isPhotographer, isGroup, assignDaysToList());
        RoleList.add( r );
    }

 
There are a few things that I need help with & I've looked everywhere...

I am building a Datatable with the Select extension inside a Salesforce Visualforce page. 

I would like to figure out how I can set the associated record inside the Salesforce controller to true when I select it on the Datatable.

I would also like to sum the selected rows and add the value to a cell in the footer.

You can find my code for the page and controller here...

https://jsfiddle.net/a13xy/ho7n121x/1/

Thanks in-advance for any help/insight

 
When swal() is called in a Lightning Component and error is thrown: Uncaught (in promise) TypeError: W.attributes.hasOwnProperty is not a function
There are a few things that I need help with & I've looked everywhere...

I am building a Datatable with the Select extension inside a Salesforce Visualforce page. 

I would like to figure out how I can set the associated record inside the Salesforce controller to true when I select it on the Datatable.

I would also like to sum the selected rows and add the value to a cell in the footer.

You can find my code for the page and controller here...

https://jsfiddle.net/a13xy/ho7n121x/1/

Thanks in-advance for any help/insight

 
I have a dropbox of numbers of records per page. When I select a value the assignPerPage PageReference method is called. If you look at the Visualforce page code, the apex:pageBlockTable calls the currentPage List<wrapPayment>. The desired outcome is when the assignPerPage is changed the pageBlockTable is to be updated, changing the pageSize from 10 to whatever is selected. 

My question is how would I update the list or reevaluate the list to output the correct number of records per page.

User-added image
<apex:tab label="To Be Claimed" name="name1" id="tabOne">
            <apex:pageMessages />
            <apex:form>
                <apex:pageBlock id="toBeID" title="Balance: £{!sumToBeClaimed}" >
                    <apex:pageBlockButtons location="top">
                        <apex:commandButton value="Process Selected" action="{!processSelected}" style="float:right;" rendered="{!IF(toBeTotalRecs==0,false,true)}"/>
                    </apex:pageBlockButtons>
                    <apex:pageBlock>
                        <div style="display:inline;">
                            <apex:outputText value=" {!pageNumber * pageSize} - {!(pageNumber * pageSize) + pageSize} of {!toBeTotalRecs} Results"/>
                        </div>
                        <div style="display:inline; float:right;">
                           Results per page: 
                            <apex:selectList value="{!perPageSelection}" size="1">
                                <apex:selectOptions value="{!perPageNumbers}"></apex:selectOptions>
                                <apex:actionSupport event="onchange" action="{!assignPerPage}" reRender="toBeID"/>
                            </apex:selectList>
                        </div>
                    </apex:pageBlock>

                    <apex:pageBlockTable value="{!currentPage}" var="claimed" id="theaddrs" styleClass="tablesorter" headerClass="header">
                        <apex:column >
                            <apex:facet name="header">
                                <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                            </apex:facet>
                                <apex:inputCheckbox id="inputId" value="{!claimed.selected}"/>
                        </apex:column>
                        <div id="{!claimed.pay.Id}">
                            <apex:column headerValue="Payment No">
                                <apex:outputLink value="{!$Site.Domain}/{!claimed.pay.Id}">{!claimed.pay.Name}</apex:outputLink>
                            </apex:column>
                            <apex:column value="{!claimed.pay.causeview__Constituent__c}" headerValue="Donor"/>
                            <apex:column value="{!claimed.pay.causeview__Date__c}" headerValue="Gift Date" styleClass="header"/>
                            <apex:column value="{!claimed.pay.Gift_Aid_Amount__c}" headerValue="Gift-Aid Amount"/>
                            <apex:column value="{!claimed.pay.Gift_Aid_Declaration__c}" headerValue="Gif-Aid Declaration"/>
                        </div>
                    </apex:pageBlockTable>
                    <apex:pageBlockButtons location="bottom" rendered="{!IF(toBeTotalRecs==0,false,true)}">
                        <apex:commandButton value="First" action="{!first}" rendered="{!isFirst}" rerender="toBeID"/>
                        <apex:commandButton value="Previous" action="{!previousPage}" rendered="{!hasPrevious}" rerender="toBeID"/>
                        <apex:commandButton value="Process Selected" action="{!processSelected}" rendered="false" rerender="toBeID"/>
                        <apex:commandButton value="Next" action="{!nextPage}" rendered="{!hasNext}" rerender="toBeID"/>
                        <apex:commandButton value="Last" action="{!last}" rendered="{!isLast}" rerender="toBeID"/>
                    </apex:pageBlockButtons>

                </apex:pageBlock>
            </apex:form>
        </apex:tab>

public Integer pageSize { get; set; }

    public List<wrapPayment> wrapPaymentList        //  Our collection of the class/wrapper objects wrapPayment
    {
        get
        {
            if ( wrapPaymentList == null )
            {
                wrapPaymentList = new List<wrapPayment>();
                //for ( causeview__Payment__c p : [SELECT Id, causeview__Constituent__c, Gift_Aid_Declaration__c, Name, causeview__Date__c, Gift_Aid_Amount__c, Gift_Aid_Claim_Status__c FROM causeview__Payment__c WHERE Gift_Aid_Claim_Status__c = 'Not claimed' AND Gift_Aid_Elegible__c = true ORDER BY causeview__Date__c DESC] )
                for ( causeview__Payment__c p : [SELECT ID, Name, Gift_Aid_Claim_Status__c, House_Number__c, First_Name__c, Last_Name__c, Postal_Code__c, causeview__Constituent__c, Gift_Aid_Declaration__c, causeview__Date__c, Gift_Aid_Amount__c FROM causeview__Payment__c WHERE Gift_Aid_Claim_Status__c = 'Not claimed' AND Gift_Aid_Elegible__c = true ORDER BY causeview__Date__c DESC] )

                {   //  As each contact is processed we create a new cContact object
                    //  and add it to the contactList
                    wrapPaymentList.add( new wrapPayment( p ) );
                }
            }
            return wrapPaymentList;
        }
        private set;
    }

public Integer pageNumber { get; set; }

public Integer numberOfPages { get; set; }

private List<List<wrapPayment>> list_Pages
    {
        get
        {
            if ( list_Pages == null )
            {
                list_Pages = new List<List<wrapPayment>>();
                Integer numInPage = pageSize;
                List<wrapPayment> thePage;

                if(wrapPaymentList.size() > 0) {
                    for ( wrapPayment pPay : wrapPaymentList )
                    {
                        if ( numInPage >= pageSize )
                        {
                            thePage = new List<wrapPayment>();
                            list_Pages.add( thePage );
                            numInPage = 0;
                        }
                        thePage.add( pPay );
                        numInPage++;
                    }
                }
            }
            if(list_Pages.size() >0){numberOfPages = list_Pages.size() - 1;}

            System.Debug('list_Pages: '+list_Pages);
            return list_Pages;
        }
        private set;
    }

    public List<wrapPayment> currentPage  { get {

        If(list_Pages!=null && list_Pages.size() > 0){
            return list_Pages[ pageNumber ];
        }
        else{
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO,'No record to be claimed.');
            ApexPages.addMessage(myMsg);
            return null;
        }

    }}

    public PageReference assignPerPage() {
        pageSize = perPageSelection;
        return null;
    }