Out on a ZiMB (Blog)
|
Out On a ZiMB
Zend i5 Toolkit Write Data Area PDF Print E-mail
Written by Chris Anderson   
Friday, 08 January 2010 15:12

So you want to use the data area functions of Zend's i5 Toolkit but every time you use the function i5_write_data_area() you get no result or, if you're looking for it, an error resulting from a malformed System i command.

Don't sweat it. You just have to include the single quotes because, for some reason, the function doesn't include them automatically.

So, instead of:

 
$newText = "hello";
$dataAreaName = "dacool";
i5_data_area_write($dataAreaName, $newText);
 
 

You do this:

 
$newText = "'hello'";
$dataAreaName = "dacool";
i5_data_area_write($dataAreaName, $newText);
 

I don't know why this isn't in the official documentation other than that there is almost nothing in the official documentation.

Comments (0)

Last Updated on Friday, 08 January 2010 15:26
 
Differences Between OnChange In Internet Explorer and Firefox PDF Print E-mail
Written by Chris Anderson   
Friday, 11 December 2009 14:59
I just spent way too long trying to figure out why some dynamic html I was modifying in Javascript wouldn't update until I clicked elsewhere on the screen. I had two radio buttons and depending on which one you clicked, further information related to that button would appear dynamically inside the table. In Firefox (as usual) everything worked great right away but in Internet Explorer it wouldn't work until I clicked somewhere else on the page. Well, and this is the part that took me way too long, it turns out it wasn't just clicking on the page but, more specifically, taking focus away from the radio button. Voila! It was simply a difference in when the onchange event was firing in the different browsers. Internet Explorer waits until focus is lost on the controlling object (not really that bizarre of a behavior when compared to, say, a textbox) whereas Firefox fired it as soon as the value of the radio button group had changed. I'm not going to pick a favorite among them but thought it would be valuable to note this in case someone else is having the same problem. My solution was to have the function called on the onclick event instead of the on change and added some logic to catch if the radio button didn't have a value (the user clicked it but didn't get it to select). Now, if only I could get dynamic table rows to appear with the proper formatting in Firefox. For some reason when I assign a large colspan to a table cell it still is only inhabiting the first cell in the table which throws off the whole layout. In this case, IE does what I want it to do. Is there no end to this cross-browser compatibility struggle?

Comments (0)

Last Updated on Friday, 11 December 2009 15:17
 
ZiMB Manager - Convenient AJAX and IBM i Access PDF Print E-mail
Written by Chris Anderson   
Friday, 20 November 2009 03:39

I've been doing a lot of work modernizing the ZiMB Comment system so it is more secure and localizable. I managed to quickly allow for UTF-8 support and have been busy rebuilding the inner workings to use the Dojo Toolkit instead of the terrible hand-written AJAX system it had earlier. This should make it much more secure and customizable. I'm looking at packaging all of the text related to the module in files that can be translated and modified easily by the end-user.

Also, there will be support (with ZiMB Manager) of Dojo Widgets in the comment's front-end UI. I used a very modular, programmable backend framework to support the generation of that data and it will be very easy for a moderately skilled developer to completely customize not only the CSS but the entire structure of the interface. As long as certain fields exist in the custom interface, it will work. This should alleviate most of the problems with the rigidity of the previous incarnation.

Anyway, on to the progress with ZiMB Manager. Much of the benefit of the Manager is that it allows the site designer to leverage all of the Dojo and ZiMB/Zend functionality from not only the Component design level but also from the actual articles themselves. You can arbitrarily add javascript and UI elements inside the editor (I'll need to generate a new one that doesn't strip markup but that's a different article) but I realized quickly that there was something glaring missing. I needed a trivially easy way to access backend PHP at the module and article level. It would be pretty useless to grant the user so much javascript level functionality and then hamstring it with no actual data support.

Problem was, how do you deliver the PHP in a modular, generic manner from the front end while allowing the backend administrators enough flexibility to accomplish whatever they need? I set to work this afternoon as soon as I realized there was such a glaring hole in my plan and had fleshed out a concept a few hours later. Since then, I've been hammering at it all night and have gotten it worked out nicely.

Essentially, I've created a backend "Script Manager" that allows the user to write arbitrary PHP script and have it stored in the database. On the front end, the ZiMB Core plugin provides a javascript function that takes a few simple parameters and interfaces with and evaluates the backend scripts and returns a JSON encoded representation of the data to the calling javascript. Of course, it is completely possible (and often desirable) to simply use the interface to persist data or run some other function on the backend AJAX-style. You can see an example of that in how the contact button to the right works. It takes the information you enter into the form, scrubs it and then uses the Joomla! sendMail function to get work to the ZiMB Info box.

So, where does this all lead? I'm not entirely sure yet but I do know that you IBM i users out there are really going to love it. It hasn't been implement but I've developed the concept of how RPG, CL and system commands will be called using an almost identical solution. Instead of a writing your own script, I'll create a 'wizard' interface wherein you enter an RPG program, etc. and its parameters and the interface is generated on its own. From there, you'd only need to reference that script from the front end as you would one of these other scripts and voila! Instant AJAX to the IBM i without any knowledge of how that actually works! Sadly, these tools will be part of the for-charge ZiMB Studio but, of course, you'll still be free to write your own RPG calls in the Script Manager.

As you can see, things are very exciting around here and are really moving forward quickly. A new version of ZiMB Manager will be deployed to this site in the next few days after we do some more testing.

Comments (3)

Last Updated on Friday, 20 November 2009 04:06
 
Welcome to Out On A ZiMB! PDF Print E-mail
Written by Chris Anderson   
Wednesday, 11 November 2009 21:05

Welcome! This will be the location (finally finalized) where we post tips, tricks, code and our development diary as we find new and interesting things relating to PHP, Joomla!, the IBM i, and ZiMB Manager. We are very excited about the initial release (very, very alpha) of ZiMB Manager and look forward to finalizing that tool as well as eventually providing ZiMB Studio to really kick your IBM i web development into high gear.


In the coming weeks, we'll be sharing some of the important things we've learned building a component that works on both iAMP and LAMP systems. Suffice it to say, there are some major differences (AIX isn't case sensitive?) between the environments and some interesting coding workarounds to go with.

Comments (1)

Last Updated on Wednesday, 11 November 2009 21:14