Forum Stats

  • 3,872,750 Users
  • 2,266,468 Discussions
  • 7,911,293 Comments

Discussions

Oracle Fusion Trees - Conditional display / formatting of nodes levels base

690077
690077 Member Posts: 17
edited Sep 2, 2009 12:49PM in JDeveloper and ADF
Hi looking for answer to the following please:

I want to use Oracle Fusion Trees - with Conditional display / formatting of nodes levels based on (rendered or display attribute / EL expressions )
eg;
<af:outputText rendered="#{node.name ne null and cartBean.displayNode(node.name)}" where I can pass node values as parameter/s to a backing bean
for conditional logic.
otherwise;
how to use basic IF ELSE logic using fusion ADF tags or something compatible with the ADF TREE TAG & its child elements???

<af:tree value="#{bindings.myView1.treeModel}"
var="node"
binding="#{backingBeanScope.backing_jsp.tree1}"
id="Tree1">

<f:facet name="nodeStamp">
<h:panelGroup id="tree1PG1">
<af:outputText rendered="#{node.name ne null and cartBean.displayNode(node.name)}"
inlineStyle="color:#FF8000;font-weight:bold;width:400px;"
value="#{node.name}" id="tree1OT1"/>
<af:outputText rendered="#{node.grpName ne null}"
value="#{node.grpName}"
inlineStyle="color:#000000;font-weight:bold;width:400px;"
id="tree1OT2"/>
<af:outputText rendered="#{node.title ne null}"
value="#{node.title}" inlineStyle="width:400px;"
id="tree1OT3"/>
</h:panelGroup>
</f:facet>

Edited by: meet.mrnrg on Sep 1, 2009 9:00 AM

Answers

  • Frank Nimphius-Oracle
    Frank Nimphius-Oracle Member Posts: 29,689 Bronze Badge
    Hi,

    have a look at af:switcher


    The switcher component dynamically decides which facet component should be rendered. It has two properties. The switcher will render the facet matching "facetName"; however, if no such facet exists (or "facetName" is null), and "defaultFacet" has been set, then that facet will be used instead. (It's possible to achieve this same functionality by using a panelGroup and binding the "rendered" property of each child, but this component can be simpler. Ordinary children of the switcher component are not rendered at all.)

    The switcher is a purely logical server-side component. It does not generate any content itself and has no client-side representation (no client component). Hence switching which facet of the switcher renders requires a server round-trip.

    You create custom facets per case

    Frank
  • 690077
    690077 Member Posts: 17
    Yes - thanks this is one type of case switching logic, which can be useful.

    the problem is with the current limitations on the level of EL expression language capabilities on the EL expression enabled attributes of various tags.

    1) The Oracle Fusion Expression - BUILDER - currently only allows the following operations;
    #{&&} #{||} #{>} #{<} #{>=} #{<=} #{==} #{!=} #{-} #{!} #{+} #{-} #{*} #{} #{%}

    2) The Oracle Fusion Expression - BUILDER - currently DOES NOT allow;
    a) access to public methods
    b) access to public methods of any return type
    c) access to public methods with any parameter lists

    3) My problem;
    This Works
    <af:outputText rendered="#{node.name ne null}" value="#{node.name}" id="tree1OT1"/>
    This DOES NOT work
    <af:outputText rendered="#{node.name ne null and cartBean.displayNode(node.name)}" value="#{node.name}" id="tree1OT1"/>
    Notice: "and cartBean.displayNode(node.name)" part of the EL Expression

    Inside the Cart Bean - A Session Object Class
    public void displayNode(Object objInst) {
    System.out.println("objInst: " + objInst);
    if (objInst != null) {
    System.out.println("objInst: CLASS: " + objInst.getClass());
    }
    }
This discussion has been closed.