RE: Freemarker+ExtJS vs Wicket questions

2011-12-06 Thread Wilhelmsen Tor Iver
 Plus another problem I see is if I have to use separate
 templates for each script tag I may end up with lots of small files so my
 logic will be peppered around.

How is that much different from using a bunch of Wicket classes with templates 
instead of placing all webapp logic in a Servlet.process() method? Wicket's 
components natively deals with HTML templates, for other types of output via 
templates you need a different approach.

I forgot to mention that what I actually ended up using was the Wicket combo of 
PackagedTextTemplate and a JavaScriptTemplate that merges in values from a Map.

- Tor Iver

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Brian Mulholland
As a Wicket neophyte myself I can't comment on most of this, but we
did just look deeply into the notion of subclassing components for the
purpose of making them render as rich text widgets from ExtJS.  Having
just done that I will say that there are ALOT of little hidden nits
and difficulties that come up in such an effort.  Wicket and ExtJS
both want to control the rendering of the end markup, so when you
replace the generated markup with Ext widgets, many of Wicket's little
pre-created solutions for various internet use cases breaks.  Each
problem is circumventable, but eventually you find yourself almost
writing your own framework rather than extending a framework.

I would really love it if a more experienced Wicket developer took a
serious crack at creating a Wicket extension that worked with rich
internet controls.  I get the feeling that my effort failed as much
because I didn't have deep Wicket knowledge as anything else.

Brian Mulholland




On Sun, Dec 4, 2011 at 12:30 AM, Andrei Voden are...@gmail.com wrote:
 Hi. I have been developing for a while using Freemarker + some JS
 frameworks (like ExtJS, Dojo and JQuery) and Java as Model building on
 back-end. Now I hear lots of talks about Wicket so Im trying to understand
 pros and cons. After reading intro in Wicket I have mixed feelings. Below
 are my conclusions. I know Im biased but dont take it as offense. Instead
 rather as my misunderstanding since Im really trying to see if Wicket
 is thing to switch to.

 Pros:

 -Seems like this is good for companies where you have Java programmers that
 you can now utilize for building Front-end.

 - Clean HTML code and all logic handled by Java.

 - Quick to start building simple apps that fall into the box of the
 framework.

 - No JScript or HTML/CSS knowledge needed. Can separate easier Frot-end and
 Back-end developers -- easier to hire.

 Cons:

 - On other hand, as Front-end developer this looks weird to me since I feel
 like I don't have full control of JScript code.

 1) Since Wicket uses Java for generating HTML/CSS/JScript UI controls for
 me meaning if I need to tweak those controls outside of their box it maybe
 problematic. In my experience any framework good until you start doing
 something different from what it was intended and then you can spend more
 time trying to do simple out of box thing then using native JScript. Is
 there JScript sources for Wicket controls?

 2) Prototyping: using Freemarker I can do changes and simply refresh page.
 In case of Wicket I need to recompile.

 3) Logic blocks: Looks like Wicket allows injection of values into HTML
 tags with wicket: attribute but how do you handle block logic like
 IF(condition) then {use HTML block1} else { use another HTML block}?

 4) Non html data templating: often during page generation I compose some
 AJAX data from FreeMarker inside tag. How do I do similar things from
 Wicket?

 5) Is it harder/simpler to create custom UI controls in Wicket vs using say
 Dojo, ExtJS or JQuery?

 Andrei

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Martin Grigorov
Hi,

On Mon, Dec 5, 2011 at 1:23 PM, Brian Mulholland blmulholl...@gmail.com wrote:
 As a Wicket neophyte myself I can't comment on most of this, but we
 did just look deeply into the notion of subclassing components for the
 purpose of making them render as rich text widgets from ExtJS.  Having
 just done that I will say that there are ALOT of little hidden nits
 and difficulties that come up in such an effort.  Wicket and ExtJS
 both want to control the rendering of the end markup, so when you
 replace the generated markup with Ext widgets, many of Wicket's little
 pre-created solutions for various internet use cases breaks.  Each
 problem is circumventable, but eventually you find yourself almost
 writing your own framework rather than extending a framework.

I'm not sure what exactly you tried but here is how I'd approach it:
- create a Wicket component that purpose is to render just the HTML
needed by the ExtJS component
e.g. div id=someId/div
for this simple HTML snipper you can just use WebMarkupContainer, but
for something more complex you'll need your own Panel
- create a Behavior that should contribute the JS code
this will load the js template, populate it with some options, connect
it to someId and finally just contribute it to the response with
#renderHead()


 I would really love it if a more experienced Wicket developer took a
 serious crack at creating a Wicket extension that worked with rich
 internet controls.  I get the feeling that my effort failed as much
 because I didn't have deep Wicket knowledge as anything else.

There are several: wiquery, jqwicket, jwicket, wicketstuff-dojo,
wicketstuff-yui, ...
I guess these use different approach to integrate Wicket with the JS
widgets. Pick the one that you like the most and make it better.

There are talks about making official integration of Wicket with
JQuery UI, i.e. maintained by Wicket core developers but so far there
is nothing done on it.


 Brian Mulholland




 On Sun, Dec 4, 2011 at 12:30 AM, Andrei Voden are...@gmail.com wrote:
 Hi. I have been developing for a while using Freemarker + some JS
 frameworks (like ExtJS, Dojo and JQuery) and Java as Model building on
 back-end. Now I hear lots of talks about Wicket so Im trying to understand
 pros and cons. After reading intro in Wicket I have mixed feelings. Below
 are my conclusions. I know Im biased but dont take it as offense. Instead
 rather as my misunderstanding since Im really trying to see if Wicket
 is thing to switch to.

 Pros:

 -Seems like this is good for companies where you have Java programmers that
 you can now utilize for building Front-end.

 - Clean HTML code and all logic handled by Java.

 - Quick to start building simple apps that fall into the box of the
 framework.

 - No JScript or HTML/CSS knowledge needed. Can separate easier Frot-end and
 Back-end developers -- easier to hire.

 Cons:

 - On other hand, as Front-end developer this looks weird to me since I feel
 like I don't have full control of JScript code.

 1) Since Wicket uses Java for generating HTML/CSS/JScript UI controls for
 me meaning if I need to tweak those controls outside of their box it maybe
 problematic. In my experience any framework good until you start doing
 something different from what it was intended and then you can spend more
 time trying to do simple out of box thing then using native JScript. Is
 there JScript sources for Wicket controls?

 2) Prototyping: using Freemarker I can do changes and simply refresh page.
 In case of Wicket I need to recompile.

 3) Logic blocks: Looks like Wicket allows injection of values into HTML
 tags with wicket: attribute but how do you handle block logic like
 IF(condition) then {use HTML block1} else { use another HTML block}?

 4) Non html data templating: often during page generation I compose some
 AJAX data from FreeMarker inside tag. How do I do similar things from
 Wicket?

 5) Is it harder/simpler to create custom UI controls in Wicket vs using say
 Dojo, ExtJS or JQuery?

 Andrei

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Brian Mulholland
 I'm not sure what exactly you tried but here is how I'd approach it:
 - create a Wicket component that purpose is to render just the HTML
 needed by the ExtJS component
 e.g. div id=someId/div
 for this simple HTML snipper you can just use WebMarkupContainer, but
 for something more complex you'll need your own Panel
 - create a Behavior that should contribute the JS code
 this will load the js template, populate it with some options, connect
 it to someId and finally just contribute it to the response with
 #renderHead()

That's not too far from what I did.  But as you get into it, all kinds
of little problems arise.  For example, Ext wants it's form in place
instead of the basic HTML form, Ext controls often want to tie into a
separate data source, making the JS controls breaks alot of Wicket's
behaviors which are geared towards markup, and so on.  The devil is in
the details.  As i said, each individual hurdle that presented itself
I was able to overcome, but as time went on, I began to feel like I
had a package full or workarounds.

 I would really love it if a more experienced Wicket developer took a
 serious crack at creating a Wicket extension that worked with rich
 internet controls.  I get the feeling that my effort failed as much
 because I didn't have deep Wicket knowledge as anything else.

 There are several: wiquery, jqwicket, jwicket, wicketstuff-dojo,
 wicketstuff-yui, ...

I saw WiQuery and JQWicket...but didn't really seem to me to be geared
towards a full integration as much as a collection of random stuff for
specific web use cases.  I wasn't familiar with the others.  I'll go
look at those.

 I guess these use different approach to integrate Wicket with the JS
 widgets. Pick the one that you like the most and make it better.

Perhaps once I am more deeply familiar with Wicket I would be
confident enough to try to extend something for public consumption,
but I don't really feel experienced enough to do things Wicket's way.
And Wicket seems like one of those frameworks that really wants you to
know the right way.  I probably shouldn't have attempted this until
I'd had a few years of development time in Wicket first.  But since
Ext is basically a component hierarchy and Wicket is basically a
component hierarchy, it SEEMED like a perfect fit.  And to some extent
i still believe it could be...in the hands of a more experienced
Wicket developer.

 There are talks about making official integration of Wicket with
 JQuery UI, i.e. maintained by Wicket core developers but so far there
 is nothing done on it.

I read some of those threads.  I think this would be an excellent
idea.  Accessibility is a BIG deal for my contract (US Govt), and many
jQuery widgets aren't ARIA enabled, so I would gently prod those
thinking about it to keep an eye on accessibility if they decided to
do this.  Try to pick jQuery components that support ARIA.

I think the world is going this way.  Users expectations of browser
interfaces are increasing quickly.  If Wicket were to come to market
with it's strong object-orientation (the selling feature that
attracted my contract), and more rich client features built in (like
the various GWT frameworks, but not using that javascript generating
methodology), I think it would capture a space most other web
frameworks aren't as well positioned to exploit.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Andrei Voden
I think using String.format for that is breaking idea of MVC where you
endup writing JScript code in Java. Sounds really awkward.
I guess I can hookup Velocity or Freemarker but isnt whole point of Wicket
is to replace that? Plus another problem I see is if I have to use separate
templates for each script tag I may end up with lots of small files so my
logic will be peppered around.

Andrei

On Mon, Dec 5, 2011 at 12:25 AM, Wilhelmsen Tor Iver toriv...@arrive.nowrote:

 script
 .templated code.
 /script

 I tend to use a Label for that kind of scenario, where the Label's model
 uses some other templating engine, anything from a simple String.format()
 to a more complex beast like Velocity (or FreeMarker).

 script wicket:id=complexScript
 /script

 - Tor Iver

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Freemarker+ExtJS vs Wicket questions

2011-12-05 Thread Martin Grigorov
On Mon, Dec 5, 2011 at 7:52 PM, Andrei Voden are...@gmail.com wrote:
 I think using String.format for that is breaking idea of MVC where you
 endup writing JScript code in Java. Sounds really awkward.
 I guess I can hookup Velocity or Freemarker but isnt whole point of Wicket
 is to replace that?

you asked how to do if/else in my templates not me ;-)

 Plus another problem I see is if I have to use separate
 templates for each script tag I may end up with lots of small files so my
 logic will be peppered around.

The templates should be in separate files because this way your
components will contribute only what is needed by them.
But then Wicket can merge all these contributions in one script that
is delivered to the browser.


 Andrei

 On Mon, Dec 5, 2011 at 12:25 AM, Wilhelmsen Tor Iver 
 toriv...@arrive.nowrote:

 script
 .templated code.
 /script

 I tend to use a Label for that kind of scenario, where the Label's model
 uses some other templating engine, anything from a simple String.format()
 to a more complex beast like Velocity (or FreeMarker).

 script wicket:id=complexScript
 /script

 - Tor Iver

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Freemarker+ExtJS vs Wicket questions

2011-12-04 Thread Martin Grigorov
Hi,

I don't want to convince you anyhow. Just responding to your
questions/observations.

On Sun, Dec 4, 2011 at 6:30 AM, Andrei Voden are...@gmail.com wrote:
 Hi. I have been developing for a while using Freemarker + some JS
 frameworks (like ExtJS, Dojo and JQuery) and Java as Model building on
 back-end. Now I hear lots of talks about Wicket so Im trying to understand
 pros and cons. After reading intro in Wicket I have mixed feelings. Below
 are my conclusions. I know Im biased but dont take it as offense. Instead
 rather as my misunderstanding since Im really trying to see if Wicket
 is thing to switch to.

 Pros:

 -Seems like this is good for companies where you have Java programmers that
 you can now utilize for building Front-end.

True, only if you are a pure consumer of component libraries.
Once you start writing your own components you'll need knowledge in JS/CSS.


 - Clean HTML code and all logic handled by Java.

This is a real pros, imo.


 - Quick to start building simple apps that fall into the box of the
 framework.

 - No JScript or HTML/CSS knowledge needed. Can separate easier Frot-end and
 Back-end developers -- easier to hire.

Partially true.
I think both developers should know something about the technology of
the other. Not details, but something. Otherwise they cannot meet in
the middle.


 Cons:

 - On other hand, as Front-end developer this looks weird to me since I feel
 like I don't have full control of JScript code.

 1) Since Wicket uses Java for generating HTML/CSS/JScript UI controls for
 me meaning if I need to tweak those controls outside of their box it maybe
 problematic. In my experience any framework good until you start doing
 something different from what it was intended and then you can spend more
 time trying to do simple out of box thing then using native JScript. Is
 there JScript sources for Wicket controls?

Well written component should provide means to be extended and
customized. Most of the components should not generate JS and/or CSS.
The resources should be delivered with the components (see
ResourceReference) and the Java part of the component should just call
JS functions.
E.g.: AjaxRequestTarget.appendJavaScript(myJsLib.doSomething())
and this call should be made so it is easy for the consumer of the
component to replace it with something else.


 2) Prototyping: using Freemarker I can do changes and simply refresh page.
 In case of Wicket I need to recompile.

For prototyping this is OK but in long term the static types and the
unit tests are more valuable ;-)
But for prototyping (small app) you can use embedded Jetty (see
Start.java in Wicket's quickstart app) and this is quite fast.



 3) Logic blocks: Looks like Wicket allows injection of values into HTML
 tags with wicket: attribute but how do you handle block logic like
 IF(condition) then {use HTML block1} else { use another HTML block}?

This is done at the server side:
if (condition) {
  add(panelA)
} else {
  add(panelB)
}

If the block is something really reusable then you should use Panel,
otherwise you can use Fragment instead.


 4) Non html data templating: often during page generation I compose some
 AJAX data from FreeMarker inside tag. How do I do similar things from
 Wicket?

It is still possible. Wicket's Ajax behaviors can give you callback
url to the component at the server side. So you can ask the component
to do something and with AjaxRequestTarget.appendJavaScript() you can
return any string response (like JSON, XML, ...) and handle this
response with any JS templating system.
See the behavior used for
https://github.com/wicketstuff/core/tree/master/jdk-1.5-parent/autocomplete-tagit-parent/autocomplete-tagit
. It returns JSON which is consumed by JQuery UI autocompleter.


 5) Is it harder/simpler to create custom UI controls in Wicket vs using say
 Dojo, ExtJS or JQuery?

The best is to integrate them. See 4) above for integration of Wicket
with JQuery UI component.
Once integrated you can give this component to a Java developer who
don't know JS at all and she can use it in her app.


 Andrei



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Freemarker+ExtJS vs Wicket questions

2011-12-04 Thread Andrei Voden
Thank you for your input. Really helping me to grasp it.
Question on #4 in Cons: what I ment is to generate templated content
outside of the tags. Like for example I have:
script
.templated code.
/script
Is that doable? Sorry if that sounds newbeesh.

Andrei


Re: Freemarker+ExtJS vs Wicket questions

2011-12-04 Thread Martin Grigorov
o.a.w.Component and Behavior classes have method #renderHead(IHeaderResponse)

with IHeaderResponse#renderXyz methods you can contribute JS, CSS and
plain text to the page. It is up to you how you'll generate the
constribution.
In TagIt component I used TextTemplate to prepare the template and
populate it but you can use anything, even FreeMarker to do that. in
wicket-velocity module we do the same with Velocity.

Additionally when you use Wicket Ajax functionality you can use
AjaxRequestTarget.(pre|ap)pendJavaScript() methods to contribute JS
respectively before and after the replacement of the components'
markup.

On Sun, Dec 4, 2011 at 11:04 AM, Andrei Voden are...@gmail.com wrote:
 Thank you for your input. Really helping me to grasp it.
 Question on #4 in Cons: what I ment is to generate templated content
 outside of the tags. Like for example I have:
 script
 .templated code.
 /script
 Is that doable? Sorry if that sounds newbeesh.

 Andrei



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Freemarker+ExtJS vs Wicket questions

2011-12-03 Thread Andrei Voden
Hi. I have been developing for a while using Freemarker + some JS
frameworks (like ExtJS, Dojo and JQuery) and Java as Model building on
back-end. Now I hear lots of talks about Wicket so Im trying to understand
pros and cons. After reading intro in Wicket I have mixed feelings. Below
are my conclusions. I know Im biased but dont take it as offense. Instead
rather as my misunderstanding since Im really trying to see if Wicket
is thing to switch to.

Pros:

-Seems like this is good for companies where you have Java programmers that
you can now utilize for building Front-end.

- Clean HTML code and all logic handled by Java.

- Quick to start building simple apps that fall into the box of the
framework.

- No JScript or HTML/CSS knowledge needed. Can separate easier Frot-end and
Back-end developers -- easier to hire.

Cons:

- On other hand, as Front-end developer this looks weird to me since I feel
like I don't have full control of JScript code.

1) Since Wicket uses Java for generating HTML/CSS/JScript UI controls for
me meaning if I need to tweak those controls outside of their box it maybe
problematic. In my experience any framework good until you start doing
something different from what it was intended and then you can spend more
time trying to do simple out of box thing then using native JScript. Is
there JScript sources for Wicket controls?

2) Prototyping: using Freemarker I can do changes and simply refresh page.
In case of Wicket I need to recompile.

3) Logic blocks: Looks like Wicket allows injection of values into HTML
tags with wicket: attribute but how do you handle block logic like
IF(condition) then {use HTML block1} else { use another HTML block}?

4) Non html data templating: often during page generation I compose some
AJAX data from FreeMarker inside tag. How do I do similar things from
Wicket?

5) Is it harder/simpler to create custom UI controls in Wicket vs using say
Dojo, ExtJS or JQuery?

Andrei