Client side code snipets

classes covered : AdfBaseEvent, AdfCustomEvent, AdfUITree, AdfRowKeySetChangeEvent, AdfUIComponent

<script>
 function clientMethodCall(
AdfBaseEvent.event)
   {                  
      component =
AdfBaseEvent.event.getSource();       
     
AdfCustomEvent.queue(component,"customEvent",{payload:
      component.getSubmittedValue()}, true);                                
      event.cancel();
   }      
 </script>
   
<af:inputtext label="type in data">
<af:clientlistener method="clientMethodCall" type="keyUp">
<af:serverlistener type="customEvent" method="#{customBean.handleRequest}">
</af:serverlistener>

Bean code

    public void handleRequest(ClientEvent event){
        System.out.println("---"+event.getParameters().get("payload"));
    } 

isPathExpanded(Object), setDisclosedRowKey() - Method in AdfUITree - org.apache.myjs.trinidad.component.AdfUITree
getAddedSet() - Method in AdfRowKeySetChangeEvent

af:tree id="tree1" value="#{bindings.DepartmentsView11.treeModel}" var="node" selectionlistener="#{bindings.DepartmentsView11.treeModel.makeCurrent}" rowselection="single">
    <f:facet name="nodeStamp">
      <af:outputtext value="#{node}">
    </af:outputtext>
    <af:clientlistener method="expandNode" type="selection">
  </af:clientlistener>
<!--[CDATA[
 <script>
function expandNode(event){
var _tree = event.getSource();
rwKeySet = event.getAddedSet();
var firstRowKey;
for(rowKey in rwKeySet){
firstRowKey  = rowKey;
break;
}
if (_tree.isPathExpanded(firstRowKey)){
_tree.setDisclosedRowKey(firstRowKey,false);
}
else{
_tree.setDisclosedRowKey(firstRowKey,true);
}
}
</script> ]]-->
   </af:tree>
</af:clientlistener></af:inputtext></f:facet></af:panelformlayout></af:form></af:document>

Bean code

public void handleRequest(ClientEvent event){ System.out.println("---"+event.getParameters().get("payload")); }

===============================================================
getPeer() - Method in AdfUIComponent
<script>
function showMenu(event){
var adfRichMenu = event.getSource();
adfRichMenu.getPeer().show(null,true);
}

<af:menuBar>
<af:menu text="Main Menu 1">
<af:commandMenuItem text="Sub Menu 1_1"/>
<af:clientListener method="showMenu" type="mouseOver"/>
</af:menu>
<af:menu text="Main Menu 2">
<af:commandMenuItem text="Sub Menu 2_1"/>
<af:commandMenuItem text="Sub Menu 2_2"/>
<af:clientListener method="showMenu" type="mouseOver"/>
</af:menu>
</af:menuBar>

http://www.oracle.com/technology/products/jdev/tips/fnimphius/rc_expand_menu_on_mouse_over.html

===============================================================
more examples by frank
http://thepeninsulasedge.com/frank_nimphius/adf-faces-rich-client-javascript-programming/
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

bocadmin_ww

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today