This discussion is archived
3 Replies Latest reply: Apr 5, 2012 2:25 PM by javaRiver RSS

Managed Bean Help for Definition Help

javaRiver Newbie
Currently Being Moderated
I am working on creating Managed Bean Help for Definition Help as described in ‘19.5.3 How to Create Managed Bean Help’ section of the Web User Interface Developer's Guide fpr ADF. Using JDev Version 11.1.2.1.0.

Thought I had all the artifacts assembled but when I run the log message is: <ELHelpProvider> <_getTranslationMap> ELHelpProvider's helpSourceExpression is null.

Any suggestions would be greatly appreciated.

Here is the managed bean:
public class ELHelpProviderProjRequest extends ELHelpProvider {
    
    public ELHelpProviderProjRequest() {        
    }
    
    /* To use the HelpProvider, the EL expression in the helpTopicId attribute must point to a Map, otherwise
       * you will get a coerceToType error. */

    public Map<String, String> getHelpMap()
      {
          Iterator iterator = _HELP_MAP.entrySet().iterator();                 
          while(iterator. hasNext()){        
          System.out.println("hash map entry " + iterator.next());
           }

        return _HELP_MAP;
      }
     
    static private final Map<String, String> _HELP_MAP = new HashMap<String, String>(); 
        static {
          // each element [put] can be for a separate helpTopicId attribute 
          _HELP_MAP.put("MAPHELP_CATEGORY_CAPITAL_DEFINITION", "Map value for credit card definition");
          _HELP_MAP.put("MAPHELP_CATEGORY_OTHER_DEFINITION", "Map value for credit card instructions");          
        }
        
}  
Here is the adf-setting.xml in Application sources / META-INF:
<?xml version="1.0" encoding="windows-1252" ?>

<adf-settings xmlns="http://xmlns.oracle.com/adf/settings" >  
  <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/settings">
  <help-provider prefix="MAPHELP_">
    <help-provider-class>    
        com.corpnet.abc.util.ELHelpProviderProjRequest
    </help-provider-class>
    <property>
      <property-name>helpSource</property-name>
      <value>#{helpTranslationMap.helpMap}</value>
    </property>
  </help-provider>
</adf-faces-config>  
  
</adf-settings>
Here is the faces-config:
<managed-bean>
    <managed-bean-name>helpTranslationMap</managed-bean-name>
    <managed-bean-class> com.corpnet.abc.util.ELHelpProviderProjRequest </managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>
Here is the helpTopicId in the inputText component:
<af:inputText value="Test" inlineStyle="font-weight: bold;" id="it31" simple="true" helpTopicId="MAPHELP_CATEGORY_CAPITAL" readOnly="true"/>
  • 1. Re: Managed Bean Help for Definition Help
    773212 Pro
    Currently Being Moderated
    Making the following two changes should take care this issue:

    1) The managed bean should not extend ELHelpProvider, i.e.
    public class ELHelpProviderProjRequest {
    ...
    2) In the adf-setting.xml use oracle.adf.view.rich.help.ELHelpProvider for the help-provider-class, i.e.
    ...
    <help-provider-class>oracle.adf.view.rich.help.ELHelpProvider</help-provider-class>
    ...
  • 2. Re: Managed Bean Help for Definition Help
    Dana Singleterry Explorer
    Currently Being Moderated
    Register the managed-bean as a help provider in the adf-settings xml like:

    Example 19-9 Registering a Managed Bean as a Help Provider

    <adf-settings xmlns="http://xmlns.oracle.com/adf/settings">
    <adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/settings">
    <help-provider prefix="MAPHELP_">
    <help-provider-class>
    oracle.adf.view.rich.help.ELHelpProvider
    </help-provider-class>
    <property>
    <property-name>helpSource</property-name>
    <value>#{helpTranslationMap.helpMap}</value>
    </property>
    </help-provider>
    </adf-faces-config>
    </adf-settings>

    As you've pointed out, Review section 19.5.3 for more details -> http://docs.oracle.com/cd/E24382_01/web.1112/e16181/af_message.htm#CHDHIGIA

    You could also investigate use the OHW product available here: http://www.oracle.com/technetwork/developer-tools/help/index-083946.html
  • 3. Re: Managed Bean Help for Definition Help
    javaRiver Newbie
    Currently Being Moderated
    The answers are correct and helpful.
    Unfortunately there is a huge error in oracle's documentation 19.5.3 How to Create Managed Bean Help’ section of the Web User Interface Developer's Guide fpr ADF. Using JDev Version 11.1.2.1.0.

    The text and code example directly contradict one another. Probably a copy-and-paste error by the writer. After pasting from a similar section the writer neglected to go and make the necessary changes. This was also missed by the editor. These mistakes cost developers time and money. Disappointing from a company like Oracle that is an industry leader.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points