Action listener activation in many phases
I need action listener (methods) to be activated in many phases. I.e., when the user clicks a submit button, I want code to be executed (in my case) after the validation phase and after (during) the invoke application phase. In earlier version of the standard, I would just register 2 listeners, returning the appropriate getPhaseId() value. Since this method is removed from the current standard, things get more complicated.
QUESTION: Why in heavens name was this method removed from the standard? I suppose, because it is difficult to support with listener methods (in contrast to instances)? Bit of a rough solution, no? Or am I missing something?
I have a solution now, I think, that is based on getting the action event immediate, and requeuing the event again and again.
In the JSP, in the JSF form, I have a submit button as follows:
<h:commandButton id="buttonId" value="ButtonText"
actionListener="#{handler.buttonListener}"
immediate="true"/>The method Handler.buttonListener is:
public final void buttonListener(ActionEvent ae) {
LOG.debug("Handler. buttonListener called ("
+ "ActionEvent.getPhaseId() = " + ae.getPhaseId()
+ "; ActionEvent.getComponent() = " + ae.getComponent()
+ ")");
PhaseId phaseId = ae.getPhaseId();
if (phaseId.equals(PhaseId.APPLY_REQUEST_VALUES)) {
LOG.debug("-- processing during " + ae.getPhaseId());
// meaningful stuff here
// prepare for execution in next phase
ae.queue();
/* this sets phase id to the current phase, so it is extremely important that
* we set the necessary phase id AFTER queuing the event */
ae.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
LOG.debug("-- ActionEvent (getPhaseId() = " + ae.getPhaseId() + ") queued");
else if (phaseId.equals(PhaseId.PROCESS_VALIDATIONS)) {
LOG.debug("-- processing during " + ae.getPhaseId());
// meaningful stuff here
// prepare for execution in next phase
ae.queue();
/* this sets phase id to the current phase, so it is extremely important that
* we set the necessary phase id AFTER queuing the event */
ae.setPhaseId(PhaseId.INVOKE_APPLICATION);
LOG.debug("-- ActionEvent (getPhaseId() = " + ae.getPhaseId() + ") queued");
else if (phaseId.equals(PhaseId.INVOKE_APPLICATION)) {
LOG.debug("-- processing during " + ae.getPhaseId());
// meaningful stuff here
LOG.debug("Handler. buttonListener done");
}The /* */ comment in the code is there because the queue methods (on the event as well as the component) set the phase id of the event to the current phase. If I set the phase id of the event before queuing it, that setting is undone, and I get an infinite loop! This is weird, and my solution is at least shaky: it doesn't feel stable across JSF implementations and future releases. I could not find a queue method that leaves the phase id alone.
QUESTION: am I missing something?
The output however is:
Mar 21, 2005 12:51:11 PM org.exadel.jsf.PhaseTracker beforePhase
INFO: BEFORE RESTORE_VIEW 1
Mar 21, 2005 12:51:11 PM org.exadel.jsf.PhaseTracker afterPhase
INFO: AFTER RESTORE_VIEW 1
Mar 21, 2005 12:51:11 PM org.exadel.jsf.PhaseTracker beforePhase
INFO: BEFORE APPLY_REQUEST_VALUES 2
12:51:12,119 DEBUG Handler:550 - Handler.buttonListener called
(ActionEvent.getPhaseId() = APPLY_REQUEST_VALUES 2;
ActionEvent.getComponent() = javax.faces.component.html.HtmlCommandButton@33b99a)
12:51:12,171 DEBUG Handler:556 - -- processing during APPLY_REQUEST_VALUES 2
12:51:12,184 DEBUG Handler:564 - -- ActionEvent (getPhaseId() = PROCESS_VALIDATIONS 3) queued
12:51:12,189 DEBUG Handler:580 - Handler.buttonListener done
12:51:12,220 DEBUG Handler:550 - Handler.buttonListener called
(ActionEvent.getPhaseId() = PROCESS_VALIDATIONS 3;
ActionEvent.getComponent() = javax.faces.component.html.HtmlCommandButton@33b99a)
12:51:12,255 DEBUG Handler:567 - -- processing during PROCESS_VALIDATIONS 3
12:51:12,256 DEBUG Handler:574 - -- ActionEvent (getPhaseId() = INVOKE_APPLICATION 5) queued
12:51:12,257 DEBUG Handler:580 - Handler.buttonListener done
12:51:12,265 DEBUG Handler:550 - Handler.buttonListener called
(ActionEvent.getPhaseId() = INVOKE_APPLICATION 5;
ActionEvent.getComponent() = javax.faces.component.html.HtmlCommandButton@33b99a)
12:51:12,267 DEBUG Handler:577 - -- processing during INVOKE_APPLICATION 5
12:51:12,268 DEBUG Handler:580 - Handler.buttonListener done
Mar 21, 2005 12:51:12 PM org.exadel.jsf.PhaseTracker afterPhase
INFO: AFTER APPLY_REQUEST_VALUES 2
Mar 21, 2005 12:51:12 PM org.exadel.jsf.PhaseTracker beforePhase
INFO: BEFORE RENDER_RESPONSE 6
Mar 21, 2005 12:51:12 PM org.exadel.jsf.PhaseTracker afterPhase
INFO: AFTER RENDER_RESPONSE 6The info is generated by a phase listener I found somewhere (sorry for the lack of reference here to the author). As you can see, I get 3 consecutive calls of my listener method, but they are all during the apply request values phase, and we jump from the apply request values phase immediately to the render response phase, skipping all the other phases, although my listener is actually called 3 times.
QUESTION: what the fuck? What is happening here, and more important, how can I fix it?
I am in touch with IBM about any patch they might have for this. I just thought I'd post details from what I researched.
Basically I found that if I had CommandButton and/or CommandLink components on my page and clicked them for a total greater than 15 times, the application just quit reacting to any of the clicks. After writing a PhaseListener I discovered that after 15 clicks the JSF lifecycle was going straight from the Restore View (1) to Render Response (6) phase instead of going through the ones in between.
I downloaded the JSF source code and tracked down the magic number 15. As mentioned earlier in this forum it has to do with the number of views per session. In the Sun JSF-RI com.sun.faces.application.StateManagerImpl class
the number of views is defaulted to 15. When the number of views hits the max the oldest view is deleted. Somehow I don't think they are deleting the oldest view or else why my app quits after 15 clicks I do not know. Anyway this is a known issue with the Sun JSF-RI and documented in their Release Notes.
Depending on the JSF implementation there may or may not be a workaround. I mean to say the the workaround is not part of the JSF spec but Sun's implementation has a feature where you can configure the com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION value in the web.xml file under the <context-param> tag. If you set the value sufficiently high you lower the risk of the app quitting on you (like a user may be unlikely to make 100 or even 50 clicks on the same page). You might also want to set the state to be saved on the server by setting javax.faces.STATE_SAVING_METHOD to server in another <context-param> tag. Somehow setting this state to client caused errors (NullPointerException) in our app in one of the Faces classes itself.
Hope this helps someone out there.
Similar Messages
-
How can i disable an Action listener temporary?
hi folks,
I have a GUI with many Jcomboxes. Each one of them has an actionlistener.
The idea was: when one of those comboboxes is selected, then the selected value will appear on ALL the comboboxes (by using setSelectedIndex(int index)).
The problem is when i select a value on ONE of those comboboxes and set it on the others, the actionListener thinks that i selcted a value on the other comboboxes and starts setting the values again... I other words if i select one combobox i obtain an endless loop...
Is it possible to disable the action listener temporary when setting the selectd values on the other comboboxes?Just use removeActionListener and then addActionListener
Noah -
Property on Backing Bean is Not set when Action Listener is Fired
Why is it that when my action listener is invoked, the property for my other component on the page has not been reflected in model yet?
Here is what I have:
My JSP has the following two components:
<h:inputText value="#{manageQuestionBean.newStory}"></h:inputText>
<h:commandButton value="add" actionListener="#{manageQuestionBean.onAddStory}"></h:commandButton> My Java code has the following:
public void onAddStory(ActionEvent event) {
//This always prints out 'null'
System.out.println("The value of 'newStory' is: " + newStory);
//TO DO: this is where the logic would go for creating a new story object.
} When I put logging statements inside my setter for the newStory property, I see that it is being set to the right value, but then it being reset to empty string. Why is that? During what phase do the action listeners get invoked?Which JSF implementation/version are you using?
mczauz wrote:
When I put logging statements inside my setter for the newStory property, I see that it is being set to the right value, but then it being reset to empty string. Why is that? When exactly happens when exactly?
During what phase do the action listeners get invoked?The invoke application phase, after the update model values phase.
You may find this article useful to learn about phases and how to add a 'phase debugger' yourselfl: [http://balusc.blogspot.com/2006/09/debug-jsf-lifecycle.html]. -
Best way to implement an Action Listener
I have multiple anonymous classes for each button in my particular JPanel, this seems very... large and I am sure it is using a large amount of memory. Is there a better way to implement several action listeners to all these buttons so that they will still do their origional function but cut down on all the anonymous classes.
Actually nothing of the sort. There is too much information to be able to be placed nicely on the Panel, so I have many buttons that open dialog boxes where the information is placed, buttons that perform specified tasks (adding, updating, loading, deleting, clearing all fields) on the database, and others, there is also action listeners on the jspinners comboboxes and others.
Actually, I take back hundred, I recently extended JPanel to do my editing panels to go into my JTabbedPane cutting down on the line count in the FrameMain class (over 8K lines before the conversion) So there is only about 20 to 25 total action listeners per extended JPanel, instead of 150 or so declared in one frame.
The biggest concern here is memory usage, as of right now it uses a ton, and by searching and reading, I belive its all the action listeners (which at the time I thought you had to have a brand new one every time you wanted it to do something different).
Going back to the one action listener with the if/else statements obviously performace may be lost, but what is the ratio to performance lost to memory gain. Will the speed increase be negligable compared to the amount of memory usage that will go down? -
Export collection action listener error after second call
Hi all,
I am using the operation export collection action listener to export to excel the content of a table. The first time I clicked the button to export, Microsoft Excel open with the table information correctly but if I want to export again then I got the following error:
<08-ago-2013 21H54' VET> <Error> <oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter> <BEA-000000> <ADF_FACES-60096:Excepción del Servidor durante PPR, #1
java.lang.IllegalStateException: ADF_FACES-60003: Component with ID: pt1:r8:4:b1 not registered for Active Data.
at oracle.adfinternal.view.faces.activedata.PageDataUpdateManager.unregisterComponent(PageDataUpdateManager.java:615)
at oracle.adfinternal.view.faces.context.RichPhaseListener.handleStartAndStopActiveData(RichPhaseListener.java:478)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:540)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:225)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:303)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:208)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:202)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:225)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3367)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
Any Idea?
Jhon Carrillo
Jdev 12cHi,
there is a bug filed for this that has been fixed for the first (upcoming) Patch Set of 12c. Until then the solution seems to be to get the current row before exporting the table and then to set it back afterwards. So what you can try is to create a hidden button for the export of the table. Say you name the button "expBut". Then have another button with a action reference to a managed bean. This button now will invoke the following code
1. read the current row from the table iterator (bindings --> (DCIteratorBinding) bindings.get("iteratorName") --> (Row) dcIterator.getCurrentRow()
2. invoke the hidden button: ActionEvent ae = new ActionEvent(expBut); ae.queue();
3. Set current row back to where it was: dcIterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
At least this seems to be the internal bug fix.
Alternatively, disable PPR on the binding layer (ChangeEventPolicy=None on the iterator) and set the same on the PartialTrigger property of the component.
Frank -
Hi All,
I have added an action listener to a TextField,im printing the text entered in textfiled by pressing the enter key of keyboard.
public void actionPerformed(ActionEvent ae) {
System.out.println(jtf.getText());
} my question is as an when i enterd the text in the textfield i want to printit . please help me to solve this.
ThanksYannix wrote:
Add a keyListener in your JTextField.
http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html
I've always thought that it is better to use solutions that use a higher level of abstraction compared to solutions that use a lower level. If so, then using key Binding may be a better solution. If this is wrong, please let me know. You can learn about key Bindings here:
http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html
One statement in this tutorial compares key bindings to keylisteners:
An alternative to key bindings is using key listeners. Key listeners have their place as a
low-level interface to keyboard input, but for responding to individual keys key bindings are more
appropriate and tend to result in more easily maintained code. Key listeners are also difficult if
the key binding is to be active when the component doesn't have focus. Some of the advantages
of key bindings are they're somewhat self documenting, take the containment hierarchy into
account, encourage reusable chunks of code (Action objects), and allow actions to be easily
removed, customized, or shared. Also, they make it easy to change the key to which an action
is bound. Another advantage of Actions is that they have an enabled state which provides an
easy way to disable the action without having to track which component it is attached to.
In the future Swing related question should be posted in the Swing forum.
http://forum.java.sun.com/forum.jspa?forumID=57
Agree 100% -
Import is not available all other actions are active but not import help?
Import is not available all other actions are active but not import help? I wish to import bookmarks from internet explorer, I am using windows 7
Make sure that you do not run Firefox in permanent Private Browsing mode.
*https://support.mozilla.com/kb/Private+Browsing
*You enter Private Browsing mode if you select: Tools > Options > Privacy > History: Firefox will: "Never Remember History"
*To see all History and Cookie settings, choose: Tools > Options > Privacy, choose the setting <b>Firefox will: Use custom settings for history</b>
* Deselect: [ ] "Permanent Private Browsing mode" -
Transaction Posting Confirmation Message and Action Listener behaviour
Hi, I have a scenario that a user is Posting a Transaction and when he press the “Post” Button a, confirmation dialog box should popup asking “Do you really want to Post the record ?”. If the user press “Yes” the record is further process and If the user press “No” then the transaction should not proceed.
I have implemented the main screen(PostTransaction.java) and the popup confirmation window(ConfirmationWindow.java)
Question 1 ) Why the code is not stoping in the Post Button Action listener as in JOptionPane, then how do i know that the user has selected "Yes" or "No" ?
Question 2) Do I have to write the code for posting of a Transaction(postTransaction() method) in the “ConfirmationWindow”? or it should be in “PostTransaction”.
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class PostTransaction extends Application{
public void start(final Stage stage) throws Exception {
Group root = new Group();
Scene scene = new Scene(root, 300,300);
stage.setScene(scene);
stage.setTitle("Transaction Post Screen");
GridPane gp = new GridPane();
Label lblName = new Label("Name");
Label lblAmount = new Label("Amount");
TextField txtName = new TextField();
TextField txtAmount = new TextField();
Button btnPost = new Button("Post Record");
gp.add(lblName, 1, 1);
gp.add(lblAmount, 1, 2);
gp.add(txtName, 2, 1);
gp.add(txtAmount, 2, 2);
gp.add(btnPost, 2, 3);
btnPost.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent arg0) {
//The code does not stop here as in JOptionPane, then how do i know that the user has selected "Yes" or "No" ??
boolean popupResult = ConfirmationWindow.confirmTranactionPosting(stage, "Please Confirm");
if(popupResult==true){
//This line is printed before the user selects yes or no
System.out.println("Proceeding with Tranaction Posting");
//postTransaction();
if(popupResult==false){
//This line is printed before the user selects yes or no
System.out.println("Do not Proceed with Tranaction Posting");
root.getChildren().add(gp);
stage.show();
public static void main(String[] args) {
launch(args);
private void postTransaction(){
//write the code for posting here
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class ConfirmationWindow extends Stage {
Stage owner;
Stage stage;
BorderPane root;
static boolean postStatus = false;
public ConfirmationWindow( Stage owner, String title){
root = new BorderPane();
stage = this;
this.owner = owner;
initModality( Modality.APPLICATION_MODAL );
initOwner( owner );
initStyle( StageStyle.UTILITY );
setTitle( title );
setContents();
public void setContents(){
Scene scene = new Scene(root,250,150);
setScene(scene);
Group groupInDialog = new Group();
groupInDialog.getChildren().add( new Label("Do you really want to Post this record ?") );
root.setCenter( groupInDialog );
Button yes = new Button( "Yes" );
yes.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
postStatus =true;
stage.close(); // Close the pop up. Transfer control to PostTransaction.java and execute the PostTransaction() method.
Button no = new Button( "No" );
no.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
postStatus =false;
stage.close(); // Close the pop up only
HBox buttonPane = new HBox();
buttonPane.setSpacing(10);
buttonPane.getChildren().addAll(yes,no);
root.setBottom(buttonPane);
stage.show();
public static boolean confirmTranactionPosting(Stage owner, String title) {
new ConfirmationWindow(owner, title);
return postStatus;
}The MII Message listener is a queue. But when I understand you correctly, you do not want to process the messages immediately after arriving in the Listener.
Maybe the categorization of messages is an option for you (see [Sap Help: Processing Rule Editor - Category|http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm]. You can enter a category for the control recipe messages. The messages will then be placed in the Listener queue. You can use the [Message Services|http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm] actions to read the categorized messages and process them as you need.
In addition to Manoj, you may also use the [Queueing actions|http://help.sap.com/saphelp_mii121/helpdata/en/43/e80b59ad40719ae10000000a1553f6/frameset.htm] of MII, where you can queue xml contents.
Hope this helps.
Michael -
ACTIVATION Error during phase MAIN_SHDRUN/ACT_UPG
Hello Experts,
I am facing an activation error during upgrade o ECC 6.0 EHP 6 in shadow instance.
ERROR: Detected the following errors:
# F:\SUM\abap\log\SAPA702EPU.UAS: 3 EDT012XActivate table "PTRV_UTIL_VPFPS_VPFPA_P" 3 EDT402 Append structure "PTRV_VPFPS_VPFPA_P_APPEND" appended to table "PTRV_UTIL_VPFPS_VPFPA_P" 1EEDT963 Field "TIME_DURATION" in table "PTRV_UTIL_VPFPS_VPFPA_P" is specified twice. Please check 2WEDT135 Flag: 'Incorrect enhancement category' could not be updated 3 EDT013 Table "PTRV_UTIL_VPFPS_VPFPA_P" was not activated 1EEDO519X"Table" "PTRV_UTIL_VPFPS_VPFPA_P" could not be activated 3 EMC738XActivate view "V_T706S_EHP" 1EEMC560 Field "T706S"-"D2100" does not exist 1EEMC560 Field "T706S"-"EXCHANGE_DATE" does not exist 1EEMC560 Field "T706S"-"TRIP_BREAK_CNTRY" does not exist 3 EMC742 View "V_T706S_EHP" was not activated 1EEDO519 "View" "V_T706S_EHP" could not be activated
...skipped 13 more lines. Please see ACTUPG.html for more information.
SAPup_troubleticket.log
This trouble ticket was created by SAPup on 20140801092425
SAPup broke during phase ACT_UPG in module MAIN_SHDRUN / Shadow System Operations: SPDD and Activation
Error Message: Detected 5 errors summarized in 'ACTUPG.ELG'
Calling 'F:\SUM\abap\exe/tp' failed with return code 8, check F:\SUM\abap\log\SAPup.ECO for details
tp used shadow connect
ACTUPG.ELG:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DDIC ACTIVATION ERRORS and RETURN CODE in F:\SUM\abap\log\SAPA-10202INPOASBC.UAS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<NO ERROR LINES FOUND, BUT HIGHEST EXIT CODE WAS: "8">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DDIC ACTIVATION ERRORS and RETURN CODE in SAPA702EPU.UAS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 EDT012XActivate table "PTRV_UTIL_VPFPS_VPFPA_P"
3 EDT402 Append structure "PTRV_VPFPS_VPFPA_P_APPEND" appended to table "PTRV_UTIL_VPFPS_VPFPA_P"
1EEDT963 Field "TIME_DURATION" in table "PTRV_UTIL_VPFPS_VPFPA_P" is specified twice. Please check
2WEDT135 Flag: 'Incorrect enhancement category' could not be updated
3 EDT013 Table "PTRV_UTIL_VPFPS_VPFPA_P" was not activated
1EEDO519X"Table" "PTRV_UTIL_VPFPS_VPFPA_P" could not be activated
3 EMC738XActivate view "V_T706S_EHP"
1EEMC560 Field "T706S"-"D2100" does not exist
1EEMC560 Field "T706S"-"EXCHANGE_DATE" does not exist
1EEMC560 Field "T706S"-"TRIP_BREAK_CNTRY" does not exist
3 EMC742 View "V_T706S_EHP" was not activated
1EEDO519 "View" "V_T706S_EHP" could not be activated
3 EDT014XActivate dependent table "/MRSS/T_CUP_OBJECT"
1EEDT242 Field "FIELD_DESCRIPTIONS": Component type or domain used not active or does not exist
2WEDT183 Field "INSTANCE"-"/MRSS/IF_CUP_OBJECTS": Reference type used is not active
1EEDT005 Nametab for table "/MRSS/T_CUP_OBJECT" cannot be generated
3 EDT015 Dependent table "/MRSS/T_CUP_OBJECT" was not activated
1EEDO519 "Table" "/MRSS/T_CUP_OBJECT" could not be activated
3 EDT014XActivate dependent table "T706S"
1EEDT963 Field "TRIP_BREAK" in table "T706S" is specified twice. Please check
3 EDT015 Dependent table "T706S" was not activated
1EEDO519 "Table" "T706S" could not be activated
1 ETP111 exit code : "8"
SAPA702EPU.SID
ent tables)
2WEDO549 "View" "V_TWGVALE" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWH01" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF0100" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF0200" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF0250" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF0260" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF501" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF600" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWICSCMF8003" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWLOF" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWMWQ" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWPC_COLHEAD" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWPC_COLHEAD_C" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWRF2" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWSD" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWTFMA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TWZLA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TXW_AD01D" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZB0W" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZB6D" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZBABG" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZBABGZB" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZD0B" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZD0BI" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZD0BW" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZE02" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZE03D" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZONE_M" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZPAB3" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZT01" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZT01D" was activated (warning for the dependent tables)
2WEDO549 "View" "V_TZV04" was activated (warning for the dependent tables)
2WEDO549 "View" "V_UEBER" was activated (warning for the dependent tables)
2WEDO549 "View" "V_USCOMP" was activated (warning for the dependent tables)
2WEDO549 "View" "V_USCOMPA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_USR_NAME" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VGNVA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VGNWA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIGWVOBW" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIGWVOBW_BUK" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIGWVOBW_GE" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIGWVOBW_GFL" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIGWVOBW_GR" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIGWVOBW_GRA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIGWVOBW_WE" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIOB01" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIOB02" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VIOB03" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VITXT" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VLBLTD" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VLTD" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VTDST" was activated (warning for the dependent tables)
2WEDO549 "View" "V_VTSPLS" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WBEW" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WCUSDOC_RELA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WITH_CTNCOT005" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFBA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFBB" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFKC" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFRA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFRB" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFZA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFZB" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WLFZUC10" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WRBLA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WRGLA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WRGLB" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WRLBA" was activated (warning for the dependent tables)
2WEDO549 "View" "V_WRSZ" was activated (warning for the dependent tables)
2WEDO549 "View" "WB2_V_VBRK_WBGT" was activated (warning for the dependent tables)
2WEDO549 "View" "WB2_V_WBRK_WBRP" was activated (warning for the dependent tables)
2WEDO549 "View" "WB2_V_WBRK_WBRP2" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVAP" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVHE" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVITX" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVJ" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVM1" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVN1" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO1" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO2" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO3" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO4" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO5" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO6" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO7" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO8" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVO9" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVOA" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVOC" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVOD" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVODX" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVOE" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVOF" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVOI" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP0" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP1" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP2" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP3" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP4" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP5" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP6" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP7" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVP8" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVPN1" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVPU1" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVW" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVWA1" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVWA2" was activated (warning for the dependent tables)
2WEDO549 "View" "WCVZ1" was activated (warning for the dependent tables)
2WEDO549 "View" "YWM_VSNACH_LIKP" was activated (warning for the dependent tables)
2WEDO549 "View" "YWTY_V_DLR_BR" was activated (warning for the dependent tables)
2WEDO549 "View" "YWTY_V_DLR_PROOR" was activated (warning for the dependent tables)
2WEDO549 "View" "YWTY_V_EMGAR_DC" was activated (warning for the dependent tables)
2WEDO549 "View" "YWTY_V_USR_DISTR" was activated (warning for the dependent tables)
2WEDO549 "View" "YWTY_V_WORKBY" was activated (warning for the dependent tables)
2WEDO549 "View" "ZZLIB_V_HKTK" was activated (warning for the dependent tables)
2WEDO549 "View" "ZZLIB_V_LIFNR_C" was activated (warning for the dependent tables)
1 ED0301X*************************************************************************
1 ED0306 "Final log"
1 ED0322 End phase "006" ***********************************************************
1 ED0320XStart phase "007" **********************************************************
1 ED0306 "Statistics on Activated and Deleted Objects"
1 ED0301 *************************************************************************
1 EDO601XNumber of objects to be activated............: "35325"
1 EDO605 Objects not activated........................: "4"
1 EDO606 Activated objects with errors in dependencies: "4"
1 EDO604 Objects activated with warning...............: "5531"
1 EDO603 Successfully activated objects...............: "29786"
1 EDO602 Number of objects to be deleted..............: "128"
1 EDO608 Objects not successfully deleted.............: "0"
1 EDO607 Successfully deleted objects.................: "128"
1 EDO609 Tables/views with DROP/CREATE................: "0"
1 EDO610 No. of them marked for DROP/CREATE: "0"
1 EDO611 Not marked for DROP/CREATE: "0"
1 EDO620 Number of nametabs to be deleted.............: "0"
1 EDO622 Successfully deleted nametabs................: "0"
1 EDO621 Nametabs that were not successfully deleted..: "0"
1 ED0301X*************************************************************************
1 ED0306 "Statistics on Activated and Deleted Objects"
1 ED0322 End phase "007" ***********************************************************
1 ED0302X=========================================================================
1 ED0314 Mass Activation
1 ED0302 =========================================================================
1 ED0327 Process..................: "defnsv1466_14_59636"
1 ED0319 Return code..............: "8"
1 ED0313 Phase 001..................: 00:00:13 (Take Over Switch-Dependent Objects)
1 ED0314 Phase 002..................: < 1 sec. (Deletion of objects: 1th call)
1 ED0314 Phase 003..................: 00:00:47 (Berechnung der Abhängigen:)
1 ED0313 Phase 004..................: 00:15:00 (Object Activation)
1 ED0314 Phase 005..................: < 1 sec. (Puffer Sync für Abhängige refTo ...)
1 ED0314 Phase 006..................: < 1 sec. (Final log)
1 ED0314 Phase 007..................: < 1 sec. (Statistics on Activated and ...)
1 ED0309 Program runtime..........: "00:16:01"
1 ED0305 Date, time...............: "01.08.2014", "09:23:55"
1 ED0318 Program end==============================================================
1 ETP155 ACTIVATION OF DD-OBJECTS
1 ETP110 end date and time : "20140801092355"
1 ETP111 exit code : "8"
1 ETP199 ######################################
4 EPU202XEND OF SECTION BEING ANALYZED END OF ACT_UPG =====================================================
Please suggest.
Regards,
AlokHi Divyanshu,
thanks for your prompt reply,
As per the error occurred, PTRV_UTIL_VPFPS_VPFPA_P is the table but when I check in SE16 its saying PTRV_UTIL_VPFPS_VPFPA_P not a table its a STRUCTURE
In SE11 its saying "PTRV_UTIL_VPFPS_VPFPA_ "does not exist.Check name.
Here it is not taking full name of table "PTRV_UTIL_VPFPS_VPFPA_P".
Pl suggest.
BR,
Alok -
I need a code example for an action listener for a jcheckbox using matisse
I am trying to make it so that when some body clicks a jcheckbox it will put a figure into a jtextfield. Because I am using matisse I need to know the code for the action listener and I need to know quickly as well so I don't have time to look it up with searches etc.
Can anbody provide me with some example code please.I thought that as you are all more experienced than I am that you would know where to look and as you would have already been to all of the sites you would have been able to save me a lot of time looking for the best one. I didn't mean to insult you sorry, I knew that I would be looking for a long time and hoped that some one could help speed that up for me.
Any way I have obviously annoyed you in that thread earlier this week. I know that you are all pee'd at me and don't believe me and that is fine. I have learnt every thing that I need to learn and would like to thank you for your help although I think that your language in your last post was not very pleasant, but that is ok.
I don't want to continue posting any more. But thank you for your help. -
Issue with setting an Action Listener for a Command Button
Hi all,
I'm trying to set an action listener for a CoreCommanButton in a backing bean. Here's my code:
CoreCommandButton editBtn = new CoreCommandButton();
MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{backBean.doButtonAct}",null);
editBtn.setActionListener(mb);
//Action listener method
public void doButtonAct(ActionEvent actionEvent)
I keep getting a javax.faces.el.MethodNotFoundException error. However when I remove the ActionEvent parameter in doButtonAct(), I get a wrong number of arguments error.
So i'm guessing there is something wrong with the parameters i accept in my action listener method. what can be causing this issue?
Cheers.I figured this out.
Since doButtonAct() requires an ActionEvent object as a parameter, i needed to define the parameter type when I create the method binding.
Solution:
Class argsString[] = new Class[] { ActionEvent.class };
MethodBinding mb = FacesContext.getCurrentInstance().getApplication().createMethodBinding("#{backBean.doButtonAct}",argsString); -
Calling action listener for a BUTTON component in java bean page
Hi,
I have made it like this.
public void handleButtonPressed(ActionEvent event){
System.out.println("success!!!!!");
//code for calling actionlistener
FacesContext fctx = FacesContext.getCurrentInstance();
ELContext elctx = fctx.getELContext();
Application application = fctx.getApplication();
ExpressionFactory exprFactory = application.getExpressionFactory();
MethodExpression methodExpr = null;
methodExpr = exprFactory.createMethodExpression(elctx, "#{exbean.handleButtonPressed}",null,new Class[] { ActionEvent.class });
MethodExpressionActionListener actionListener = null;
actionListener = new MethodExpressionActionListener(methodExpr);
button.addActionListener(actionListener);
Even after making the listener Function as Void wHen i click the button i m getting the error saying."ARGUMENTS MISMATCH,ADF_FACES60097"??
can you help me out?
and in the msg log i m getting this
"SkinFactoryImpl> <getSkin> Cannot find a skin that matches family portal and version v1.1. We will use the skin portal.desktop.
<MethodExpressionActionListener> <processAction> Received 'javax.el.PropertyNotFoundException' when invoking action listener '#{exbean.handleButtonPressed}' for component 'null'
<MethodExpressionActionListener> <processAction> javax.el.PropertyNotFoundException: Target Unreachable, identifier 'custombean' resolved to null"
I Have tried with this giving Void TYPE as an argument
methodExpr = exprFactory.createMethodExpression(elctx, "#{exbean.handleButtonPressed},Void.TYPE,new Class[] { ActionEvent.class });
I M getting the same error.
Edited by: chaya on Dec 22, 2011 2:47 PMyeah but i m creating button itself dynamically by java code....
//code
UIComponent button;
button = findComponentInRoot("cb1");
RichPanelGroupLayout pgl;
pgl = (RichPanelGroupLayout)button.getParent();
List<UIComponent> children;
children = pgl.getChildren();
RichPanelGroupLayout pgll;
pgll = new RichPanelGroupLayout();
RichInputText it;
it = new RichInputText();
it.setLabel("New textbox " + (children.size()));
RichCommandButton but = new RichCommandButton();
but.setPartialSubmit(true);
but.setText("Delete");
/*calling actionevent*/
FacesContext fctx = FacesContext.getCurrentInstance();
ELContext elctx = fctx.getELContext();
Application application = fctx.getApplication();
ExpressionFactory exprFactory = application.getExpressionFactory();
MethodExpression methodExpr = null;
methodExpr = exprFactory.createMethodExpression( elctx,"#{inbean.actionPerformed}",null, new Class[] {ActionEvent.class});
MethodExpressionActionListener actionListener = null;
actionListener = new MethodExpressionActionListener(methodExpr);
but.addActionListener(actionListener);
/*end of call*/
children.add(pgll);
children.add(it);
children.add(but);
AdfFacesContext.getCurrentInstance().addPartialTarget(pgl);
//code to call method
public void actionPerformed(ActionEvent event) {
System.out.println("entered sec bean");
return " ";}
this way i m trying to create a button programatically and tryin to add actionlistener which is not working.
the actionlistener is throwing error.... with the line
methodExpr = exprFactory.createMethodExpression( elctx,"#{inbean.actionPerformed}",null, new Class[] {ActionEvent.class}); -
hello
the problem in my code is that i defined
actionlistener for a button but it does not
do what it should do . it throws an error in the console
and i think my code is 100% correct what is the problem
please help me this is the codewith
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class Library extends JFrame implements ActionListener {
private JMenuBar jmb = new JMenuBar();
private JMenu books = new JMenu("Books",true);
private JMenu members = new JMenu("Members",true);
private JMenu loans = new JMenu("Loans",true);
private JMenuItem addNb = new JMenuItem("Add New Book");
private JMenuItem listB = new JMenuItem("List All Books");
private JMenuItem listAb = new JMenuItem("List Available Books");
private JMenuItem listBb = new JMenuItem("List Borrowed Books");
private JMenuItem addNm = new JMenuItem("Add New Member");
private JMenuItem removeM = new JMenuItem("Remove a Member");
private JMenuItem listAm = new JMenuItem("List All Members");
private JMenuItem loanB = new JMenuItem("Loan A Book");
private JMenuItem returnB = new JMenuItem("Return A Book");
private JTextField bNumber = new JTextField(14);
private JTextField bAuthor = new JTextField(14);
private JTextField bTitle = new JTextField(14);
private JTextField mId = new JTextField(14);
private JTextField mName = new JTextField(14);
private JTextField idB = new JTextField(14);
private JTextField nBToB = new JTextField(14);
private JTextField nBTor = new JTextField(14);
private JTextArea dispaly = new JTextArea();
private JButton oKb1 = new JButton("OK");
private JButton okb2 = new JButton("OK");
private JButton cloaseb = new JButton("Close");
private JButton oKm1 = new JButton("OK");
private JButton oKm2 = new JButton("OK");
private JButton cancelM = new JButton("Cancel");
private JButton oKm3 = new JButton("OK");
private JButton oKm4 = new JButton("OK");
private JButton cancelM2 = new JButton("Cancel");
private JButton oKl = new JButton("OK");
private JButton oKr = new JButton("OK");
private JButton yes = new JButton("Yes");
private JButton no = new JButton("No");
private JLabel bN = new JLabel("Book Number");
private JLabel bA = new JLabel("Book Author");
private JLabel bT = new JLabel("Book Title");
private JLabel iN = new JLabel("ID Number");
private JLabel mN = new JLabel("Member's Name");
private JLabel iNb = new JLabel("ID number of the borrower");
private JLabel nBb = new JLabel("Number of the books to borrow");
private JLabel nBr = new JLabel("Number of the books to return");
private JLabel mIdl = new JLabel("ID number of the stuednt");
private JPanel tempoIPanel= new JPanel(new FlowLayout());
Container cp;
JFrame mainFrame;
JInternalFrame tempoI;
Library() {
//LibraryClass lClass = new LibraryClass();/*
mainFrame = new JFrame();
mainFrame.setJMenuBar(jmb);
mainFrame.setSize(800,550);
mainFrame.getContentPane().setLayout(new FlowLayout());
jmb.add(books);
jmb.add(members);
jmb.add(loans);
books.add(addNb);
addNb.addActionListener(this);
books.add(listB);
listB.addActionListener(this);
books.add(listAb);
listAb.addActionListener(this);
books.add(listBb);
listBb.addActionListener(this);
members.add(addNm);
addNm.addActionListener(this);
members.add(removeM);
removeM.addActionListener(this);
members.add(listAm);
listAm.addActionListener(this);
loans.add(loanB);
loanB.addActionListener(this);
loans.add(returnB);
returnB.addActionListener(this);
//actions listeners
oKb1.addActionListener(this);
mainFrame.setVisible(true);
public void actionPerformed(ActionEvent ae) {
if(ae.getSource() == addNb) {
tempoI = new JInternalFrame("Add new Book",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new FlowLayout());
tempoI.getContentPane().add(bN);
tempoI.getContentPane().add(bNumber);
tempoI.getContentPane().add(bA);
tempoI.getContentPane().add(bAuthor);
tempoI.getContentPane().add(bT);
tempoI.getContentPane().add(bTitle);
tempoI.getContentPane().add(oKb1);//add action listener here
tempoI.setVisible(true);
if(ae.getSource() == listB) {
//LibraryClass.listBooks();
if(ae.getSource() == listAb){}
if(ae.getSource() == listBb){}
if(ae.getSource() == addNm) {
tempoI = new JInternalFrame("Add new Member",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new FlowLayout());
tempoI.getContentPane().add(iN);
tempoI.getContentPane().add(mId);
tempoI.getContentPane().add(mN);
tempoI.getContentPane().add(mName);
tempoI.getContentPane().add(oKm1);//add action listener
tempoI.getContentPane().setSize(300,400);
tempoI.setVisible(true);
if(ae.getSource() == removeM) {
tempoI = new JInternalFrame("Rmove member",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new FlowLayout());
tempoI.getContentPane().add(mIdl);
tempoI.getContentPane().add(mId);
tempoI.getContentPane().add(oKm2);//add action listener
//LibraryClass.removeM(Double.parseDouble(mId.getText()));
tempoI.getContentPane().setSize(300,400);
tempoI.setVisible(true);
if(ae.getSource() == listAm) {
//LibraryClass.listMembers();
if(ae.getSource() == loanB) {
tempoI = new JInternalFrame("Loan book",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new FlowLayout());
tempoI.getContentPane().add(iNb);
tempoI.getContentPane().add(idB);
tempoI.getContentPane().add(nBb);
tempoI.getContentPane().add(nBToB);
tempoI.getContentPane().add(oKl);
//LibraryClass.borrowBook(Book bk,Member m);
tempoI.getContentPane().setSize(300,400);
tempoI.setVisible(true);
if(ae.getSource() == returnB) {
tempoI = new JInternalFrame("Return Book",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new FlowLayout());
tempoI.getContentPane().add(iNb);
tempoI.getContentPane().add(idB);
tempoI.getContentPane().add(nBr);
tempoI.getContentPane().add(nBTor);
tempoI.getContentPane().add(oKr);
tempoI.getContentPane().setSize(400,300);
tempoI.setVisible(true);
//Book.addBook(bNumber.getText(),bAuthor.getText(),bTitle.getText());
class ClubLibrarySystem {
public static void main(String[] args) {
new Library();
}hello
the problem in my code is that i defined
actionlistener for a button but it does not
do what it should do . it throws an error in the
consoleWhat error?
and i think my code is 100% correct what is theWell, but it isn't.
Have you tried using a debugger?
problem
please help me this is the codewith
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class Library extends JFrame implements
ActionListener {
private JMenuBar jmb = new JMenuBar();
private JMenu books = new JMenu("Books",true);
private JMenu members = new
JMenu("Members",true);
private JMenu loans = new
JMenu("Loans",true);
private JMenuItem addNb = new JMenuItem("Add New
Book");
private JMenuItem listB = new JMenuItem("List All
Books");
private JMenuItem listAb = new JMenuItem("List
Available Books");
private JMenuItem listBb = new JMenuItem("List
Borrowed Books");
private JMenuItem addNm = new JMenuItem("Add New
Member");
private JMenuItem removeM = new JMenuItem("Remove a
Member");
private JMenuItem listAm = new JMenuItem("List All
Members");
private JMenuItem loanB = new JMenuItem("Loan A
Book");
private JMenuItem returnB = new JMenuItem("Return A
Book");
private JTextField bNumber = new JTextField(14);
private JTextField bAuthor = new JTextField(14);
private JTextField bTitle = new JTextField(14);
private JTextField mId = new JTextField(14);
private JTextField mName = new JTextField(14);
private JTextField idB = new JTextField(14);
private JTextField nBToB = new JTextField(14);
private JTextField nBTor = new JTextField(14);
private JTextArea dispaly = new JTextArea();
private JButton oKb1 = new JButton("OK");
private JButton okb2 = new JButton("OK");
private JButton cloaseb = new JButton("Close");
private JButton oKm1 = new JButton("OK");
private JButton oKm2 = new JButton("OK");
private JButton cancelM = new JButton("Cancel");
private JButton oKm3 = new JButton("OK");
private JButton oKm4 = new JButton("OK");
private JButton cancelM2 = new JButton("Cancel");
private JButton oKl = new JButton("OK");
private JButton oKr = new JButton("OK");
private JButton yes = new JButton("Yes");
private JButton no = new JButton("No");
private JLabel bN = new JLabel("Book
Number");
private JLabel bA = new JLabel("Book
Author");
private JLabel bT = new JLabel("Book
Title");
private JLabel iN = new JLabel("ID Number");
private JLabel mN = new JLabel("Member's
Name");
private JLabel iNb = new JLabel("ID number of the
borrower");
private JLabel nBb = new JLabel("Number of the
books to borrow");
private JLabel nBr = new JLabel("Number of the
books to return");
private JLabel mIdl = new JLabel("ID number of
the stuednt");
private JPanel tempoIPanel= new JPanel(new
FlowLayout());
Container cp;
JFrame mainFrame;
JInternalFrame tempoI;
Library() {
//LibraryClass lClass = new LibraryClass();/*
mainFrame = new JFrame();
mainFrame.setJMenuBar(jmb);
mainFrame.setSize(800,550);
mainFrame.getContentPane().setLayout(new
FlowLayout());
jmb.add(books);
jmb.add(members);
jmb.add(loans);
books.add(addNb);
addNb.addActionListener(this);
books.add(listB);
listB.addActionListener(this);
books.add(listAb);
listAb.addActionListener(this);
books.add(listBb);
listBb.addActionListener(this);
members.add(addNm);
addNm.addActionListener(this);
members.add(removeM);
removeM.addActionListener(this);
members.add(listAm);
listAm.addActionListener(this);
loans.add(loanB);
loanB.addActionListener(this);
loans.add(returnB);
returnB.addActionListener(this);
//actions listeners
oKb1.addActionListener(this);
mainFrame.setVisible(true);
public void actionPerformed(ActionEvent ae) {
if(ae.getSource() == addNb) {
tempoI = new JInternalFrame("Add new
w Book",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new
w FlowLayout());
tempoI.getContentPane().add(bN);
tempoI.getContentPane().add(bNumber);
tempoI.getContentPane().add(bA);
tempoI.getContentPane().add(bAuthor);
tempoI.getContentPane().add(bT);
tempoI.getContentPane().add(bTitle);
tempoI.getContentPane().add(oKb1);//add action
n listener here
tempoI.setVisible(true);
if(ae.getSource() == listB) {
//LibraryClass.listBooks();
if(ae.getSource() == listAb){}
if(ae.getSource() == listBb){}
if(ae.getSource() == addNm) {
tempoI = new JInternalFrame("Add new
w Member",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new
w FlowLayout());
tempoI.getContentPane().add(iN);
tempoI.getContentPane().add(mId);
tempoI.getContentPane().add(mN);
tempoI.getContentPane().add(mName);
tempoI.getContentPane().add(oKm1);//add action
n listener
tempoI.getContentPane().setSize(300,400);
tempoI.setVisible(true);
if(ae.getSource() == removeM) {
tempoI = new JInternalFrame("Rmove
e member",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new
w FlowLayout());
tempoI.getContentPane().add(mIdl);
tempoI.getContentPane().add(mId);
tempoI.getContentPane().add(oKm2);//add action
n listener
//LibraryClass.removeM(Double.parseDouble(mId.getText
tempoI.getContentPane().setSize(300,400);
tempoI.setVisible(true);
if(ae.getSource() == listAm) {
//LibraryClass.listMembers();
if(ae.getSource() == loanB) {
tempoI = new JInternalFrame("Loan book",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new
w FlowLayout());
tempoI.getContentPane().add(iNb);
tempoI.getContentPane().add(idB);
tempoI.getContentPane().add(nBb);
tempoI.getContentPane().add(nBToB);
tempoI.getContentPane().add(oKl);
//LibraryClass.borrowBook(Book bk,Member m);
tempoI.getContentPane().setSize(300,400);
tempoI.setVisible(true);
if(ae.getSource() == returnB) {
tempoI = new JInternalFrame("Return
n Book",true,true);
mainFrame.getContentPane().add(tempoI);
tempoI.getContentPane().setLayout(new
w FlowLayout());
tempoI.getContentPane().add(iNb);
tempoI.getContentPane().add(idB);
tempoI.getContentPane().add(nBr);
tempoI.getContentPane().add(nBTor);
tempoI.getContentPane().add(oKr);
tempoI.getContentPane().setSize(400,300);
tempoI.setVisible(true);
//Book.addBook(bNumber.getText(),bAuthor.getText(),bT
tle.getText());
class ClubLibrarySystem {
public static void main(String[] args) {
new Library(); -
Calling Action listener in Custom component
Hello,
I am currently developing my own component containing an hyper-link and I am stuck with the Renderer. What should I put in the href of my "a" tag (<a href="???">) in order to call an Action listener ? I would like my renderer to do something similar to <h:commandLink actionListener="#{myBean.myActionListener}".
Could you help me?
Gerald.</a>Hello,
Did you achieve this??? I'm also planing to put very similar to your thought. If you have a solution on your requirement, pls mail me to [email protected]
Thanks in Advance.
regards,
Ram -
Is there a way to have the same action listener for few buttons?
guys, lets say i have button1, button2 and button3
how do i add the same action listener for 3 of them. doing 3 different action listener is very tedius! my assignment have almots 100 buttons but I need their action listener to be the same.Hi,
Your class needs an action listener, so add implements ActionListener to you class creation string.
Then on each button set an action command;
button1.setActionCommand(BUTTON1);Now add an listener;
buttons1.addActionListener(this);Finally create a method to perform a task
public void actionPerformed(ActionEvent e)
if (e.getActionCommand().equals(BUTTON1))
xxxx
}This should do the trick.
adelebt
Maybe you are looking for
-
I'm a Desktop user, but often find myself needing to go to the Metro/Start and Search Tool to find programs and App(let)s in order to run them. However, after doing this several times for many programs, I find myself wanting to create Desktop icons
-
How to transfer music from an external iPod to my media center?
I´ve got an iPod, that isn´t mine, but I like to put the music, which is on this ipod, on my iPod. Can you please help me? Thanks!
-
Function Module BAPI_ABSENCE_CREATE for creating leave request.
Hi Experts, I am using FM BAPI_ABSENCE_CREATE for creating leave request. I am passing all the data into this as import parameter. When i am executing this return table gives statement EPG184Employee/applicant is not locked yet Please let me know wh
-
HELP, Diagnostics Applet JMF classes.....Not Found
Hi, I installed JMF and verified the jars are included in classpath and path, but when I run the diagnostic applet page, it still says Applet JMF classes not found, anyone has any idea? classpath: .;.;.;C:\PROGRA~1\JMF21~1.1E\lib\sound.jar;C:\PROGRA~
-
How to call up an executable file (eg. MSPaint) from within my java program
How to call up an executable file (eg. MSPaint) from within my java program