YUI ScriptNodeDataSource Issue

While using the YUI Library, I came across an annoying issue. It is stated places that order matters when dealing with the library includes, yet there are still some issues that come up. The main one I’ve found is with the YAHOO.util.ScriptNodeDataSource this is used for accessing remote data via the YUI Get Utility. But using the configuration from Yahoo the Get library isn’t included by default, yet when you add it after finding that error the system still won’t work.

The Get Utility has to be loaded before the DataSource library, yet this is the only part of the DataSource library that require the Get utility so it isn’t listed as a dependency for that library. I used the YUI Dependency Configurator yet while working without the combined files you can still introduce the ordering issue. Yahoo needs to add a simple check that the Get utility is always loaded before the DataSource Utility yet that haven’t yet. You may not have this issue while using the combined files mode as it will all be executed at once.

So if you see an error message like “this.getUtility is undefined” make sure you have the Get Utility loaded before the DataSource.

More →

Quick GWT Note

While working on a small GWT project with two other developers I ran into an odd runtime exception “com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException” as I was testing my app in the hosted mode I’m not sure how to refresh that built in browser which is the listed fix. What I ended up doing was a simple clean of the project which solved my problem, I think it relates to how I’m using SVN not integrated into Eclipse with the project yet its hard to tell. But if you run accross this expection try a simple clean before pulling too much hair out.

More →

ExpressionEngine Pagination and Get Parameters

This may not come up that often but if you are using Get parameters such as lets say submitted by a form to filter some weblog entries, these parameters will not be preserved while using the built in pagination. This can be a real issue if you are trying to filter results and let users page through them but we can add a touch of PHP and fix this issue. In your paginate tags we just need to add the query string to the page link. You’ll notice in the sample we use the server parameter ‘query_string’ along with the question mark which will produce our correct links.

{paginate}
  {if previous_page}
    <a href="{auto_path}<?php echo "?".$_SERVER['QUERY_STRING']; ?>" class='paginate-previous'>Previous</a>
  {/if}

  {if next_page}
    <a href="{auto_path}<?php echo "?".$_SERVER['QUERY_STRING']; ?>" class='paginate-next'>Next</a>
  {/if}
{/paginate}
More →

ExpressionEngine Pagination and the Dynamic Parameter

While working with an ExpressionEngine based site I ran across a listing of a weblog that could contain 1000′s of posts yet as it was displayed with the Dynamic Parameter off there was no stock way to support Pagination of the items. I used a simple hack, shown at the end of the post, that allowed me to use the pagination but it shows a bigger issue with ExpresionEngine, while it may not come up that often there still should be pagination for any exp:weblog:entries set but it is not. There is no reason that non-dyanmic listings shouldn’t be paginated if anything it would be more likely needed as they are likely to be a long list of a whole set.

The hack I used to enable pagination while the dynamic=”off” was available here on the ExpressionEngine Wiki but as it is a wiki I felt that I should give you the basics here as well.

In system/modules/weblog/mod.weblog.php find the comment “Parse page number” you need to simply remove the AND $dynamic from the if statment to allow for the pagination use inside a non-dynamic weblog listing.

Start with:

if (preg_match("#^P(\d+)|/P(\d+)#", $qstring, $match) AND $dynamic)
{
...

Change to:

if (preg_match("#^P(\d+)|/P(\d+)#", $qstring, $match) )
    {
    ...

More →

wget and special characters

While using wget with authorization to download some data you may run into the problem of having a special character such as ‘>’ in your password. It’s a simple fix of wrapping your password in quotes. But the only error message that this problem will give is an authentication failure.

More →