PopupControlExtender issues

A PopupControlExtender can be used in an ASP.Net application for a control to show a pop-up window when it is clicked. Like other Ajax controls, it works on the client side (i.e. it does not generate post-back). This means the content of the pop-up needs to be filled for each row if pop-up window is used to produce drill-through effect for a GridView, or a way to generate post-back needs to devised. The following is a way to generate post-back so the content of the poop-up window can be dynamic:

  1. Change the field for pop-up to template field.
  2. Add button control, then add the PopupControlExtender to this control and make it invisible.
  3. Add another button control and create a handler for the command event. Assign the index of the row of the GridView to he CommandArgument (i.e. CommandArgument="<%# ((GridViewRow) Container).RowIndex %>").
  4. In the command event handler, produce the content of the pop-up control which could be another GridView, then the following client side Javascript to click the invisible button:
    • Page.ClientScript.RegisterStartupScript(typeof(string), "Click", "document.getElementById(\"" + bt.ClientID + "\").click()", true);

This is supposed to work. It indeed generates post-back and the clicking to show the pop-up control. Unfortunately the pop-up control is not pop-up anymore. It is merely turned from invisible to visible staying at its original place instead of popping up at the control clicked.

 

Web-based applications development

For client-side application (i.e. an application running in a browser on a client machine), Java applet has more capacity than other choices that are widely supported by browsers. I have had enough with ActiveX after touching it briefly.

For server-side application, ASP.Net makes its development as easy as desktop application. ASP.Net is widely supported.

Programming Socket with eMbedded VC++

There is no other choice but CCeSocket.

The confusing point is that CCeSocket is derived from CSocket that is derived from CAsyncSocket, but CCeSocket supports asynchronous notification while CSocket does not.  CCeSocket objects can use the notification handling functions of CAsyncSocket.  There is difference between CCeSocket and CAsyncSocket in terms of how the notification is implemented, but users of these classes usually do not need to know the details.

Programming Database with eMbedded VC++

Microsoft has been touting eMbedded VC++ as the most powerful tools for programming Windows CE, or the the best tool for programming handheld device.  They have also been promoting the universal data access model - ADO. However they do not support ADO in eMbedded VC++ as in VC++.  To use ADO, you would have to settle with their less powerful tool- eMbedded VB or use classes created by a third party as they suggest.

Connecting twice needed

Sometimes connection to a remote site (e.g FTP connection, socket connetion) needs to be tried twice to establish the first connection for an application.

Programming Java 3-D

A good starting point is Java 3D API Collateral.

Another good site is Java 3D Community Site.

Considering the inherent poor performance of Java, Java 3-D is surprisingly fast.  

Three-D programming involves two aspects: 1. creating virtual objects; 2. defining how to view the scene of virtual objects.  These two aspects are buried in Java  in the form of Java 3-D's complicated scene graph.  Fortunately, for many 3-D tasks, Java 3-D has a convenient class SimpleUniverse that takes care of many regular 3-D programming tasks and the viewing aspect so the programmers can focus on creating the objects.

The architecture of Java 3-D API has been poorly designed.  Although Java is undoubtedly the best or one of the best object-oriented languages, but Java 3-D API is mainly procedure-oriented.  For example, a virtual object and its behaviors (e.g. rotating) are forcefully separated into different classes. What is even more ironical is that an object is a child of its behavior in the scene graph hierarchy.

The object-oriented way to look at the the Scene Graph is as follows:

  1. Create objects by constructing Leaf instances (e.g. Shape3D) and NodeComponent instances that define some properties of the objects.
  2. Create transformations by constructing instances of TransformGroup and string them into a chain, attach the Leaf instance to the tail of the chain.
  3. Attach the head of the TransformGroup chain to an instance of Branch Group.
  4. Attach the instance of Branch Group to a Locale instance that can be regarded as a reference point in the virtual universe.
  5. Attach the Locale instance to a VirtualUniverse instance.

Follow the steps similar to the above step 1 - 3 to create a view branch and attach it to the Locale object. Ironically in Java-3D, you need to do the above in the reverse order.

Basic Steps:

  1. Create a new Canvas3D and add it to comonent (e.g. JPanel).
  2. Create a SimpleUniverse based on the above Cavas3D.
  3. Create a content BranchGroup.
    1. Create a Transform3D.
    2. Create a TransformGroup based on the Transform3D and configure it (e.g. set capabilities).
    3. Create the objects (e.g. instances of Shape3D) and add them to the TransformGroup. This is the core part of Java 3D programming. Most development time is spent on creating objects.
    4. Repeat step 1-3 to add more objects.
    5. Create a BranchGroup and add all the TransformGroups to this BranchGroup.
  4. Add the content BranchGroup to the SimpleUniverse.

As stated above, the most important and time consumming step is 3.3 - constructing objects. Some simple objects can be created by constructing a Shape3D object with a Geometry object or both a Geometry object and an Appearance object. For complex object, it may be a good idea to create new class extended from Shape3D, but one has to remember that all the Geometry objects contained in a Shape3D object must be of the same equivalence class. This means a very complex object has to be put together with multiple Shape3D objects.

Programming with Java

It is a pity that Java does not have an enumerating data type as the enum in C++.

 


Online since 2003
Support Wikipedia

Waging Peace, Fighting Disease, Building Hope with Passion and Integrity