*UPDATE* I've made some improvements to the MODAL feature and posted them to the 2.3 SVN repo. The online demo contains the latest 2.3 revision. Check out the Attendee screen and edit an existing attendee record.
I was working on something tonight and wanted to see if there was any interest for this. Basically, I've noticed that the Edit and New displaymode are constrained by the size of the BizForm as defined in template. In many cases this is fine but if one iw working with a complex layout, the resulting BizForm can be oddly shapped leading to unusual forms. A different approach is to put all Edit|New|Query modes in a modal dialog or Light Box that will appear in the same place with the same width each time. This means you have a consistant canvas on which to design editing forms. Modals have a downside, they are jarring for the user and gray out the original page. If you guys think this is worth adding, I can put this in the latest 2.3 SVN.
Here are some screen shots of Openbiz using modals vs. an oddly shapped BizForm...
|
|||



Updated Modal Support I've
Updated Modal Support
I've updated modal support to correct some limitations. Namely, the MODAL will be rended when a user "Double Clicks" a record OR uses the Context Menu. Also, All the required JS files are included in OpenBiz's auto JS include script. This means that for sites that rely on OpenBiz handling of CSS or JavaScript, no template changes are needed.
I've updated the 2.3 user guide with instructions for use...
http://www.phpopenbiz.org/jim/node/253
and udpated the demo to reflect the changes. Click the link below and try to Edit a record. You can also try Search or New
http://phpopenbiz.org/demo/23/baseapp/bin/controller.php?view=demo.AttendeeView
I've posted limited Modal
I've posted limited Modal support to the SVN copy of OpenBiz 2.3. It has one know bug described below.
To See In Action:
The online demo has also been updated.
http://phpopenbiz.org/demo/23/baseapp/bin/controller.php?view=demo.Atten...
And Click the Attendee->Edit or Query button
Usage Notes:
Require ModalBox.js and ModalBox.css. Also requires Prototype, Script, Effects JS.
Use by setting a ToolBar entry to use FunctionType="Modal". This means that when clicked, the resulting BizForm will be displayed in a Modal Window.
Known Bugs...
FIXED - The Modal doesn't seem to work correctly in IE. I'm considering using a different ModalBox script.
FIXED - The Modal doesn't work when multiple BizForms are returned. For example, when clicking a NEW toolbar on a BizView where multiple BizForms are displayed will resulting the Modal Window opening and closing. I'm not sure how to get around it but I can atleast describe the problem. Hopefully someone who know Javascript and Prototype better than I can help.
PENDING - Oh it also doesn't support the Double Click to EDIT feature. I can't find that in clientutil.js to modify.
Modal support works by modifying ClientUtils in a couple of places but the real work is here around line 386...
AjaxForm.prototype.CallbackFunction = function (retContent)
{
if (this.m_FunctionType=="Modal") {
Modalbox.show(retContent, {title: 'Window', overlayOpacity: .1, width: 650, overlayDuration: .1, slideDownDuration: .1, slideUpDuration: .25});
} else {
try {
Modalbox.hide();
this.Show(retContent);
} catch (err){
this.Show(retContent);
}
}
}
You can see that the first NON MODAL functiontype will cause the Modal window to close. I do this so users can click other tools bars like SAVE or CANCEL and any open Modal windows close. But this blows up when multiple BizForms are returned when a Modal is intended to be displayed. For example, when a users clicks the NEW toolbar item any BizForm on the BizView is refreshed. This means the quoted function is called mutliple times during the same AJAX cycle resulting in the NEW BizForm opening and closing as soon as the next BizForm is processed.
Jim, In case of new record,
Jim,
In case of new record, the bottom form should not be rendered with the parent form. So there is a need to change the bizform code for newrecord call.
Of course, the functionType (Modal) needs to be checked not in the form callback function, should be in the global callback function.
Thanks,
Rocky
Jim, This is definitely a
Jim,
This is definitely a good improvement on current bizform. Please do commit your change in SVN. Thanks!
- rocky