Page 3 of 3

Re: Postback Implementation

Posted: Thu Oct 29, 2009 1:35 pm
by JNettles
At the moment I'm just using a standard jQuery script source but that will be changing - controls will have specific Javascript blocks dumped into the output as needed. Still haven't figured out how asynchronous postbacks will work either but I'm hoping it will be as simple as adding a postback="ajax" attribute to the controls.

Server-side validation is handled this way (though its subject to change). If a <jar:Form> control is present in the markup a hidden field is introduced that tells the controller to run any validation subroutines present in the code-behind before redirecting to the specified page - so when the form is processed the checks for any controls that need validating (saved in hidden fields) and runs the input against the validation function. So long as everything checks out the rest of the submit subroutine executes - otherwise the original page is restored (with any changes to it as per the validater routines.

For security every visitor on the site is automatically logged as a guest (so long as the ACL is enabled) unless otherwise stated and pages can be restricted based upon specific users, groups, etc. in the markup. <jar:ACL id="pageACL" restrict="exceptions" groups="group1, group2"/>. You can influence it in the code-behind preload subroutine by calling, $this->pageACL->properties..... I haven't implemented a Master page system yet but theoretically the programmer could simply create security for the Master page/s since if the Master rejects a request then the entire operation is terminated and the user is directed to a 403 Forbidden.

All subject to change. This is very much in the experimentation stage.

Re: Postback Implementation

Posted: Thu Oct 29, 2009 2:23 pm
by Christopher
I would be great if you could post some code for people to try. It sounds interesting.

Re: Postback Implementation

Posted: Thu Oct 29, 2009 3:45 pm
by JNettles
All in good time. :) Still needs some pretty serious work, especially on the markup parser. Does anyone have a fast XHTML parser that handles namespaces? My regex one is super-slow.

Re: Postback Implementation

Posted: Thu Oct 29, 2009 9:07 pm
by Weirdan
JNettles wrote:Does anyone have a fast XHTML parser that handles namespaces?
Wouldn't SimpleXML not suffice in this case?

Re: Postback Implementation

Posted: Fri Oct 30, 2009 8:19 am
by JNettles
Unfortunately no. Perhaps someone wiser has done it but my previous attempts with SimpleXML didn't get the results I needed.