Hi All,

I'm having a problem with a method thats being called twice when it should only be called once.

I have a form, with one submit button, whose action is bound to the method typeSelectedGoToDetails(). Now I have done search through the whole project and this method is only lised twice, once inside the wod file as bound to the submit button and the second time is its own declaration in the java file.
However upon clicking the submit button it is being called twice.


Listed below are the stack traces from each of the times it is called, and a copy of the code itself.

Can anyone see what dumb thing i am doing this time ? Or explain why the method is being called twice.

Thanks
Owen


Code :

/**
Check that the required info has been given, if so check if the publication title is simialr to any found in the DB.
        */
        public WOComponent typeSelectedGoToDetails() throws Exception
    {
                WOComponent nextPage = null;
                int i;
                boolean rightToGo = true;
                if ( newTitle != null ) { //THE BREAK POINT IS ON THIS LINE
                        if (!newTitle.trim().equals("") ) {
                                if ( thePublication.publicationType() == null) {
                                        setMessage("Please select a valid 
Publication Type.");
                                } else {
                                        //Check if there is more than 1 author
if ( thePublication.publicationType().hasAuthors().intValue() == 1 && numNewAuthors < 1 ) {
                                                rightToGo = false;
                                                setMessage("There must be at least 1 
Author.");
                                        }
if ( thePublication.publicationType().hasEditors().intValue() == 1 && numNewEditors < 1 ) {
                                                        rightToGo = false;
                                                        setMessage("There must be at 
least 1 Editor.");
                                        }
                                        //Check if they need editors and if so 
that there is more than 1
                                        if ( rightToGo ) {
                                                setMessage("");
//*** FIX ME *** Need to update so only asks for pubs who's status is not = to new.
                                                similarPublications = 
(NSArray)searchForSimilarItems(newTitle);
                                        }
                                }
                        } else {
                                setMessage("You must enter a title for the 
Publication.");
                        }
                } else {
                        setMessage("You must enter a title for the 
Publication.");
                }
                if ( !similarPublicationsFound && rightToGo ) {
                        //No similar items found, just go stright to the 
details.
                        setupNewPublication();
PublicationDetails newPage = (PublicationDetails) pageWithName ("PublicationDetails");
                        newPage.setEc(getEc());
                        newPage.setThePublication(thePublication);
                        newPage.setUp();
                        newPage.setAddingNew(true);
                        newPage.setValideState(false);
                        nextPage = newPage;
mySession().replaceLastCookie("PublicationDetails","Publication Details",newPage.pagesState(),true);
                        
                } else {
                        nextPage = context().page();
                }
                
        return nextPage;
    }


First Time :
#0 0x00000004 in addPublication.typeSelectedGoToDetails() at addPublication.java:131
#1      sun.reflect.NativeMethodAccessorImpl.invoke0()
#2 0x00000057 in sun.reflect.NativeMethodAccessorImpl.invoke() at NativeMethodAccessorImpl.java:39 #3 0x00000006 in sun.reflect.DelegatingMethodAccessorImpl.invoke() at DelegatingMethodAccessorImpl.java:25
#4      0x0000006f in java.lang.reflect.Method.invoke() at Method.java:324
#5 0x00000003 in KeyValueCodingProtectedAccessor.methodValue() at KeyValueCodingProtectedAccessor.java:54 #6 0x00000009 in com.webobjects.foundation.NSKeyValueCoding $_MethodBinding.valueInObject() at NSKeyValueCoding.java:1160 #7 0x00000022 in com.webobjects.foundation.NSKeyValueCoding $DefaultImplementation.valueForKey() at NSKeyValueCoding.java:1268 #8 0x00000002 in com.webobjects.appserver.WOComponent.valueForKey() at WOComponent.java:1539 #9 0x0000001a in com.webobjects.foundation.NSKeyValueCoding $Utility.valueForKey() at NSKeyValueCoding.java:498 #10 0x00000013 in com.webobjects.foundation.NSKeyValueCodingAdditions $DefaultImplementation.valueForKeyPath() at NSKeyValueCodingAdditions.java:212 #11 0x00000002 in com.webobjects.appserver.WOComponent.valueForKeyPath () at WOComponent.java:1600 #12 0x00000013 in com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent () at WOKeyValueAssociation.java:46 #13 0x00000064 in com.webobjects.appserver._private.WOSubmitButton.invokeAction() at WOSubmitButton.java:70 #14 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #15 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #16 0x00000027 in com.webobjects.appserver._private.WOForm.invokeAction() at WOForm.java:82 #17 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #18 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #19 0x0000003a in com.webobjects.appserver._private.WOConditional.invokeAction() at WOConditional.java:55 #20 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #21 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #22 0x0000003a in com.webobjects.appserver._private.WOConditional.invokeAction() at WOConditional.java:55 #23 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #24 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #25 0x00000029 in com.webobjects.appserver._private.WOComponentContent.invokeAction() at WOComponentContent.java:31 #26 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #27 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #28 0x00000072 in com.webobjects.appserver._private.WOHTMLURLValuedElement.invokeAction () at WOHTMLURLValuedElement.java:115 #29 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #30 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #31 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction() at WOComponent.java:945 #32 0x0000000b in com.webobjects.appserver._private.WOComponentReference.invokeAction() at WOComponentReference.java:104 #33 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #34 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #35 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction() at WOComponent.java:945 #36 0x00000014 in com.webobjects.appserver.WOSession.invokeAction() at WOSession.java:1168 #37 0x0000000f in com.webobjects.appserver.WOApplication.invokeAction () at WOApplication.java:1375 #38 0x00000062 in com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedPage() at WOComponentRequestHandler.java:196 #39 0x000000ba in com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedSession() at WOComponentRequestHandler.java:287 #40 0x00000054 in com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedApplication() at WOComponentRequestHandler.java:322 #41 0x0000006d in com.webobjects.appserver._private.WOComponentRequestHandler._handleReque st() at WOComponentRequestHandler.java:358 #42 0x00000017 in com.webobjects.appserver._private.WOComponentRequestHandler.handleReques t() at WOComponentRequestHandler.java:432 #43 0x00000029 in com.webobjects.appserver.WOApplication.dispatchRequest() at WOApplication.java:1306
#44     0x00000027 in Application.dispatchRequest() at Application.java:303
#45 0x000002d9 in com.webobjects.appserver._private.WOWorkerThread.runOnce() at WOWorkerThread.java:173 #46 0x00000081 in com.webobjects.appserver._private.WOWorkerThread.run () at WOWorkerThread.java:254
#47     0x0000000b in java.lang.Thread.run() at Thread.java:552



2nd Time :
#0 0x00000004 in addPublication.typeSelectedGoToDetails() at addPublication.java:131
#1      sun.reflect.NativeMethodAccessorImpl.invoke0()
#2 0x00000057 in sun.reflect.NativeMethodAccessorImpl.invoke() at NativeMethodAccessorImpl.java:39 #3 0x00000006 in sun.reflect.DelegatingMethodAccessorImpl.invoke() at DelegatingMethodAccessorImpl.java:25
#4      0x0000006f in java.lang.reflect.Method.invoke() at Method.java:324
#5 0x00000003 in KeyValueCodingProtectedAccessor.methodValue() at KeyValueCodingProtectedAccessor.java:54 #6 0x00000009 in com.webobjects.foundation.NSKeyValueCoding $_MethodBinding.valueInObject() at NSKeyValueCoding.java:1160 #7 0x00000022 in com.webobjects.foundation.NSKeyValueCoding $DefaultImplementation.valueForKey() at NSKeyValueCoding.java:1268 #8 0x00000002 in com.webobjects.appserver.WOComponent.valueForKey() at WOComponent.java:1539 #9 0x0000001a in com.webobjects.foundation.NSKeyValueCoding $Utility.valueForKey() at NSKeyValueCoding.java:498 #10 0x00000013 in com.webobjects.foundation.NSKeyValueCodingAdditions $DefaultImplementation.valueForKeyPath() at NSKeyValueCodingAdditions.java:212 #11 0x00000002 in com.webobjects.appserver.WOComponent.valueForKeyPath () at WOComponent.java:1600 #12 0x00000013 in com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent () at WOKeyValueAssociation.java:46 #13 0x00000064 in com.webobjects.appserver._private.WOSubmitButton.invokeAction() at WOSubmitButton.java:70 #14 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #15 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #16 0x00000027 in com.webobjects.appserver._private.WOForm.invokeAction() at WOForm.java:82 #17 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #18 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #19 0x0000003a in com.webobjects.appserver._private.WOConditional.invokeAction() at WOConditional.java:55 #20 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #21 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #22 0x0000003a in com.webobjects.appserver._private.WOConditional.invokeAction() at WOConditional.java:55 #23 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #24 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #25 0x00000029 in com.webobjects.appserver._private.WOComponentContent.invokeAction() at WOComponentContent.java:31 #26 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #27 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #28 0x00000072 in com.webobjects.appserver._private.WOHTMLURLValuedElement.invokeAction () at WOHTMLURLValuedElement.java:115 #29 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #30 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #31 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction() at WOComponent.java:945 #32 0x0000000b in com.webobjects.appserver._private.WOComponentReference.invokeAction() at WOComponentReference.java:104 #33 0x00000036 in com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction () at WODynamicGroup.java:101 #34 0x00000003 in com.webobjects.appserver._private.WODynamicGroup.invokeAction() at WODynamicGroup.java:110 #35 0x00000019 in com.webobjects.appserver.WOComponent.invokeAction() at WOComponent.java:945 #36 0x00000014 in com.webobjects.appserver.WOSession.invokeAction() at WOSession.java:1168 #37 0x0000000f in com.webobjects.appserver.WOApplication.invokeAction () at WOApplication.java:1375 #38 0x00000062 in com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedPage() at WOComponentRequestHandler.java:196 #39 0x000000ba in com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedSession() at WOComponentRequestHandler.java:287 #40 0x00000054 in com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWit hPreparedApplication() at WOComponentRequestHandler.java:322 #41 0x0000006d in com.webobjects.appserver._private.WOComponentRequestHandler._handleReque st() at WOComponentRequestHandler.java:358 #42 0x00000017 in com.webobjects.appserver._private.WOComponentRequestHandler.handleReques t() at WOComponentRequestHandler.java:432 #43 0x00000029 in com.webobjects.appserver.WOApplication.dispatchRequest() at WOApplication.java:1306
#44     0x00000027 in Application.dispatchRequest() at Application.java:303
#45 0x000002d9 in com.webobjects.appserver._private.WOWorkerThread.runOnce() at WOWorkerThread.java:173 #46 0x00000081 in com.webobjects.appserver._private.WOWorkerThread.run () at WOWorkerThread.java:254
#47     0x0000000b in java.lang.Thread.run() at Thread.java:552


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to