Wednesday, February 21, 2007

Wicked wicket framework
---------------------------
I had earlier blogged about my foray into web 2.o and how I ended up trying wicket. I still am quite impressed with Wicket though I no longer work with it. Wicket interested me because it had a TreeTable component which I wanted to adapt to display XML. The exisiting TreeTable in Wicket displayed static, hierarchical data that could display only 5 columns. This was because the Wicket used a model bean which is a plain old java bean that looked like this:

public class ModelBean {

public ModelBean() {
}

public String getColumn_1_Value() {
}

public String getColumn_2_Value() {
}


:
:
:
}

What I envisaged would solve the problem was:

public class MyModelBean {

public MyModelBean() {...


public String getColumnValue(int columnNumber) {
if(columnNumber == 0)
return name;
else if(columnNumber == 1)
return size;
else if(columnNumber == 2)
return type;
else if(columnNumber == 3)
return lastModified;
}


This way the treetable would be able to display any kind of hierarchical data. However, in the end it proved to be easier said than done. Wicket uses PropertyResolver to resolve a compound expression of the form

userObject.value

which then got evaluated to

getUserObject().getValue()
}


using reflection. i.e 2 calls were being made on the PropertyResolver. The first one would ofcource return the userObject associated with the ModelBean and the getValue would then be called on the userObject. My new version would then pass the columnNumber as the argument to getValue. Further, key classes and methods inside wiket were marked private which hindered direct subclassing and workarounds had to be devised. Further there were so many execution paths since Wicket supports indexing of arrays, hashmaps besides javabean types that finding the places that needed changing was difficult to say the least. But as they say, Alls well that ends well and the code is now in the Apache incubator as Wicket has formally been inducted into Apache.
The work is by no means complete. The treetable editing functionality is not complete as yet. The treenodes are not editable. The swing version that I have developed is able to edit the treenodes. If time permits I would like to take that up as well. The only thing that is stopping me is the stack up inside my head has been cleared to make room for other stuff. Restarting work would mean once again going back and starting from the beginning

At times I did end up comparing wicket's syntax with that of JSF. JSF uses EL (expression language) for their expression support. JSF too uses PRopertyResolvers and with JSF our job is made slightly more difficult by ther being 2 different EL syntaxes, the JSTL syntax and JSF syntax which ofcourse is the topic of another blog altogether

16 comments:

Matej Knopp said...

Huh?

The model bean you describe is only simple one that serves as an example. You can have your own TreeNode with any bean as model. Also you don't need to use PropertyColumn, you can make your own (even editable, see the example) Columns.

prakash visvanathan said...

Hi Matej,
Thanks. I will check out the example. Is it part of wicket distribution. If so which one, 1.2, 1.3?

Also have you been able to compile my code yet?

cheers,
prakash

TU said...

自己破産 相談
インプラント
過払い
治験
お見合い
屋形船
酸素カプセル
お見合いパーティー
屋形船貸切
ティーカッププードル
マカ
まつげエクステ
債務整理
募金
カラコン
トイレつまり
婚活

Anonymous said...

[url=http://www.ganar-dinero-ya.com][img]http://www.ganar-dinero-ya.com/ganardinero.jpg[/img][/url]
[b]Estas necesitando informacion sobre como ganar dinero[/b]
Nosotros hemos hallado la mejor pagina web en internet de como trabajar en casa. Como nos ha sido de utilidad a nosotros, tambien les puede ser de utilidad a ustedes. No son solo metodos de ganar dinero con su pagina web, hay todo tipo de metodos para ganar dinero en internet...
[b][url=http://www.ganar-dinero-ya.com][img]http://www.ganar-dinero-ya.com/dinero.jpg[/img][/url]Te recomendamos entrar a [url=http://www.ganar-dinero-ya.com/]Ganar-dinero-ya.com[/url][url=http://www.ganar-dinero-ya.com][img]http://www.ganar-dinero-ya.com/dinero.jpg[/img][/url][/b]

Anonymous said...

good day people. I'm actually into shoes and I had been looking for the sake of that particular make. The prices due to the fact that the sneakers are around 250 bucks on every page. But finally I set this locate selling them someone is concerned half price. I really like those [url=http://www.shoesempire.com]prada sneakers[/url]. I will probably order those. what do you think?

Anonymous said...

Hello. And Bye.

Anonymous said...

good day dudes. I'm really into shoes and I have been digging as far as something that exact brand. The prices for the shoes are about 240 bucks on every page. But definitively I bring about this site selling them someone is concerned half price. I in reality like those [url=http://www.shoesempire.com]gucci sneakers[/url]. I will absolutely order those. what do you think?

Anonymous said...

easy backup wizard -
easy member pro -
easy tv soft -
eatstopeat -
eat stop eat -
error fix -
error killer -
evidence nuker -
fap turbo -
fatburningfurnace -
fat burning furnace -
fatloss4idiots -
fat loss 4 idiots -
final uninstaller -
fitnessmodelprogram -
fitness model program -
flatten your abs -
gamers testing ground -
gov auction -
governmentregistry -
government registry -
gov records -
herbal hair solution -
homebre ware -
home job group -
homemadeenergy -
home made energy -
inteli gator -
joanas world -
joyful tomato -
kidney stone remedy -
learn digital photography now -
learn elements now -
linden method -

Anonymous said...

lose man boobs -
malware removal bot -
maternityacupressure -
maternity acupressure -
meet your sweet -
muscle gaining secrets -
muscle gain truth -
niche adsense themes -
ninety day powerseller -
pc optimizer pro -
pregnancy miracle -
pregnancy without pounds -
privacy control -
publicrecordspro -
public records pro -
quit smoking today -
reg genie -
registry easy -
registry genius -
registry smart -
registry winner -
registry winner download -
retrievea lover -
reverse mobile -
richard mackenzie direct -
rocket italian -
save my marriage today -
secrets book -
seo elite -
spyware cease -
spyware remover -
spy zooka -
stock assault -
talking to toddlers -

Anonymous said...

the action machine -
thebadbreathreport -
the bad breath report -
thedietsolutionprogram -
the diet solution program -
the rich jerk -
tonsil stones remedies -
top secret fat loss secret -
turbo cash generator -
turbulence training -
twitter online system -
uncle sams money -
underground hypnosis -
vincedelmontefitness -
vince del monte fitness -
warp speed fat loss -
water 4 gas -
wedding speech 4u -
wp goldmine -
wrap candy -
xsite pro -
zygor guides -
37 days to clean credit -
advanced defrag -
adware alert -
adware bot -
affiliate prophet -
affiliate video brander -
anti spyware -
art of approaching -
atomic blogging -
auction classified cash -
automated cash formula -
bbq book -

Anonymous said...

bloggers pay check -
blogging in action -
body building revealed -
burnthefat -
burn the fat -
carb rotation diet -
cheat your way thin -
chopper tattoo -
cleanup the profits -
cold sore freedom in 3 days -
commission blueprint -
conversationalhypnosis -
conversational hypnosis -
cure for bruxism -
declutter fast -
driver checker -
earth4energy -
earth 4 energy -
easy member pro -
easy tv soft -
eatstopeat -
eat stop eat -
fap turbo -
fatburningfurnace -
fat burning furnace -
fatloss4idiots -
final sync -
final uninstaller -
fitness model program -
fit yummy yummy -
flatten your abs -
forex ambush -
governmentregistry -
government registry -

Anonymous said...

healthy urban kitchen -
homebrew installer -
homemadeenergy -
home made energy -
instant article wizard -
jamo rama -
joyful tomato -
lose man boobs -
lower body make over -
maternityacupressure -
maternity acupressure -
maverick money makers -
meet your sweet -
muscle gaining secrets -
muscle gain truth -
natural cancer treatments -
niche review templates -
nyhms warcraft guides -
pappa pc -
pc booster -
pc optimizer pro -
pc secret formula -
pda flix -
privacy control -
publicrecordspro -
public records pro -
push button ecover -
reg defense -
reg genie -
registry easy -
registry genius -
registry smart -
registry winner -
registry winner download -

Anonymous said...

healthy urban kitchen -
homebrew installer -
homemadeenergy -
home made energy -
instant article wizard -
jamo rama -
joyful tomato -
lose man boobs -
lower body make over -
maternityacupressure -
maternity acupressure -
maverick money makers -
meet your sweet -
muscle gaining secrets -
muscle gain truth -
natural cancer treatments -
niche review templates -
nyhms warcraft guides -
pappa pc -
pc booster -
pc optimizer pro -
pc secret formula -
pda flix -
privacy control -
publicrecordspro -
public records pro -
push button ecover -
reg defense -
reg genie -
registry easy -
registry genius -
registry smart -
registry winner -
registry winner download -

Anonymous said...

reverse mobile -
richard mackenzie direct -
rocket japanese -
rotator cuff training -
save my marriage today -
secrets book -
silent sales machine -
silver lotto -
spyware cease -
super affiliate handbook -
the 11 forgotten laws -
thebadbreathreport -
the bad breath report -
thedietsolutionprogram -
the diet solution program -
the power pause -
tmj help -
tonsil stones remedies -
top secret fat loss secret -
turbulence training -
twitter rockstar -
uncle sams money -
underground hypnosis -
vincedelmontefitness -
vince del monte fitness -
warcraft millionaire -
warcraft wealth -
warp speed fat loss -
webcomp analyst -
wedding speech 4u -
win back love -
your software website -
zox pro -
zygor guides -

Anonymous said...

500 love making tips -
acid alkaline diet -
acne no more -
advanced defrag -
adware alert -
adware bot -
affiliate elite -
anti spyware -
anti spyware bot -
article bully -
art of approaching -
auto pilot profits -
bbq book -
blogging in action -
body building revealed -
burnthefat -
burn the fat -
carb rotation diet -
chopper tattoo -
conversationalhypnosis -
conversational hypnosis -
cure for tinnitus -
debt free in three -
driver checker -
duplicate file cleaner -
earth4energy -
earth 4 energy -
easy member pro -
easy tv soft -
eatstopeat -
eat stop eat -
end your tinnitus -
fap winner -
fat burning furnace -

Anonymous said...

酒店經紀 酒店打工 酒店工作 酒店上班 酒店兼差 酒店兼職 打工兼差 打工兼職 台北酒店 酒店應徵 禮服酒店 酒店 經紀 打工 兼差