Tips on using af:media to display OrdImage

When you use af:media to display OrdImage type though ADF binding, you are expected to help the binding layer by mentioning the special treatment requirement for the source attribute. Failing to do may result in the following error ;)

javax.el.PropertyNotFoundException: The class 'oracle.ord.im.OrdImageDomain' does not have the property 'media'

Solution is simple, open the page definition and key in CustomInputHandler="OrdDomainValueHandler" for the attribute which is bound to OrdDomain type. The OrdDomainValueHandler class serves as the custom handler for intermedia objects. Note that af:media will use the OrdDomainValueHandler to extract values for specific attributes( source, innerHeight, innerWidth etc. ) which can't be read directly from the associated ViewObject.

Example:

 JSF tag:   
  <af:media source="#{bindings.Image.inputValue.source}"   
      contentType="#{bindings.Image.inputValue.media.mimeType}" id="ot1"/>  
 Page definition entry:  
 <attributeValues IterBinding="ImageView1Iterator"   
      id="Image" CustomInputHandler="OrdDomainValueHandler">  
  <AttrNames>  
      <Item Value="Image"/>  
  </AttrNames>  
 </attributeValues>  

Comments

Ram said…
hi
can you please get a brief description for using to make a video run in the website.. am using oracle jdeveloper 11.1.1.4

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of my employer.