This is a bit out there - so go jQuery client side first if possible, but... if 
you do want to use the SHAREPOINT EVENT RECEIVERS to perform your validation 
logic server side:

Perform all validation in your event receivers synchronously: ItemAdding, 
ItemUpdating events.

Instead of redirecting to a page you need to persist the information first 
using a serializable message of sorts.
Write a memento validation object, store it into a session state object / or 
HttpContext.Application.
Then redirect back to the referrer page (editform.aspx), but append the memento 
id (using a guid) to the query string.

Then use jQuery to hit the server via an ASHX page to retrieve the json 
equivalent of the stored validation message and display validation errors in a 
popup window.

I personally prefer client side when the rules are simple enough - check out 
the xVAL framework for clientside / serverside jQuery validation.


From: [email protected] [mailto:[email protected]] On Behalf Of 
Paul Noone
Sent: Wednesday, 11 November 2009 2:00 PM
To: ozMOSS
Subject: RE: JavaScript popup from an event handler

EDIT: VIEW Form Pages are editable via the browse. New/Edit form pages are not. 
You'll need SPD - or something else that can mangle MOSS pages.

Not to self, next time read more closely.

From: [email protected] [mailto:[email protected]] On Behalf Of 
Paul Noone
Sent: Wednesday, 11 November 2009 2:56 PM
To: ozMOSS
Subject: RE: JavaScript popup from an event handler

Hi Daniel,

Form pages can be edited in the same way as any other page - but without the 
pain of versioning, check-out and publishing workflows. :)

Just go to Site Actions -> Edit Page. Add a CEWP to the web part zone and wack 
in your JQuery.

As for hooking up with a server-side event handler...I'll leave that to someone 
who knows. :\

Regards,

Paul
Online Developer, ICT
CEO Sydney

From: [email protected] [mailto:[email protected]] On Behalf Of 
Daniel W. Brown
Sent: Wednesday, 11 November 2009 2:38 PM
To: ozMOSS
Subject: RE: JavaScript popup from an event handler

Newb hat on with jQuery so bear with me :P

>From what you're saying I would need to edit the HTML of NewForm/EditForm.aspx 
>in SPD and add the jQuery in there?

With that in mind, How would I hook up jQuery and the server side event handler 
code which checks the "business rules" around saving an item? As the message 
box will has to show after checking of the list/calendar (done server side).

Keen to use jQuery, seems very cool indeed :)




From: [email protected] [mailto:[email protected]] On Behalf Of 
Steven Berry
Sent: Wednesday, 11 November 2009 1:40 PM
To: ozMOSS
Subject: RE: JavaScript popup from an event handler

Yeah attach a jquery listener at the dom level to watch for a change in field 
value and then just render it to your end date field.

From: Jeremy Thake [mailto:[email protected]]
Sent: Wednesday, 11 November 2009 2:08 PM
To: ozMOSS
Subject: RE: JavaScript popup from an event handler

U can use jQuery to hook up to any element in a HTML page (so therefore 
SharePoint page). Their syntax is a little more easy on the eye than JavaScript 
directly. Then you can add this jQuery script block to your editform.aspx so 
that it triggers on a click.

From: [email protected] [mailto:[email protected]] On Behalf Of 
Daniel W. Brown
Sent: Wednesday, 11 November 2009 11:00 AM
To: ozMOSS
Subject: JavaScript popup from an event handler

Hi again :P

Has anyone successfully got a JavaScript popup window attached to the save 
button when added/editing a list item?

I've got an event handler which handles business rule checking against the new 
item against such things as duplicate bookings, max people per hour, etc.

For a normal user, these rules are unbreakable, for a Admin, they are 
advisories only and can be "override", However the way the event handler works, 
its redirecting to a /_layouts/ error page.

Is it possible to get a JavaScript popup window showing from an event handler? 
No matter where i look i can't find a reference to 'Page' to assign JavaScript.

Any help greatly appreciated.

Cheers,

DB




________________________________

This message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately if you have received this e-mail by mistake and delete this e-mail 
from your system. No responsibility is assumed by the company or its employee 
to any other person for any loss or damage (whether caused by negligence or 
not) arising from the use of the information and advice contained herein. 
Finally, it is your responsibility to check any attachments for viruses and 
defects before opening or sending them on.

________________________________
_______________________________________________
ozmoss mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to