When JDeveloper IDE doesn't render the visual editor

Posted by Frank Nimphius on Oracle Blogs See other posts from Oracle Blogs or by Frank Nimphius
Published on Thu, 21 Jun 2012 15:02:33 +0000 Indexed on 2012/06/21 21:20 UTC
Read the original article Hit count: 221

Filed under:

Though with Oracle JDeveloper 11g the problem of the IDE not rendering JSF pages properly in the visual editor has become rare, there always is a way for the creative to break IDE functionality. A possible reason for the visual editor in JDeveloper to break is a failed dependency reference, which often is in a custom JSF PhaseListener configured in the faces-config.xml file. To avoid this from happening, surround the code in your PhaseListener class with the following statement (for example in the afterPhase method)

public void afterPhase(PhaseEvent phaseEvent) {
  if(!ADFContext.getCurrent().isDesigntime()){
    ... listener code here ...
  }
}

The reason why the visual editor in Oracle JDeveloper fails rendering the WYSIWYG view has to do with how the live preview is created. To produce the visual display of a view, JDeveloper actually runs the ADF Faces view in JSF, which then also invokes defined PhaseListeners. With the code above, you check whether the PhaseListener code is executed at runtime or design time.If it is executed in design time, you ignore all calls to external resources that are not available at design time.

© Oracle Blogs or respective owner

Related posts about /Oracle/JDeveloper