packageElement url
Permalink 3 users found helpfulI am currently building time tracking package. By installing the package, a couple of new single pages and a new theme is created. This all works fine.
To add a new time i call a form. This form is also a single page. The form is currently opend over a javascript link window.open with no bars, scrolls and so on...
this works fine. But i would like to have this form in a package element. How can i directly link to a package element to open it with a javascript window.opwn with no bars, scrolls and so on?
Is this possible? Or do i have to take the way over a single page as i do right now?
thanks a lot

So I'll do it with a single page and some in page css to hide the header and footer.
I am going to pack the whole form, 150 lines of code, into a function in the single page controller.
Right?
Remo is right (as always)
DashboardTimeTrackerController extends Controller{ function loadElement($element){ Loader::packageElement($element,'time_tracker',$_GET); ?> die(); } }
What is really nice about this vs say loading from a tools request is you don't have to duplicate the functionality or permissions handling that is around the single page in the dashboard. If they can see that page (and its controller) then they should be able to do any action shown there. Compare this to about 10 lines of boilerplate on every tool or 10 lines somewhere you call from your tools request and I'll take my way every time :).
Works great.
The C5 jQuery dialog is now essentially a layer on top of a jQuery.UI dialog with a capability to load the dialog content from a url (such as an action in your controller or a tool). Beware that some of the dialog parameters behave a little differently and events have different names.
As long as you're using a desktop browser, overlays are great. But as soon as you work with a mobile browser, it's a pain in the b....
For example. It is very tricks, or better nearly impossible, to fill a form nested in an overlay. See Scrennshot.
I am now trying to fix this. If i do not find a solution, i'll have to switch back to popup windows.
Do you have an idea how to fix this?
Kind regards,
Steff
When creating a dialog you can control the size, placement and movement(dragable) of the dialog. So perhaps make it just about fill the window above the keyboard with no drag, then use a scrollable div to wrap the dialog content.
I have customers using 'Front End File Uploader' from iphone and android, which pops a jQuery dialog and does ajax uploads, so the overall method works.
There is also a jQuery plugin 'drag to scroll' (or something like that) so the content of a larger dialog can be dragged about within a container. Though dragging would need to be resolved against form entry within the same area.
Thank you. After a couple of tests, I found the problem.
I was loading the overlay with something like this
function custWOpnOrd(uID){ $.fn.dialog.open({ title: 'Customers with open tasks', width: '500px', height: '320px', href: '<?php echo BASE_URL?>/ts-reporting/loadForm/custWOpnOrd' }); }
instead of this
loadForm = function(formName, uID){ jQuery.fn.dialog.open({ title: 'This is my title', href: '<?php echo BASE_URL?>/ts-reporting/loadForm/' + formName, width: 550, modal: false, height: 380, }); }
It now works with the mobile browser.
The 'modal' parameter used to catch me as it is back to front. '$' should still work.
You can also build the C5 validation token into the dialog and action to make sure it is a genuine ajax call and you are not being spoofed.
"You can also build the C5 validation token into the dialog and action to make sure it is a genuine ajax call and you are not being spoofed."
Do you have a sample for me?
Thanks
http://www.concrete5.org/community/forums/customizing_c5/token-vali...
C5 docs at:
http://www.concrete5.org/documentation/developers/forms/basic-valid...
You would want to get the token as a string and add it to the url or post data for the ajax call as the parameter ccm_token.
That helped.