Set ATG Property And Popup Window After Clicking on Link

la cuarta ventana on Flickrla cuarta ventana by bachmont 

Sometimes when you click on a link in an ATG JSP/DSP page you want a property of an ATG component to be set as well.  For example:


What gets tricky is if you also want a popup window to display the contents of this link.

The Wrong Way

I tried adapting the instructions from the tutorial Popup Windows | open new customised windows with JavaScript.


This does not work, i.e. the setter for baz in BarFormHandler is never called.

The Brute Force Way

I then reverted to the original DSP and looked at the outputted HTML.  Based on that I updated the DSP like this.

<% atg.servlet.DynamoHttpServletRequest dreq = atg.servlet.ServletUtil.getCurrentRequest(); %>

This works but is grotesque.

The Good Idea That Did Not Work

Then I realized I could just set a parameter in the URL and have the form handler use the value to set the property.


And in BarFormHandler

public boolean beforeSet(DynamoHttpServletRequest req,
            DynamoHttpServletResponse res) throws DropletFormException {

  String indexParam = request.getParameter("index");

  return super.beforeSet(request, response);

This did not work plus I did not really like it because now I have a beforeSet method that is called for every single request.

The Winner

I then realized I did not read the tutorial Popup Windows | open new customised windows with JavaScript carefully.  There is a more elegant way to call the JavaScript which degrades gracefully for browsers that don’t support JavaScript.


This works, is elegant and requires just adding the onclick attribute to the original DSP.

Ignore Files and Directories in Subversion

snubbed by Rennett Stowe

In the course of a project there are always files and directories that you don’t want to check in but which Subversion complains it doesn’t know anything about them.  So it makes sense to tell Subversion to ignore them, in other words, keep quiet. 🙂

The mechanism for doing this works okay but I wouldn’t say it’s perfect.

This is how I do it.

  1. Go to the directory where want to ignore a file or subdirectory.
  2. Issue the command
    svn propedit svn:ignore .
  3. Your editor then will be launched and you can enter one line at a time those files and/or subdirectories you want to ignore.
  4. Commit your changes.
    svn commit -–depth empty

    Two things to notice.

    1. --depth empty argument

      only commit the propedit changes

    2. Committing your changes means everyone will end up ignoring these files and/or directories so make sure you are ignoring the right ones.
  5. If you don’t want to commit your changes you can revert them.
    svn revert .

For further reading please see Pete Freitag’s blog post Ignore Files and Directories in Subversion.