Re: EOEditingContext.MessageHandler
Re: EOEditingContext.MessageHandler
- Subject: Re: EOEditingContext.MessageHandler
- From: Chuck Hill <email@hidden>
- Date: Thu, 13 Oct 2005 12:39:41 -0700
It looks like it does not like the anonymous inner class. I'd try it
like this:
public TransactionsHistory(WOContext context) {
super(context);
ec.setMessageHandler(this);
}
public void editingContextPresentErrorMessage(EOEditingContext
context, String message) {
errMsg = message;
}
public boolean editingContextShouldContinueFetching
(EOEditingContext context, int count, int originalLimit,
EOObjectStore objectStore) {
return false;
}
...
On Oct 13, 2005, at 11:05 AM, Marcos Trejo Munguia wrote:
Hi list!
Someone has successfully implement this class in a WebObjects
Application?
I have the next code:
private EOEditingContext ec = new EOEditingContext();
public NSArray transactions;
public TransactionsHistory(WOContext context) {
super(context);
ec.setMessageHandler(new Object() {
public void editingContextPresentErrorMessage
(EOEditingContext context, String message) {
errMsg = message;
}
public boolean editingContextShouldContinueFetching
(EOEditingContext context, int count, int originalLimit,
EOObjectStore objectStore) {
return false;
}
});
}
public void next() {
...
EOFetchSpecification fs = new EOFetchSpecification
("InventoryTransDetail", qual, sorts, false, false, null);
fs.setRefreshesRefetchedObjects(true);
fs.setPromptsAfterFetchLimit(true);
fs.setFetchLimit(500);
transactions = ec.objectsWithFetchSpecification(fs);
}
When the fetch gets 500 objects or more I get the next exception:
[2005-10-13 12:35:14 CDT] <WorkerThread1>
java.lang.IllegalArgumentException: <NSSelector> method is not
public: public void TransactionsHistory
$1.editingContextPresentErrorMessage
(com.webobjects.eocontrol.EOEditingContext,java.lang.String)
Class com.webobjects.foundation.NSSelector can not access a member
of class TransactionsHistory$1 with modifiers "public"
at com.webobjects.foundation.NSSelector._safeInvokeMethod
(NSSelector.java:124)
at com.webobjects.foundation._NSDelegate._perform
(_NSDelegate.java:225)
at com.webobjects.foundation._NSDelegate.perform
(_NSDelegate.java:166)
at com.webobjects.eocontrol.EOEditingContext.handleError
(EOEditingContext.java:2927)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecificatio
n(EOEditingContext.java:4055)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecificatio
n(EOEditingContext.java:4438)
at TransactionsHistory.next(TransactionsHistory.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at KeyValueCodingProtectedAccessor.methodValue
(KeyValueCodingProtectedAccessor.java:54)
at com.webobjects.foundation.NSKeyValueCoding
$_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)
at com.webobjects.foundation.NSKeyValueCoding
$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1268)
at com.webobjects.appserver.WOComponent.valueForKey
(WOComponent.java:1539)
at com.webobjects.foundation.NSKeyValueCoding
$Utility.valueForKey(NSKeyValueCoding.java:498)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$DefaultImplementation.valueForKeyPath
(NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath
(WOComponent.java:1600)
at
com.webobjects.appserver._private.WOKeyValueAssociation.valueInCompone
nt(WOKeyValueAssociation.java:46)
at com.webobjects.appserver._private.WOActiveImage.invokeAction
(WOActiveImage.java:255)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(
WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction
(WODynamicGroup.java:110)
at com.webobjects.appserver._private.WOConditional.invokeAction
(WOConditional.java:55)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(
WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction
(WODynamicGroup.java:110)
at com.webobjects.appserver._private.WOForm.invokeAction
(WOForm.java:82)
at
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(
WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction
(WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction
(WOComponent.java:945)
at com.webobjects.appserver.WOSession.invokeAction
(WOSession.java:1166)
at com.webobjects.appserver.WOApplication.invokeAction
(WOApplication.java:1375)
Can someone tell me how can I get this to work?
I'll appreciate your help.
Thank you. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden