You need to sign in to do that
Don't have an account?
kminev
Databinding with visualforce component and datatable tag
Hi,
I've been trying to resolve an issue with my visual force component which has a datatable with List of objects which are stored in custom controller.
I have <apex:inputField> on this datatable which are bound to Sobject property and any time I click on a button my apex controller does not have the changed value from the user.
Below is my visual force component code:
<apex:component access="global" allowDML="true" controller="ProposalPdfGeneratorCmpExtension" selfClosing="true"> <apex:attribute access="global" name="OpportunityId" required="false" description="This is the opportunity id!" assignTo="{!OpportunityId}" type="Id" /> <apex:attribute access="global" name="ShowProfitMarginColumn" description="This property determines whether profit margin column will be displayed." assignTo="{!showProfitMarginColumn}" type="Boolean"/> <apex:attribute access="global" name="ShowSignature" description="Toggles signature panel!" assignTo="{!showSignature}" type="Boolean"/> <apex:attribute access="global" name="ShowPremiumDiscount" description="Toggles Premium/Discount column!" assignTo="{!showPremiumDiscount}" type="Boolean"/> <apex:stylesheet value="{!$Resource.ProposalCss}"/> <apex:pageMessages id="errors"/> <div align="left" style="float: left; font-size: 10pt;"> <apex:panelGrid columns="1" styleClass="companyTable"> <apex:outputText value="{!$Organization.Name}" styleClass="companyName"/> <apex:outputText value="{!$Organization.Street}"/> <apex:outputText value="{!$Organization.City}, {!$Organization.State} {!$Organization.PostalCode}"/> <apex:outputText value="{!$Organization.Phone}"/> </apex:panelGrid> </div> <div align="right" style="float: right;"> <apex:image url="{!$Resource.MY_Logo}" width="60%" height="60%"/> </div> <div style="clear: both;"/> <div align="center" class="proposalTitle"> <apex:outputLabel styleClass="proposalTitle">{!if(opportunityProposal.Proposal_Name__c != null, opportunityProposal.Proposal_Name__c, opportunityProposal.Name)}</apex:outputLabel> </div> <div style="clear: both;"/> <br/> <br/> <table width="100%" class="tableProposalLines" border="1"> <tr class="tablehead"> <td width="50%">Hours / Days</td> <td width="50%">Monitoring</td> </tr> <tr border="1"> <td>On Call</td> <td>Exchange Connectivity</td> </tr> <tr border="1"> <td>24x7</td> <td>Network, Wan, and Server Infrastructure</td> </tr> </table> <br/><br/> <apex:form > <apex:outputpanel id="panelTable" > <!-- <apex:dataTable id="proposalDataTable" border="1" value="{!opportunityLinesShell}" var="shell" headerClass="tablehead" styleClass="tableProposalLines" width="100%"> <apex:column headerValue="Category" width="100"> <apex:outputLabel value="{!shell.olCategory}"/> </apex:column> <apex:column headerValue="Description"> <apex:dataTable value="{!shell.OpportunityLineItems}" var="ol"> <apex:column > <apex:outputField value="{!ol.Proposal_Description__c}"/> </apex:column> </apex:dataTable> </apex:column> <apex:column headerValue="Quantity"> <apex:dataTable value="{!shell.OpportunityLineItems}" var="ol"> <apex:column > <apex:inputField style="text-align: center;" value="{!ol.Count__c}"/> </apex:column> </apex:dataTable> </apex:column> <apex:column headerValue="Premium / Discount %" width="95" rendered="{!showPremiumDiscount}"> <apex:dataTable value="{!shell.OpportunityLineItems}" id="premiumDiscountTable" var="ol"> <apex:column > <apex:outputField value="{!ol.Premium_Discount_Percent__c}" /> </apex:column> </apex:dataTable> </apex:column> <apex:column headerValue="Retail Price Per" width="95" id="priceColumn" > <apex:dataTable value="{!shell.OpportunityLineItems}" var="ol"> <apex:column > <apex:inputField value="{!ol.Retail_Price__c}" /> </apex:column> </apex:dataTable> </apex:column> <apex:column headerValue="Subtotal" width="95" > <apex:dataTable value="{!shell.OpportunityLineItems}" var="ol"> <apex:column > <apex:outputField value="{!ol.Total_Sale_Price__c}"/> </apex:column> </apex:dataTable> </apex:column> <apex:column headerValue="Profit Margin%" rendered="{!showProfitMarginColumn}"> <apex:dataTable value="{!shell.OpportunityLineItems}" var="ol"> <apex:column > <apex:outputField value="{!ol.Profit_Margin_Percent__c}"/> </apex:column> </apex:dataTable> </apex:column> </apex:dataTable> --> <apex:dataTable value="{!opportunityLineItems}" var="ol"> <apex:column > <apex:inputField value="{!ol.Retail_Price__c}"/> </apex:column> </apex:dataTable> </apex:outputpanel> </apex:form> <div style="clear: both;"/> <br/> <div style="float: right; font-size: 7pt;"> <table class="tablehead"> <tr> <td width="175px">Total One-Time Fee Estimate:</td> <td><apex:outputField value="{!opportunityProposal.SOME_FIELD}"/></td> </tr> <tr> <td>Total Recurring Monthly Fee Estimate:</td> <td><apex:outputField value="{!opportunityProposal.SOME_FIELD}"/></td> </tr> <tr> <td><div style="{!if(showProfitMarginColumn, "display:inline;", "display:none;")}">Profit Margin:</div></td> <td><apex:outputField value="{!opportunityProposal.Profit_Margin__c}" rendered="{!showProfitMarginColumn}"/></td> </tr> <tr> <td><div style="{!if(showProfitMarginColumn, "display:inline;", "display:none;")}">Profit Margin%:</div></td> <td><apex:outputField value="{!opportunityProposal.Profit_Margin_Percent__c}" rendered="{!showProfitMarginColumn}"/></td> </tr> </table> </div> <div style="clear: both;"/> <br/><br/><br/> <apex:dataTable border="1" styleClass="tableProposalLines" value="{!termsAndConditions}" var="tnc" width="100%" > <apex:column > {!if((tnc.T_s_C_s_Proposal_Line__c != null || tnc.T_s_C_s_Proposal_Line__c != ""), tnc.T_s_C_s_Proposal_Line__c, tnc.T_s_C_s_Pre_Defined_Proposal_Line__c)} </apex:column> </apex:dataTable> <c:Proposal_Signature_Cmp id="proposalSignatureCmp" rendered="{!showSignature}"/> <apex:form > <div align="center"> <br/> <apex:commandButton value="Save Proposal Changes" action="{!persistProposalWithOpportunity}" rerender="panelTable" /> </div> </apex:form> </apex:component>
More code will follow...
I am out of options at this point I tried everything.
kminev
kminev