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
Lawrence-AccentureLawrence-Accenture 

VF Error: Unknown property 'SObjectScriptRow.Custom_Field__c' with dynamic components

We are trying to use dynamic components/Apex to render the following PageBlockTable with a mix of input and output fields across a list of records:

<apex:pageblock title="New">
    <apex:pageBlockTable value="{!newItemsList}" var="new">
        <apex:column value="{!new.Name}"/>
        <apex:column headerValue="Quantity">
            <apex:inputField value="{!new.Quantity__c}" Id="Quantity"/>
        </apex:column>

This VF works fine as straight VF on the page, but we need to render this as a dynamic component. The output fields work fine, and the display of the input fields works fine as well, but when we submit the page (even without changing the value in the field), we get the following error:

Unknown property 'SObjectScriptRow.Quantity__c'
Error is in expression '{!rowRec.Quantity__c}' in component <apex:page> in page listItems

I can find nothing in the documentation, or elsewhere online related to "SObjectScriptRow". I know "Quantity__c" is a valid field on our records because it is able to render it correctly.

My theory is that the VF code/dynamic component code is loosing track of the source record when the page is being submitted and doesn't know what object the "rowRec"/"SObjectScriptRow" reference refers to for that field.

I know inputFields work through dynamic components as we have other dynamic components with input fields that do work. But those are in PageBlockSections and not in PageBlockTables (which also means there is only one record that those input fields are associated with, whereas in the PageBlockTable, there may be multiple rows that the VF engine has to iterate over to generate the table).

Any thoughts on what is wrong here? Or on how I can fix it?

Anyone from Salesforce who can confirm that this is or is not a bug in the underlying VF code?

Thanks,

---Lawrence
logontokartiklogontokartik
Can you please post the code that you are using to create dynamic components in Visualforce page?