Postback Implementation

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: Postback Implementation

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Postback Implementation

Post by Christopher »

I would be great if you could post some code for people to try. It sounds interesting.
(#10850)
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: Postback Implementation

Post 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.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Postback Implementation

Post by Weirdan »

JNettles wrote:Does anyone have a fast XHTML parser that handles namespaces?
Wouldn't SimpleXML not suffice in this case?
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: Postback Implementation

Post by JNettles »

Unfortunately no. Perhaps someone wiser has done it but my previous attempts with SimpleXML didn't get the results I needed.
Post Reply