Re: [Wicket-user] Validation messages

2005-11-06 Thread Juergen Donnerstag
It shouldn't. I guess the important point is that
ComponentStringResourceLoade does not get the FormComponent (text1)
You don't start looking for text1 in the formComponents properties
file, do you? You start with the parent component containing text1. A
key text1 expresses that text1 is a child of the parent.

Juergen

On 11/5/05, Sven Meier [EMAIL PROTECTED] wrote:
 Hello Juergen,

 I've taken a short look on your code in the CVS :

 DefaultValidatorResourceKeyFactory.java:

 *  public* String newKey(IValidator validator, FormComponent formComponent)
   {
 *return* formComponent.getId() + *.* + 
 Classes.name(validator.getClass());
   }

 ComponentStringResourceLoader.java:
   ...
   /// Build search stack
 /  Stack searchStack = *new* Stack();
   searchStack.push(component);
   String prefixKey = component.getId() + *.* + key;

 I'm wondering if this leads to a duplicated ID of the validated
 component in prefixId? e.g.

   form1.text1.text1.RequiredValidator

 But maybe I'm wrong - so I'll better give it a try on Monday.

 Thanks

 Sven

 Juergen Donnerstag wrote:

 Repetition: Message retrieval for the following scenario -
 form-panel-textfield - is currently not supported
 
 Let's say that we have the following component hierarchy:
 APage
 -BForm id=b
  --XPanel id=x
 RequiredTextField id=foo
  --YPanel id=y
 RequiredTextField id=foo
 
 Sven made a suggestion on how to change which is not 100% compliant. I
 worked a bit on it and I think I found a solution. An example:
 
 The Page looks like
add(new Label(label));
 
Form form1 = new Form(form1);
add(form1);
form1.add(new MyTextField(text1, input-1));
form1.add(new MyTextField(text2, input-2));
 
Form form2 = new Form(form2);
add(form2);
 
Panel panel1 = new Panel(panel1);
form2.add(panel1);
panel1.add(new MyTextField(text3, input-3));
panel1.add(new MyTextField(text4, input-4));
 
Panel panel2 = new Panel(panel2);
form2.add(panel2);
panel2.add(new MyTextField(text5, input-5));
panel2.add(new MyTextField(text6, input-6));
 
 And the properties file:
 
 # Default message
 RequiredValidator = Default message: ${label} required
 
 # A Textfield with label
 form1.text1 = text1label
 form1.text1.RequiredValidator = ${label} is required
 
 # A TextField without label. label should default to the formComponent's id
 form1.text2.RequiredValidator = ${label} is required
 
 # This one is wrong. Because the panel id is missing
 form2.text3.RequiredValidator = wrong: text is missing
 
 # Must be like
 form2.panel1.text3.RequiredValidator = ok: text is missing
 
 form2.panel1.text4 = Text4Label
 form2.panel1.text4.RequiredValidator = ok: ${label} is missing
 
 form2.panel2.text5.RequiredValidator = ok: text555 is missing
 #form2.panel2.text6.RequiredValidator = ok: text555 is missing
 
 form2.text5.RequiredValidator = wrong: text555 is missing
 form2.text6.RequiredValidator = wrong: text555 is missing
 
 form2.panel1.text5.RequiredValidator = wrong: text555 is missing
 form2.panel1.text6.RequiredValidator = wrong: text555 is missing
 
 I think it is 100% compliant now, solves the panel problem and as
 suggested by Sven adds one more (IMO useful) feature; useful for
 self-contained, re-usable components. The key (e.g.
 text6.RequiredValidator) is prepended with the relativ path (virtual
 root component is the component associated with the properties files).
 His english is better than mine and his examples probably as well.
 
 I'll check it in tonight.
 
 Juergen
 
 
 
 On 10/29/05, Sven Meier [EMAIL PROTECTED] wrote:
 
 
 I've opened a bug, see:
 
 http://sourceforge.net/tracker/index.php?func=detailaid=1339904group_id=119783atid=684975
 
 Sven
 
 Juergen Donnerstag wrote:
 
 
 
 Did you open a bug or RFE already? If not, please do so, otherwise
 there is always a risk that it'll be forgotten.
 
 Juergen
 
 On 10/27/05, Martijn Dashorst [EMAIL PROTECTED] wrote:
 
 
 
 
 +1, if it doesn't break stuff.
 
 Martijn
 
 
 On 10/27/05, Juergen Donnerstag [EMAIL PROTECTED] wrote:
 
 
 
 
 Would you please open a bug for it. Thanks.
 
 As long as long as no one else on the list is against fixing it that
 way, I'll try and put it into 1.1.
 
 Juergen
 
 On 10/27/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 
 
 
 Looks to me you are right. We didn't think about a Panel being a child
 of a Form. I guess it was our assumption that FormComponents are
 always a direct child of a Form.
 
 
 
 
 Nested panels inside the same form was the first thing I checked when
 
 
 
 
 evaluating Wicket. It's a very handy solution to break large forms into
 logical units.
 
 
 
 
 I'm currently not able to look into the code. Do we traverse up the
 component tree already, like you do?
 
 
 
 
 Yes, code is taken from the 

[Wicket-user] eclipse refactoring plugin

2005-11-06 Thread Igor Vaynberg
Hi guys, ive been doing some refactoring lately and got really tired of
renaming the .html and .properties file after i renamed the page or
panel class. This sucks especially when you have inner classes and you
have to rename all inner resources like SomePage$SomeInnerPanel.html

I created a small plugin for eclispe that does the renaming of all
non-java resources when you rename a class that extends
wicket.MarkupContainer.

Essentially if you have a page called SomePage class and you rename it
to SomeOtherPage all resources SomePage.* in the same package will be
renamed to SomeOtherPage.*

If there is any interest i can make it available as a wicket-stuff
project. keeping in mind that it was my first forray into eclipse, so i
cannot guarantee it works 100%.

-Igor



Re: [Wicket-user] Adding Support for optgroup

2005-11-06 Thread Igor Vaynberg
I think the way to go would be to have a set of components that work like CheckGroup/Check
we can have a Select component that acts like the CheckGroup component,
and a SelectChoices component that works like the dropdownchoice with
the exception of rendering select tags. We also have a
SelectChoicesGroup which is a simple webmarkupcotainer with a builtin
label attr modifier.

that way you have all the flexibility, the java code can look like this:

Select select=new Select(sel);
Choices nogroup=new Choices(nogroup, mylistofchoices, choicerenderer);
select.add(nogroup);
ChoiceGroup group1=new ChoiceGroup(group1, this is group 1 choices);
select.add(group1);
group1.add(new Choices(group1choices, mylistofchoices2, choicerenderer));

and html will look like this

select wicket:id=select
option wicket:id=nogroup/option
optgroup wicket:id=group1
option wicket:id=group1choices/option
/optgroup
/select

what do you think?
-Igor


-Igor
On 11/4/05, Andrew Berman [EMAIL PROTECTED] wrote:
Yes my bad, I meant the label attribute, I got it confused with the label tag's for attribute. I'm
not sure what the best solution is either. Passing a string in
definitely works, but it's not really consistent with the rest of the
Wicket components (except Label which just takes the string and creates
a new model with it). Nevertheless, I use i18n in my app and I
use the getString(...) method all over the place, so passing in a
String is, IMHO, not a bad thing.
Ok, what if we made OptGroup a component just like
DropDownChoice, as you mentioned. Then couldn't we just do a test
in the DropDownChoice/MultiChoice constructors to see if the list/model
contains OptGroups? The only problem is what does the
ChoiceRenderer passed into the DropDownChoice refer to at that point?
How to display the optgroup or display the options? Should
optgroup take in a ChoiceRenderer?
--AndrewOn 11/4/05, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
unless of course we just pass in a string instead of imodel and leave i18n to the user...

-Igor
On 11/4/05, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
you mean for the label attribute? Optgroup in this case wouldnt be a
component so the IModel provided needs to be attached to some component
so that it is detached properly, so the user needs to worry about
attaching it somewhere, and the more optgroups you have the trickier
that gets.

-Igor
On 11/4/05, Andrew Berman [EMAIL PROTECTED]
 wrote:
Igor, why wouldn't the model be attached to the OptGroup object?
Each OptGroup takes a model which is used for the for attribute.On 11/4/05, 
Johan Compagner [EMAIL PROTECTED] wrote:




For the other choice objects (The singleselectchoice, dropdownchoice)
we could have a list of optgroups and the optgroup has a list of its choices
So you are just makeing one line with choices and optgroups (with again a list of choices)

johan
On 11/4/05, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
havent decided what the best way to do this is. one problem i see with
passing a list of optgroups is that the optgroup will have to have an
IModel for its label in case someone wants to i18n it, but then how do
we handle attaching and detaching that model since its not attached to
any component. maybe separate components like check and checkbox are
the best way, and have an optgroup that works exactly like dropdown
choice to simplify things.

still thinking,
thoughts?

-Igor
On 11/3/05, Igor Vaynberg 





[EMAIL PROTECTED] wrote:
yeah sorry, think of it as pseudo html :)
-Igor
On 11/3/05, Andrew Berman [EMAIL PROTECTED]
 wrote:
It would be similar to Check/CheckGroup because you could create a
Select object, which is like the CheckGroup object, and an Option
object, which is similar to the Check object. By doing that, then
I can manually insert the optgroup tag either directly in the
HTML or using a WebMarkupContainer in the JavaCode if the label needs
to be dynamic. However, your thought about having an OptGroup
object and extending the current DropDownChoice (and it makes sense to
do the ListMultipleChoice too as you can use OptGroup with a select box
that allows multiple choices) intrigues me. Maybe that is the
smoothest way to go because it will reuse what's already available and
would only add the one OptGroup component. I like it.
By the way, your html should look like below, your HTML above is not correct:select wicket:id=selectGroup optgroup label=Label 1 option/option
 option/option /optgroup optgroup label=Label 2
option/option
 option/option
 /optgroup/select--AndrewOn 11/3/05, Igor Vaynberg
 [EMAIL PROTECTED]
 wrote:I dont really understant what you mean.
If you want to do it like the Check/CheckGroup is done you would have a
SelectGroup and Select components that you would put into your html and
then you can manually insert optgroup

ie

select wicket:id=selectGroup
optgroupwicket doesnt care/optgroup
select wicked:id=choice1
select wicket:id=choice2
/optgroup
/select

But then you are talking about making it a single component, so that is 

[Wicket-user] Re: wicket:body and Border component

2005-11-06 Thread Johan Maasing

Nick Heudecker wrote:



Didn't work. So I have a Border component with the following markup:

wicket:border
wicket:body/
/wicket:border

Then I have a Page with the following markup:

span wicket:id=border
span wicket:id=eventSummaryPanel/
/span

And the error is: There must be exactly one wicket:body tag for 


each

border compoment. Well, I have exactly one wicket:body/ tag for 


I just started learning wicket and one of the first things I ran into 
was that error message. My problem was that I had a border component 
like yours. In the page-java I tried to add the nested component to the 
page thus:


Page.html
span wicket:id=border
  span wicket:id=message
/span

Page.java
  add(new MyBorder(border));
  add(new Label(message, the message)) ;

The problem is that the message-label does not belong to the page 
anymore. It belongs to the border so you have to add the message to 
the border and not the page.
This is confusing for someone like myself that comes from tapestry where 
 the same pattern works differently. The wicket error message is really 
confusing too.




---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] eclipse refactoring plugin

2005-11-06 Thread Johan Compagner
that looks nice and handyOn 11/6/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
Hi guys, ive been doing some refactoring lately and got really tired of
renaming the .html and .properties file after i renamed the page or
panel class. This sucks especially when you have inner classes and you
have to rename all inner resources like SomePage$SomeInnerPanel.html

I created a small plugin for eclispe that does the renaming of all
non-java resources when you rename a class that extends
wicket.MarkupContainer.

Essentially if you have a page called SomePage class and you rename it
to SomeOtherPage all resources SomePage.* in the same package will be
renamed to SomeOtherPage.*

If there is any interest i can make it available as a wicket-stuff
project. keeping in mind that it was my first forray into eclipse, so i
cannot guarantee it works 100%.

-Igor





Re: [Wicket-user] eclipse refactoring plugin

2005-11-06 Thread Martijn Dashorst
H YEAH!

Martijn


On 11/6/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
 Hi guys, ive been doing some refactoring lately and got really tired of
 renaming the .html and .properties file after i renamed the page or panel
 class. This sucks especially when you have inner classes and you have to
 rename all inner resources like SomePage$SomeInnerPanel.html

  I created a small plugin for eclispe that does the renaming of all non-java
 resources when you rename a class that extends wicket.MarkupContainer.

  Essentially if you have a page called SomePage class and you rename it to
 SomeOtherPage all resources SomePage.* in the same package will be renamed
 to SomeOtherPage.*

  If there is any interest i can make it available as a wicket-stuff project.
 keeping in mind that it was my first forray into eclipse, so i cannot
 guarantee it works 100%.

  -Igor




--
Living a wicket life...

Martijn Dashorst - http://www.jroller.com/page/dashorst

Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1


---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] wicket-core-tree doesn't work with wicket-contrib-navmenu correctly

2005-11-06 Thread yongbl
Hi,

I havetried to use the navmenu in my project sucessfully. However, when I click on a tree's node, the navmenu disappeared. Any idea how I can solved this?

Regards,
James Yong
		Do you Yahoo!? 
New and Improved Yahoo! Mail - 1GB free storage!

[Wicket-user] Re: wicket-core-tree doesn't work with wicket-contrib-navmenu correctly

2005-11-06 Thread James Yong
yongbl i_yongbl at yahoo.com.sg writes:

 
 
 Hi,
  
 I have tried to use the navmenu in my project sucessfully. However, when I 
click on a tree's node, the navmenu disappeared. Any idea how I can solved this?
  
 Regards,
 James Yong
 
   
 Do you Yahoo!?New and Improved Yahoo! Mail - 1GB free storage!
 

To add on, I found that the following css is missing in the head tag when the 
problem occurs.


 link 
href=/cms/ex_card/resources/wicket.contrib.markup.html.navmenu.style.tabs.TabsS
tyle/tabs-folders.css type=text/css rel=stylesheet 
wicket:id=cssStyleResource/

link 
href=/cms/ex_card/resources/wicket.markup.html.tree.Tree/tree.css 
type=text/css rel=StyleSheet wicket:id=css/





---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Re: wicket-core-tree doesn't work with wicket-contrib-navmenu correctly

2005-11-06 Thread James Yong
 
 To add on, I found that the following css is missing in the head tag when the 
 problem occurs.
 
  link 
 
href=/cms/ex_card/resources/wicket.contrib.markup.html.navmenu.style.tabs.TabsS
 tyle/tabs-folders.css type=text/css rel=stylesheet 
 wicket:id=cssStyleResource/
 
   link 
 href=/cms/ex_card/resources/wicket.markup.html.tree.Tree/tree.css 
 type=text/css rel=StyleSheet wicket:id=css/
 

Hi,

I have solved the problem. It turn out that I had overrided onEndRequest() in 
my parent page and adding a super.onEndRequest() solved the problem.

Anyway, thanks for reading :mrgreen:

Regards,
James Yong



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Eduardo Rocha
I think Christian's idea is nice, and I saw at least three comments against it:

1. It is necessary to call injectDependencies on deserialization (Igor)

If a component implements protected Object readResolve() throws
ObjectStreamException, as specified in Serializable class, I think
this could be handled, what do you think?

2. The component itself would do lookups (Alexandru).

Yes, but it would be a base class, and as a user you would never see
as your component doing the lookup. Otherwise, as said in a previous
thread, there could be a phase in the RequestCycle responsible for
injecting things, and that would also solve the issue (1).

3. You should never ever call a overridable method in a constructor (Eelco).

Make it final?

2005/10/27, Christian Essl [EMAIL PROTECTED]:
 On Thu, 27 Oct 2005 16:15:37 -0700, Eelco Hillenius
 [EMAIL PROTECTED] wrote:

  Furthermore, you should never ever call a overridable method in a
  constructor.

 You are right. It must be commented to not be dependent on any state set
 of the constructors below this magic helper class. Apart of this
 overriding is generaly a bit dangerous if you don't read the comment well
 and don't know when it is called.

 Anyway it was just an idea. I like this 'injection' thing just not AOP.

 Christian

 
  Eelco
 
  On 10/27/05, Alexandru Popescu [EMAIL PROTECTED]
  wrote:
  #: Christian Essl changed the world a bit at a time by saying on
  10/28/2005 12:54 AM :#
   Is AOP realy needed for that?
  
   Propably I do not understand the problem but why can't you just write
  a
   special Panel, Page etc which calls an overrideable
  injectDependencies()
   method in the constructor. The default implementation of
   injectDependencies() does basicly read the annotations, lookup the
   services and inject them?
 
  Because in this case the component itself does the lookup. And this is
  not what you really want.
 
  ./alex
  --
  .w( the_mindstorm )p.
 
  I think this way you could on an instance by
   instance basis fine-grain control what gets injected. And during
  testing
   you just inject the mocks in this overriden method.
  
   Just my two cents.
  
   Thanks,
   Christian
  
   On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
   [EMAIL PROTECTED] wrote:
  
  
   On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:
  
   BTW rather than letting panels pull service from the page, I'd
  prefer
   the page to push services into its panels (i.e. the page  injects
   dependencies into its panels).
   I don't want my panels to be dependent on the containing page.
  
   Yup. That is exactly what I do.
  
   But. I just moved the aspect from WebPage to Component and guess
  what,
   the annotation and bean resolving works fine in Panels and
   WebComponents too now :-)
  
   It is still to hackerish to use btw. There are some really nasty
  delays
   for example. I need to find some time to polish this.
  
 S.
  
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End of
  2005
   Visit http://www.jboss.com/services/certification for more
  information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
  
 
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
  ---
  This SF.Net email is sponsored by the JBoss Inc.
  Get Certified Today * Register for a JBoss Training Course
  Free Certification Exam for All Training Attendees Through End of 2005
  Visit http://www.jboss.com/services/certification for more information
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user



 --
 Christian Essl





 ___
 Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: 
 http://mail.yahoo.de



 ---
 This SF.Net email is sponsored by the JBoss Inc.
 Get Certified Today * Register for a JBoss Training Course
 Free Certification Exam for All Training Attendees Through End of 2005
 Visit http://www.jboss.com/services/certification for more information
 ___
 Wicket-user 

Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Eduardo Rocha
Make it final?

I personally dislike Wicket's final methods, but I would like to read
people's opinion :) - and in this case it is the easiest way.

2005/11/6, Eduardo Rocha [EMAIL PROTECTED]:
 I think Christian's idea is nice, and I saw at least three comments against 
 it:

 1. It is necessary to call injectDependencies on deserialization (Igor)

 If a component implements protected Object readResolve() throws
 ObjectStreamException, as specified in Serializable class, I think
 this could be handled, what do you think?

 2. The component itself would do lookups (Alexandru).

 Yes, but it would be a base class, and as a user you would never see
 as your component doing the lookup. Otherwise, as said in a previous
 thread, there could be a phase in the RequestCycle responsible for
 injecting things, and that would also solve the issue (1).

 3. You should never ever call a overridable method in a constructor (Eelco).

 Make it final?

 2005/10/27, Christian Essl [EMAIL PROTECTED]:
  On Thu, 27 Oct 2005 16:15:37 -0700, Eelco Hillenius
  [EMAIL PROTECTED] wrote:
 
   Furthermore, you should never ever call a overridable method in a
   constructor.
 
  You are right. It must be commented to not be dependent on any state set
  of the constructors below this magic helper class. Apart of this
  overriding is generaly a bit dangerous if you don't read the comment well
  and don't know when it is called.
 
  Anyway it was just an idea. I like this 'injection' thing just not AOP.
 
  Christian
 
  
   Eelco
  
   On 10/27/05, Alexandru Popescu [EMAIL PROTECTED]
   wrote:
   #: Christian Essl changed the world a bit at a time by saying on
   10/28/2005 12:54 AM :#
Is AOP realy needed for that?
   
Propably I do not understand the problem but why can't you just write
   a
special Panel, Page etc which calls an overrideable
   injectDependencies()
method in the constructor. The default implementation of
injectDependencies() does basicly read the annotations, lookup the
services and inject them?
  
   Because in this case the component itself does the lookup. And this is
   not what you really want.
  
   ./alex
   --
   .w( the_mindstorm )p.
  
   I think this way you could on an instance by
instance basis fine-grain control what gets injected. And during
   testing
you just inject the mocks in this overriden method.
   
Just my two cents.
   
Thanks,
Christian
   
On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
[EMAIL PROTECTED] wrote:
   
   
On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:
   
BTW rather than letting panels pull service from the page, I'd
   prefer
the page to push services into its panels (i.e. the page  injects
dependencies into its panels).
I don't want my panels to be dependent on the containing page.
   
Yup. That is exactly what I do.
   
But. I just moved the aspect from WebPage to Component and guess
   what,
the annotation and bean resolving works fine in Panels and
WebComponents too now :-)
   
It is still to hackerish to use btw. There are some really nasty
   delays
for example. I need to find some time to polish this.
   
  S.
   
   
   
---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of
   2005
Visit http://www.jboss.com/services/certification for more
   information
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
   
   
   
  
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End of 2005
   Visit http://www.jboss.com/services/certification for more information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
  
   ---
   This SF.Net email is sponsored by the JBoss Inc.
   Get Certified Today * Register for a JBoss Training Course
   Free Certification Exam for All Training Attendees Through End of 2005
   Visit http://www.jboss.com/services/certification for more information
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
  --
  Christian Essl
 
 
 
 
 
  ___
  Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier 
  anmelden: http://mail.yahoo.de
 
 
 
  

Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Alexandru Popescu

#: Eduardo Rocha changed the world a bit at a time by saying on  11/6/2005 3:51 
PM :#

I think Christian's idea is nice, and I saw at least three comments against it:

1. It is necessary to call injectDependencies on deserialization (Igor)

If a component implements protected Object readResolve() throws
ObjectStreamException, as specified in Serializable class, I think
this could be handled, what do you think?



Yes - or at least this is what is supposed to be the correct way to handle it.


2. The component itself would do lookups (Alexandru).

Yes, but it would be a base class, and as a user you would never see
as your component doing the lookup. Otherwise, as said in a previous
thread, there could be a phase in the RequestCycle responsible for
injecting things, and that would also solve the issue (1).



The idea of the RequestCycle doing also injection is one that I like. Unfortunately it will not be 
able to solve the page/component injection. Wicket is encouragging the usage of normal Java 
constructors for adding pages, components, etc. For having automatic injection on these I really 
don't see any good solution other than aop ;-).



./alex
--
.w( the_mindstorm )p.


3. You should never ever call a overridable method in a constructor (Eelco).

Make it final?

2005/10/27, Christian Essl [EMAIL PROTECTED]:

On Thu, 27 Oct 2005 16:15:37 -0700, Eelco Hillenius
[EMAIL PROTECTED] wrote:

 Furthermore, you should never ever call a overridable method in a
 constructor.

You are right. It must be commented to not be dependent on any state set
of the constructors below this magic helper class. Apart of this
overriding is generaly a bit dangerous if you don't read the comment well
and don't know when it is called.

Anyway it was just an idea. I like this 'injection' thing just not AOP.

Christian


 Eelco

 On 10/27/05, Alexandru Popescu [EMAIL PROTECTED]
 wrote:
 #: Christian Essl changed the world a bit at a time by saying on
 10/28/2005 12:54 AM :#
  Is AOP realy needed for that?
 
  Propably I do not understand the problem but why can't you just write
 a
  special Panel, Page etc which calls an overrideable
 injectDependencies()
  method in the constructor. The default implementation of
  injectDependencies() does basicly read the annotations, lookup the
  services and inject them?

 Because in this case the component itself does the lookup. And this is
 not what you really want.

 ./alex
 --
 .w( the_mindstorm )p.

 I think this way you could on an instance by
  instance basis fine-grain control what gets injected. And during
 testing
  you just inject the mocks in this overriden method.
 
  Just my two cents.
 
  Thanks,
  Christian
 
  On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
  [EMAIL PROTECTED] wrote:
 
 
  On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:
 
  BTW rather than letting panels pull service from the page, I'd
 prefer
  the page to push services into its panels (i.e. the page  injects
  dependencies into its panels).
  I don't want my panels to be dependent on the containing page.
 
  Yup. That is exactly what I do.
 
  But. I just moved the aspect from WebPage to Component and guess
 what,
  the annotation and bean resolving works fine in Panels and
  WebComponents too now :-)
 
  It is still to hackerish to use btw. There are some really nasty
 delays
  for example. I need to find some time to polish this.
 
S.
 


--
Christian Essl






---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Allow forcing of PageMap where Page will be added on creation?

2005-11-06 Thread Janne Hietamäki

Hi,

I'm doing some AJAX-stuff, and because there is not yet real support of 
rendering single components (and having a URL for a Component) I'm doing 
all this stuff with a AjaxWrapperPage like


public class AjaxWrapperPage extends WebPage {

   public AjaxFieldResult(Component component) {
  add(component);
   }  
}


and markup which only results the component..

span wicket:id=result/span

My implementation is a little more complex, so I don't have to care 
about the component naming and other stuff, anyway..


I have a interface like IAjaxListener which extends IRequestListener:

public interface IAjaxRequestListener extends IRequestListener {

   void onAjaxRequest();
 
}


And I use all this stuff with:

protected void onAjaxRequest(){
RequestCycle.get().setResponsePage(new 
AjaxWrapperPage(component));   
}



Everything works fine, but I have a problem with PageMaps.. Since I 
can't set the PageMap when creating a Page, these AjaxWrapperPages go to 
default PageMap, and cause expired pages. And I wouldn't really want to 
add these pages to any pagemap at all, since I know they will be 
rendered only once, ever.


This whole thing is not really too slick and clean, but it allows me to 
do nice AJAX-stuff with wicket.


Something like this would solve my problems on Page.java

 private final void init()
   {
   // All Pages are born dirty so they get clustered right away
   setDirty(true);

   // set the pagemap
   setPageMap(getDefaultPageMap());

   setId(getPageMap().getNextId());

   // Set versioning of page based on default
   
setVersioned(Application.get().getSettings().getVersionPagesByDefault());

   }

   protected String getDefaultPageMap(){
   return getRequestCycle() != null ? 
getRequestCycle().getRequest().getParameter(pagemap) : null;

   }

This would allow me to force my WrapperPages to go to another PageMap..

Any ideas?

--
Janne Hietamäki
Cemron Ltd
http://www.cemron.com/


---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Eduardo Rocha
2005/11/6, Alexandru Popescu [EMAIL PROTECTED]:
 #: Eduardo Rocha changed the world a bit at a time by saying on  11/6/2005 
 3:51 PM :#
  I think Christian's idea is nice, and I saw at least three comments against 
  it:
 
  1. It is necessary to call injectDependencies on deserialization (Igor)
 
  If a component implements protected Object readResolve() throws
  ObjectStreamException, as specified in Serializable class, I think
  this could be handled, what do you think?
 

 Yes - or at least this is what is supposed to be the correct way to handle it.

  2. The component itself would do lookups (Alexandru).
 
  Yes, but it would be a base class, and as a user you would never see
  as your component doing the lookup. Otherwise, as said in a previous
  thread, there could be a phase in the RequestCycle responsible for
  injecting things, and that would also solve the issue (1).
 

 The idea of the RequestCycle doing also injection is one that I like. 
 Unfortunately it will not be
 able to solve the page/component injection. Wicket is encouragging the usage 
 of normal Java
 constructors for adding pages, components, etc. For having automatic 
 injection on these I really
 don't see any good solution other than aop ;-).


It could be a setter injection. Personally I think that using a
service in the constructor is not the way to go, I prefer to delay the
use of a service when is really needed. So the calls to the service
should be in one of onBeginXXX, when the RequestCycle should already
have injected the service.


 ./alex
 --
 .w( the_mindstorm )p.

  3. You should never ever call a overridable method in a constructor (Eelco).
 
  Make it final?
 
  2005/10/27, Christian Essl [EMAIL PROTECTED]:
  On Thu, 27 Oct 2005 16:15:37 -0700, Eelco Hillenius
  [EMAIL PROTECTED] wrote:
 
   Furthermore, you should never ever call a overridable method in a
   constructor.
 
  You are right. It must be commented to not be dependent on any state set
  of the constructors below this magic helper class. Apart of this
  overriding is generaly a bit dangerous if you don't read the comment well
  and don't know when it is called.
 
  Anyway it was just an idea. I like this 'injection' thing just not AOP.
 
  Christian
 
  
   Eelco
  
   On 10/27/05, Alexandru Popescu [EMAIL PROTECTED]
   wrote:
   #: Christian Essl changed the world a bit at a time by saying on
   10/28/2005 12:54 AM :#
Is AOP realy needed for that?
   
Propably I do not understand the problem but why can't you just write
   a
special Panel, Page etc which calls an overrideable
   injectDependencies()
method in the constructor. The default implementation of
injectDependencies() does basicly read the annotations, lookup the
services and inject them?
  
   Because in this case the component itself does the lookup. And this is
   not what you really want.
  
   ./alex
   --
   .w( the_mindstorm )p.
  
   I think this way you could on an instance by
instance basis fine-grain control what gets injected. And during
   testing
you just inject the mocks in this overriden method.
   
Just my two cents.
   
Thanks,
Christian
   
On Thu, 27 Oct 2005 21:50:02 +0200, Stefan Arentz
[EMAIL PROTECTED] wrote:
   
   
On Oct 27, 2005, at 9:21 PM, Sven Meier wrote:
   
BTW rather than letting panels pull service from the page, I'd
   prefer
the page to push services into its panels (i.e. the page  injects
dependencies into its panels).
I don't want my panels to be dependent on the containing page.
   
Yup. That is exactly what I do.
   
But. I just moved the aspect from WebPage to Component and guess
   what,
the annotation and bean resolving works fine in Panels and
WebComponents too now :-)
   
It is still to hackerish to use btw. There are some really nasty
   delays
for example. I need to find some time to polish this.
   
  S.
   
 
 
  --
  Christian Essl
 
 



 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: wicket:body and Border component

2005-11-06 Thread Nick Heudecker
That's why you wrap the border calls:http://www.wicket-wiki.org.uk/wiki/index.php/Consistent_page_layout_using_borders
On 11/6/05, Johan Maasing [EMAIL PROTECTED] wrote:
The problem is that the message-label does not belong to the pageanymore. It belongs to the border so you have to add the message tothe border and not the page.


Re: [Wicket-user] Adding Support for optgroup

2005-11-06 Thread Andrew Berman
Sounds and looks good to me. On 11/6/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
I think the way to go would be to have a set of components that work like CheckGroup/Check
we can have a Select component that acts like the CheckGroup component,
and a SelectChoices component that works like the dropdownchoice with
the exception of rendering select tags. We also have a
SelectChoicesGroup which is a simple webmarkupcotainer with a builtin
label attr modifier.

that way you have all the flexibility, the java code can look like this:

Select select=new Select(sel);
Choices nogroup=new Choices(nogroup, mylistofchoices, choicerenderer);
select.add(nogroup);
ChoiceGroup group1=new ChoiceGroup(group1, this is group 1 choices);
select.add(group1);
group1.add(new Choices(group1choices, mylistofchoices2, choicerenderer));

and html will look like this

select wicket:id=select
option wicket:id=nogroup/option
optgroup wicket:id=group1
option wicket:id=group1choices/option
/optgroup
/select

what do you think?
-Igor


-Igor
On 11/4/05, Andrew Berman [EMAIL PROTECTED]
 wrote:
Yes my bad, I meant the label attribute, I got it confused with the label tag's for attribute. I'm
not sure what the best solution is either. Passing a string in
definitely works, but it's not really consistent with the rest of the
Wicket components (except Label which just takes the string and creates
a new model with it). Nevertheless, I use i18n in my app and I
use the getString(...) method all over the place, so passing in a
String is, IMHO, not a bad thing.
Ok, what if we made OptGroup a component just like
DropDownChoice, as you mentioned. Then couldn't we just do a test
in the DropDownChoice/MultiChoice constructors to see if the list/model
contains OptGroups? The only problem is what does the
ChoiceRenderer passed into the DropDownChoice refer to at that point?
How to display the optgroup or display the options? Should
optgroup take in a ChoiceRenderer?
--AndrewOn 11/4/05, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
unless of course we just pass in a string instead of imodel and leave i18n to the user...

-Igor
On 11/4/05, Igor Vaynberg 


[EMAIL PROTECTED] wrote:
you mean for the label attribute? Optgroup in this case wouldnt be a
component so the IModel provided needs to be attached to some component
so that it is detached properly, so the user needs to worry about
attaching it somewhere, and the more optgroups you have the trickier
that gets.

-Igor
On 11/4/05, Andrew Berman [EMAIL PROTECTED]
 wrote:
Igor, why wouldn't the model be attached to the OptGroup object?
Each OptGroup takes a model which is used for the for attribute.On 11/4/05, 
Johan Compagner [EMAIL PROTECTED] wrote:





For the other choice objects (The singleselectchoice, dropdownchoice)
we could have a list of optgroups and the optgroup has a list of its choices
So you are just makeing one line with choices and optgroups (with again a list of choices)

johan
On 11/4/05, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
havent decided what the best way to do this is. one problem i see with
passing a list of optgroups is that the optgroup will have to have an
IModel for its label in case someone wants to i18n it, but then how do
we handle attaching and detaching that model since its not attached to
any component. maybe separate components like check and checkbox are
the best way, and have an optgroup that works exactly like dropdown
choice to simplify things.

still thinking,
thoughts?

-Igor
On 11/3/05, Igor Vaynberg 






[EMAIL PROTECTED] wrote:
yeah sorry, think of it as pseudo html :)
-Igor
On 11/3/05, Andrew Berman [EMAIL PROTECTED]
 wrote:
It would be similar to Check/CheckGroup because you could create a
Select object, which is like the CheckGroup object, and an Option
object, which is similar to the Check object. By doing that, then
I can manually insert the optgroup tag either directly in the
HTML or using a WebMarkupContainer in the JavaCode if the label needs
to be dynamic. However, your thought about having an OptGroup
object and extending the current DropDownChoice (and it makes sense to
do the ListMultipleChoice too as you can use OptGroup with a select box
that allows multiple choices) intrigues me. Maybe that is the
smoothest way to go because it will reuse what's already available and
would only add the one OptGroup component. I like it.
By the way, your html should look like below, your HTML above is not correct:select wicket:id=selectGroup optgroup label=Label 1 option/option
 option/option /optgroup optgroup label=Label 2
option/option
 option/option
 /optgroup/select--AndrewOn 11/3/05, Igor Vaynberg
 [EMAIL PROTECTED]
 wrote:I dont really understant what you mean.
If you want to do it like the Check/CheckGroup is done you would have a
SelectGroup and Select components that you would put into your html and
then you can manually insert optgroup

ie

select wicket:id=selectGroup
optgroupwicket doesnt care/optgroup
select wicked:id=choice1
select wicket:id=choice2

Re: [Wicket-user] eclipse refactoring plugin

2005-11-06 Thread Andrew Berman
Definitely would be nice.On 11/6/05, Martijn Dashorst [EMAIL PROTECTED] wrote:
H YEAH!MartijnOn 11/6/05, Igor Vaynberg [EMAIL PROTECTED] wrote: Hi guys, ive been doing some refactoring lately and got really tired of
 renaming the .html and .properties file after i renamed the page or panel class. This sucks especially when you have inner classes and you have to rename all inner resources like SomePage$SomeInnerPanel.html
I created a small plugin for eclispe that does the renaming of all non-java resources when you rename a class that extends wicket.MarkupContainer.Essentially if you have a page called SomePage class and you rename it to
 SomeOtherPage all resources SomePage.* in the same package will be renamed to SomeOtherPage.*If there is any interest i can make it available as a wicket-stuff project. keeping in mind that it was my first forray into eclipse, so i cannot
 guarantee it works 100%.-Igor--Living a wicket life...Martijn Dashorst - http://www.jroller.com/page/dashorst
Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1---SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Downloadit for free - -and be entered to win a 42 plasma tv or your very ownSony(tm)PSP.Click here to play: 
http://sourceforge.net/geronimo.php___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Igor Vaynberg
Or how about a simple solution:

public MyApplication extends WebApplication {
 public Object lookup(String name) {
 Object=...do a lookup from somewhere like spring context or app object...;
 return object;
 }
}

public MyPage extends Page {
 public transient SomeService service;

 public SomeService getService() {
 if (service==null) {
 service=getApplication().lookup(SomeService.class.getName());
 }
 return service;
}

I know its not quiete as elegant as ioc but it has none of the
performance hits an automatic injection would cause if it would be done
on deserialization of every component. Also its a lazy lookup so you
dont do it until its needed, and its only done once per page (until it
gets deserialized).

-Igor

 


[Wicket-user] Re: Re: Wicket 1.1 line endings bug?

2005-11-06 Thread jan_bar
I use DiffUtil. The extension may help. You don't have troubles with it?

Jan

Juergen Donnerstag [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Are you using DiffPrint which we use for core unit tests?  May be we
just have to extend this class

Juergen

On 11/5/05, jan_bar [EMAIL PROTECTED] wrote:
 I don't know what is the best solutions. For me the pain is in JUnit tests
 when I compare byte to byte the rendered results with expected results. It
 should not break because of changed line endings. I have to write
comparator
 that will take different line endings into account.

 Jan





---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Igor Vaynberg
you are right, this is not ioc. but are pages/components managed by an ioc container?
-Igor
On 11/6/05, Alexandru Popescu [EMAIL PROTECTED] wrote:
#: Igor Vaynberg changed the world a bit at a time by saying on11/6/2005 7:06 PM :# Or how about a simple solution: public MyApplication extends WebApplication { public Object lookup(String name) {
 Object=...do a lookup from somewhere like spring context or app object...; return object; } } public MyPage extends Page { public transient SomeService service;
 public SomeService getService() { if (service==null) { service=getApplication().lookup(SomeService.class.getName()); } return service; } I know its not quiete as elegant as ioc but it has none of the performance
 hits an automatic injection would cause if it would be done on deserialization of every component. Also its a lazy lookup so you dont do it until its needed, and its only done once per page (until it gets
 deserialized). -IgorBut this was exactly what I was suggesting to avoid ;-). Lookups and factories are not ioc/di../alex--.w( the_mindstorm )p.---
SF.Net email is sponsored by:Tame your development challenges with Apache's Geronimo App Server. Downloadit for free - -and be entered to win a 42 plasma tv or your very ownSony(tm)PSP.Click here to play: 
http://sourceforge.net/geronimo.php___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Eelco Hillenius
I see absolutely nothing wrong with lookups at that level. It's less
code than you would need for any component configuration and it's more
efficient too. And there are just no disadvantages, are there?

And... for this whole discussion: if you like one approach... go
implement it now! Create your own component factory, annotations
processor, aop, and please contribute when you've got something nice
working. Or let us know when you need specific changes to Wicket to
support your needs. We'll most probably honor such requests if they
are reasonable as we've done in the past.

Eelco


On 11/6/05, Alexandru Popescu [EMAIL PROTECTED] wrote:
 #: Igor Vaynberg changed the world a bit at a time by saying on  11/6/2005 
 7:06 PM :#
  Or how about a simple solution:
 
  public MyApplication extends WebApplication {
  public Object lookup(String name) {
  Object=...do a lookup from somewhere like spring context or app object...;
  return object;
  }
  }
 
  public MyPage extends Page {
  public transient SomeService service;
 
  public SomeService getService() {
  if (service==null) {
  service=getApplication().lookup(SomeService.class.getName());
  }
  return service;
  }
 
  I know its not quiete as elegant as ioc but it has none of the performance
  hits an automatic injection would cause if it would be done on
  deserialization of every component. Also its a lazy lookup so you dont do it
  until its needed, and its only done once per page (until it gets
  deserialized).
 
  -Igor
 

 But this was exactly what I was suggesting to avoid ;-). Lookups and 
 factories are not ioc/di.

 ./alex
 --
 .w( the_mindstorm )p.



 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: Re: Wicket 1.1 line endings bug?

2005-11-06 Thread Juergen Donnerstag
No, but I work wih CVS only. I don't download the jars. And I modify
project.xmll to use the snapshot jar which I build myself.

Juergen

On 11/6/05, jan_bar [EMAIL PROTECTED] wrote:
 I use DiffUtil. The extension may help. You don't have troubles with it?

 Jan

 Juergen Donnerstag [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Are you using DiffPrint which we use for core unit tests?  May be we
 just have to extend this class

 Juergen

 On 11/5/05, jan_bar [EMAIL PROTECTED] wrote:
  I don't know what is the best solutions. For me the pain is in JUnit tests
  when I compare byte to byte the rendered results with expected results. It
  should not break because of changed line endings. I have to write
 comparator
  that will take different line endings into account.
 
  Jan





 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Servlet forward to a JSP

2005-11-06 Thread Robert McClay
I'm exploring the possibility of integrating Wicket into a JSP 
application. Is it possible to tell Wicket to do a servlet forward to a 
JSP? I would like to add a few request attributes and then forward to a 
JSP. The reason I'd like to do a forward VS include is I need to be 
able to populate request attributes prior to the JSP running. The login 
page is currently implemented in JSP. Another option would be to 
refactor the login page, but I'm curious if it is feasibile to attempt 
the former as I want to use as much of the existing system as possible. 
Thanks.





---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] eclipse refactoring plugin

2005-11-06 Thread Igor Vaynberg
got access to a laptop, and just checked it in.
its in wicket-stuff/wicketeer

as i said this is my first go at an eclipse plugin so im sure the code isnt as elegant as it could be

right now it handles all basic cases, like renaminga class that inherits from markup container and renaming an inner class that inherits from the markup container. one case that is not handled is renaming files for a class that does not inherit from the markup container but has inner classes that do.


i would like this to be a community driven effort because i do not have a ton of time to put into this, so any contributions are welcome. And if someone has eclipse experience and wouldnt mind looking over it and giving pointers that would be great too.


-Igor

On 11/6/05, Igor Vaynberg [EMAIL PROTECTED] wrote:
i will check it in tonight.-Igor 

On 11/6/05, Andrew Berman [EMAIL PROTECTED]
 wrote: 
Definitely would be nice. 

On 11/6/05, Martijn Dashorst  [EMAIL PROTECTED]
 wrote: 
H YEAH!MartijnOn 11/6/05, Igor Vaynberg 
[EMAIL PROTECTED] wrote:  Hi guys, ive been doing some refactoring lately and got really tired of  renaming the .html and .properties file after i renamed the page or panel class. This sucks especially when you have inner classes and you have to
 rename all inner resources like SomePage$SomeInnerPanel.html I created a small plugin for eclispe that does the renaming of all non-java resources when you rename a class that extends wicket.MarkupContainer
.Essentially if you have a page called SomePage class and you rename it to  SomeOtherPage all resources SomePage.* in the same package will be renamed to SomeOtherPage.*If there is any interest i can make it available as a wicket-stuff project.
 keeping in mind that it was my first forray into eclipse, so i cannot  guarantee it works 100%.-Igor--Living a wicket life...Martijn Dashorst - 
http://www.jroller.com/page/dashorst Wicket 1.1 is out: http://wicket.sourceforge.net/wicket-1.1
--- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Downloadit for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.Click here to play: http://sourceforge.net/geronimo.php___
Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Servlet forward to a JSP

2005-11-06 Thread Eelco Hillenius
Sure. Use wicket.markup.html.pages.RedirectPage for server-side
redirecting to a non-wicket locations. If you want to inlcude things
likes JSP pages into Wicket pages, you can use the
wicket.markup.html.include.Include component. The latter is a bit
rough, so if you need better support on that one, please contribute ;)

Eelco


On 11/6/05, Robert McClay [EMAIL PROTECTED] wrote:
 I'm exploring the possibility of integrating Wicket into a JSP
 application. Is it possible to tell Wicket to do a servlet forward to a
 JSP? I would like to add a few request attributes and then forward to a
 JSP. The reason I'd like to do a forward VS include is I need to be
 able to populate request attributes prior to the JSP running. The login
 page is currently implemented in JSP. Another option would be to
 refactor the login page, but I'm curious if it is feasibile to attempt
 the former as I want to use as much of the existing system as possible.
 Thanks.




 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] My take on Spring integration

2005-11-06 Thread Alexandru Popescu

#: Eelco Hillenius changed the world a bit at a time by saying on  11/6/2005 
9:38 PM :#

I see absolutely nothing wrong with lookups at that level. It's less
code than you would need for any component configuration and it's more
efficient too. And there are just no disadvantages, are there?

And... for this whole discussion: if you like one approach... go
implement it now! Create your own component factory, annotations
processor, aop, and please contribute when you've got something nice
working. Or let us know when you need specific changes to Wicket to
support your needs. We'll most probably honor such requests if they
are reasonable as we've done in the past.

Eelco




My single contribution to this discussion was not to proove something is bad, but rather to 
understand others points of view and also to feedback my understanding regarding ioc/di. Considering 
this, I would probably still be able to point you that lookup is not bad per se, but it is not 
ioc/di. Sure, there are a few disadvantages when compairing these 2, and iirc these are presented in 
Spring discussions.


As regards implementing it: when reaching the point where I would need them, if nothing is available 
I will definitely come out with something. As, maybe some of the people here are aware, I am 
involved in oss projects for quite a while, so if this will be the case I will do my best to 
contribute them back to the community.


cheers,

./alex
--
.w( the_mindstorm )p.


On 11/6/05, Alexandru Popescu [EMAIL PROTECTED] wrote:

#: Igor Vaynberg changed the world a bit at a time by saying on  11/6/2005 7:06 
PM :#
 Or how about a simple solution:

 public MyApplication extends WebApplication {
 public Object lookup(String name) {
 Object=...do a lookup from somewhere like spring context or app object...;
 return object;
 }
 }

 public MyPage extends Page {
 public transient SomeService service;

 public SomeService getService() {
 if (service==null) {
 service=getApplication().lookup(SomeService.class.getName());
 }
 return service;
 }

 I know its not quiete as elegant as ioc but it has none of the performance
 hits an automatic injection would cause if it would be done on
 deserialization of every component. Also its a lazy lookup so you dont do it
 until its needed, and its only done once per page (until it gets
 deserialized).

 -Igor


But this was exactly what I was suggesting to avoid ;-). Lookups and factories 
are not ioc/di.

./alex
--
.w( the_mindstorm )p.



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Re: Servlet forward to a JSP

2005-11-06 Thread Robert McClay
If I come up with anything useful I'd be happy to contribute. The JSP I 
need to forward to requires request attributes, so I don't think the 
wicket.markup.html.include.Include component will work as from what I 
understand it is a separate request whose output is then included into 
the markup? In this case, the result of RedirectPage would be the same 
as it is a fresh browser request and I need to populate a request with 
request.setAttribute() and have the JSP be able to retrieve the request 
attributes. What I'm looking for is a way in Wicket to tell it to 
finish its processing, not output any markup, and then forward the 
request to another servlet, not include or redirect.  Thanks.


On 2005-11-06 15:38:06 -0700, Eelco Hillenius [EMAIL PROTECTED] said:


Sure. Use wicket.markup.html.pages.RedirectPage for server-side
redirecting to a non-wicket locations. If you want to inlcude things
likes JSP pages into Wicket pages, you can use the
wicket.markup.html.include.Include component. The latter is a bit
rough, so if you need better support on that one, please contribute ;)

Eelco


On 11/6/05, Robert McClay [EMAIL PROTECTED] wrote:

I'm exploring the possibility of integrating Wicket into a JSP
application. Is it possible to tell Wicket to do a servlet forward to a
JSP? I would like to add a few request attributes and then forward to a
JSP. The reason I'd like to do a forward VS include is I need to be
able to populate request attributes prior to the JSP running. The login
page is currently implemented in JSP. Another option would be to
refactor the login page, but I'm curious if it is feasibile to attempt
the former as I want to use as much of the existing system as possible.
Thanks.




---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Downl oad
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php






---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: Servlet forward to a JSP

2005-11-06 Thread Eelco Hillenius
Ah, yes. True. It used to resolve local includes using
javax.servlet.RequestDispatcher, i which case including request
attributes would work. However, that proved to be quite problametic
and we changed it to always use the absolute requests.

What you need shouldn't be too hard however. But it is not something
Wicket supports out-of-the-box (and I'm not sure whether that would be
in Wicket's scope either).

You don't need Wicket to tell stopping any processing, as that is
already part of the idea of component orientation. What you need (to
build) is a component that gets the content you want to include during
it's rendering process. E.g. by letting your component extend from
WebComponent and overriding method onComponentTagBody to do the work.
In this method, you'll probably want to use the request processor:

RequestDispatcher dispatcher =
((ServletWebRequest)getRequest()).getHttpServletRequest()
.getRequestDispatcher(*path-to-jsp*);

For the including.

Eelco

Eelco


On 11/6/05, Robert McClay [EMAIL PROTECTED] wrote:
 If I come up with anything useful I'd be happy to contribute. The JSP I
 need to forward to requires request attributes, so I don't think the
 wicket.markup.html.include.Include component will work as from what I
 understand it is a separate request whose output is then included into
 the markup? In this case, the result of RedirectPage would be the same
 as it is a fresh browser request and I need to populate a request with
 request.setAttribute() and have the JSP be able to retrieve the request
 attributes. What I'm looking for is a way in Wicket to tell it to
 finish its processing, not output any markup, and then forward the
 request to another servlet, not include or redirect.  Thanks.

 On 2005-11-06 15:38:06 -0700, Eelco Hillenius [EMAIL PROTECTED] said:

  Sure. Use wicket.markup.html.pages.RedirectPage for server-side
  redirecting to a non-wicket locations. If you want to inlcude things
  likes JSP pages into Wicket pages, you can use the
  wicket.markup.html.include.Include component. The latter is a bit
  rough, so if you need better support on that one, please contribute ;)
 
  Eelco
 
 
  On 11/6/05, Robert McClay [EMAIL PROTECTED] wrote:
  I'm exploring the possibility of integrating Wicket into a JSP
  application. Is it possible to tell Wicket to do a servlet forward to a
  JSP? I would like to add a few request attributes and then forward to a
  JSP. The reason I'd like to do a forward VS include is I need to be
  able to populate request attributes prior to the JSP running. The login
  page is currently implemented in JSP. Another option would be to
  refactor the login page, but I'm curious if it is feasibile to attempt
  the former as I want to use as much of the existing system as possible.
  Thanks.
 
 
 
 
  ---
  SF.Net email is sponsored by:
  Tame your development challenges with Apache's Geronimo App Server. Downl 
  oad
  it for free - -and be entered to win a 42 plasma tv or your very own
  Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
  ---
  SF.Net email is sponsored by:
  Tame your development challenges with Apache's Geronimo App Server. Download
  it for free - -and be entered to win a 42 plasma tv or your very own
  Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php





 ---
 SF.Net email is sponsored by:
 Tame your development challenges with Apache's Geronimo App Server. Download
 it for free - -and be entered to win a 42 plasma tv or your very own
 Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user