Get aplication module from an event
Hi.
I need get the aplication module from an event:
public static EventResult handleLovValidateEvent(
BajaContext context,
Page page,
PageEvent event)
System.out.println("[LovEvents]Lov Validate Event");
ConsultasAppMod am= (ConsultasAppMod)ServletBindingUtils.getApplicationModule(context);
ViewObject vo = am.findViewObject("EntidadesExternasView");
String searchText = event.getParameter("searchText");
EventResult result = new EventResult();
result.setProperty("showWindow", Boolean.TRUE);
result.setProperty("fieldText", "xpto");
return result;
but the variable "am" have null value, so when i try findViewObject i have a error :
Unhandled Exception thrown: class javax.servlet.ServletException.
What's wrong ??
Eliseu Cartaxo
Eliseu,
For this to work, in your UIX XML file, in the event handler, you need to surround the call to your <method> handler with a findRootAppModule tag. Note also that you can put a findViewObject inside there in the handler in XML so that you can then use ServletBindingUtils.getViewObject directly instead of getting the AM first.
An example, from the UIX Developer's Guide, is:
<handlers>
<event name="goto" >
<bc4j:findRootAppModule name="root" >
<bc4j:findViewObject name="alpha" >
<bc4j:goto/>
</bc4j:findViewObject>
</bc4j:findRootAppModule>
</event>
</handlers>For more information, see the UIX Developer's Guide in the JDeveloper help system or at http://helponline.oracle.com/uix/help/. (Click developer's guide, Integration with External Technologies, 16. Business Components for Java Integration.)
If you continue having problems with this issue, please include the <handlers> section of your .uix file.
-brian
UIX Team
Similar Messages
-
How to get the object from an event
Hey, thanks for helping.
I'm trying to get the causing object from the event so i can run a method from the causing object,
I tred using the getSource method inherited from the Event class but it doesn't see the method I have in that object (method1)
I have this code:
private class Over implements MouseListener
public void mouseClicked(MouseEvent e)
public void mousePressed(MouseEvent e)
public void mouseReleased(MouseEvent e)
public void mouseExited(MouseEvent e)
public void mouseEntered(MouseEvent e)
e.getSource().method1();
}By the way, MouseEvent is a subtype of ComponentEvent, so it has the method:
Component comp = evt.getComponent();which is convenient if "method1" is a Component method.
Another btw: the "adapter" classes allow you to write listeners without cluttering your code with empty method bodies:
class Over extends MouseAdapter {
public void mouseEntered(MouseEvent e) {
} -
How to get application module instance from java bundle?
Hi!
I would like to build an application that would get all translations from a database table.
So I created application module for translations that contains a view object which is selecting translations for specific language from a database table. I exposed a method in application module as client interface which returns HashMap<String, String> for all translations for specific language. When I test my view and client interface method call they work fine.
Then I created java bundle classes to get translations for specific language. Then I tried to override public Object[][] getContents() method.
I tried to get my translations application module like this:
SharedTranslationsAppModuleImpl am = new SharedTranslationsAppModuleImpl();
Map<String, String> translationsMap = am.getTranslations(this.getLocaleCode); // Client interface method call
In getTranslations(String LocaleCode) I try to get that view (which would select translations from database) but it returns NULL and I get NPE error message.
So what is the right way to get application module from java bundle file? Now everytime application wants to get translations, application stops and displays NPE message.
Regards, Marko
I use JDeveloper 11.1.2.1.0Marko,
you can't just instantiate an application module. An application module has to be set up, db connections and memory pools have to be initialized and ....
Can you describe why and when you try to read the resource bundle from the db and where the resource bundle is used?
This blog may be what you are looking for http://technology.amis.nl/2012/08/10/implement-resource-bundles-for-adf-applications-in-a-database-table/
Timo -
How to get parameter value from report in event of value-request?
Hi everyone,
The customer want to use particular F4 help on report, but some input value before press enter key are not used in event of "at selection-screen on value-request for xxx", How to get parameter value in this event?
many thanks!
JackYou probably want to look at function module DYNP_VALUES_READ to allow you to read the values of the other screen fields during the F4 event... below is a simple demo of this - when you press F4 the value from the p_field is read and returned in the p_desc field.
Jonathan
report zlocal_jc_sdn_f4_value_read.
parameters:
p_field(10) type c obligatory, "field with F4
p_desc(40) type c lower case.
at selection-screen output.
perform lock_p_desc_field.
at selection-screen on value-request for p_field.
perform f4_field.
*& Form f4_field
form f4_field.
*" Quick demo custom pick list...
data:
l_desc like p_desc,
l_dyname like d020s-prog,
l_dynumb like d020s-dnum,
ls_dynpfields like dynpread,
lt_dynpfields like dynpread occurs 10.
l_dynumb = sy-dynnr.
l_dyname = sy-repid.
*" Read screen value of P_FIELD
ls_dynpfields-fieldname = 'P_FIELD'.
append ls_dynpfields to lt_dynpfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = l_dyname
dynumb = l_dynumb
tables
dynpfields = lt_dynpfields
exceptions
others = 1.
check sy-subrc is initial.
*" See what user typed in P_FIELD:
read table lt_dynpfields into ls_dynpfields
with key fieldname = 'P_FIELD'.
*" normally you would then build your own search list
*" based on value of P_FIELD and call F4IF_INT_TABLE_VALUE_REQUEST
*" but this is just a demo of writing back to the screen...
*" so just put the value from p_field into P_DESC plus some text...
concatenate 'This is a description for' ls_dynpfields-fieldvalue
into l_desc separated by space.
*" Pop a variable value back into screen
clear: ls_dynpfields.
ls_dynpfields-fieldname = 'P_DESC'.
ls_dynpfields-fieldvalue = l_desc.
append ls_dynpfields to lt_dynpfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = l_dyname
dynumb = l_dynumb
tables
dynpfields = lt_dynpfields
exceptions
others = 0.
endform. "f4_field
*& Form lock_p_desc_field
form lock_p_desc_field.
*" Make P_DESC into a display field
loop at screen.
if screen-name = 'P_DESC'.
screen-input = '0'.
modify screen.
exit.
endif.
endloop.
endform. "lock_p_desc_field -
How to get "double click" as an event in Module Pool
Dear Experts,
Being new to ABAp, I am struck in a problem.
I want to get double click as an event in my module pool program.
On the screen I have two input/output fields. The attributes of them are as below:
1) 1st I/O field Attributes:
Name: WA_AUFN-A
Dropdown: List box
Display: Resp. to DblClk = Checked
1) 2nd I/O field Attributes:
Name: IT_AUF-A
Dropdown: No drop down box
Display: Resp. to DblClk = UN- Checked
I get some data populated in 1st I/O field in list display.
My Requirement:
As I select one of the data from the 1st I/O field and double click on it, then what I want is that the same selected data
should appear in the 2nd I/O field.
So I want to know how can I capture "Double click as an event".
Can any1 help me out.
Regards
ChandanHi Chandan,
below is the explanation.
for example if u have 2 screen fields VBAK-VBELN & VBAK-VKORG.
VBAK-VBELN has some value say 1000. based on this one u have to fill VBAK_VKORG.
Data: l_f_field like HELP_INFO-DYNPROFLD,
l_f_value like vbak-vbeln.
case pick.
GET CURSOR FIELD l_f_field.
with this u will get to know on which field user is double clicked. so, in this case l_f_filed will have a value of VBAK-VBELN
if l_f_field = ''VABK-VBELN' and
l_f_value = '1000'. "this is optional, based on ur requirement
VBAK-VKORG = '0780'. "fill here
endif.
endcase.
Let me know if it is not clear.
Regards,
Prasad -
Swing: when trying to get the values from a JTable inside an event handler
Hi,
I am trying to write a graphical interface to compute the Gauss Elimination procedure for solving linear systems. The class for computing the output of a linear system already works fine on console mode, but I am fighting a little bit to make it work with Swing.
I put two buttons (plus labels) and a JTextField . The buttons have the following role:
One of them gets the value from the JTextField and it will be used to the system dimension. The other should compute the solution. I also added a JTable so that the user can type the values in the screen.
So whenever the user hits the button Dimensiona the program should retrieve the values from the table cells and pass them to a 2D Array. However, the program throws a NullPointerException when I try to
do it. I have put the code for copying this Matrix inside a method and I call it from the inner class event handler.
I would thank you very much for the help.
Daniel V. Gomes
here goes the code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import AdvanceMath.*;
public class MathF2 extends JFrame {
private JTextField ArrayOfFields[];
private JTextField DimOfSis;
private JButton Calcular;
private JButton Ativar;
private JLabel label1;
private JLabel label2;
private Container container;
private int value;
private JTable DataTable;
private double[][] A;
private double[] B;
private boolean dimensionado = false;
private boolean podecalc = false;
public MathF2 (){
super("Math Calcs");
Container container = getContentPane();
container.setLayout( new FlowLayout(FlowLayout.CENTER) );
Calcular = new JButton("Resolver");
Calcular.setEnabled(false);
Ativar = new JButton("Dimensionar");
label1 = new JLabel("Clique no bot�o para resolver o sistema.");
label2 = new JLabel("Qual a ordem do sistema?");
DimOfSis = new JTextField(4);
DimOfSis.setText("0");
JTable DataTable = new JTable(10,10);
container.add(label2);
container.add(DimOfSis);
container.add(Ativar);
container.add(label1);
container.add(Calcular);
container.add(DataTable);
for ( int i = 0; i < 10 ; i ++ ){
for ( int j = 0 ; j < 10 ; j++) {
DataTable.setValueAt("0",i,j);
myHandler handler = new myHandler();
Calcular.addActionListener(handler);
Ativar.addActionListener(handler);
setSize( 500 , 500 );
setVisible( true );
public static void main ( String args[] ){
MathF2 application = new MathF2();
application.addWindowListener(
new WindowAdapter(){
public void windowClosing (WindowEvent event)
System.exit( 0 );
private class myHandler implements ActionListener {
public void actionPerformed ( ActionEvent event ){
if ( event.getSource()== Calcular ) {
if ( event.getSource()== Ativar ) {
//dimensiona a Matriz A
if (dimensionado == false) {
if (DimOfSis.getText()=="0") {
value = 2;
} else {
value = Integer.parseInt(DimOfSis.getText());
dimensionado = true;
Ativar.setEnabled(false);
System.out.println(value);
} else {
Ativar.setEnabled(false);
Calcular.setEnabled(true);
podecalc = true;
try {
InitValores( DataTable, value );
} catch (Exception e) {
System.out.println("Erro ao criar matriz" + e );
private class myHandler2 implements ItemListener {
public void itemStateChanged( ItemEvent event ){
private void InitValores( JTable table, int n ) {
A = new double[n][n];
B = new double[n];
javax.swing.table.TableModel model = table.getModel();
for ( int i = 0 ; i < n ; i++ ){
for (int j = 0 ; j < n ; j++ ){
Object temp1 = model.getValueAt(i,j);
String temp2 = String.valueOf(temp1);
A[i][j] = Double.parseDouble(temp2);What I did is set up a :
// This code will setup a listener for the table to handle a selection
players.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
ListSelectionModel rowSM = players.getSelectionModel();
rowSM.addListSelectionListener(new Delete_Player_row_Selection(this));
//Class will take the event and call a method inside the Delete_Player object.
class Delete_Player_row_Selection
implements javax.swing.event.ListSelectionListener
Delete_Player adaptee;
Delete_Player_row_Selection (Delete_Player temp)
adaptee = temp;
public void valueChanged (ListSelectionEvent listSelectionEvent)
adaptee.row_Selection(listSelectionEvent);
in the row_Selection function
if(ex.getValueIsAdjusting()) //To remove double selection
return;
ListSelectionModel lsm = (ListSelectionModel) ex.getSource();
if(lsm.isSelectionEmpty())
System.out.println("EMtpy");
else
int selected_row = lsm.getMinSelectionIndex();
ResultSetTableModel model = (ResultSetTableModel) players.getModel();
String name = (String) model.getValueAt(selected_row, 1);
Integer id = (Integer) model.getValueAt(selected_row, 3);
This is how I got info out of a table when the user selected it -
When I get an ICS from Outlook Express (Office is PC based) that is a multi-day event, it populates my iCal as a single day and since I am not the owner I cannot edit the ICS. I have to delete it and send a "decline notice" to the sender and re-enter it so I can put in multiple day events. Help!
If you are running Tiger, you don't have time machine.
You need to get something like SuperDuper! or Carbon Copy Cloner (sorry, I don't have a handy link for CCC but you can Google it to get their site) to make a clone of your drive on the external and then do incremental backups. The free versions do a lot and you can upgrade to the full-service versions for small change if you need more. The one time I used SuperDuper! for cloning a volume it worked just fine.
(My backup application is the last PPC capable version of Retrospect, which does a credible job, or has over the past ten-twelve years.) -
Functional module to get the File from a given Directory
Hi all,
I am using a FM name 'subst_get_file_list' to get the file from a given directory but it is accepting only 40 Character length file only my requirement is to accept file name other than 40 char,
give me good sugestion
regards
paulHi Paul,
Check the Function Module Gayathri has given. ie. 'SO_SPLIT_FILE_AND_PATH'.
In the exporting parameter FULL_NAME , give the path name and in the importing parameter stripped_name , you will get the filename.
Check this code.
REPORT ZSHAIL_SPLITFILE.
data: it_tab type filetable with header line,
gd_subrc type i.
tables: rlgrap.
data: path type string,
file_name type string.
parameters file_nam type rlgrap-filename .
data: user_act type i.
at selection-screen on value-request for file_nam.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
WINDOW_TITLE = 'select a file'
DEFAULT_EXTENSION = '*.txt
DEFAULT_FILENAME = ''
FILE_FILTER = '*.txt'
INITIAL_DIRECTORY = ''
MULTISELECTION = abap_false
WITH_ENCODING =
CHANGING
file_table = it_tab[]
rc = gd_subrc
USER_ACTION = user_act
FILE_ENCODING =
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if user_act = '0'.
loop at it_tab.
file_nam = it_tab-filename.
endloop.
endif.
path = file_nam.
CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = path
IMPORTING
STRIPPED_NAME = file_name
FILE_PATH =
EXCEPTIONS
X_ERROR = 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.
at selection-screen.
message i001(zmess) with file_name.
Regards,
SP. -
Using Get Data From Aggregation event class in SQL Profiler - SSAS 2012
Hi,
I'd like to understand better the use of the Get data from aggregation event class in SQL Profiler to monitor a MDX query and which info provide. Fe, does it return the MDX query? Is it possible to use this event class in order to monitor MDX query vs a
Tabular model?
In the TechNet documentation, this event class is handled briefly.
ThanksHi pscorca,
This event is raised when the storage engine reads data from an aggregation, it may have a negative impact on performance when turned on. If you need to monitor SSAS instance status, we can also use dynamic management view:
Use Dynamic Management Views (DMVs) to Monitor Analysis Services:
http://msdn.microsoft.com/en-us/library/hh230820.aspx
Regards,
Elvis Long
TechNet Community Support -
Function module to get the dates from the year and the period
Is there a function Module to get the dates from the year and the period
Check with :
To get last day of period use .
LAST_DAY_IN_PERIOD_GET.
To get last of month Use :
RE_LAST_DAY_OF_MONTH
HRVE_LAST_DAY_OF_MONTH
LAST_DAY_OF_MONTHS
ISB_PREVIOUS_PERIOD_DATE_GET
Thanks
Seshu -
I need a picture from an event that I only have video of. Is there a way to get a jpeg/still shot exported from imovie clip? I'm a fairly new mac user.
John Codgell has some tips on how to use MPEG Streamclip to do this on this Discussion Thread:
Helpful AnswerRe: can you make a still photo from clip -
Function module to get the details from table COEP
hi all,
I have to select the data from COEP table based on OBJNR.i don't have any other key information.so i have to select the data based on OBJNR only.
can any one please tell me is there any function to get the data from this table.
Thanks.Hi
Try the fun module
K_CO_OBJECT_BALANCE_GET
see the sample select statement for COEP
clear cobrb_tab.
refresh cobrb_tab.
select objnr " Object No
rec_objnr1 " Ref Object No
bureg " Dostribution Rule
lfdnr " Sequence No
perbz " Settlement Rule
konty " Acct Assign Category
bukrs " Company Code
kostl " Cost Center
into table cobrb_tab
from cobrb
where kostl in rn_kostl.
sort cobrb_tab by objnr rec_objnr1.
delete adjacent duplicates from cobrb_tab comparing objnr.
Get the Settlement Costs from COEP Table
clear it_set_tab.
refresh it_set_tab.
if not cobrb_tab[] is initial.
select kokrs " Controlling Area
belnr " Acc Document
buzei " Line Item
perio " Period Block
wkgbtr " Value in CO Curr
lednr " Ledger No
objnr " Object No
gjahr " Fiscal Year
wrttp " Actuals
versn " Version
kstar " Cost Element
beknz " Dr/Cr Indicator
parob1 " Partner Object
into table it_set_tab
from coep
for all entries in cobrb_tab
where lednr = c_lednr and
wrttp = c_wrttp2 and
versn = c_versn and
gjahr = p_gjahr and
objnr = cobrb_tab-objnr and
parob1 = cobrb_tab-rec_objnr1 and
beknz in (c_o, c_a).
endif.
Reward points for useful Answers
Regards
Anji -
Any event for getting Wi_id no from table Swwwihead
Hi ,
I am getting wi_id using interface if_swf_ifs_workitem_exit using method after creation but during this time workitem is not saved to table swwwihead. Is there any event or any other alternative to get the workittem from that table after saving the data and before it goes to the sap inbox.?
Regards,
ShwetangHi ,
I am getting the needed data from the paramenter but my problem is i had made one user decision activity which is going to sap inbox and i have to send thid decision box to lotus notes inbox which i am doing with a program rswuwfml2.
I am writing this program exit to run this program when the workitem is created and these are getting from the method but the program rswuwfml2 requires work id and other details from table swwwiead as when method is populaed this details are not commited o the table.
I don't want call his program explicity.
Hope this will clear your doubts regarding my question.
Thanks
Shwetang -
How to Get property values from Shared Object in client's load event - Very urgent
I am using shared object to share data between two users. First user connect to shared object and set some value in shared object. Please consider that second user has not connected with the shared object yet.
Now when second user connects to the server and try to get that property set by first user, he could get shared object but could not get properties of Shared object set by first user. I observed few times that Second user can get these properties within "Sync" event between two users. But I would like to get these values for Second user in any stage (i.e. in load event etc.). Whenever Second user tries to get the property of Shared object, the object will reset the actual property value and then return reset value.
Anyone faced such issue while using shared object between two users. If so, I would appreciate if you could let me know your suggestions for following questions:
1) Is there any way to get all the properties of shared object before sync event called, as I want to get it immediately when second user connect to the application and perform next task based on the values stored in shared object.
2) Is it possible for second user to check whether any property has been set by first user? So that second user can use the property instead of reset it.
Any kind of help would be greatly appreciated.
Thank You.I am using shared object to share data between two users. First user connect to shared object and set some value in shared object. Please consider that second user has not connected with the shared object yet.
Now when second user connects to the server and try to get that property set by first user, he could get shared object but could not get properties of Shared object set by first user. I observed few times that Second user can get these properties within "Sync" event between two users. But I would like to get these values for Second user in any stage (i.e. in load event etc.). Whenever Second user tries to get the property of Shared object, the object will reset the actual property value and then return reset value.
Anyone faced such issue while using shared object between two users. If so, I would appreciate if you could let me know your suggestions for following questions:
1) Is there any way to get all the properties of shared object before sync event called, as I want to get it immediately when second user connect to the application and perform next task based on the values stored in shared object.
2) Is it possible for second user to check whether any property has been set by first user? So that second user can use the property instead of reset it.
Any kind of help would be greatly appreciated.
Thank You. -
LabVIEW DSC: How to get alarm status from the area?
Colleagues,
I have, lets say, 50 Shared Variables where alarming enabled. Some of these variables assigned to area, so I can get status of the entire area or acknowledge an entire area of alarms (prior to version 8.x there was groups of the tags).
Now I would like to get alarm status from the entire area. How can I do it?
In version 6 I was able to wire tag group to Get Alarm Summary Status. Now, in version 8, Alarm Status.vi can be wired to the array of the variables, but not to area. Is it possible to get all variables from the area?
regards,
Andrey.I am not sure if I should be posting my problem under this particular topic. I am having trouble understanding acknowledge alarm vi and what this vi is supposed to do is not clear to me yet.
I have around 300 shared variables in my project and I have created a particular vi just to view the alarms that may pop up during runs. I created a main menu and this alarm vi can be accessed upon a button click in the main menu. Users get alarm alert based on sound configuration. Then he can navigate to the alarm vi and acknowledge the alarm. The alarm vi only contains alarm and event display found under DSC module.
The problem is everytime I click the alarm button in the main menu, it takes around 2 minutes for the alarm vi to update which is very annoying and unsatisfactory in the middle of run. I am not sure why it happens and I haven't got any response from support yet. These shared variables are managed under 10 different library files that are set up based on different loops of the process (flow, pressure and so on).
Then I looked into three alarm examples that ship with DSC module. None of these examples use acknowledge alarm vi. I implemented another vi similar to alarm demo vi in that example - containing multicolumn listbox. I created acknowledge event containing acknowledge button and used the acknowledge alarm vi under this event. Read vi alarm is under timeout event.
When I click the acknowledge button as soon as I see the alarm in multicolumn listbox, nothing happens - the color of font does not get changed to purple neither any alarms get acknowledged. I tried to aknowledge alarm by variable name or alarms or alarm area, it does not give me anything. What is this acknowledge alarm supposed to do? I tried to find examples everywhere in the web that uses this particular vi and haven't found one yet.
Maybe you are looking for
-
I have a problem with 3.6.3 in Windows 7 64-bit with pages not reloading when I navigate back to them or refresh due to a change in the page. As an example, on eBay, but when I hit resend, the page loads blank (over and over). I have to renavigate to
-
Hi All, We have done the required configuration for COPA. We have created a COPA (Costing Based) report as well. The client wants this COPA report to be run for the first quarter of 2008 i.e. April 2008 to June 2008. However, discount values for the
-
I cannot import footage of any kind anymore in premiere pro cc, and all finished projects give me a offline media message'importer is missing'. Anyone with the same problem? I am currently working on a PC, windows 7professional. GPU GTX 760. Quicktim
-
XL Reporter - Item Description does not populate
Hi, I am working on 2007 B and in XL reporter I am not able to get the Item description ..However I am able to pull up the item code in the advance report builder from report composer .. Can you please help with this ... Thank you , Regards, Aru
-
"Time Machine Error The backup volume is read only"
Lately, every time I try to backup to my Time Capsule using Time Machine it fails and I get a message saying "Time Machine Error The backup volume is read only. To select a different volume, open system preferences and choose Time Machine" So I do th