3

UPDATED:

The below answer was incomplete and here is the complete answer to my question:

If you really want an Sobject type declare attribute as an sobject

<apex:attribute name="CaseNumber" description="Case Number" type="<name_of_your_object>" required="true"/>

<apex:inputField id="cn" value="{!CaseNumber.<field_name>}"/>

Hope this will help others.

I'm creating a VF Component page and I'm not sure why I'm getting this error:

Error: Could not resolve the entity from value binding '{!CaseNumber}'. can only be used with SObjects, or objects that are Visualforce field component resolvable.

<apex:component>

    <apex:attribute name="CaseNumber" description="Case Number" type="String" required="true"/>    

 <apex:pageBlockSection title="Item Detail " columns="1" showHeader="true" > 
      <apex:outputPanel layout="none">
       <table class="list" border="0" cellpadding="0" cellspacing="0"  >
         <tr >
           <td>Case Number</td>
           <td style="text-align:left;"><apex:inputField id="cn" value="{!CaseNumber}"/></td>
         </tr>
       </table>
 </apex:outputPanel>
</apex:pageBlockSection>

</apex:component> 
3

The problem here is you are using apex:inputField that requires an Sobject .

If your attribute type is String just use apex:inputText instead

<apex:inputText id="cn" value="{!CaseNumber}"/>

If you really want an Sobject type declare attribute as an sobject

<apex:attribute name="CaseNumber" description="Case Number" type="Case" required="true"/>
  • I want to use Sobject type.... Type case is a name of the object? You mean – Nick Kahn Feb 29 '16 at 3:54
  • @AbuHamzah Yes .Its name of the object – Mohith Shrivastava Feb 29 '16 at 3:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.