Re: EOEditingContext.MessageHandler
Re: EOEditingContext.MessageHandler
- Subject: Re: EOEditingContext.MessageHandler
- From: Zak Burke <email@hidden>
- Date: Thu, 13 Oct 2005 15:43:10 -0400
Marcos Trejo Munguia wrote on 10/13/05 2:05 PM:
> Hi list!
>
> Someone has successfully implement this class in a WebObjects Application?
In my EC subclass constructor I have:
...
setMessageHandler(new I3pkbMessageHandler());
...
My message handler is the following:
public I3pkbMessageHandler()
{}
/**
* Save the alert in the EditingContext's errorMessage list if this
* is an I3pkbEditingContext.
*
* @param context EC this message applies to
* @param message message to save
*
*/
public void editingContextPresentErrorMessage(EOEditingContext context,
String message)
{
if (context instanceof I3pkbEditingContext)
{
I3pkbEditingContext ec = (I3pkbEditingContext) context;
if (ec.errorMessages == null)
ec.errorMessages = new NSMutableArray();
ec.errorMessages.addObject(message);
}
}
/**
* Block fetches that return too many rows (i.e. return false) and alert
* the user that this action was taken.
*
* @param context EditingContext in which blocked fetch occurred
* @param count how many rows were retrieved so far
* @param limit how many rows may be retrieved at once
* @param objectStore dunno what this is for
*
* @return false under all circumstances in order to block large fetches
*/
public boolean editingContextShouldContinueFetching(EOEditingContext
context, int count, int limit, EOObjectStore objectStore)
{
editingContextPresentErrorMessage(context, "Fetch limit ("+limit+")
exceeded; please restrict your search parameters");
return false;
}
_______________________________________________
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