Showing posts with label flex tutorials. Show all posts
Showing posts with label flex tutorials. Show all posts

Tuesday, May 19, 2009

A Good ImageCache for Flex Lists

A while back I brought to life a dream custom component I had wanted for a long time. It's basically a horizontal scrolling thumbnail image holder, the ubiquitous kind that's in everything from YouTube to Flickr. Mine is a little different in that it combines the following:
  • Hover side-scrolling
  • Accurate shuttle indicator below images
  • Accu-sizes to any display object container width
  • and finally...it caches the images for no lag
Pretty much does the job for me. I'll post it soon, happy to share and hear feedback on it. And on that note, I ran across a legacy of cache issue explorations and solutions by other flex scripters. The earlier one, which I noted but haven't tried out, is Ely's SuperImage from a couple of years back. It touches on the all-important performance issue of non-caching assets in Flex components.

The follow-up, which I'm stoked to note is lean, lithe and easy to plug in, is thanksMister's ImageCache. There's even a sample app using the Flickr API. Tested and hereby endorsed. Hope you get some use out of it.

Wednesday, April 29, 2009

Bug in Weborb 3.6 for .NET prevents WDMF from generating server code

Here's an issue that could cost you lots of troubleshooting time to fix. While weborb is a stellar product IMO it is lacking in thorough support docs. Probably that is fine since a commercial client can purchase phone support, but I digress. The problem aka bug aka omission I refer to in weborb 3.6.0.3 results in:

Code Generation Failed

This is the result of an attempt to generate the all-important client-server serialization classes that weborb builds. The client classes are downloaded from the weborbconsole while the server classes are written to the bin directory assuming your permissions are properly set to allow this.

Permissions are easily set via Windows IIS or your webhost control panel. Permissions are also easily reviewed from your website of interest thanks to the diagnostics.aspx page provided. Potential issues are even coded red. Easy enough.

Problem is essentially the result of a wishlist item added to Weborb 3.6 and released 12/02/08, Visual Studio templates. I didn't even expect to find them, but did so and began enjoying the ease of deployment templates offer. Only problem is, they won't work unless you add the XSLT files in the ODBC directory from the original full vers of weborb30.

I tried other stuff for a while to fix the prob, then finally read the error text logs on my deployment and discovered the omission. As stated before, Weborb is the Barry Bonds of remoting, a real slugger for joining up RIAs for web and I can't say this enough. The fact that I could rely on the framework tools to hunt down the error and fix it is one reason why. Now, has anyone else had this problem? If so, I hope this helped.

Fig 1. Diagnostics aspx page for weborb









Fig 2. Creating a weborb-enabled website in Visual Studio 2008 using the weborb-provided template











Fig 3. The missing odbc folder, where it should be









Fig 4. What you should see if all goes well in the weborbconsole WDMF

Wednesday, April 1, 2009

httphandlers and asp.net

HTTPHANDLERS

They're a critical link in remoting, such as between a .Net application and a Flex presentation server. They can also be customized for other uses, such as dispatching synchronous or asynchronous data. Once you break the seal on httphandlers, you will likely discover they are profound in their utility.

This example demonstrates how to use HttpHandler technology using Asp.Net2.0 and C#.NET

This tutorial only uses the default namespace. The System namespace contains the EventHandler.

HttpHandler is a class that implements the IHttpHandler and IHttpAsyncHandler interfaces. This section describes how to create and register HttpHandler and provides examples of a synchronous handler, an asynchronous handler, and a handler factory.

First, you need to create a classlibrary HttpHandlerDLLVB. The code as follows:



using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.SessionState;

namespace HttpHandlerDLL
{
public class MyHttpHander : IHttpHandler,IReadOnlySessionState
{
public bool IsReusable
{
get { return true; }
}

public void ProcessRequest(HttpContext context)
{
context.Response.Write("<h1><b>HttpHandler Test</b></h1>");
context.Session["Test"] = "Invoke a session in HttpHandler.";
context.Response.Write(context.Session["Test"]+"<br>");
context.Response.Write("<a href='HttpHandlerCsharp.aspx'><b>return</b></a>");
}
}
}

Then create a website project and reference classlibrary HttpHandlerDLLVB.dll.

At last configure your web.config as follows.

<httpHandlers>
<add verb="*" path="ViewHttpHandler.aspx" type="HttpHandlerDLLVB.HttpHandlerDLLVB.MyHttpHandlerVB,HttpHandlerDLLVB"/>
</httpHandlers>
The front end HttpHandlerVB.aspx page looks something like this:

<a href="ViewHttpHandler.aspx">Test HttpHandler</a></p>
</div>
The flow for the code behind page is as follows.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}

Tuesday, December 16, 2008

ToolTips in Flex 3

Tooltips. They pop up to provide contextual expansion. They enhance your workspace. They gratify you with sleek utility. They're an integral Flex component. You will probably be customizing them.

Flex Docs is a good starter on custom and standard tooltips:
http://www.adobe.com/devnet/flex/quickstart/using_tooltips/

Adobe docs are not so great when it comes to positioning custom tooltips, but fear not, it's simple once you know how :).

Just be sure to utilize both the toolTipCreate AND toolTipShow methods of the mx.events.ToolTipEvent class and you'll be golden.

Another plus, tooltips are a great use of MVC and you can encapsulate calls to events via event.toolTip.

Another good tutorial resource:
http://blog.flexmonkeypatches.com/2008/09/10/flex-custom-tooltip-speech-bubble/

Happy tooltipping.