Re: Constructors take vararg of Component? (Enhancement RFC)

2013-01-07 Thread Martin Grigorov
Hi,

The component constructor doesn't call #add() at the moment (and I think
this wont change soon without a better reason).
So even if adding the varargs this wont help.

But you can create your own components which do this:

public class MyForm extends FormEntity {
   public MyForm(String id, IModelEntity model, Component... children) {
 super(id, model);

 ad(children);
   }
}


On Sun, Jan 6, 2013 at 9:24 PM, Zac Bedell zacl...@thebedells.org wrote:

 Greetings all,

 I was wondering what Wicket users  devs might thing of a possible API
 change for a future version (maybe Wicket 7?) of including a varargs array
 of Component as the final parameter of all of the various MarkupContainer
 subclasses?  I find myself doing things like these a lot:

 pnlNoRsvp = new WebMarkupContainer(pnlNoRsvp);
 pnlRsvp = new StatusPanel(pnlRsvp);
 pnlConfirm = new ConfirmPanel(pnlConfirm);
 pnlRsvpRules = new RsvpRulesPanel(pnlRsvpRules);

 RsvpPage.this.add(
 new Label(event.title),
 new CssFeedbackPanel(feedback),
 new FormRsvpPage(frmRsvp, cpm) {
   {
 add(pnlNoRsvp, pnlRsvp, pnlConfirm);
   }
 },
 pnlRsvpRules
 );

 -- or --

 FormRsvpPage frmRsvp = new FormRsvpPage(frmRsvp, cpm);
 frmRsvp.add(pnlNoRsvp, pnlRsvp, pnlConfirm);

 RsvpPage.this.add(
 new Label(event.title),
 new CssFeedbackPanel(feedback),
 frmRsvp,
 pnlRsvpRules
 );

 --

 If Form and the various other Wicket MarkupContainer's had constructors
 with Component... as their final parameter, it would be possible to do
 something like:

 RsvpPage.this.add(
 new Label(event.title),
 new CssFeedbackPanel(feedback),
 new FormRsvpPage(frmRsvp, cpm, pnlNoRsvp, pnlRsvp, pnlConfirm),
 pnlRsvpRules
 );

 --

 Granted, this would balloon the number of constructors throughout the
 framework just to save a bit of typing.  Curious what others might think...

 Best regards,
 Zac Bedell
 -
 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 http://jweekend.com/


Re: [6.4.0] RadioColumn event in dataTable

2013-01-07 Thread dmalescot
thanks, it works perfectly :)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/6-4-0-RadioColumn-event-in-dataTable-tp4655161p4655178.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Constructors take vararg of Component? (Enhancement RFC)

2013-01-07 Thread Jochen Mader
Why aren't you using fluent interfaces?
The API ist built around that and allows for a much cleaner structure
inside your constructors.
Just watch out for those Auto-Formaters ;)

new FormRsvpPage(frmRsvp, cpm)
.add(new StatusPanel(pnlRsvp))
.add(new ConfirmPanel(pnlConfirm))
.add(new RsvpRulesPanel(pnlRsvpRules));


On Mon, Jan 7, 2013 at 9:17 AM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 The component constructor doesn't call #add() at the moment (and I think
 this wont change soon without a better reason).
 So even if adding the varargs this wont help.

 But you can create your own components which do this:

 public class MyForm extends FormEntity {
public MyForm(String id, IModelEntity model, Component... children) {
  super(id, model);

  ad(children);
}
 }


 On Sun, Jan 6, 2013 at 9:24 PM, Zac Bedell zacl...@thebedells.org wrote:

 Greetings all,

 I was wondering what Wicket users  devs might thing of a possible API
 change for a future version (maybe Wicket 7?) of including a varargs array
 of Component as the final parameter of all of the various MarkupContainer
 subclasses?  I find myself doing things like these a lot:

 pnlNoRsvp = new WebMarkupContainer(pnlNoRsvp);
 pnlRsvp = new StatusPanel(pnlRsvp);
 pnlConfirm = new ConfirmPanel(pnlConfirm);
 pnlRsvpRules = new RsvpRulesPanel(pnlRsvpRules);

 RsvpPage.this.add(
 new Label(event.title),
 new CssFeedbackPanel(feedback),
 new FormRsvpPage(frmRsvp, cpm) {
   {
 add(pnlNoRsvp, pnlRsvp, pnlConfirm);
   }
 },
 pnlRsvpRules
 );

 -- or --

 FormRsvpPage frmRsvp = new FormRsvpPage(frmRsvp, cpm);
 frmRsvp.add(pnlNoRsvp, pnlRsvp, pnlConfirm);

 RsvpPage.this.add(
 new Label(event.title),
 new CssFeedbackPanel(feedback),
 frmRsvp,
 pnlRsvpRules
 );

 --

 If Form and the various other Wicket MarkupContainer's had constructors
 with Component... as their final parameter, it would be possible to do
 something like:

 RsvpPage.this.add(
 new Label(event.title),
 new CssFeedbackPanel(feedback),
 new FormRsvpPage(frmRsvp, cpm, pnlNoRsvp, pnlRsvp, pnlConfirm),
 pnlRsvpRules
 );

 --

 Granted, this would balloon the number of constructors throughout the
 framework just to save a bit of typing.  Curious what others might think...

 Best regards,
 Zac Bedell
 -
 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 http://jweekend.com/

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



Re: Wicket Atmosphere does not run in Firefox 17

2013-01-07 Thread Noven
Emond,

Finally I can make it run in Firefox by disable using websocket in web.xml


init-param
    param-nameorg.atmosphere.useWebSocket/param-name
    param-valuefalse/param-value
    /init-param


Don't know if there's drawback doing that since it comes as default setting in 
the quickstart. 


Regards,
Noven



 From: Emond Papegaaij emond.papega...@gmail.com
To: users@wicket.apache.org; Noven noven_...@yahoo.com 
Sent: Thursday, December 27, 2012 2:29 PM
Subject: Re: Wicket Atmosphere does not run in Firefox 17
 
It seems you hosting provider does not support websockets. For some reason,
in Chrome the downgrade to 'streaming' works fine, but in Firefox it does
not. Firefox keeps trying to establish a ws connection, which fails over
and over again. I think this is a problem in Atmosphere. You could try
asking this question at their google groups. I've created a ticket
(WICKET-4946) for passing parameters to atmosphere, which would allow you
to disable websocket.

Best regards,
Emond Papegaaij


On Mon, Dec 24, 2012 at 12:22 PM, Noven noven_...@yahoo.com wrote:


 Hi,

 Thank you for your reply before. I did not change anything in firefox. If
 I have to, I can't use this feature.
 I doubt if the problem caused from firefox. When the quickstart deployed
 in my localhost (both tomcat and jetty), it run well in firefox.


 
  From: Andreas Kuhtz andreas.ku...@gmail.com
 To: users@wicket.apache.org; Noven noven_...@yahoo.com
 Sent: Monday, December 24, 2012 5:21 PM
 Subject: Re: Wicket Atmosphere does not run in Firefox 17


 Hi,

 Have you configured a proxy in firefox? if so, you may enable the ws://*
 to use the proxy, not only http and https.
 Hope this helps.

 Cheers


 2012/12/24 Noven noven_...@yahoo.com

 Hi All,
 
 I just tried deploy the wicket-atmosphere-quickstart here at
 http://api.bola54.com into tomcat v.7.0.32
 
 It's able run well on safari and chrome, but fail run on newest firefox
 v.17.
 
 By using the same tomcat version, I am able to run it on firefox v.17 in
 my localhost but failed at http://api.bola54.com.
 
 
 Did anybody know this issue before?
 
 
 Thank you.


Re: BeanValidation - IllegalStateException: Could not resolve Property from component

2013-01-07 Thread heapifyman
The PropertyValidator is added in the BeanValidationBorder. Unfortunately,
I don't know what property the FormComponent is for, when
BeanValidationBorder is created.
So I guess, I have to get rid of CompoundPropertyModel and pass PropertyModels
to my FormComponents' constructors.

Interestingly, the CompoundPropertyModel way was working in the net.ftlines
version of wicket-bean-validation.



2013/1/6 martin.dilger martin.dil...@googlemail.com

 Your Code does not show where the PropertyValidator is added.
 If you work with CompoundPropertyModels, you need to explicitely configure
 the Property, since no Model is available to retrieve the Information.

 Wicket expects a Model of Type IPropertyReflectionAwareModel to work.

 Just do the following (Dummy Code)

 ...add(new PropertyValidator(new
 Property(YourClass.class,AttributeName;



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/BeanValidation-IllegalStateException-Could-not-resolve-Property-from-component-tp4655159p4655170.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: wicket 6 form example?

2013-01-07 Thread Martin Grigorov
Hi,

I think
https://code.google.com/p/londonwicket/downloads/detail?name=LondonWicket-FormsWithFlair.pdfcan=2q=shows
an example for this.
It is also based on Wicket 1.3 but this area is not different in Wicket 6.
jQuery is just a detail about internals. The Java APIs are still the same.

All you need is AjaxFormComponentUpdatingBehavior (AFCUB) attached to the
FormComponent and a FeedbackPanel(s) which will be updated in AFCUB's
onSubmit() and onError() methods.


On Mon, Jan 7, 2013 at 1:30 PM, Andy Van Den Heuvel 
andy.vandenheu...@gmail.com wrote:

 I'm new to Wicket and I'm searching for good examples using wicket 6/jQuery
 based examples for forms.

 Basically I need to create a form with inline ajax validation. I mean: when
 I leave a textfield only this textfield is validated via ajax and feedback
 is inline for that textfield only.

 I've read Wicket In Action, but this is 1.3 code. Is there a good github
 project or something that focuses on the Wicket 6 stuff?




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


Re: wicket 6 form example?

2013-01-07 Thread Andy Van Den Heuvel
Thanks, I will try it out


On Mon, Jan 7, 2013 at 12:55 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 I think

 https://code.google.com/p/londonwicket/downloads/detail?name=LondonWicket-FormsWithFlair.pdfcan=2q=shows
 an example for this.
 It is also based on Wicket 1.3 but this area is not different in Wicket 6.
 jQuery is just a detail about internals. The Java APIs are still the same.

 All you need is AjaxFormComponentUpdatingBehavior (AFCUB) attached to the
 FormComponent and a FeedbackPanel(s) which will be updated in AFCUB's
 onSubmit() and onError() methods.


 On Mon, Jan 7, 2013 at 1:30 PM, Andy Van Den Heuvel 
 andy.vandenheu...@gmail.com wrote:

  I'm new to Wicket and I'm searching for good examples using wicket
 6/jQuery
  based examples for forms.
 
  Basically I need to create a form with inline ajax validation. I mean:
 when
  I leave a textfield only this textfield is validated via ajax and
 feedback
  is inline for that textfield only.
 
  I've read Wicket In Action, but this is 1.3 code. Is there a good github
  project or something that focuses on the Wicket 6 stuff?
 



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



Re: mark bookmarkable Link as selected

2013-01-07 Thread Dirk Wichmann

Ah, I see, thats exact what I'm searching for.
I've wrapped the BookmarkableLink in a Panel and override onConfigure() 
so the default wont match.


Thanks, a lot
Cheers Dirk

Mit freundlichem Gruß
*Dirk Wichmann*
d...@team-wichmann.de mailto:d...@team-wichmann.de
Mobil: +49 163 569 2 563
Am 06.01.2013 13:35, schrieb Martin Grigorov:

He means  org.apache.wicket.markup.html.link.BookmarkablePageLink#linksTo().

By default Wicket disables any link in the current page which points to the
same page. See org.apache.wicket.markup.html.link.Link#isEnabled()


On Sun, Jan 6, 2013 at 2:30 PM, Dirk Wichmann d...@team-wichmann.de wrote:


Hi Per,

sorry, but I dont understand?? what means linksto(page) in bpl. Athen
I know the onconfigure method but what should I check there??

Thanks in advance
Cheers Dirk


Mit freundlichem Gruß
*Dirk Wichmann*
d...@team-wichmann.de mailto:d...@team-wichmann.de
Mobil: +49 163 569 2 563
Am 05.01.2013 19:19, schrieb per.newgro:

  You could usw linksto(page) in bpl. Athen in onconfigure oft the link you

can check if this is true and disable the link. Maybe link.getpage helps to.

Cheers Per









Re: Applying jQuery Effects (fadeIn, fadeOut) to Wicket 6 components issue.

2013-01-07 Thread Martin Grigorov
Hi,

Your investigation is fully correct!
I think you can overcome this by adding an invisible panel. I.e. at the
server side add style='display:none' to the Panel. Wicket JS will replace
the old with the new one and then your fadeIn effect will show it.


On Mon, Jan 7, 2013 at 3:01 PM, Carlson Weber carlso...@gmail.com wrote:

 Hey there!
 I've been digging the internet for a solution for this problem, did a lot
 of debugging on Wicket's javascripts and I am almost reaching a dead end.
 I have a very simple test case: A page with a Label and a Link. When I
 click this link, I want that the label change it's caption using the fadeIn
 jQuery effect.

 The workflow is that:
 * Hide the label with jQuery.hide();
 * Change the label text to the new one;
 * As the element is hidden on the first step, I can now show the element
 using jQuery.fadeIn();

 The problem is that when Wicket has any component on the AjaxRequestTarget,
 it is deleting the current DOM and inserting in its place a brand new
 element. I can hide the component before the Wicket.DOM.replace call, but
 it's useless, because when Wicket creates the new component, it is visible
 again. And because of that, obviously, fadeIn has no effect, because Wicket
 already is showing my element.
 Do you guys have any solution to do this? What I want to reach finally is
 that: I have a panel in my application and when I click an AjaxSubmitLink,
 I want to replace this entire panel with a new one and I want that this
 panel will slide to its place.
 By the way, I saw that wicket has the function Wicket.Events.subscribe with
 events /dom/node/removing and /dom/node/added. The problem is that if I
 attach my fadeIn function to the added event, the component is already
 visible and the effect won't take place, because Wicket first adds the
 component to DOM and after that it notifies /dom/node/added.

 Thanks in advance!

 --
 Carlson Weber Filho
 9255-9933




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


Re: Applying jQuery Effects (fadeIn, fadeOut) to Wicket 6 components issue.

2013-01-07 Thread Hans Lesmeister 2
Martin Grigorov-4 wrote
 I.e. at the server side add style='display:none' to the Panel. Wicket JS
 will replace
 the old with the new one and then your fadeIn effect will show it.

And with:
panel.setVisible(false);
panel.setOutputMarkupPlaceholderTag(true);
the style-attribute is added for you by Wicket




-
-- 
Regards, 
Hans 

http://cantaa.de 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Applying-jQuery-Effects-fadeIn-fadeOut-to-Wicket-6-components-issue-tp4655187p4655189.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Applying jQuery Effects (fadeIn, fadeOut) to Wicket 6 components issue.

2013-01-07 Thread Martin Grigorov
On Mon, Jan 7, 2013 at 5:10 PM, Hans Lesmeister 2 
hans.lesmeis...@lessy-software.de wrote:

 Martin Grigorov-4 wrote
  I.e. at the server side add style='display:none' to the Panel. Wicket
 JS
  will replace
  the old with the new one and then your fadeIn effect will show it.

 And with:
 panel.setVisible(false);
 panel.setOutputMarkupPlaceholderTag(true);
 the style-attribute is added for you by Wicket


No. This way Wicket will render only the Panel's tag without its children
stuff.
You need to use onComponentTag() or AttributeModifier to just add
display:none to the style attribute.






 -
 --
 Regards,
 Hans

 http://cantaa.de

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Applying-jQuery-Effects-fadeIn-fadeOut-to-Wicket-6-components-issue-tp4655187p4655189.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 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 http://jweekend.com/


Static image

2013-01-07 Thread René Vangsgaard
Hi - I would like to link to a static image, and the link should be
stateless.

I have tried this (using Scala):

val img = new Image(img, new ContextRelativeResource(images/img + imgId
+ .png))

But the link becomes stateful.

I just found

val img = new Image(img, new UrlResourceReference(new Url(listOfStrings,
Charset.defaultCharset(

Is the last example the preferred way of achieving this?

Thanks in advance,
René