JDEV 10.1.2 UIX Tree Event Handler
Hi,
I have built my tree bound to two ADF entities/views.
It works fine in a small standalone application, but as soon as I try to integrate it with my main app it fails to call either the "null" or the "expand" event handler (null for page rendering and expand for... well expanding the node (see below))
I've run it in debug and the event code just isn't getting fired
There must be something in my main app that is intercepting the event handler before it gets to my uix handlers.
New to all this so any help greatly appreciated!
In summary, what would intercept default event handling in a uix page.
Thanks
Mark
<handlers>
<event name="expand">
<method class="view.TreeUtils" method="doTreeEvent"/>
</event>
<event name="null">
<method class="view.TreeUtils" method="doTreeEvent"/>
</event>
</handlers>
Hi,
it appears that if I change the forward to have 'redirect="true"' within the struts config file then this works fine now.
Mark
Similar Messages
-
Jdev 10.1.2 UIX: How to handle page event and also follow link destination
Hello guys, I think this should be easy:
I have a frame with a link that produces an event which is handled by an event handler. But this link also has destination and targetFrame attributes.
The event handling just updates the visual state of the frame which contains the link, but I also need the link to load the destination into the targetFrame, but this is not happening, just the event is handled but the link doesn't work.
How can I get both, the event handling and the destination, work?
Here is the code for the link:
<link text="${uix.current.title}" destination="${uix.current.destination}"
targetFrame="main">
<primaryClientAction>
<fireAction event="optionClick">
<parameters>
<parameter key="clickedIndex" value="${uix.current.index}" />
</parameters>
</fireAction>
</primaryClientAction>
</link>Thanks
FerThanks to everyone who read it. I figured out how to solve this.
The workaround was to set every link destination to one action which performs 2 things:
1. Update the visual state of the first frame (setting attributes to a session object) and;
2. Puts the destination that I wanted to be loaded into the second frame as a request attribute;
besides all the above, the link had its targetFrame set to "_parent", so the Frameset page was reloaded and therefore reloaded both frames, this way the first frame renders updated (thanks to the changes made to the session object) and the second frame has its source attribute bound to ${requestScope.frameDestination} to load the desired page (actually a struts action).
Hope this helps someone else.
Bye. -
Hi All,
I amd currently developing an ALV tree program to capture the hierarchy of functional location. I managed to display the hierarchy in ALV Tree using cl_gui_column_tree.
Now, i am working on double clicking the functional location and it will bring me to tcode IL03. But, it seems like i cannot capture of the field value clicked. Below are my source code. Can anyone pls help me on this? Thank you very much
*& Form register_events
text
--> p1 text
<-- p2 text
FORM register_events .
Define the events which will be passed to the backend
DATA: lt_events TYPE cntl_simple_events,
l_event TYPE cntl_simple_event.
CALL METHOD gd_tree->get_registered_events
IMPORTING
events = lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_item_double_click.
l_event-appl_event = 'X'.
APPEND l_event TO lt_events.
CALL METHOD gd_tree->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
IF sy-subrc <> 0.
MESSAGE x208(00) WITH 'ERROR'.
ENDIF.
Set Handler
DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
CREATE OBJECT l_event_receiver.
SET HANDLER l_event_receiver->handle_item_double_click FOR gd_tree.
ENDFORM. " register_events
CLASS lcl_tree_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_item_double_click
FOR EVENT item_double_click OF cl_gui_alv_tree
IMPORTING node_key
fieldname.
ENDCLASS. "lcl_tree_event_receiver DEFINITION
CLASS lcl_tree_event_receiver IMPLEMENTATION.
METHOD handle_item_double_click.
DATA: lt_selected_nodes TYPE lvc_nkey,
lt_fieldname TYPE lvc_fname.
Determine which line is selected
CALL METHOD gd_tree->get_selected_item
IMPORTING
e_selected_node = lt_selected_nodes
e_fieldname = lt_fieldname.
CALL METHOD cl_gui_cfw=>flush.
SET PARAMETER ID 'IFL' FIELD lt_fieldname.
SET PARAMETER ID 'ISR' FIELD 'MOB01'.
CALL TRANSACTION 'IL03' AND SKIP FIRST SCREEN.
ENDMETHOD. "handle_item_double_click
ENDCLASS. "lcl_tree_event_receiver IMPLEMENTATIONHello Goh
Based on your coding you are using CL_GUI_ALV_TREE instead of CL_GUI_COLUMN_TREE.
Calling method get_selected_item within your event handler method is unnecessary because these data are already provided by the event interface.
[code]METHOD handle_item_double_click.
DATA: lt_selected_nodes TYPE lvc_nkey,
lt_fieldname TYPE lvc_fname.
*$Comment: unnecessary because these data are already provided
by the event interface (IMPORTING nodekey fieldname).
Determine which line is selected
**CALL METHOD gd_tree->get_selected_item
**IMPORTING
**e_selected_node = lt_selected_nodes
**e_fieldname = lt_fieldname.
ENDMETHOD. "handle_item_double_click[/code]
The following sample is based in report BCALV_TREE_04 but can be simply applied to your application:
[code] METHOD handle_item_double_click.
define local data
DATA:
ls_outtab TYPE sflight.
FIELD-SYMBOLS:
<ld_fld> TYPE ANY.
Call this method to get the values of the selected tree line
CALL METHOD g_alv_tree->get_outtab_line
EXPORTING
i_node_key = node_key
IMPORTING
e_outtab_line = ls_outtab
E_NODE_TEXT =
et_item_layout =
ES_NODE_LAYOUT =
EXCEPTIONS
node_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ASSIGN COMPONENT fieldname OF STRUCTURE ls_outtab TO <ld_fld>.
IF ( <ld_fld> IS ASSIGNED ).
... Call transaction with selected (item) value.
ENDIF.
ENDMETHOD. "handle_item_double_click[/code]
The ASSIGN statement will work if no item of the hierarchy part is selected.
Regards
Uwe -
Hi,
I had a Tlayout.In that the left view is a Tree. When I clicked a particular element in the Tree on the left View I want the details of it to be displayed in the right View. What is the code for handling the click event of a tree and load a view corresponding to the clicked element and display it in right view.
Thanks in Advance
Safeer.IError Summary
While processing the current request, an exception occured which could not be handled by the application or the framework.
If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
Root Cause
The initial exception that caused the request to fail, was:
java.lang.NullPointerException
at hbs.saf.TreeTut1View.wdDoModifyView(TreeTut1View.java:234)
at hbs.saf.wdp.InternalTreeTut1View.wdDoModifyView(InternalTreeTut1View.java:220)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:308)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:480)
... 27 more
See full exception chain for details.
System Environment
Client
Web Dynpro Client Type HTML Client
User agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Version null
DOM version null
Client Type msie6
Client Type Profile ie6
ActiveX enabled
Cookies enabled
Frames enabled
Java Applets enabled
JavaScript enabled
Tables enabled
VB Script enabled
Server
Web Dynpro Runtime Vendor: SAP, build ID: 7.0007.20060331081328.0000 (release=645_VAL_REL, buildtime=2006-03-31:06:24:04[UTC], changelist=396896, host=pwdfm101), build date: Wed Mar 28 16:13:15 GMT+05:30 2007
J2EE Engine No information available
Java VM Java HotSpot(TM) Server VM, version:1.4.2_12-b03, vendor: Sun Microsystems Inc.
Operating system Windows 2003, version: 5.2, architecture: x86
Session & Other
Session Locale en_US
Time of Failure Tue Jul 31 11:10:50 GMT+05:30 2007 (Java Time: 1185860450203)
Web Dynpro Code Generation Infos
local/TreeTut1
SapDictionaryGenerationCore 7.0009.20060802115015.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:24:21[UTC], changelist=413123, host=PWDFM101.wdf.sap.corp)
SapDictionaryGenerationTemplates (unknown)
SapGenerationFrameworkCore 7.0009.20060719095755.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:12:57[UTC], changelist=411255, host=PWDFM101.wdf.sap.corp)
SapIdeWebDynproCheckLayer 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:00[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)
SapMetamodelCommon 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:46[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)
SapMetamodelCore 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:38[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)
SapMetamodelDictionary 7.0009.20060719095619.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:21:59[UTC], changelist=411251, host=PWDFM101.wdf.sap.corp)
SapMetamodelWebDynpro 7.0009.20060428190938.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:26:52[UTC], changelist=400815, host=PWDFM101.wdf.sap.corp)
SapWebDynproGenerationCTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)
SapWebDynproGenerationCore 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:11[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)
SapWebDynproGenerationTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)
sap.com/tcwddispwda
No information available null
sap.com/tcwdcorecomp
No information available null
Detailed Error Information
Detailed Exception Chain
java.lang.NullPointerException
at hbs.saf.TreeTut1View.wdDoModifyView(TreeTut1View.java:234)
at hbs.saf.wdp.InternalTreeTut1View.wdDoModifyView(InternalTreeTut1View.java:220)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:308)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:480)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:330)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:297)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:706)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:660)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:228)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:56)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) -
UIX choice component event handling
Hi, I am using UIX in JDEV 10G. My page has a few dependent uix choice components on it. The first choice populates the second choice box and so on. I am using primaryClientActions to handle firing the event of populating the choice box. Below is the EventHandler for the fired event. I have a viewObject and AppModule. I set the where clause on the viewobject with the parameters from the previous choice selection. My question is: How do I get my query results back to my UIX choice component. I thought if I called executequery() it would update the view Objects query and update my page, but I think I am missing a step.
public static EventResult fminstEventHandler(BajaContext context,Page page,PageEvent event) throws Throwable
result = new EventResult();
fmInst = event.getParameter("FmName");
DeptAppModuleImpl dam = new DeptAppModuleImpl();
ViewObject deptView = dam.getDeptView1();
deptView.setWhereClause("where inst ='" + fmInstNum +"' and dept != '*****' and guide_yr ='"+guideyr +"' union select 'ALL', '0' from dual");
deptView.executeQuery();
return result; //result is nothing right now.
Thanks for your help.
McKellSure. Thanks for responding to my question. Below is the UIX file:
<?xml version = '1.0' encoding = 'windows-1252'?>
<page xmlns="http://xmlns.oracle.com/uix/controller"
xmlns:ui="http://xmlns.oracle.com/uix/ui"
xmlns:data="http://xmlns.oracle.com/uix/ui"
xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
xmlns:html="http://www.w3.org/TR/REC-html40" expressionLanguage="el"
xmlns:myTemplate="CourseTransferTemplate">
<templates xmlns="http://xmlns.oracle.com/uix/ui">
<templateImport source="CrsTranTemplate.uit"/>
</templates>
<content>
<dataScope xmlns="http://xmlns.oracle.com/uix/ui">
<provider>
<!-- Add DataProviders (<data> elements) here -->
</provider>
<contents>
<document xlmns="http://xmlns.oracle.com/uix/ui">
<metaContainer>
<!-- Set the page title -->
<head title="Course Transfer Search"/>
</metaContainer>
<contents>
<body>
<contents>
<form name="form0">
<contents>
<!-- <formParameter name="event"/> -->
<myTemplate:CourseTransferTemplate selectedTab="0"
title="Course Transfer Search"
xmlns:myTemplate="CourseTransferTemplate">
<contents>
<rawText
text="<p>Welcome to the Utah System of Higher Education (USHE) Course Transfer Guide on the Web!
<p>The USHE Course Transfer Guide provides course-by-course articulation and transfer information. It shows how a course at the institution you are transferring from (the 'from' school) articulates with a course at the institution to which you plan to transfer (the 'to' school). The USHE Course Transfer Guide has been developed by the Utah Transfer Articulation Committee and the ">
<contents>
<link text="Utah System of Higher Education"
destination="http://www.utahsbr.edu"/>
<rawText text="(USHE). It is updated every year by participating institutions and a new guide is published in the fall.<p>"/>
</contents>
</rawText>
<!-- GuideYR -->
<rawText text="Guide Year ">
<contents>
<choice model="${data.TransferGuideUIModel.GuideYr2}" name="GuideYr2" prompt="GuideYr2" >
<primaryClientAction>
<firePartialAction event="guideyrEvent"
formSubmitted="true"
/>
</primaryClientAction>
<contents childData="${data.TransferGuideUIModel.GuideYr2.displayData}">
<option model="${uix.current}" text="${uix.current.prompt}"
value="${uix.current.prompt}" />
</contents>
</choice>
</contents>
</rawText>
<!-- FmName -->
<rawText text="From Institution ">
<contents>
<choice model="${data.TransferGuideUIModel.Name}"
name="FmName" prompt="FmName">
<primaryClientAction>
<firePartialAction event="FmInstEvent"
formSubmitted="true"
targets="Department"/>
</primaryClientAction>
<contents
childData="${data.TransferGuideUIModel.Name.displayData}">
<option model="${uix.current}"
text="${uix.current.prompt}"
value="${uix.current.prompt}"/>
</contents>
</choice>
</contents>
</rawText>
<!-- Dept -->
<rawText text="From Department ">
<contents>
<choice model="${data.TransferGuideUIModel.Dept}" name="Dept" prompt="Dept">
<primaryClientAction>
<firePartialAction event="DepartmentEvent"
formSubmitted="true"
targets="Course"/>
</primaryClientAction>
<contents childData="${data.TransferGuideUIModel.Dept.displayData}">
<option model="${uix.current}"/>
</contents>
</choice>
</contents>
</rawText>
<!-- Crs -->
<rawText text="From Course ">
<contents>
<choice id="Course" name="Crs" nodeID="Course">
<primaryClientAction>
<firePartialAction event="CourseEvent"
formSubmitted="true"
/>
</primaryClientAction>
</choice>
</contents>
</rawText>
<!-- ToName -->
<rawText text="To Institution ">
<contents>
<choice model="${data.TransferGuideUIModel.Name}"
name="ToName" prompt="ToName">
<primaryClientAction>
<firePartialAction event="ToInstEvent"
formSubmitted="true"
/>
</primaryClientAction>
<contents
childData="${data.TransferGuideUIModel.Name.displayData}">
<option model="${uix.current}"
text="${uix.current.prompt}"
value="${uix.current.prompt}"/>
</contents>
</choice>
</contents>
</rawText>
<button text="Find Articulations"/>
<rawText text="<p>Choose the academic year you want to search for articulations. Then choose the institution you are transferring from. After you make your selection, a list of departments will be created for you to choose from. Once you choose your department, a list of courses will be created for you to refine your selection. You will then choose which institution you would like to transfer to (you may choose all institutions) and click on 'find articulations'. "/>
</contents>
<tabs/>
<pageButtons/>
<globalButtons/>
<pageHeader/>
<start/>
<end/>
<about/>
<copyright/>
<privacy/>
<corporateBranding/>
<productBranding/>
</myTemplate:CourseTransferTemplate>
</contents>
</form>
</contents>
</body>
</contents>
</document>
</contents>
</dataScope>
</content>
<handlers>
<!-- Add EventHandlers (<event> elements) here -->
<event name="*" source="FmName">
<method class="mypackage1.EventHandlers" method="fminstEventHandler"/>
</event>
<event name="*" source="Department">
<method class="mypackage1.EventHandlers" method="deptEventHandler"/>
</event>
<event name="*" source="GuideYr2">
<method class="mypackage1.EventHandlers" method="guideyrEventHandler"/>
</event>
<event name="*" source="Course">
<method class="mypackage1.EventHandlers" method="courseEventHandler"/>
</event>
<event name="*" source="ToName">
<method class="mypackage1.EventHandlers" method="toinstEventHandler"/>
</event>
</handlers>
</page>
HERE IS THE EVENT HANDLER:
public static EventResult fminstEventHandler(BajaContext context,Page page,PageEvent event) throws Throwable
try
con = new DBConnection();
catch (SQLException e)
System.out.println(e);
fmInst = event.getParameter("FmName");
ResultSet rset = con.query(namesql); //Here con connects to my database and preforms a query.
while(rset.next())
fmInstNum = rset.getString(1);
System.out.println(fmInstNum);
//DeptAppModule and DeptView are an Application Module and View Object I created from the JDeveloper wizards
DeptAppModuleImpl dam = new DeptAppModuleImpl();
ViewObject DeptView = dam.getDeptView1();
DeptView.setWhereClause("where inst ='" + fmInstNum +"' and dept != '*****' and guide_yr ='"+guideyr +"' union select 'ALL', '0' from dual");
DeptView.executeQuery();
//This is where I don't know how to return the result from the query back to the uix choice component named "Dept"
return new EventResult(page);
Thanks you so much for your assistance. I might be approaching this completely wrong. I am new to JDeveloper and the UIX framework. Thank you again.
McKell -
Event handler for disclosureopenicon in tree in flex 4
hi all,
Is it possible to write event handler to disclosureopenicon for tree control in flex?
if its possible means, h w can i write?Hi Ananth,
You can do this by firing a Navigation event for Opening and closing of these tree nodes.
Cheers,
Jeevan -
Action Event Handler on Tree nodes
I have an actionListener event handler registered on a tree node as follows:
<af:tree value="#{bindings.SomeViewObj1.treeModel}" var="node" rowSelection="none" id="t1"
binding="#{EditFormBean.tree1}" displayRow="selected" summary="Tree"
partialTriggers=":::cb1 :::cb2">
<f:facet name="nodeStamp">
<af:panelGroupLayout id="pgl3">
<af:outputText value="#{node}" id="ot1"/>
<af:commandImageLink text="E" id="cil3" partialSubmit="true"
*actionListener="#{EditFormBean.onEdit}"* binding="#{EditFormBean.cmdImageLink}">
<af:setPropertyListener from="#{node.hiertType.structureDefName}" type="action"
to="#{viewScope.formView}"/>
<f:attribute name="node" value="#{node}"/>
</af:commandImageLink>
<af:commandImageLink text="A" id="cil1"/>
<af:commandImageLink text="D" id="cil2"/>
</af:panelGroupLayout>
</f:facet>
</af:tree>
I have at each node stamp facet a panelGroup Layout that contains the node value and a command Image link. The tree has two hierarchical levels. When I press the command Image link on the first tree noe level, the actioListener method in teh managed bean (EditFormBean.onEdit) gets called. When I press the same commandImage link on the second tree level, the same action listener does not get called. I need to get past this problem before I code the actionListener which needs to set the current row in the iterator based on the key selected on the tree node. I simply have a print statement in the action listener method which shows something when the first level command image link is clicked but does not print anything when the second level command image link is clicked.
I am using JDeveloper 11.1.2.1.0
There is also adf faces code around this snippet that uses an af:switcher facea component to display the appropriate form based on the nodee level in which the comman d image link is clicled but it is irrelevant to the problem I am getting.
Any help on that would be appreciatedHi,
hard to say . Didn't see this before. Can yoiu remove "binding="#{EditFormBean.cmdImageLink}"" from the command link. The tree stamps its children so that it doesn't make sense to keep a handle to the component instance
Frank -
How can I add new event handler in BC4J event flow in UIX?
How can I declarativly add extension to existing event handleres in BC4J+UIX page?
I generate through wizards UIX+BC4J pages and I want extend some actions in eventhandlers section. Can I do it in some way like <event name=".." method=".." class=".."> like in any regular event handlers?you can use the <method ..> event handler inside the BC4J event handlers, like:
<bc4j:findRootAppModule name="EmpAppModule" >
<bc4j:findViewObject name="CurrentDeptEmpsVO" >
<method class="myPackage.myClass" method="doOperation"/>
</bc4j:findViewObject>
</bc4j:findRootAppModule> -
UIX with XSQL as XML data provider and event handler
Hello ,
I would like to bind XML data to messageinput elements of a form element
as values to be presented before entering (data provider)
as well as input values to be persisted after completing the form (event handler).
My impression (as a newbee) is that only for BC4J integration there is a bidirectional binding with view objects.
Can i use 'include' to bind a static xml file as data source for output?
How can i use XSQL to be bound as data for input as well as for output of a form?
A last question concerning a page with 3 tabs:
do i need 3 different pages and requests to get the data of the 3 tabs
or is it possible to get the whole data of the page in one request
and distribute it over the 3 tabs.
Any help appreciated
Thanks
Klaus DreistadtYou could do this, but we don't provide any tools to make this easy.
You'd have to write an implement of the DataObject interface
that gives your UI access to the XML document, and write custom
event handlers to perform the "set" side of things. The Data Binding
and UIX Controller chapters of the UIX developer's guide will give you
a high-level view of how to accomplish this, but nothing specifically
about reading or writing to XML documents. -
Tree's DragSource changes at DragDrop event handler?
I try to drag a node A into node B. When the DragDrop event
handler is called, the dragSource is changed to the drop source?
I have declared the following:
<mx:Tree ......... dragDrop="OnDragDrop(event)"....../>
In the function:
private function OnDragDrop( event:DragEvent ):void
var ds:DragSource = event.dragSource;
items = new XML( ds.dataForFormat("treeItems")[0] );
I was expecting the "items" has a copy of the dragged item
(node A). However, it has all the drop node's info (node B). How do
I get teh drag and drop nodes in this event?
P.S. I am trying to drag and drop at the same tree control.
Could that be why? Is it suppose to be like this? Or, its a bug?
-AlanRegarding your button look and feel issue, the easiest thing to do would be to copy the button template you are using for the template-based buttons and modify that to add in your onClick handlers.
The builtin button template for the theme I am using (Theme 12) looks like this
<table class="t10Button" cellspacing="0" cellpadding="0" border="0" summary="">
<tr>
<td class="t10L"><img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /></td>
<td class="t10C">#LABEL#</td>
<td class="t10R"><img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /></td>
</tr>
</table>In other words, each button is rendered in its own HTML table.
Copy this button template, call it mybutton and have it look like
<table class="t10Button" cellspacing="0" cellpadding="0" border="0" summary="">
<tr>
<td class="t10L"><img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /></td>
<td class="t10C">#LABEL#</td>
<td class="t10R"><img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /></td>
</tr>
</table>Notice that I put a no-op in the href tag for the button and added a onClick handler that will do the real work. In your case, you would use the URL Redirect on the Button attributes page to call your SavePage() function. Since the onClick is called before the href, it should (hopefully) do what you are looking for.
I put up these changes at
http://htmldb.oracle.com/pls/otn/f?p=24317:26
Do let us know.
Thanks -
Event Handling for tree structure using "CL_GUI_ALV_TREE_SIMPLE"
Hi,
I have created a tree structure using class CL_GUI_ALV_TREE_SIMPLE.
Now I wanted to insert a check and give message when the user opens the last node in my structure.
I checked the events available in the class , but there in none which gets trigered when we try to open a node.
Please guide me with this scenario.
Thanks & Regards,
Omkar M.Hello Omkar
The solution is somewhat odd but apparently works. As sample report please check BCALV_TREE_SIMPLE_DEMO.
Copy this report and make the following changes:
class lcl_tree_event_receiver definition.
public section.
methods:
on_expand_no_children " new event handler method
for event expand_no_children of cl_gui_column_tree
importing NODE_KEY, " class = CL_GUI_COLUMN_TREE !!!
on_add_hierarchy_node
for event on_add_hierarchy_node of cl_gui_alv_tree_simple
importing grouplevel
index_outtab.
endclass.
CLASS lcl_tree_event_receiver IMPLEMENTATION.
METHOD on_expand_no_children.
BREAK-POINT.
ENDMETHOD. "on_expand_no_children
FORM register_events.
* define the events which will be passed to the backend
DATA: lt_events TYPE cntl_simple_events,
l_event TYPE cntl_simple_event.
* define the events which will be passed to the backend
l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
APPEND l_event TO lt_events.
l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
APPEND l_event TO lt_events.
CALL METHOD tree1->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
* set Handler
DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
CREATE OBJECT l_event_receiver.
SET HANDLER l_event_receiver->on_add_hierarchy_node
FOR tree1. " CL_GUI_ALV_TREE_SIMPLE
SET HANDLER l_event_receiver->on_expand_no_children
FOR ALL INSTANCES. " CL_GUI_COLUMN_TREE !!!
ENDFORM. " register_events
As soon as you open a node in the ALV tree the report will stop at the break-point.
Now you need to check if there are still children nodes to be displayed.
If not then trigger your special coding.
Regards
Uwe -
STRUTS and UIX: How to use getCustomMethod in event handler
I am having app module method exposed to a client as my custom method that does something. Then I have a data page (UIX) with a submit button that triggers event handler:
public void onMyEvent(DataActionContext ctx) {
HttpServletRequest request = ctx.getHttpServletRequest();
HttpSession session = request.getSession();
JUCtrlActionBinding method = ctx.getCustomMethod();
if (method == null) System.out.println("method is null!!!!!!!!!!!");for some reason my method handle is null WHY???
this seems to work when I call my method from findForward() though.If you use ADF BC, you can override the method create(AttributeList) in the Entity Object implementation class (EmployeesImpl.java).
Use: Menu --> Tools --> Override Methods --> create
In the overridden create method you can assign the next value from a DB sequence (e.g. EMP_SEQ) to the ID attribute:
protected void create(AttributeList nameValuePair) {
// Super
super.create(nameValuePair);
// Id
SequenceImpl s = new SequenceImpl("EMP_SEQ", getDBTransaction());
setEmployeeId(s.getSequenceNumber());
} -
UIX event handler + struts
Hi,
I'm using UIX + struts in jdev10g and im getting problems trying to handle a simple action binding event like the "Next" operation. Below is a short example of what im trying to do.
Test.uix
<submitButton text="Next" model="${bindings.Next}" id="Next2" event="next"/>
<event name="next" source="Next2">
<invoke method="doIt" javaType="oracle.jbo.uicli.binding.JUCtrlActionBinding"
instance="${bindings.Next}"/>
</event>
testAction.java
public void onNext(DataActionContext ctx)
if (ctx.getEventActionBinding() != null)
ctx.getEventActionBinding().doIt();
If i run the code above i can see that it executes ctx.getEventActionBinding().doIt(); but the action binding never gets executed, and this efect is the same for other actions like create,previous etc...
Another thing that calls my attention is that every time i drag a operation from the DataControl Palette the event name is always "action"
<submitButton text="First" model="${bindings.First}"
id="First0" event="action"/>
So how is the correct way to handle events in the UIX + Struts?????
Please i need a help on this one!!!!!
Tanks,
Eduardo M. SassoFirst of all tanks for the help.
But what i want to do is to subclass the DataForwardAction for my DataPage and let the struts controller handle the event, just like the documentation says...
About Event Handling in Applications Using Oracle ADF, UIX, and Struts
http://helponline.oracle.com/jdeveloper/help?topic=adf_auixadfevents_html
If i try to do the same thing using jsp it works great...
This is problem is getting me nuts!!! it looks to me that this problem is very easy to solve but i just cant see the solution....
tanks again -
UIX-XML BC4J Question regarding event handling
How can I use/access Application Module, defined in UIX-XML page (using <bc4j:registryDef>), in my event handler method ???
Sorry for the confusion. I figured out what you were asking.
The right way is this.
First, in your UIX XML page, declare your handler like this:
<event name="%myEvent%" >
<bc4j:findRootAppModule name="%ModuleName%" >
<method class="%eventclass%" method="%eventmethod%" />
</bc4j:findRootAppModule>
</event>
the strings in the % have to be replaced with your own particular names. %ModuleName% should be the same as the name of the module in the registry.
Then in the event handler %eventclass%.%eventmethod% you can use this to find the Application Module:
oracle.jbo.ApplicationModule mymodule
= oracle.cabo.data.servlet.bind.ServletBindingUtils.getApplicationModule(context);
"context" is passed in to your event handler as a BajaContext. ServletBindingUtils has several other methods for getting BC4J stuff, you should look at its definition.
Joe -
JDEV 10.1.3: Issue with Inherited public event handler methods in beans
I have a bean validator method which it inherits from another base class.
I am able to pick this method using the property inspector and it works fine.
But in the jspx source view, i see a red wiggly line under the expression. Is this a bug or some bizzare way of enforcing some best practice (if using inherited event handler methods in beans is NOT a best practice)?
The same is true for value change listeners.I started from scratch and the problem remains. Only one commandButton can fire an event which sets a variable that controls a af:switcher. The effect is similar to what the "blocking" attribute does but it is set to false on my components. Any ideas, time has already run out.
Maybe you are looking for
-
There should be a tv app made by apple for people to hook up their cable network and watch tv
People could put their cable network on their ios device and be able to watch on air and free recorder tv. There will be no charge to apple and no extra charge to the cable provider. When people buy or rent movies, apple will make some money and the
-
Sound disappeared from HDMI. MSI message in dmesg.
I use a laptop with slim/xmonad and frequently plug it into my TV and found this to automate the process off setting sound and picture when i plug it in. Tested it out and seemed to work fine, and now 2 days later, I get no sound from HDMI. PC speake
-
Hello friends i have a table 'ABC'. In tha i have two columns named "Sector" and "Item" i have given the Column details here. Sector Item CV-COL BAU CV-ELE BMS CV-NGS CLP i want output such that each sector should be displayed as a column and below i
-
Having text reveal under an image when hovered on
I know there is a way to do this using some css and such but I am wondering if there is some tool within Muse that will help me do this. Check out this site built in Muse to see what I am wanting to do: http://jeretslack.com/index.html Thanks.
-
Edit submenu without affecting top menu
Hi all, I'm very new to Muse so still learning a lot. I was wondering if it was possible to edit a submenu without affecting the top menu. For instance, in the following scenario I have a top menu that is Vertically; Left-Aligned and I would like the