Is event handling possible with any object?
can i set a event notification to any object? say for example if i have a multidimensional array of strings can i associate a event handler with it so that when a different application or part of a code changes it's contents i can fire a method?
consider the scenario
initially...
String userId[][]=new String[R][C];
public MyServer()
userId[0][0] = "mr00047";
userId[0][1] = "false";
userId[1][0] = "dider7";
userId[1][1] = "false";
userId[2][0] = "thegreendove";
userId[2][1] = "false";
}now at some point the content of the userId array changes
for(int i=0;i<3;i++)
if(temp.equals(MyServer.userId[0]))
flag=true;
MyServer.userId[i][1]="true"; // I want to fire a method from this point
break;
can any body tell me how can i do it? please help!!!
This could help you: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Observable.html
Similar Messages
-
Event Handling Techniques with MVC
Hello all,
I have a situation where I have a model that can be thought of like a graph with many nodes and edges. I would like to create a view of this model with a customized JLabel that shows a data value for each node and edge in the model. The event handling to accomplish this has left me a bit perplexed, though. On one hand I was considering something similar to the following:
// a dedicated listener for each label
MyLabel mylabels[] = new MyLabel[numLabels];
for(int i = 0; i != mylabels.length; i++){
MyEventHandler eh = new MyEventHandler(mylabels);
mylabel.addMouseListener(eh);
public class MyEventHandler extends MouseAdapter{
private MyLabel label;
public void mouseClicked(MouseEvent e){
label.setText(etc...);
// at this point I would want to set the value of the point or edge
// that this label corresponds to, not sure of the best strategy
// here either
etc...
The other technique that I am considering might look similar to the following:
// only one listener for all labels
MyLabel mylabels[] = new MyLabel[numLabels];
MyEventHandler eh = new MyEventHandler();
for(int i = 0; i != mylabels.length; i++){
mylabel.addMouseListener(eh);
public class MyEventHandler extends MouseAdapter{
public void mouseClicked(MouseEvent e){
//call a control object in MVC architecture, for more processing
control.update(e.getSource(), (String)input);
etc...
// in the control object class
public void update(Object eventSource, String input){
MyLabel source = (MyLabel)eventSource;
source.setText(input);
// the label would have some kind of index to indicate which one it is
model.setData(source.getIndex(), input);
I am interested in knowing any accepted/popular solutions to situations like this. Are either of my samples worth implementing? I would greatly appreciate any suggestions. Thanks.I would recommend creating a single listener and add it to every label added to the graph. If you're interested in events that occur outside of the labels (in the background), add a listener to the container of the labels as well.
Unfortunately, you cannot simply add a listener to the container and get all the mouse events from the container's children because Swing's event dispatching system will only dispatch mouse events to a container if the click location was not within any of the container's children. This means that mouse listeners registered to a container will only receive mouse events within the container's background. -
OIM 10g Event Handler : Integrated with User Groups.User Members
I have created custom event handler and integrated it with User Groups.User Members data object.
here is my code od event handler class:
public class GroupEventHandler extends tcBaseEvent {
public GroupEventHandler() {
this.setEventName("Event Handler Sample");
protected void implementation() throws Exception {
System.out.println("============@@@@@@@@ IN EVENT HANDLER ");
try
String groupKey = this.getDataObject().getString("Groups.Key");
writeToFile(groupKey);
catch (Exception e)
e.printStackTrace();
But I am getting this exception :
ERROR [ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' XELLERATE.SERVER - Class/Method: tcTableDataObj/getString encounter some problems: Column 'GROUPS.KEY' not found
com.thortech.xl.dataaccess.tcDataSetException: Column 'GROUPS.KEY' not found
at com.thortech.xl.dataaccess.tcDataSet.getColumnIndex(Unknown Source)
at com.thortech.xl.dataaccess.tcDataSet.getString(Unknown Source)
at com.thortech.xl.dataobj.tcTableDataObj.getString(Unknown Source)
at oim.GroupEventHandler.implementation(GroupEventHandler.java:19)
at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcUSG.eventPostInsert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
at com.thortech.xl.ejb.beansimpl.tcGroupOperationsBean.addMemberUsers(Unknown Source)
at com.thortech.xl.ejb.beans.tcGroupOperationsSession.addMemberUsers(Unknown Source)
at com.thortech.xl.ejb.beans.tcGroupOperations_ejm77u_EOImpl.addMemberUsers(tcGroupOperations_ejm77u_EOImpl.java:1671)
at Thor.API.Operations.tcGroupOperationsClient.addMemberUsers(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.security.Security.runAs(Security.java:41)
at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(Unknown Source)
at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
at $Proxy66.addMemberUsers(Unknown Source)
at com.thortech.xl.webclient.actions.UserGroupMembersAction.assignMemberUsers(Unknown Source)
at com.thortech.xl.webclient.actions.UserGroupMembersAction.assignGroupMembers(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(Unknown Source)
at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source)
at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown Source)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)Anyone have idea about why "Groups.Key" not found exception thrown here..
I have assigned this event handler at postinsert event of User Groups.User Members Data Object. -
Event handler - open with explorer issue
hi all,
I have developed an event handler (itemadded syncronuos) for a library. i need to populate title field
public override void ItemAdded(SPItemEventProperties properties)
base.ItemAdded(properties);
properties.ListItem["Title"] = "some value"
properties.ListItem.SystemUpdate();
I have deployed the same feature to 2 environments -> Dev Env, Test Env.
when I copy and paste a pdf file with "Open with explorer" in Dev Env it works fine.
when I do the same in Test Env i can't copy the file and i get this error:
Error 0x80070057: the parameter is incorrect.
I see this in my Event Viewer
The description for Event ID 14901 from source WebClient cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
Could you help me?
Thanks.
On your local machine you are as you on the server, are you try it on the test server or browsing the test environment from local machine and doing the copy from local machine. also i hope your event handler is not firing on all the list, just make
sure. You can try this in a different library..create a fresh library and see what happen without event handler.
Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
INSQLSERVER.COM
Mohammad Nizamuddin -
Getting ORA-00932 with any object table
Hi, I'm new to Oracle and it's enormous community so I apologize in advance for posting
in the wrong place or for giving not enough information.
As I just said, I'm new to Oracle therefore I'm following the [introductory guide|http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/appdev.102/b14260/adobjint.htm#sthref102] and trying the examples it gives one-by-one.
I used to use MySql in the past but now I need to use a more stable and scalable database that allows
the storage of objects.
I'm using Oracle 10.g XE on a GNU/Linux computer (Ubuntu 8.10)
Let's start with the question:
in the Example 1-6 the following code is given:
CREATE TYPE emp_person_typ AS OBJECT (
name VARCHAR2(30),
manager REF emp_person_typ );
Type created.
CREATE TABLE emp_person_obj_table OF emp_person_typ;
Table created.
INSERT INTO emp_person_obj_table
SELECT emp_person_typ ('Bob Jones', REF(e))
FROM emp_person_obj_table e
WHERE e.name = 'John Smith';
1 row(s) inserted.Executing these queries return successfull messages.
But when I try to retrieve the records by using this query:
select * from emp_person_obj_table;or when accessing the "Data" tab of that table in the Object Browser"
I get this error:
(error report:)
ORA-00932: inconsistent datatypes: expected NUMBER got REF RESMAN.EMP_PERSON_TYPAll queries are executed in the Application Express (2.1.0.00.39) query runner.
I think I did everything in the right manner, although the code is just copy-pasted from the guide, so I can't realize
why this annoying error is still appearing when accessing that table.
I noticed that executing the same selection query as above in the SQL*Plus CLI works as expected
and returns a resultset.
Thanks in advance for any reply.Since the query works in SQL*Plus, I would tend to assume that this is a limitation of the APEX query runner. If you post over in the APEX forum, someone may be able to confirm that or suggest a way of working around it.
Do you need to use the APEX query runner? Could you use SQL*Plus or SQL Developer instead?
Justin -
I want to be able to download pictures from my camera and caption them on my iPad2. Is this possible? Having trouble finding an app for that...
I believe the iPhoto App can add captions to photos.
-
Fractal designs like these? Possible with any software?
Ok... There are two type of fractal/chaos images I'd like to make.. to import into photoshop for some work of mine..
I have the master suite (student edition) so if not photoshop illustrator would be fine, I'll convert to jpg for what I need.
1. A fractal/chaos design that appears to move (as an illusion) (jpg or normal image file)
http://www.moebiusnoodles.com/s/wp-content/uploads/2012/07/MovingFractalIllustion.jpg
http://1.bp.blogspot.com/-LUKFMS_Mz7g/TaCP29yiUfI/AAAAAAAAB9Y/7y1jMhPCteg/s1600/MovingFrac tal.jpg
Illusions - Fractal Illusions
2. A fractal/chaos animation, that loops back to where it started preferably not too long either.. (video or animated gif, that I can take the sequence into photoshop)
(doesn't have to seem as 3d rendered as this.. but similar to this..)
Surface detail on Vimeo
Any Ideas how this could be achieved?
Thanks
AdamI just happen to know of a guy (through the net only) that dedicated a web site to fractal and software for creating fractals. Or I should say dedicated to mathmatical graphics.
The site hasn't done anything in quite a while but as far as i know all the links are still good.
Exper Chaotic Flow -
Event handling, incrementing with buttons
Hey
struggling a little and hope someone out there might be able to help out
i need to find out how to make a new line appear everytime a button is pressed, the lines are all exactly the same length, just in a different position to the last
the lines are identical and just trying to show a zig zag path.
thanks in advancePlease post an SSCCE*. It's not clear that you're even talking about Java.
* http://mindprod.com/jgloss/sscce.html
~ -
Hello everyone.
i am trying to handle events in the item master date form (150) in order to hide the Item Cost. It is working fine with most of the time using only the UI api. However if doing the following actions, the events are not processed by the application anymore.
1- Start SBO (2005 sp1 pl18)
2- Login
3- Start my add-on with vb.net
4- Go into the item master data.. (handling events correctly)
5- Close item master data.
6 -Go into another form
7- Close the other form
8- Go back into item master data --> no events handling is done
Any ideas???
Thank you
Simon
Source code.
Public Class ItemCostControl
Private WithEvents SBO_Application As SAPbouiCOM.Application
' Declare Event Filter
Public oFilters As SAPbouiCOM.EventFilters
Public oFilter As SAPbouiCOM.EventFilter
Private Const itemCostField As String = "64"
Private Const itemCostColumn As String = "22"
Private Const itemCostGrid As String = "28"
Private Const formItemMaster As String = "150"
Private Sub SetApplication()
'// Use an SboGuiApi object to establish the connection
'// with the application and return an initialized appliction object
Dim SboGuiApi As SAPbouiCOM.SboGuiApi
Dim sConnectionString As String
SboGuiApi = New SAPbouiCOM.SboGuiApi
sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
'// connect to a running SBO Application
SboGuiApi.Connect(sConnectionString)
'// get an initialized application object
SBO_Application = SboGuiApi.GetApplication()
End Sub
Private Sub SetFilters()
'// Create a new EventFilters object
oFilters = New SAPbouiCOM.EventFilters
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)
'// assign the form type on which the event would be processed
oFilter.AddEx("150")
SBO_Application.SetFilter(oFilters)
End Sub
Public Sub New()
'// set SBO_Application with an initialized application object
SetApplication()
'// set SBO_Application with an initialized EventFilters object
SetFilters()
End Sub
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Dim oForm As SAPbouiCOM.Form
System.Diagnostics.Debug.WriteLine("Item Event for " + FormUID)
If pVal.FormType <> 0 And pVal.BeforeAction = False Then
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
System.Diagnostics.Debug.WriteLine("Item Pressed")
hideField(pVal.FormType, pVal.FormTypeCount, itemCostField)
hideColumn(pVal.FormType, pVal.FormTypeCount, itemCostGrid)
Case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE
System.Diagnostics.Debug.WriteLine("Form Activate")
hideField(pVal.FormType, pVal.FormTypeCount, itemCostField)
hideColumn(pVal.FormType, pVal.FormTypeCount, itemCostGrid)
Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
System.Diagnostics.Debug.WriteLine("Form Load")
hideField(pVal.FormType, pVal.FormTypeCount, itemCostField)
hideColumn(pVal.FormType, pVal.FormTypeCount, itemCostGrid)
End Select
End If
End Sub
Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
'// in order to activate your own forms instead of SAP Business One system forms
'// process the menu event by your self
'// change BubbleEvent to True so that SAP Business One won't process it
Dim oForm As SAPbouiCOM.Form
If pVal.BeforeAction = False Then
hideField(formItemMaster, 1, itemCostField)
hideColumn(formItemMaster, 1, itemCostGrid)
End If
End Sub
Public Sub hideField(ByVal FormType As String, ByVal FormTypeCount As Integer, ByVal fieldNo As String)
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.GetForm(FormType, FormTypeCount)
oForm.Items.Item(fieldNo).Left = 3000
oForm.Items.Item(fieldNo).Visible = False
End Sub
Public Sub hideColumn(ByVal FormType As String, ByVal FormTypeCount As Integer, ByVal fieldNo As String)
Dim oForm As SAPbouiCOM.Form
Dim oGrid As SAPbouiCOM.Matrix
Dim oItem As SAPbouiCOM.Item
oForm = SBO_Application.Forms.GetForm(FormType, FormTypeCount)
oItem = oForm.Items.Item(fieldNo)
oGrid = oItem.Specific
If oGrid.Columns.Item(itemCostColumn).Visible = True Then
oGrid.Columns.Item(itemCostColumn).Visible = False
oGrid.Columns.Item(itemCostColumn).Width = 0
End If
End Sub
End ClassHi, Simon!
Try setting filters like that:
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE)
'// assign the form type on which the event would be processed
oFilter.AddEx("150")
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED)
'// assign the form type on which the event would be processed
oFilter.AddEx("150")
oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK)
'// assign the form type on which the event would be processed
oFilter.AddEx("150")
I suppose that the setting method you used, was filtering only et_MENU_CLICK for the 150-form. But other events (et_FORM_ACTIVATE, et_ITEM_PRESSED) were handling for all forms...
hth,
Aleksey -
Event Callback VI with LVOOP / overhead, caveats, future
OK another exploratory post from me. To anyone who has put up with this kind of thing from yours truly many times in the past, apologies. Completely impervious to any objections, here goes:
I have discovered a new toy : Registering event callback VIs. OK, I have used them before but a previous post by James McNally about his MVC framework revealed to me a usage which I had not previously thought of. Thanks for that James.
I like LVOOP. One pattern which is quite easy to understand is the command pattern in conjunction with state machines where we essentially replace the individual states of a state machine with external VIs. This makes it far easier to customise behaviour and allows for re-use of the core state machine for differing functionalities. Cool.
We can leverage this with LVOOP by passing different "commands" to the state machine depending on the real object being utilised and thus we have a nice extensible architecture. Again, cool. If we need to change one common action, we simply update that VI and instantaneously all ancestors share the new code in that command object. Double cool.
Problem is that I love User Events. The idea of having an extensible object model gets awkward to handle when you start using Events to handle communications in and out of the object. Create a Parent, Implement the 15 Events required. Create a child, Implement the 15 Parent events and the 12 new events. Create a Grandchild, Implement the 15 Grandparent, the 12 Parent and then the 25 new Events. Armageddon occurs when you want to change the common functionality for the sixth Event of the Parent. Now you need to go to each and every ancestor which uses them and update them. Wait a second, isn't LVOOP supposed to save me from this kind of crud? Frustration ensures. Can you ever be sure you got all instances? What about those obejcts not listed in the project, maybe you forgot one of them...... Nasty testing and debugging ensues.
I think I may have (partially) found the answer. What we need to do is basically do the same thing we have done with the command pattern and extract the individual frames of the event structure and place them into external VIs so that we can 1) re-use the VIs in each level of hierarchy and 2) maintain all the other niceties of Events.
Turns out that using Callback VIs for each level of the object hierarchy can help to solve this problem. You need to have a method with a different name for each level of the hierarchy which exposes the events int his way because each method will most likely have different input values.
Has anyone else done things like this? Are there limitations as to what can and can't be done with this arrangement? Any nasty bugbears waiting for me around the corner? How to deal with events which should give some kind of return value? Do I encorporate the return value into an implementation-agnostic return channel (again Events of course) with the object in question providing one return user event for each callback function which requires a return value?
Say hello to my little friend.
RFC 2323 FHE-CompliantGrr, I was trying to attach a file (whose contents apparently didn't match the file name?!!) when I ran out of time to edit and now I lost my text.
Here's an example.
Base class swaps out a control Caption for Label upon "Mouse Enter"
Child class swaps out a control Label for Caption on "Mouse Leave"
Grandchild increments a counter (stored in Description) for every "Mouse Enter"
Trivial but get's at what I mean.
I know I can do this in other ways but
1) I don't need a parallel process
2) I'm just having fun
Darn, I can't attach a zip. Rename this file to .zip and unpack. Sorry guys.
Say hello to my little friend.
RFC 2323 FHE-Compliant
Attachments:
LVOOP with Event callbacks.txt 78 KB -
Event handling on a chart or a region
Hi All,
Is it possible to do event handling on a chart or on a region ? For instance I plotted a 2d chart if i click on any part of the chart i need to display some table. Is this event handling possible ?Do I need to write some code in java script ? Any pointers to this will be of great help
Thanks in AdvanceHello,
You can write js or use standard apex functionality.
Check this: http://tryapexnow.com/apex/f?p=2277:5
there is IR below first chart. You click, and the value of item P5_MONTH is populated, report below hows the corresponding month.
But you need to make it more sophisticated.
So basically using Apex url already gives lots
Change NULL to be a link to page 5 setting item P5_MONTH (sorry can not copy paste the whole query here, I get Sorry, content is not allowed)
IR SQl query:
select o.*
from demo_product_info p, demo_order_items oi, demo_orders o
where oi.product_id = p.product_id
and o.order_id = oi.order_id
and to_char(o.order_timestamp, 'RRRR MM') = :P5_MONTH -
About CL_GUI_ALV_GRID's event-handling & PAI/PBO
Hi, all,
I met a problem when using CL_GUI_ALV_GRID's event-handling.
I created a simple event-handling-class with an event-handling-method for DOUBLE-CLICK event of CL_GUI_ALV_GRID. And the event-handling-method, only makes some changes to the contents of itab to be shown in ALV_GRID.
The problem is: In my idea, after event-dispatch and event-handling in PAI, subsequent PBO will be called. Since SET_TABLE_FOR_FIRST_DISPLAY is called in PBO, I would saw the changed itab shown. BUT, I saw the contents of the itab remaining unchanged.
* PAI module, DISPATCH the event
CASE OK_CODE.
WHEN OTHERS.
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
I debugged, and found that, after event-handling-method, PBO module doesn't execute.
That's my wondering, after the preceding PAI, shouldn't the subsequent PBO appear? OR is event-handling different from other user actions?
Many thanks.Hi,
for double click you need explicit handler ,
just check it.
REPORT ZTEST1234 MESSAGE-ID ZZ .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID, "First
G_GRID1 TYPE REF TO CL_GUI_ALV_GRID. "Second
DATA: L_VALID TYPE C,
V_FLAG,
V_DATA_CHANGE,
V_ROW TYPE LVC_S_ROW,
V_COLUMN TYPE LVC_S_COL,
V_ROW_NUM TYPE LVC_S_ROID.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM,
G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST', "First Container
G_CONTAINER2 TYPE SCRFNAME VALUE 'TEST1',"Second container
GS_LAYOUT TYPE LVC_S_LAYO.
DATA:BEGIN OF ITAB OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
LFDAT like lips-vfdat,
BOX(1),
HANDLE_STYLE TYPE LVC_T_STYL,
END OF ITAB.
* CLASS lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
**Hot spot Handler
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
**Handler to Check the Data Change
HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED
E_ONF4
E_ONF4_BEFORE
E_ONF4_AFTER,
**Double Click Handler
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO.
ENDCLASS. "lcl_event_handler DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Handle Hotspot Click
METHOD HANDLE_HOTSPOT_CLICK .
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW_ID.
V_COLUMN = E_COLUMN_ID.
V_ROW_NUM = ES_ROW_NO.
MESSAGE I000 WITH V_ROW 'clicked'.
ENDMETHOD. "lcl_event_handler
*Handle Double Click
METHOD HANDLE_DOUBLE_CLICK.
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW.
V_COLUMN = E_COLUMN.
V_ROW_NUM = ES_ROW_NO.
IF E_COLUMN = 'VBELN'.
SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ENDIF.
IF E_COLUMN = 'POSNR'.
MESSAGE I000 WITH 'Click on POSNR row number ' E_ROW.
"with this row num you can get the data
ENDIF.
ENDMETHOD. "handle_double_click
**Handle Data Change
METHOD HANDLE_DATA_CHANGED.
CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
EXCEPTIONS
FINISHED = 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.
ENDMETHOD. "HANDLE_DATA_CHANGED
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*& Global Definitions
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER, "handler
G_CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER. "Container2
*- Fieldcatalog for First and second Report
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT,
LS_VARI TYPE DISVARIANT.
* START-OF_SELECTION
START-OF-SELECTION.
SELECT VBELN
POSNR
FROM LIPS
UP TO 20 ROWS
INTO CORRESPONDING FIELDS OF TABLE ITAB.
END-OF-SELECTION.
IF NOT ITAB[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.
*& Form CREATE_AND_INIT_ALV
* text
FORM CREATE_AND_INIT_ALV .
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
"First Grid
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER1.
CREATE OBJECT G_GRID
EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
"Second Grid
CREATE OBJECT G_CUSTOM_CONTAINER1
EXPORTING CONTAINER_NAME = G_CONTAINER2.
CREATE OBJECT G_GRID1
EXPORTING I_PARENT = G_CUSTOM_CONTAINER1.
* Set a titlebar for the grid control
CLEAR GS_LAYOUT.
GS_LAYOUT-GRID_TITLE = TEXT-003.
GS_LAYOUT-ZEBRA = SPACE.
GS_LAYOUT-CWIDTH_OPT = 'X'.
GS_LAYOUT-NO_ROWMARK = 'X'.
GS_LAYOUT-BOX_FNAME = 'BOX'.
GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
* SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
SET HANDLER G_HANDLER->HANDLE_DATA_CHANGED FOR G_GRID.
data: ls_outatb like line of itab,
v_index type sy-tabix.
DATA: LS_EDIT TYPE LVC_S_STYL,
LT_EDIT TYPE LVC_T_STYL.
LOOP AT ITAB INTO ls_outatb WHERE POSNR = '000010'.
V_INDEX = SY-TABIX.
LS_EDIT-FIELDNAME = 'VBELN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 8.
INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE ls_outatb-handle_style.
MODIFY ITAB INDEX V_INDEX FROM ls_outatb TRANSPORTING
HANDLE_STYLE.
ENDLOOP.
* setting focus for created grid control
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
EXPORTING
CONTROL = G_GRID.
* Build fieldcat and set editable for date and reason code
* edit enabled. Assign a handle for the dropdown listbox.
PERFORM BUILD_FIELDCAT.
* Optionally restrict generic functions to 'change only'.
* (The user shall not be able to add new lines).
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
**Vaiant to save the layout
LS_VARI-REPORT = SY-REPID.
LS_VARI-HANDLE = SPACE.
LS_VARI-LOG_GROUP = SPACE.
LS_VARI-USERNAME = SPACE.
LS_VARI-VARIANT = SPACE.
LS_VARI-TEXT = SPACE.
LS_VARI-DEPENDVARS = SPACE.
CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
**Calling the Method for ALV output for First Grid
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
**Calling the Method for ALV output for Second Grid
CALL METHOD G_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
* EXPORTING
* IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
* Set editable cells to ready for input initially
CALL METHOD G_GRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ENDFORM. "CREATE_AND_INIT_ALV
*& Form EXCLUDE_TB_FUNCTIONS
* text
* -->PT_EXCLUDE text
FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
* Only allow to change data not to create new entries (exclude
* generic functions).
DATA LS_EXCLUDE TYPE UI_FUNC.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
*& Form build_fieldcat
* Fieldcatalog
FORM BUILD_FIELDCAT .
DATA: L_POS TYPE I.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Item'(025).
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Del Date'(015).
X_FIELDCAT-FIELDNAME = 'LFDAT'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
ENDFORM. " build_fieldcat
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF G_CUSTOM_CONTAINER IS INITIAL.
**Initializing the grid and calling the fm to Display the O/P
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards
vijay -
Help needed in implementing validation event handler in OIM 11g
Hello experts,
I am trying to set username policy by implementing a validation event handler in OIM 11.1.1.5.
Following are the steps followed
1. Import metadata
Created a file called Eventhandler.xml as below and imported using weblogicImportmetadata.sh
<?xml version='1.0' encoding='UTF-8'?>
<eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
<validation-handler class="test.iam.eventhandlers.CustomValidationEventHandler" entity-type="User" operation="CREATE" name="CustomValidationEventHandler" order="1000" sync="TRUE"/>
</eventhandlers>
2. Register plugin
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<plugins pluginpoint="oracle.iam.platform.kernel.spi.ValidationHandler">
<plugin pluginclass="test.iam.eventhandlers.CustomValidationEventHandler" version="1.0" name="CustomValidationEventHandler" />
</plugins>
</oimplugins>
Just givng sys out in the below code to check whther it is getting triggerred during user create.
package test.iam.eventhandlers;
import java.util.HashMap;
import oracle.iam.platform.Platform;
import oracle.iam.platform.context.ContextAware;
import oracle.iam.platform.kernel.ValidationException;
import oracle.iam.platform.kernel.ValidationFailedException;
import oracle.iam.platform.kernel.spi.ValidationHandler;
import oracle.iam.platform.kernel.vo.BulkEventResult;
import oracle.iam.platform.kernel.vo.BulkOrchestration;
import oracle.iam.platform.kernel.vo.Orchestration;
public class CustomValidationEventHandler implements ValidationHandler {
@Override
public void initialize(HashMap<String, String> arg0) {
// TODO initialization
System.out.println("init validate event handler");
@Override
public void validate(long processId, long eventId, Orchestration orchestration)
throws ValidationException, ValidationFailedException {
System.out.println("Beginning of validation");
System.out.println("End of validation");
@Override
public void validate(long processId, long eventId, BulkOrchestration arg2)
throws ValidationException, ValidationFailedException {
// TODO - N/A
System.out.println("Bulk Orchestration not yet implemented");
Now when i create a user it is not allowing and i am getting system error in the front end and in the logs i could see something below
<May 28, 2012 3:03:29 PM CEST> <Error> <oracle.iam.identity.usermgmt.impl> <IAM-3050029> <The user cannot be created due to validation errors.
oracle.iam.platform.kernel.ValidationFailedException: Event handler CustomValidationEventHandler implemented using class/plug-test.iam.eventhandlers.CustomValidationEventHandler could not be loaded.
at oracle.iam.platform.kernel.impl.OrchProcessData.runValidationEvents(OrchProcessData.java:177)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.validate(OrchestrationEngineImpl.java:644)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.process(OrchestrationEngineImpl.java:497)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:444)
at oracle.iam.platform.kernel.impl.OrchestrationEngineImpl.orchestrate(OrchestrationEngineImpl.java:378)
at oracle.iam.identity.usermgmt.impl.UserManagerImpl.create(UserManagerImpl.java:656)
at oracle.iam.identity.usermgmt.api.UserManagerEJB.createx(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
I have implemented preprocess and postprocess event handler before with similar kind of plugin registration, metadata import and everything worked fine. Not sure what is the problem here with validation event handler.
Thanks
DKInstead of registering the plug-in can u try placing it in the plugins folder under Oracle_IDM1/server folder.
at times restart is required. esp when the server is running in production mode.
Regards
user12841694 -
Unable to expand table (or 'any' object) node - permissions issue?
I am the dba for a database and hence have access to the system user. When I connect to the db through SQL Developer, I can expand the table node under any user and list tables. As I can with any object node.
I now want to create an admin user that has restricted capabilities, one of which will be to view objects, such as tables etc..
(I will ultimately do this via a role to allow multiple users to have the admin capabilities, but for now have just created an admin_user userid).
However, when I connect to the database using this admin_user userid, I am unable to expand any object node.
I have played with different permissions, granting 'select any dictionary', 'select_catalog_role', 'select on dba_tables' but the user still can not view any objects via the appropriate node. eg. attempting to go to Other Users - username - Tables just shows nothing. (There are no filters).
However the admin_user can run a SQL command to view the tables. eg. Select * from dba_tables, will list all tables for all users within the database. So they DO appear to have the appropriate access.
So why can't they see the tables in the tables node?
Is there some piece of configuration within SQL Developer itself that I have overlooked?
CheersI am the dba for a database and hence have access to the system user. When I connect to the db through SQL Developer, I can expand the table node under any user and list tables. As I can with any object node.
I now want to create an admin user that has restricted capabilities, one of which will be to view objects, such as tables etc..
(I will ultimately do this via a role to allow multiple users to have the admin capabilities, but for now have just created an admin_user userid).
However, when I connect to the database using this admin_user userid, I am unable to expand any object node.
I have played with different permissions, granting 'select any dictionary', 'select_catalog_role', 'select on dba_tables' but the user still can not view any objects via the appropriate node. eg. attempting to go to Other Users - username - Tables just shows nothing. (There are no filters).
However the admin_user can run a SQL command to view the tables. eg. Select * from dba_tables, will list all tables for all users within the database. So they DO appear to have the appropriate access.
So why can't they see the tables in the tables node?
Is there some piece of configuration within SQL Developer itself that I have overlooked?
Cheers -
Event on placing the library object on the document
Hi,
I'm lokking for the technical event (like kBeforeOpenDocSignalResponderService) when any Object from the Indesign library is placed on the opened document.This should help
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/97-deferred-trainstop-navigation-1528557.pdf
Maybe you are looking for
-
How can I revert my Macbook Air back to Mountain Lion?
I got my Macbook Air for Christmas in 2012, so it's only a little over a year old. It came with Mountain Lion, and it's been fine, until I updated it to Mavericks. Well, it was alright for a little bit, until the past two days, it has frozen on me fo
-
I use this particular Mac as a workstation for Logic Pro. I have two USB cables connected to the computer. One is for a powered hub (hosting a midi interface and an iLok key) and the second is for an audio interface. These devices are plugged into a
-
How to hide Saved Searches in the header area of web ui
Hi All, My Query Is how to hide Saved Searches in the header area of web ui. For This is there any configuration or we have do through the code. Thanks & Regards, Venkat
-
Editable columns in table control?
Hi Gurus, I am using table control. When I click one button(Add Structure ) i am creating table rows with data, example it creates 3 rows everytime on click on this button. But coming to colmns, for first row i want first 2 columns are in edit mode,
-
Just wondering if anyone else ran into a problem with the latest version of vim, where you can no longer paste into vim from the X clipboard. I got so used to selecting text from anywhere and everywhere (OpenOffice, Firefox, any other X app), and pas