function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
theoptheop 

DataTable not populating

Hi, I have a datatable that doesn't seem to want to render in a popup and the data is there. The command links show and function fine, ex: http://puu.sh/2gfL8

 

Any help appreciated, thanks,

Theo

 

@@@this.PopedSpecialEventFees: (evt__Event_Fee__c:{Name=Registration, evt__Description__c=<br>, CurrencyIsoCode=USD, Id=a0rV0000000Owo9IAC, evt__Amount__c=100.00, evt__Category__c=Attendee}, evt__Event_Fee__c:{Name=Lunch Fee, evt__Description__c=<br>, CurrencyIsoCode=USD, Id=a0rV0000000OwoEIAS, evt__Amount__c=20.00, evt__Category__c=Attendee}, evt__Event_Fee__c:{Name=Event Fee Payment - 30 days, evt__Description__c=<br>, CurrencyIsoCode=USD, Id=a0rV0000000OwPWIA0, evt__Amount__c=500.00, evt__Category__c=Attendee}, evt__Event_Fee__c:{Name=Event Fee Payment - 60 days, evt__Description__c=<br>, CurrencyIsoCode=USD, Id=a0rV0000000OwPbIAK, evt__Amount__c=450.00, evt__Category__c=Attendee})

 

 

    public pagereference showSEPopUp(){
        List<evt__Event_Fee__c> tempPopedSpecialEventFees = [SELECT Id, Name, evt__Amount__c, evt__Category__c, evt__Description__c
                                      FROM evt__Event_Fee__c 
                                      WHERE evt__Active__c = true
                                      ORDER BY evt__Order__c];

        
        System.debug('@@@this.PopedSpecialEventFees: ' + this.PopedSpecialEventFees);
        this.sePopup = true;
        
        this.PopedSpecialEventFees = tempPopedSpecialEventFees;
        
        return null;
    }//showPopUp

 

                <apex:actionRegion id="act"> 
                    <apex:outputPanel id="sepopup">
                        <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!sePopup}"/>
                        <apex:outputPanel styleClass="custPopup" id="opanel" layout="block" rendered="{!sePopup}">
                            start
                            <apex:outputPanel id="sefees" >
                                <apex:dataTable value="{!PopedSpecialEventFees}" var="eventfee" id="eventfees">
                                    <apex:column value="{!eventfee.Name}" headerValue="Name"/>
                                    <apex:column value="{!eventfee.evt__Category__c}" headerValue="Category"/>
                                    <apex:column value="{!eventfee.evt__Description__c}"  headerValue="Description"/>
                                    <apex:column value="{!eventfee.evt__Amount__c}"  headerValue="Amount"/>
                                </apex:dataTable>
                            </apex:outputPanel>
                            end
                            <table>
                                <tr>
                                    <td width="20%">
                                        <div style="float:left">
                                            <apex:commandlink action="{!HidePopUps}" rerender="sepopup">
                                                <apex:image style="" id="theCancelImage" value="{!URLFOR($Resource.ACAMS__Resources,'image/cancel.png')}" />
                                            </apex:commandlink>
                                        </div>
                                        <div style="float:right">
                                            <apex:commandlink action="{!AddToCart}" rerender="sepopup">
                                                <apex:image style="" id="theAddToCartImage" value="{!URLFOR($Resource.ACAMS__Resources,'image/addtocart.png')}" />
                                            </apex:commandlink>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            
                        </apex:outputPanel>
                    </apex:outputPanel>
                </apex:actionRegion>

 

Best Answer chosen by Admin (Salesforce Developers) 
Rahul SharmaRahul Sharma
There is issue with rendering, The popup might be opening after click of some button, Try with re-rendering sefees(Id of output panel, containing data-table).

Also remove rendered attribute, just to ensure that you are at-least getting table in UI.

All Answers

Rahul SharmaRahul Sharma
Try initializing the PopedSpecialEventFees list before assigning the value to it.
theoptheop

Thanks Rahul, but no luck, same issue.

 

    // Controller
    public EventsController () {
        
        //Initialize
        this.PopedSpecialEventFees = new List<evt__Event_Fee__c>();
        this.seList = new List<evt__Special_Event__c>();

 

Rahul SharmaRahul Sharma

Okay, So try this out.

 

this.PopedSpecialEventFees.addAll(tempPopedSpecialEventFees);

 

for collecting the list to another list.

theoptheop

It created more table rows but still no data. http://puu.sh/2gk5D

 

    public pagereference showSEPopUp(){
        List<evt__Event_Fee__c> tempPopedSpecialEventFees = new List<evt__Event_Fee__c> ();
            
            tempPopedSpecialEventFees = [SELECT Id, Name, evt__Amount__c, evt__Category__c, evt__Description__c
                                      FROM evt__Event_Fee__c 
                                      WHERE evt__Active__c = true
                                      ORDER BY evt__Order__c];

        
        System.debug('@@@this.PopedSpecialEventFees: ' + this.PopedSpecialEventFees);
        this.sePopup = true;
        this.PopedSpecialEventFees.addAll(tempPopedSpecialEventFees);
        //this.PopedSpecialEventFees = tempPopedSpecialEventFees;
        
        return null;
    }//showPopUp

 

Rahul SharmaRahul Sharma
There is issue with rendering, The popup might be opening after click of some button, Try with re-rendering sefees(Id of output panel, containing data-table).

Also remove rendered attribute, just to ensure that you are at-least getting table in UI.
This was selected as the best answer
theoptheop

That did it, thanks Rahul. I rerended on the datatable id.