Child pages
  • Click to Open

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Click to Open (C2O) allows you to open components in Eclipse directly from the running application in your browser! Click to Open appears in the lower left corner of browser as part of the pages of your running application. Clicking on this component, and then on an object in the browser window, opens the relevant WOComponent in Eclipse. This makes life easier for UI designers and for developers getting familiar with new projects. It also provides some other very slick debugging tools.

Check out the screencast at the mDimension build site

Click to Open is a browser based extension to WOLips found in Project Wonder. All of the Wonder ERD2W components support Click to Open.

Note that click-to-open support is expensive, because it has to dig around your component HTML quite a bit, so you will take a performance hit in development to have it enabled.

*Also note that if you use ERExcelLook or ERPDFGeneration that you will want to disable Click to Open in development. The former you can do in a rule: 

Code Block
*10 : pageConfiguration like '*Excel' => clickToOpenEnabled = "false" [com.webobjects.directtoweb.BooleanAssignment]

The latter in your component:

Code Block

public boolean clickToOpenEnabled(WOResponse response, WOContext context) {
     return false;
 }

What You Need

You need the WOLips framework that is part of Project Wonder. Nothing else from Project Wonder is neededYou also need the ERExtensions framework that is part of Project Wonder on the class path at runtime. If you already use Project Wonder, you are you almost done.

If you are not using Project Wonder, you can download it from mDimension's site, untar the frameworks, and copy just the WOLips.framework and ERExtensions.framework to where you have the rest of your frameworks (usually /Library/Frameworks or ~/Library/Frameworks).

Getting Set Up

Add the WOLips.framework

Follow the tutorial on adding a framework to add WOLips.framework and ERXExtentions.framework to your application.

...

Code Block
java
java
package net.com.foo.bar;

import com.webobjects.appserver.*;


/**
 * Support for "Click to Open" navigation from the browser to the template in Eclipse.  To enable this,
 * launch with:
 * <pre>
 * -Der.component.clickToOpen=true
 * </pre>
 */
public class ClickToOpenComponent extends com.webobjects.appserver.WOComponent {

    public static final boolean isClickToOpenEnabled = Boolean.getBooleanparseBoolean(System.getProperty("er.component.clickToOpen", "false"));

    public ClickToOpenComponent(WOContext context) {
        super(context);
    }

    public void appendToResponse(WOResponse response, WOContext context) {
        ERXClickToOpenSupport.preProcessResponse(response, context, isClickToOpenEnabled);
        super.appendToResponse(response, context);
        ERXClickToOpenSupport.postProcessResponse(getClass(), response, context, isClickToOpenEnabled);
    }
}

...

and you're done. If you don't have a page wrapper, you will have to add this to every page. Hint: page wrappers make your life easier.

...

You can optionally change the port number. If you do change the port number, see wolips.port in the Set Application Properties section above.

Enable Click to Open

And add If you are using Wonder, add the following to your Properties file:

  • er.component.clickToOpen=true
  • er.extensions.ERXApplication.developmentMode=true

If you are not using Wonder, add the Launch parameters as follows:

  • Parameter = -Der.component.clickToOpen=true

...

  • , Argument = true
  • Parameter = -Der.extensions.ERXApplication.developmentMode=true

...

  • Argument = true

Using Click to Open

Run your application and look in the lower, left hand corner. You should see a link like this:

...

Click on this component to open the Click to Open UI:

Image RemovedImage Added

EditDisplayAd is the page in the browser. Click on this link to open this page in Eclipse.

...

  • Esc is a shortcut for getting out of click-to-open mode
  • hold down the Cmd key while you move the mouse around and it will highlight the component
  • Cmd-click it will popup the stack of components and you can pick from the stack:
  • you can set the binding expanded=true; on WOLToolBar so it's open by default, instead of closed