Radio button renderer in a datagrid

Using a radio button as a data grid cell renderer is an example of a more complex usage of data grid cell renderers. This is one way to achive this in a not very complicated way: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ public var dp:XML = <users> <user> <name>one</name> <main>true</main> </user> <user> <name>two</name> <main>false</main> </user> <user> <name>tre</name> <main>false</main> </user> </users>; ]]> </mx:Script> <mx:VBox> <mx:DataGrid dataProvider="{dp.user}" width="400"> <mx:columns> <mx:DataGridColumn headerText="Name" dataField="name"/> <mx:DataGridColumn headerText="Main"> <mx:itemRenderer> <mx:Component> <mx:HBox horizontalAlign="center"> <mx:Script> <!...

August 29, 2009 · len

unsupported keyword OID.2.5.4.17

The problem Exception in thread "main" java.io.IOException: unsupported keyword OID.2.5.4.17 at com.sun.net.ssl.internal.ssl.AVA.<init>(DashoA12275(Compiled Code)) at com.sun.net.ssl.internal.ssl.RDN.<init>(DashoA12275(Compiled Code)) at com.sun.net.ssl.internal.ssl.X500Name.a(DashoA12275(Compiled Code)) at com.sun.net.ssl.internal.ssl.X500Name.<init>(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect(DashoA12275) at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream(DashoA12275) What’s your fault when a client running your application for more than 5 years is now receiving this error when its security provider finally upgraded it’s certificates to include: OID.2.5.4.17=<9 digit zip> now standard in almost all certificates. Upgrade you might say but this is not simple considering that the client is AIX based:...

February 27, 2009 · len

A bit of hibernate optimization

The context Assume you are dealing with a hibernate operation which requires to copy a lot of objects in the database. For instance you are having 2 objects as described in the diagram bellow: budget and entries and you want to duplicate the budget and all it’s entries for some operation. There are several way to do this. Budget - entries First approach In hibernate usual approach this is done most of the time as something similar to:...

February 10, 2009 · len

Fixing dateChooser position and size

As described here, the dateChooser positioning algorithm does not account for the overall size of the window and this results in some clipping of the dateChooser window for the DateField. Take a look at frameworks/projects/framework/src/mx/controls/DateField.as displayDropdown function. I’m trying here to provide a partial fix. The ideea: trap the open event and reposition/resize the dateChooser. This can be done just by adding an event listener to the DropdownEven.OPEN event. to avoid problems if the dropdown appears on top of the dropdown button I had to move the code inside a derived class to access the textInput object....

January 29, 2009 · len

A few notes on flex objects

For a java developer starting to work with flex seems quite easy. However since most people will never read the hole manuals, probably also because of this easiness I’ve decided to write some things about flex objects which are not immediately obvious from a java developer point of view. The flex objects are hashes This is the most interesting aspect of a flex Object from my point of view and if you see things in this way then the following might seem a bit more clear:...

January 26, 2009 · len

Remove duplicate mails

The problem Sometimes my evolution email client does the nasty thing that it duplicates some of the mails in my folders. I can think of 2 causes of this problem. Either it loses the track of mails downloaded from pop accounts on which the messages are not deleted imediately so it fetches them again or there is a problem with the filters that it forgets to delete the message from the original folder....

January 23, 2009 · len

Propagating model changes to a DataGrid

Flex offers a nice way to represent data in a model and configure this model as a data source for a DataGrid or other visual components (ComboBox, AdvancedDataGrid, etc.). This allows for a quick start but sometimes deadends when a change to the model is not propagated to the view. I am trying here to explain a few aspects related to this. The first model [Bindable] private var dataSource1:ArrayCollection = new ArrayCollection([ {col1:'1A', col2: '1B'}, {col1:'2A', col2: '2B'} ]); The DataGrid...

January 16, 2009 · len

Oracle and java.util.Date

Q: Assume someone, for compatibility is storing java.util.Date values in Oracle as long values (number of milliseconds since the standard base time known as “the epoch”, namely January 1, 1970, 00:00:00 GMT), how to read these dates in sql? A: select TO_CHAR(TO_DATE('19700101000000','YYYYMMDDHH24MISS') + NUMTODSINTERVAL(start_time/1000, 'SECOND'), 'YYYY-MM-DD HH24:MI:SS') from qrtz_triggers

December 1, 2008 · len

JBPM optimization

I am quite a fan of BPM concepts and since for the time JBPM is the most know implementation which I have used already in several projects I am stuck with it. Yet it’s one of the more complex-inefficient models I have seen. Enough cause to loose a few days. The context The application was tested with a few tens of workflows and works reasonable. Increasing the number of workflows by an order of ten and you have long waiting minutes ahead just for the simple task of finding the TaskInstances....

October 30, 2008 · len

Another way to use Quartz in JBoss

I was explaining here how to create a Quartz job using the standard Quartz-ra service which comes bundled with JBoss. The method is rather limited, or I was not able to find the proper documentation on how to register new jobs on the fly. This is why in this post I will show how to access the quartz scheduler directly. Note: everything here applies to JBoss 4.2.2GA Remove the existing Quartz You need to remove the existing Quartz-ra and quartz....

October 13, 2008 · len