Wicket

Wicket DropDownChoice Advice

Yes, I admit it, the DropDownChoice is tough! 
After spending way too many hours on it, I have the following advice.  If you are trying to bind the value of your dropdownchoice to anything besides a String, that's fine and dandy, but don't try to have the DropDownChoice bind DIRECTLY to your value.  For example, if you have a Double, Long, whatever, you should set it yourself.  How do you do this?  By having the DropDownChoice bind to some pojo, and you use that pojo value to set your Double/Long/Whatever.

Wicket and Gmap Gotcha

I am integrating the wicket gmap2 component into my application.  There were two issues

  1. Do not put the gmap into a html table.  If I did this, the google logo would display, but nothing else did.  I don't think I had any table css styles, but once I converted my application to use div's, all was well.
  2. You can not put your gmap on an ajax panel.  What I mean, you can have your gmap appear as an ajax update.  I looked at the ajax console and I got a "channel is busy"

 

Wicket AJAX Tip

Just documenting my experiences with wicket and ran into a situation that took me a little time to figure out.  The case involves updating a component that is invisible.  Short story is that you can't!
Imagine you have the following components:

  • Search Form
  • Link to Detail Form
  • Detail form
  • Results table

Your search form will populate the Results table, and make the detail form invisible.
The Link To Detail Form makes the Results table invisible, and the detail for visible.

Stupid mistake Part II

I'm leaving for the day.  After mis-naming my last file (see last post), for the first time ever, I cut-n-paste line numbers into my wicket template.  I was perplexed to see my tree displaying a seemingly random sequence of numbers.  I was wondering if my category id was being put in the label, all sorts of questions arose in my mind.  Two minutes later, I realized my template was wacked by my copy-n-paste from the Internets...

 

Ah!!!! I can make such stupid mistakes in Wicket

After copying the 11 files and gazillion lines of code to implement my category tree checkbox, I was see the ol'

WicketMessage: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered).
1. [MarkupContainer [Component id = checkbox]]

Accessing Spring beans inside wicket

While having fun implementing a checkbox tree for categories, I realized that I needed to access a spring service from outside of the Wicket Page/Component, from some Model classes that were being used to retrieve data for the tree.
 
I added the following to my RootTreeNode, but alas, my bean did not get set.  I suspect that this annotation only works for Wicket pages/components.
    @SpringBean(name = "categoryService")    protected CategoryService categoryService;

Wicket tree vs. DotNet Tree

Okay, I admit it.  Using a checkbox tree in DotNet is much easier than in Wicket.

In DotNet, it's drap/drop and loop through your list and add your items.  Blam!  It works.

I am still trying to figure things out on the wicket side.  Not putting wicket down at all since It's the best thing out there going in Java land.

 

http://www.nabble.com/file/p13439520/CheckBoxTree.java

Wicket and the wicket:extend?

I am in the midst of developing a wicket application and thus far, to include a panel in a page, I would just write create a template for the panel and put my panel components in the "wicket:panel" tag

Just like this:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" >
<wicket:panel>
    More components in here
</wicket:panel>
</html>

In the PageablesPage example of wicket, they use the "wicket:extend"

Wicket Modal dialog, I love you more when you abuse me like this.

I just updated this story to include the solution to my problem at the bottom of the page...

 

The following describes a problem that i had with the wicket modal dialog and how I fixed my code to solve my problem.  The problem is only appearing in Firefox, and not in Safari

I am in the midst of writing my first full application with wicket.  I love the Modal Dialog.  However, anytime I brought it up from my very nested panel, the content that I wanted to appear within the dialog would be written to the main screen.  Like this...

Syndicate content