Re:Event declaration and handling in portals
Hi,
I am new to portal and I got struck in how to access events and to declare events as well .
Please guide me in this issue
Thank You,
D.Durga Rao
Hi,
Check this link for the tag for button. It shows onClientClick and onClick. onClientClick is client side validation (code written in javascript inside jsp itself) and onClick is server side validation.
http://help.sap.com/saphelp_nw70/helpdata/en/f1/9a0e41a346ef6fe10000000a1550b0/content.htm
For server side: Use onClick:
JSP DynPage: Declaration of the method that processes the event:
public void myClick (Event event) { ..coding.. }
or
public void onMyClick (Event event) { ..coding.. }
Here myClick is like ProcessConfirm defined for button. It can be defined as
public void ProcessConfirm (Event event) { ..coding.. }
or
public void onProcessConfirm (Event event) { ..coding.. }
Regards,
Harini S
Similar Messages
-
Custom Event generation and Handling
HI all,
I am new to java. I have a dataset which changes dynamically and this dataset is responsible for some other dataset(s). So whenever the original dataset is modified, the other datasets based on this dataset should be updated automatically so as to preserve the consistency.
What I want to do is to write a custom event which is to be fired whenever the original dataset is modified and notify it to other datasets so as to ensure the consistency.
Any help in this regard is extremely appreciated.HI Duffymo,
Here is my problem for better understanding:
I have a vector data in a NodePanel (this vector data originates from some other datastructure...but that is immaterial as we know that this data is an instance of that datastructure). This vectordata in NodePanel is responsible for another vectordata in SchedulePanel. The NodePanel and SchedulePanel are tabbedPanels in a tabbedframe. Whenever I update the vector data in NodePanel, the vector data in SchedulePanel needs to be updated.
The solution you gave me, taught me an insight of the event handling in Java.
I am quoting my source for your reference as I am unable to incorporate your idea into my project.
Event class:
import java.util.*;
public class VectorUpdateEvent extends EventObject
public VectorUpdateEvent(Object source)
super(source);
Interface to EventListener
public interface VectorUpdateListener
public void eventVectorUpdated(VectorUpdateEvent event);
class EventGenerator
import java.util.*;
public class VectorUpdateEventIssuer
implements EventListener
public VectorUpdateEventIssuer()
listListeners = new ArrayList();
public synchronized void addVectorUpdateEventListener(VectorUpdateEvent l)
listListeners.add(l);
protected synchronized void removeVectorUpdateEventListener(VectorUpdateEvent l)
listListeners.remove(listListeners.indexOf(l));
protected void notifyVectorUpdateEvent(Object source)
VectorUpdateEvent evt = new VectorUpdateEvent(source);
Iterator itr = listListeners.iterator();
while (itr.hasNext())
((VectorUpdateListener)itr.next()).eventVectorUpdated(evt);
private ArrayList listListeners;
class where the event originates
class NodePanel
extends JPanel
implements ActionListener, ListSelectionListener
/////////////Constructors/////////////////////////
public NodePanel()
addNodeButton = new JButton("Add Node");
delNodeButton = new JButton("Delete Node");
dumpNodeButton = new JButton("Dump Node");
reloadNodeButton = new JButton("Reload Node");
browseButton = new JButton("Browse Node");
exitButton = new JButton("Exit");
add(addNodeButton);
add(delNodeButton);
add(dumpNodeButton);
add(reloadNodeButton);
add(browseButton);
add(exitButton);
setButtonsEnabled(false);
addNodeButton.addActionListener(this);
delNodeButton.addActionListener(this);
dumpNodeButton.addActionListener(this);
reloadNodeButton.addActionListener(this);
browseButton.addActionListener(this);
exitButton.addActionListener(this);
nodesVector = new Vector();
nodesList = new JList(nodesVector);
this.vectorNodeAttributes = new Vector();
JScrollPane scrollPane = new JScrollPane(nodesList);
add(scrollPane,BorderLayout.CENTER);
nodesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
nodesList.addListSelectionListener(this);
////////////////Methods///////////////////////////
/////////////Event valueChanged///////////////////
public void valueChanged(ListSelectionEvent evt)
JList source = (JList) evt.getSource();
setButtonsEnabled(true);
desiredNode = (String) source.getSelectedValue();
if (desiredNode == null)
setButtonsEnabled(false);
//////////////Event actionPerformed////////////
public void actionPerformed(ActionEvent evt)
Object source = evt.getSource();
if (source == addNodeButton)
addNodeButtonClicked();
else if (source == delNodeButton && desiredNode != null)
deleteNodeButtonClicked();
else if (source == dumpNodeButton && desiredNode != null)
JFileChooser d = new JFileChooser();
//d.setCurrentDirectory("");
d.setFileFilter(new XMLFilter());
int result = d.showSaveDialog(this);
else if (source == reloadNodeButton && desiredNode != null)
JFileChooser d1 = new JFileChooser();
//d.setCurrentDirectory("");
d1.setFileFilter(new XMLFilter());
int result = d1.showOpenDialog(this);
//String filename=d1.getSelectedFile().getName();
if (source == browseButton && desiredNode != null)
browseButtonClicked();
else if (source == exitButton)
System.exit(0);
//////////Enables or Diables the Buttons////////
private void setButtonsEnabled(boolean enable)
delNodeButton.setEnabled(enable);
dumpNodeButton.setEnabled(enable);
reloadNodeButton.setEnabled(enable);
browseButton.setEnabled(enable);
private void deleteNodeButtonClicked()
if (noFieldDlg != null)
noFieldDlg.dispose();
noFieldDlg = new NoFieldDialog("Delete the Node?");
noFieldDlg.show();
if (noFieldDlg.getDialogResult() == DialogResult.OK)
int nodeToRemove=0;
for (int i=0; i< vectorNodeAttributes.size(); i++)
if(((NodeAttributes)(vectorNodeAttributes.get(i))).getNodeName().compareTo(nodesList.getSelectedValue()) == 0)
nodeToRemove = i;
vectorNodeAttributes.remove(nodeToRemove);
nodesVector.removeElement(nodesList.getSelectedValue());
this.nodesList.setListData(nodesVector);
NodePanel.nodesPresent = nodesVector;
updateStaticNodeList();
/*************** as soon as the NodePanel.nodesPresent is updated, the changes are to be reflected in the Schedule Panel ******************/
VectorUpdateEvent e = new VectorUpdateEvent(this);
VectorUpdateEventIssuer v = new VectorUpdateEventIssuer();
v.addVectorUpdateEventListener(e);
v.notifyVectorUpdateEvent(this);
///////////////Data Members////////////////////
private JButton addNodeButton;
private JButton delNodeButton;
private JButton dumpNodeButton;
private JButton reloadNodeButton;
private JButton browseButton;
private JButton exitButton;
private String desiredNode;
private OneFieldDialog oneFieldDlg = null;
private NoFieldDialog noFieldDlg = null;
private JList nodesList;
private Vector nodesVector;
private Vector vectorNodeAttributes;
private static Vector nodesPresent = null;
} // end class NodePanel
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
////////////////Class SchedulePanel////////////////
class SchedulePanel extends JPanel
implements ActionListener, ListSelectionListener, VectorUpdateListener
////////////////Constructors//////////////////
public SchedulePanel()
addScheduleButton = new JButton("Add Schedule");
delScheduleButton = new JButton("Delete Schedule");
dumpScheduleButton = new JButton("Dump Schedule");
reloadScheduleButton = new JButton("Reload Schedule");
browseScheduleButton = new JButton("Browse Schedule");
exitButton = new JButton("Exit");
add(addScheduleButton);
add(delScheduleButton);
add(dumpScheduleButton);
add(reloadScheduleButton);
add(browseScheduleButton);
add(exitButton);
setButtonsEnabled(false);
addScheduleButton.addActionListener(this);
delScheduleButton.addActionListener(this);
dumpScheduleButton.addActionListener(this);
reloadScheduleButton.addActionListener(this);
browseScheduleButton.addActionListener(this);
exitButton.addActionListener(this);
scheduleVector = new Vector();
scheduleList = new JList(scheduleVector);
this.vectorScheduleOperations = new Vector();
JScrollPane scrollPane = new JScrollPane(scheduleList);
add(scrollPane);
scheduleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
scheduleList.addListSelectionListener(this);
//updateEventListener = new VectorUpdateEventIssuer();
//updateEventListener.addVectorUpdateEventListener(this);
/////////////Methods///////////////////////
////////////Event valueChanged/////////////
public void valueChanged(ListSelectionEvent evt)
JList source = (JList)evt.getSource();
setButtonsEnabled(true);
desiredSchedule = (String)source.getSelectedValue();
if (desiredSchedule == null)
setButtonsEnabled(false);
////////////Event actionPerformed////////
public void actionPerformed(ActionEvent evt)
Object source = evt.getSource();
if (source == addScheduleButton )
addScheduleButtonClicked();
else if (source==delScheduleButton && desiredSchedule!=null)
deleteScheduleButtonClicked();
else if (source == dumpScheduleButton && desiredSchedule!=null)
JFileChooser d = new JFileChooser();
d.setFileFilter(new XMLFilter());
int result = d.showSaveDialog(this);
else if (source == reloadScheduleButton && desiredSchedule!=null)
JFileChooser d1 = new JFileChooser();
d1.setFileFilter(new XMLFilter());
int result = d1.showOpenDialog(this);
else if (source == browseScheduleButton && desiredSchedule!=null)
browseScheduleButtonClicked();
else if (source == exitButton)
System.exit(0);
public void eventVectorUpdated(VectorUpdateEvent event)
System.out.println("Hello! EventRaised");
///////////Data Members//////////////////
private JButton addScheduleButton;
private JButton delScheduleButton;
private JButton dumpScheduleButton;
private JButton reloadScheduleButton;
private JButton browseScheduleButton;
private JButton exitButton;
private String desiredSchedule;
private OneFieldDialog oneFieldDlg = null;
private NoFieldDialog noFieldDlg = null;
private JList scheduleList;
private Vector scheduleVector;
private Vector vectorScheduleOperations;
private VectorUpdateEventIssuer updateEventListener;
} // end class SchedulePanel
I hope you understood my problem now. The NodeAttributes is a datastructure containing the node name and an associated table for that. THe ScheduleOperations is similar to the NodeAttributes but it contains a DefaultTableModel which inturn consists of a column which is filled with the list of current nodes available + their schedules.
I am sorry for my long posting.
Thanks once again in anticipation. -
Dynamic Event Creation and Handling the events
Hi All
I am using WAS 6.4.
I have two components say Component A and Component B in which Component A is a reusable component and is used by other components say for e.g the Component B.
The following is the requirement.
Component A should create buttons for other components dynamically.
As an example, Component B specifies to Component A the buttons required say button B1 and button B2.
Component B also contains methods M1 and M2 for the buttons created by the component A.
Now I would like to associate these buttons created by component A with the methods created in Component B
The number of buttons that are to be created may vary from component to component.
If any one as any suggestion or solution, help me out.
Thanks
Regards
NagaKishoreHi NagaKishore,
I'm not exactly sure why you want to do this, but it is pretty easy if I switch it up a bit. (Maybe you are trying to create a navigation page or something?)
Instead of your component B using component A, if you define a Web Dynpro interface in component A, then implement this interface in component B (or all component Bs), achieving your goal would not be too difficult. It could define a generic method (or event) with a "button key" as an argument that would tell component B which button was pressed and allow it to behave as desired. The Web Dynpro interface defined in A could also have an interface context that would allow the the button text to be passed along with (for the sake of simplicity) a "button key" that component that should be triggered when the button is pressed. (Note this could be a varying size list as required.)
The component B(s) need not be known until run-time. They can be created using something like:
wdThis.wdGet<Used Compontne Name>ComponentUsage().createComponent(<Component Name>,<Object Name (if in a different component)>)
Once the component is created, the context can be accessed giving the list of buttons to create and the values. The buttons can be created in the wdModifyView during the first pass of the creation of the view displaying the buttons (after the dynamic creation of the used components which can occur in the wdDoInit of the component controller).
If the user presses a chosen button on component A, then the generic method (most likely an event) of component Bs interface is called and passed the "button key", component B then takes over. Note this would also work if component B had a visualization component that must be displayed through an interface view that is defined on the web dynpro component interface that is implemented by B.
Hope this helps or at least triggers discussion that will answer your question,
--Greg -
Event handling in portal through sap netweaver.
Hi...
Please let me know..how to evoke event handling in iviews..thru sap netweaver in ep.Hi,
For iview event handling you can use EPCF (<b>Enterprise Portal Client Framework (EPCF) provides an infrastructure for scripting used in iViews and by the portal</b>.)
http://help.sap.com/saphelp_nw04s/helpdata/en/ce/3e98408d953154e10000000a1550b0/frameset.htm
/** The below link is a link to a PDF of EPCF details **/
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/771fa290-0201-0010-3d93-865e66cc6d7e
Go to this link and download the pdf.This could be some help to you.
Thanks
Ritu
/Helpfull answer will be rewarded with points/ -
What is Triggering and Handling Events in ABAP OOPs
Gowri
) TYPE type ..
To declare static events, use the following statement:
CLASS-EVENTS ... ...
It links a list of handler methods with corresponding trigger methods. There are four different types of event.
It can be
· An instance event declared in a class
· An instance event declared in an interface
· A static event declared in a class
· A static event declared in an interface
The syntax and effect of the SET HANDLER depends on which of the four cases listed above applies.
For an instance event, you must use the FOR addition to specify the instance for which you want to register the handler. You can either specify a single instance as the trigger, using a reference variable
After the RAISE EVENT statement, all registered handler methods are executed before the next statement is processed (synchronous event handling). If a handler method itself triggers events, its handler methods are executed before the original handler method continues. To avoid the possibility of endless recursion, events may currently only be nested 64 deep.
Handler methods are executed in the order in which they were registered. Since event handlers are registered dynamically, you should not assume that they will be processed in a particular order. Instead, you should program as though all event handlers will be executed simultaneously.
"Example :
REPORT demo_class_counter_event.
CLASS counter DEFINITION.
PUBLIC SECTION.
METHODS increment_counter.
EVENTS critical_value EXPORTING value(excess) TYPE i.
PRIVATE SECTION.
DATA: count TYPE i,
threshold TYPE i VALUE 10.
ENDCLASS.
CLASS counter IMPLEMENTATION.
METHOD increment_counter.
DATA diff TYPE i.
ADD 1 TO count.
IF count > threshold.
diff = count - threshold.
RAISE EVENT critical_value EXPORTING excess = diff.
ENDIF.
ENDMETHOD.
ENDCLASS.
CLASS handler DEFINITION.
PUBLIC SECTION.
METHODS handle_excess
FOR EVENT critical_value OF counter
IMPORTING excess.
ENDCLASS.
CLASS handler IMPLEMENTATION.
METHOD handle_excess.
WRITE: / 'Excess is', excess.
ENDMETHOD.
ENDCLASS.
DATA: r1 TYPE REF TO counter,
h1 TYPE REF TO handler.
START-OF-SELECTION.
CREATE OBJECT: r1, h1.
SET HANDLER h1->handle_excess FOR ALL INSTANCES.
DO 20 TIMES.
CALL METHOD r1->increment_counter.
ENDDO.
The class COUNTER implements a counter. It triggers the event CRITICAL_VALUE when a threshold value is exceeded, and displays the difference. HANDLER can handle the exception in COUNTER. At runtime, the handler is registered for all reference variables that point to the object.
Reward points if it is usefull ...
Girish -
Event handling in Portal IView of JspDynpage
Hi All,
I have created the portal iview with jspdynpage.Can any body tell whether event handling can be performed from the portal iview which is created from the jspdynpage?
Regards,
V Karthihi
check this threads
Event handling in portal through sap netweaver.
From creation of JSP page to iView at Portal
Thanks -
How to throw and handle event defined in component interface
Hi folks,
I have defined a component interface with an event 'open_info'
I have some sub components which are implementing that component interface. I also get the two events generated (the interface check box is not marked)
I use those sub components and try to handle the event. but unfortunately the event is not handled.
I'm not sure if I do everything right. I checked the interface checkbox at the events tab of the controller of the sub component. I then may handle the event in the embedding main component. but it appears to be a different event.
probably I eed to access the interface controller and throw the event there, but I don't know how.
I couldn't fnd documentation or wdr* components which deal with that issue. do you have any suggestions?
regards
stefanHi Stefan,
Do the following in the component being used:
say component name is ZCMP_01
go to COMPONENTCONTROLLER
Create an Event with necessary parameters if needed, say Event name is EVNT_01 and has an importing parameter, say PARAM_01 type char10,
Make sure you have set the interface check box. Now this event is available in the INTERFACECONTROLLER.
Say ZCMP_01 has a view with a button, on click of the button, call a method in the COMPONENTCONTROLLER.
Perform all the required operations, At the required point, fire EVNT_01
wd_this->fire_EVNT_01_evt(
PARAM_01 = 'sample' ).
Now the other component that has to use ZCMP_01, say ZCMP_02
In the component properties od ZCMP_02, add usage for ZCMP_01, say USG_CMP_01
Go to the view in ZCMP_02 where you wish to handle the event EVNT_01 of ZCMP_01,
Go to Methods tab, create an event hadler, say EVNT_01_HNDLR ... method type = Event Handler,
Event = EVNT_01, Controller = INTERFACECONTROLLER, Component Use, USG_CMP_01.
Now your event handler will have foll parametrs: WDEVENT .. type ref to CL_WD_CUSTOM_EVENT,
PARAM_01 type CHAR10
Handle the event as required.
Regards,
Reema. -
Portal Event name and namespace (ECM)
Hi Experts
I want to register for the Portal Event that gets triggered when an employee is selected.
In the Compensation Information page, there is an employee search iview. I need to know what Portal Event name and namespace is triggered when an employee is selected.
Does somebody already know what the name and namespace is?
thanks in advance
Anton KruseFound the solution here: Parameter Passing from WDJ iview to WDABAP Iview
call function 'HR_ASR_WDA_GET_EMPLOYEE'
exporting
id = 'MSS01' "ABAP Memory ID To get the PERNR Selected.
importing
pernr = gv_pernr. -
Revision: 16673
Revision: 16673
Author: [email protected]
Date: 2010-06-25 09:43:24 -0700 (Fri, 25 Jun 2010)
Log Message:
Removed selectors and tags, We are now using dispatchers and explicit event types to handle commands
Modified Paths:
cairngorm3/trunk/samples/insync/insync-basic/src/InsyncContext.mxml
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/RefreshSearchAfterSav eController.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/RemoveContactCommand. as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/RemoveContactIntercep tor.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/SaveContactCommand.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/SearchEvent.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/presentation/ContactFormPM.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/presentation/ContactsListPM.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/presentation/ContactsNavigatorPM. as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/presentation/ToolbarPM.as
cairngorm3/trunk/samples/insync/insync-basic/test/insync/application/RefreshSearchAfterSa veControllerTest.as
cairngorm3/trunk/samples/insync/insync-basic/test/insync/application/RemoveContactCommand Test.as
cairngorm3/trunk/samples/insync/insync-basic/test/insync/application/SaveContactCommandTe st.as
Added Paths:
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/AddContactEvent.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/EditContactEvent.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/RemoveContactEvent.as
cairngorm3/trunk/samples/insync/insync-basic/src/insync/application/SaveContactEvent.asbleach wrote:
i see these
URxvt*background: #171717
URxvt*foreground: #B2B2B2
URxvt*color0: #171717
URxvt*color1: #3D3D3D
URxvt*color2: #ffffff
are not commented out
3d3d3d is for red but you have a blackish and color2 is for green but you have it white the rest should be the default colors. it uses the same colors only it changes the vairiant of the color you choice there or normally moc uses colors such as green blue and such which will call your console colors for those respective fields I know moc has /user/share/moc/themes/ that you can edit or make your own for instance copy one and edit it. I think htop uses the same color count which is 8 but with so green will be white when you use urxvt. 8 for normal colors 16 for bright dark and urxvt is 256 which is 16 but can use any of the 256 colors for 16.
just to clarify you have commented out your colors 4-15 and your green and red is weird, and htop aswell as moc is 8 bit. moc theme_yellow_red is default for background so it will use urxvts background
Haahaha, that is simple. And it works!!!
I didn't bother with commenting that because i thought they are not applied. Anyway, thanks man. My urxvt terminal si grateful to you and your thorough explanation. SOLVED! -
[JS] Basic question about event listeners and event handlers
I am very new to the whole topic of event listeners and event handlers. I'd run the test for the following problem myself, but I don't know where to start, and I just want to know if it's impossible -- that is, if I'm misunderstanding what event listeners and event handlers do.
Say I have an InDesign document with a text frame that is linked to an InCopy story. Can I use an "afterImport" event listener on the text frame to perform some action any time the link to the InCopy story gets updated? And will the event handler have access to both the story that is imported, and the pathname of the InCopy file?
Thanks.Thank you, Kasyan.
Both of those are good solutions.
We are currently using InDesign CS4 and InCopy CS5. I'm hoping to get them to purchase the whole CS5 suite soon, since I'd like to start writing scripts for InDesign CS5 as soon as possible, as long as I'm going to have to be doing it in the not too distant future anyway. The greater variety of event handlers sounds like it might be something that is crucial to the project I'm working on, so that adds to the argument for getting CS5.
Thanks again. You have no idea how helpful this is. I made some promises to my boss yesterday that I later realized were based on assumptions of mine about the InDesign/InCopy system that didn't make any sense, and I was going to have to retract my promises. But after reading your response I think I can still deliver, in a slightly different way that I had been thinking before.
Richard -
Hello,
Here's quite a tricky problem, which I could need some help for.
I have an object of class cl_gui_dialogbox_container with some HTML in it. The users can resize and move the control on the screen. Now position and size shall be kept in a dictionary table for each user.
I've registered the three events close, move_contol and size_control
CALL METHOD gc_dialogbox->set_registered_events
EXPORTING
events = gt_events
with event_ids 8, 11 and 12 and set the three handlers, e.g.
SET HANDLER cl_event_receiver_tree=>handle_close
FOR gc_dialogbox.
I created three corresponding methods handle_close, handle_move_control and handle_size_control.
Well, so far for what I've done. Now the results:
If I close the dialogue box, ABAP correctly jumps into method handle_close. But at that point, the control has already been closed! So I can't read size and position any more.
If I move or rezise the window, nothing at all happens... Not even the debugger would pop up if I do anything with the box.
Does anyone here know how to do this?
Thanks!
Jan
Edited by: Jan Krohn on Nov 22, 2008 3:17 PMA quick update in case anyone else is looking for a solution:
I've still not found out how to handle the events move_control and size_control.
However, when handling close_control, it's possible to catch size and position:
call the methods to obtain size and/or position
call a cfw flush
only then the parameters will be filled with the correct values.
Important: This must happen after the close button has been pressed, but before the control will be destroyed. So put it in the correct place in your source code. -
OO ALV validation check without event DATA_CHANGED and results via popup
Hi Gurus,
I'm working on SAP ECC 6.0 and I'm facing a problem during the ALV validation check. My requirement is to show an ALV with one editable field. In addition I have to pre-initialize this field in order to give a reference value to the user, but this is not always correct, or better, this field represent the maximum amount available, but, because of other validation checks, this field is not always correct (and it's ok, it's not a problem), and if it is greater than another amount I have to display an error.
I was thinking about catching the event DATA_CHANGED and do the checks inside of it. It works but not completely, because if the user do not change anything the event is not raised and I cannot do my checks.
My solution is to do the checks without catching the DATA_CHANGED event and display the errors in a separate popup window.
The checks are ok, but I have problems during the displaying of the results: I would like to use the class CL_ALV_CHANGED_DATA_PROTOCOL in order to display the errors, I tried creating the Object:
Data: go_Error Type Ref To CL_ALV_CHANGED_DATA_PROTOCOL.
Create Object go_Error
Exporting
* i_container =
i_calling_alv = go_0200_Alv
giving it a reference to the ALV (the go_0200_Alv is my CL_GUI_ALV_GRID object).
Then I did many Call Methods to the Add_Protocol_Entry to add the message in the protocol and then display them calling the Display_Protocol Method of my "go_Error".
The Popup is shown and the "links" to the ALV are correct (if I double click a message it selects the corresponding row of the ALV, but (and it's my problem) I cannot see the Description of the Column with the error: the popup window is an ALV grid itself with 3 columns ("Message Type", "Name of the Column" and "Message Text") where I can see correctly the Message Type and the Message Text but not the name of the column.
Debugging the code I found that If I catch the event, the parameter er_Data_Changed (the class CL_ALV_CHANGED_DATA_PROTOCOL) is filled with some other informations like Modified Rows and other attributes like FieldCatalog, Row-ID, so I thought the problem was related to that, and that's why I replicated the whole case in my processing, filling every table I would see if I use the "standard way" for validation. Bu it didn't correct the error. I still don't see the name of the Column.
This is my code, it's only the part interested, If you need other informations, please ask me and I will copy them.
form CHECK_ALV_0200_0110 Changing pc_Error Type Char01.
Data: lt_MatchK1 Type tp_Matches1_Key_t,
l_Message Type Char100,
l_MessX Type String,
l_QtaRes Type ZDM_AMT_ASSIGNED,
l_QtaAcc Type ZDM_AMT_ACCRUED,
l_QtaStep Type ZDM_AMT_ASSIGNED.
Field-Symbols: <fs_Table> Type Standard Table,
<fs_Master> Type Standard Table,
<fs_Mod_Cell> Type LVC_S_MODI,
<fs_Line> Type Any,
<fs_Field> Type Any,
<fs_Any> Type Any.
Data lt_Matches_Alv_Mod Type tp_Matches1_Alv_t.
Data ls_Modi Type LVC_S_MODI.
Data: l_Row_ID Type I,
l_Tabix Type I.
Field-Symbols: <fs_Match_ALV> Type tp_Matches1_Alv_s.
Free go_Error.
CREATE OBJECT go_Error
EXPORTING
* i_container =
i_calling_alv = go_0200_Alv
* Validation Checks
Clear pc_Error.
Clear ls_Modi.
Loop At gt_Matches1_Alv Assigning <fs_Match_ALV>.
l_Tabix = Sy-Tabix.
Check <fs_Match_ALV>-Status Eq con_Status_Temp.
* Set the Modified Row for the CL_ALV_CHANGED_DATA_PROTOCOL object
Append <fs_Match_ALV> To lt_Matches_Alv_Mod.
Add 1 To ls_Modi-Row_Id.
ls_Modi-FieldName = 'AMT_DEDUCTED'.
Write <fs_Match_ALV>-Amt_Deducted To ls_Modi-Value Currency <fs_Match_ALV>-Waers.
Condense ls_Modi-Value No-Gaps.
ls_Modi-Tabix = l_Tabix.
Append ls_Modi To: go_Error->mt_Mod_Cells,
go_Error->mt_Good_Cells.
l_Row_ID = ls_Modi-Row_Id.
Clear l_Message.
If <fs_Match_ALV>-Amt_Deducted Eq 0.
pc_Error = con_X.
CALL METHOD go_Error->Add_Protocol_Entry
EXPORTING
i_msgid = 'ZDMV'
i_msgty = 'E'
i_msgno = '005'
* i_msgv1 =
* i_msgv2 =
* i_msgv3 =
* i_msgv4 =
i_fieldname = 'AMT_DEDUCTED'
i_row_id = l_Row_ID
* i_tabix =
Continue.
EndIf.
Case g_Dynnr.
When '0110'.
Perform Get_ResQtaDispute1 Using lt_MatchK1
<fs_Match_ALV>
Changing l_QtaRes.
Perform Get_ResQtaAccrued1 Using <fs_Match_ALV>
Changing l_QtaAcc.
* When '0111'.
* Perform Get_ResQtaDispute2 Using lt_MatchK2
* <fs_Match_ALV>
* Changing l_QtaRes.
* Perform Get_ResQtaAccrued2 Using <fs_Match_ALV>
* Changing l_QtaAcc.
EndCase.
Add <fs_Match_ALV>-Amt_Deducted To l_QtaStep.
If l_QtaStep > l_QtaRes.
* Store the Error
pc_Error = con_X.
Write l_QtaRes To l_Message Currency <fs_Match_ALV>-Waers.
Condense l_Message No-Gaps.
CALL METHOD go_Error->Add_Protocol_Entry
EXPORTING
i_msgid = 'ZDMV'
i_msgty = 'E'
i_msgno = '002'
i_msgv1 = l_Message
* i_msgv2 =
* i_msgv3 =
* i_msgv4 =
i_fieldname = 'AMT_DEDUCTED'
i_row_id = l_Row_ID
* i_tabix =
EndIf.
If l_QtaStep > l_QtaAcc.
* Store the Error
pc_Error = con_X.
Write l_QtaAcc To l_Message Currency <fs_Match_ALV>-Waers.
Condense l_Message No-Gaps.
CALL METHOD go_Error->Add_Protocol_Entry
EXPORTING
i_msgid = 'ZDMV'
i_msgty = 'E'
i_msgno = '002'
i_msgv1 = l_Message
* i_msgv2 =
* i_msgv3 =
* i_msgv4 =
i_fieldname = 'AMT_DEDUCTED'
i_row_id = l_Row_ID
* i_tabix =
EndIf.
EndLoop.
If pc_Error Eq con_X.
* If there was at least one error, Display the Popup
go_Error->mt_FieldCatalog[] = gt_0200_FCat[].
go_Error->ms_Layout-Zebra = con_X.
Get Reference Of lt_Matches_Alv_Mod[] Into go_Error->Mp_Mod_Rows.
CALL METHOD go_error->display_protocol
* EXPORTING
* i_container =
* i_display_toolbar =
* i_optimize_columns =
EndIf.
EndForm.
Do you know if there is a particular issue about that? Or, maybe, I'm doing something wrong...
Please help me
Regards,
Claudio
Edited by: Claudio Distrutti on Oct 31, 2008 12:38 PMHello Claudio
Nobody prevents you from calling your event handler method go_grid->HANDLE_DATA_CHANGED directly!
What do I mean with that?
I assume you are calling method go_grid->CHECK_CHANGED_DATA at the beginning of the PAI module to catch any changes from the editable ALV grid. Within the event handler method you do your validation and send the error popup if necessary.
Now when the user closes the error popup and pushes e.g. the SAVE button then I can happen that method HANDLE_DATA_CHANGED does not trigger event DATA_CHANGED because nothing was indeed changed on the ALV grid. Yet the invalid value is still there.
However within the FORM routine for saving the data you can just call your event handler method directly:
FORM save_data.
CALL METHOD go_grid->handle_data_changed
EXPORTING
* er_data_changed =
e_ucomm = 'SAVE'.
ENDFORM.
Now within your event handler method you always know when the method was called because if method CHECK_CHANGED_DATA triggers event DATA_CHANGED the IMPORTING parameter ER_DATA_CHANGED is bound whereas it is empty when the method is called from your SAVE routine.
METHOD handle_data_changed.
DATA: lo_log TYPE REF TO CL_ALV_CHANGED_DATA_PROTOCOL.
IF ( er_data_changed IS BOUND ).
lo_log = er_data_changed.
ELSE.
CREATE OBJECT lo_log.
ENDIF.
" Do the validations and send error log if necessary
lo_log->DISPLAY_PROTOCOL( ).
ENDMETHOD.
Regards
Uwe -
Page cannot be displayed' error when 2 events (FireAction and GO) fired
We have created a framework page where FireAction event will be executed
when the value of a calendar item is modified. When we modify the
value and leave the cursor in the field (without tabbing out), and click
GO button, 'Page cannot be displayed' error message will be displayed.
When FireAction event is started, we use CO to retrieve the event. And
when the cursor remains in item1 after being modified and click GO,
2 events will be started (the FireAction event and the GO button's event)
and 'Page cannot be displayed' error will be shown since CO is retrieving
2 events at the same time.
Since by changing certain fields of framework page without tabbing out
is a regualar operation, how can we go around this error when we are
using FireAction event?
sample34_00co.java
package oracle.apps.xx03.ap.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.OADialogPage;
import java.util.Calendar;
* Controller for ...
public class Sample34_00CO extends OAControllerImpl
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
public StringBuffer message = new StringBuffer();
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
Calendar cal = Calendar.getInstance();
// When the browser back button is not executed
if (!pageContext.isBackNavigationFired(false))
System.out.println("NOT FROM BACK BUTTON!! ["+cal.getTime()+"]");
// When the browser back button is executed
else
System.out.println("FROM BACK BUTTON!! ["+cal.getTime()+"]");
//Action being performed when the browser back button is executed
OADialogPage dialogPage = new OADialogPage(STATE_LOSS_ERROR);
pageContext.redirectToDialogPage(dialogPage);
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
Calendar cal = Calendar.getInstance();
if ( "updateItem1".equals(pageContext.getParameter(EVENT_PARAM)) )
//When FireAction is executed
System.out.println("item1 FireAction is executed! ["+cal.getTime()+"]");
else
//When other actions beside FireAction is executed
System.out.println("item1 FireAction is not executed! ["+cal.getTime() +"]");
sample34_00pg.xml
<?xml version = '1.0' encoding = 'UTF-8'?>
<!-- dbdrv: exec java oracle/jrad/tools/xml/importer XMLImporter.class java &phase=dat+24 checkfile:~PROD:~PATH:~FILE &fullpath:~PROD:~PATH:~FILE -username &un_apps -password &pw_apps -dbconnection &jdbc_db_addr -userId "1" -rootPackage /oracle/apps/~PROD -rootdir &fullpath:~PROD:mds:directory -->
<page xmlns:jrad="http://xmlns.oracle.com/jrad" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:ui="http://xmlns.oracle.com/uix/ui" version="9.0.3.8.11_1183" xml:lang="en-US" xmlns:user="http://xmlns.oracle.com/jrad/user" xmlns="http://xmlns.oracle.com/jrad" file-version="$Header$">
<content>
<oa:pageLayout id="PageLayoutRN" windowTitle="Sample34_00 WindowTitle" amDefName="oracle.apps.fnd.framework.server.OAApplicationModule" title="Sample34_00 PageHeader">
<ui:corporateBranding>
<oa:image id="corporateBrandingImage" source="/OA_MEDIA/FNDSSCORP.gif"/>
</ui:corporateBranding>
<ui:contents>
<oa:messageComponentLayout id="MainRN" controllerClass="oracle.apps.xx03.ap.webui.Sample34_00CO">
<ui:contents>
<oa:messageTextInput id="item1" prompt="item1" dataType="DATE">
<ui:primaryClientAction>
<ui:fireAction event="updateItem1"/>
</ui:primaryClientAction>
</oa:messageTextInput>
<oa:messageLayout id="ButtonLayout">
<ui:contents>
<oa:submitButton id="Go" use="/oracle/apps/fnd/attributesets/Buttons/Go"/>
</ui:contents>
</oa:messageLayout>
</ui:contents>
</oa:messageComponentLayout>
</ui:contents>
</oa:pageLayout>
</content>
</page>
----------Shive...good one..!!
One thing that you can do if you don't wanna have PPR, is to validate date column in fire action event in CO in process form request, and raise an error if you don't find appropriate format or null , as per your requirement.
--Mukul -
Problem declaring and using a REF CURSOR
I'm having a real problem using a REF CURSOR type
Here's the DECLARE and the start of the BEGIN I've so far developed.
DECLARE
TYPE r1 IS RECORD (
szvcapc_pidm szvcapc.szvcapc_pidm%TYPE,
szvcapc_term_code szvcapc.szvcapc_term_code%TYPE,
szvcapc_request_no szvcapc.szvcapc_request_no%TYPE);
szvcapc_rec r1;
TYPE cursor_1 IS REF CURSOR RETURN r1;
szvcapc_cv cursor_1;
TYPE r2 IS RECORD (
stvests_code stvests.stvests_code%TYPE
stvests_rec r2;
TYPE cursor_2 IS REF CURSOR RETURN stvests_rec;
stvests_cv cursor_2;
BEGIN
OPEN szvcapc_cv FOR
SELECT szvcapc_pidm, szvcapc_term_code, szvcapc_request_no
FROM szvcapc
WHERE szvcapc_passed_ind = 'Y'
AND szvcapc_award_credits = 'N';
LOOP
FETCH szvcapc_cv INTO szvcapc_rec;
EXIT WHEN szvcapc_cv%NOTFOUND;
END LOOP;
OPEN stvests_cv FOR
SELECT stvests_code
FROM stvests
WHERE stvests_eff_headcount = 'Y';
LOOP
FETCH stvests_cv INTO stvests_rec;
EXIT WHEN stvests_cv%NOTFOUND;
END LOOP;
SELECT *
FROM (
<snip>
INNER JOIN stvests_rec
ON SFBETRM.SFBETRM_ESTS_CODE = stvests_rec.STVESTS_CODE
<snip>
I later try to use the stvests_rec and szvcapc_rec in the main SELECT statement it doesn't recognise stvests_rec and szvcapc_rec as a "Table or View".
I have to use a REF CURSOR as this code is ultimately for use in Oracle Reports.
What am I doing wrong?> The reason I'm trying to use a REF CURSOR is that I was told that you
couldn't use CURSORs in Oracle Reports.
That does not change anything ito what happens on the Oracle server side. A cursor is a cursor is a cursor.
Every single SQL winds up as a cursor. Each cursor has a reference handle to access and use. HOW this handle is used in the language differs. But that is a language issue and not an Oracle RDBMS issue.
For example. An EXECUTE IMMEDIATE in PL/SQL creates a cursor handle and destroys it after use - automatically. An implicit cursor works the same. An explicit cursor you have the handle fetch from it and close from it when done.
A ref cursor is simply a handle that can be returned to an external client - allowing that application to use the handle to fetch the rows.
Do not think that a ref cursor is any different from the RDBMS side than any other cursor. The RDBMS does not know the difference. Does not care and nor should it.
> I'm trying to reduce the hits on the database from nested selects by
removing the dataset from the main SELECT statement and performing it only
once outside and then referencing this previously collected dataset inside the
main SELECT statement.
Good stuff that you are considering SQL performance. But you need to make sure that you
a) identify the performance inhibitor issue correctly
b) address this issue correctly
And you need to do that within SQL. Not PL/SQL. PL/SQL will always be slower at crunching data than SQL. For example, wanting to cache the data somehow to reduce the read overhead - that is exactly what the DB buffer cache does. It caches data. That is also exactly what the CBO will attempt - reduce the amount of data that needs to be read and processed.
Not saying that the RDBMS can do it all. It needs help from you - in the form of a SQL that instructs it to process only the minimum amount of data required to get the required results. In the form of a sound physical design that provides optimal usage of data storage and access (like indexing, partitioning, clustering, etc).
Bottom line - you cannot use a REF CURSOR to make a SQL go faster. A REF CURSOR is simply a cursor in the SQL Engine. A cursor is nothing but the "compiled-and-executable" code of a SQL "source program". -
QT in html, events fired and movie internals doc
Hi,
The Javascript Scripting Guide says under "Executing JavaScript Functions From QuickTime", page 11:
Wired actions can be triggered by user interaction, as a result of a frame in the movie being displayed, or as the
result of arbitrary wired calculations.
It also briefly describes (page 23) the matrix and rectangle properties, saying "You can use a movie’s transformation matrix to scale, translate, and rotate the movie image. For details on the transformation matrix, see Movie Internals."
And the Rectangle is defined as "void SetRectangle(string rect)"
Where can I find the reference to the events fired by QT automatically ?
Where can I find this Movie Internals description ?
I'm not very familiar with javascript... That's not a QT issue, but where can I find a description of the rect ?
Many thanks
Jean-Pierre
Windows XP ProYes, you can navigate to other pages using buttons/code in an swf file. And you can trigger an event as well, though I don't know if that's what you intended to say if navigating to another page is what you are really after.
In AS3, to make a button work with code, you need to add an event listener and event handler function for it. You might need to add a few (for different events, like rollover, rollout, clicking it, but for now we'll just say you want to be able to click it to get a web page to open. In the timeline that holds that button, in a separate actions layer that you create, in a frame numbered the same as where that button exists, you would add the event listener:
btn1.addEventListener(MouseEvent.CLICK, btn1Click);
The name of the unique function for processing the clicking of that button is specified at the end of the event listener assignment, so now you just have to write that function out:
function btn1Click(evt:MouseEvent):void {
var url:String = "http://www.awebsite.com/awebpage.html";
var req:URLRequest = new URLRequest(url);
navigateToURL(req);
Maybe you are looking for
-
Assigning a DataProvider filter value with JavaScript
I have a "Fiscal Yr/Period" filter characteristic in my web application that I am assigning the value of the current month and year when the web application is loaded. In other words, this filter is applied to the DataProvider when the application l
-
How do i update iphone 4 without losing my apps or music
how do i update my iphone 4 without losing apps data music
-
IN R/3 SYS logical system creation
Hi people in idoc2file scenario i created logical system for 2 clients 1. is for r/3 system for example 800 (LS800) 2. is for pi system for example 100(LS100) in r/3 system only i created this two LS so creation is compl
-
Photoshop CS2 Layer Styles / Blending Options stopped working
I'm running Photoshop CS2 on PC. When right clicking on layers to bring up the Layer Styles / Blending Options palette, I can get the palette okay but the selections won't work when I check the boxes. I try to select different options....drop shadow,
-
Error connecting jsp with MS SQL Server 2000
Dear all, I have developed a simple application in java for connecting with SQL Server. But the same thing is not working in jsp. We are using Tomcat 4.0 as a server. Which jar files am I supposed to keep in the Tomcat folder and plz, give the entire