Re: General questions regarding Wicket roadmap and plans

2009-12-04 Thread Martijn Dashorst
The problem with pre built components is that they never, ever are
exactly what you want or need. Maintaining such components for other
people is what I call hell. We are in the business of creating the
best Java web framework for building your own custom components with
unprecedented ease. This takes enough time already.

Anybody is welcome to build component libraries, open source or
commercially. Our license allows for that and nobody would object to
creative folks trying to earn a buck or two with their component
(libraries).

That this hasn't happened (yet) is mostly because it is so damned easy
to create your own custom components according to your coding style
that precisely fit in your application and perform exactly those task
you intend them to. And conversely it is damned hard to create a
finished, polished, released component. It is easy to start a
component, but it is *work* to ship it.

Martijn

On Fri, Dec 4, 2009 at 6:37 AM, Lester Chua cicowic...@gmail.com wrote:
 I think it's kinda of chicken and egg issue wrt components.
 If newbies do not see components readily available, they will probably end
 up coding what they want themselves because:

 1) it takes time to articulate properly their requirements
 2) avoid facing potential embarrassment  because the component that they
 want is trivial (which turns out not to be)
 3) I know it when I see it (this is quite common and this approach
 normally requires a large library of things to pick from)

 Maybe the reason why no one is asking is one of the above reasons, or all of
 them combined.


 Igor Vaynberg wrote:

 the interesting bit is that people are saying that there are not
 enough components that wicket ships with, but no one is saying which
 componets exactly they are missing.

 -igor

 On Thu, Dec 3, 2009 at 7:41 PM, Ashley Aitken mrhat...@mac.com wrote:


 On 02/12/2009, at 10:45 AM, Igor Vaynberg wrote:



 but as you will see, there is not much
 demand for precanned components out there, they are just too easy to
 roll yourself and there are a lot of open source ones that you can at
 least get ideas from for your specific requirements.


 But isn't that missing some of the major reasons for using components:

 1. that you shouldn't have to reinvent the wheel (even if it is easy),
 2. that a component that is tried and tested (version 3+) is better than
 my
 version 1,
 3. components can encapsulate best practice that takes time to learn,
 4.  a suite of components may integrate better.

 Writing a linked list in Java is easy but I would never consider doing
 that,
 the available classe are much more powerful, general, well-tested,
 integrated, ...

 I'm not knowledgeable wrt Wicket components or JSF components, but
 generally
 speaking what components available in JSF, for example, wouldn't be
 useful
 in Wicket and why not?

 I'm with the OP in that I'm a little surprised by the lack of published
 components (from low-level to high-level).  Again, I am probably missing
 something ...

 Maybe as I learn more about Wicket and get more experience I will
 understand.

 Cheers,
 Ashley.

 --
 Ashley Aitken
 Perth, Western Australia
 Skype/iChat: MrHatken (GMT + 8hrs!)


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




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





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





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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



Re: close a ModalWindow when session expired

2009-12-04 Thread Bernard Lupin

Hi again,
After a lot of various tries, I finally found a solution that seems to work.
On my ModalWindow close button, I don't need javacode anymore, I just have
this small javascript command in the markup file:

onclick=window.parent.Wicket.Window.close();

Do you think that it's a good way to solve my problem ?
Regards,
Bernard


Bernard Lupin wrote:
 
 Hi,
 On my ModalWindow's close button, I only want to ... close the modal
 window. It seems that myWindow.close(target) calls some Ajax request,
 which is failing when session is expired.
 But if I click on the cross button in the upper right of the modal window,
 everything works well : the modal window is closed and the original window
 becomes active again.
 I searched in source page and in wicket source code, but can't find what
 code is behind this cross button.
 Could you tell me which javascript code I could invoke on my close button,
 to close the window without ajax request ?
 Thanks a lot
 Bernard
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/close-a-ModalWindow-when-session-expired-tp26622679p26635817.html
Sent from the Wicket - User 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: InvalidUrlException considered evil?

2009-12-04 Thread Alex Objelean

That is why this Exception was created... you can override requestCycle 
handle this kind of exception whatever you like ...

Alex Objelean


Marat Radchenko-2 wrote:
 
 There some places in Wicket sources where it throws
 InvalidUrlException that causes exception logging and
 InternalErrorPage is shown.
 
 However, I don't agree that badly constructed URL is and _internal_
 error. It is external error (for example, user was playing with urls,
 modifying them by hand).
 
 So, my proposal: stop treating invalid urls and internal errors, don't
 log traces for them, don't show InternalErrorPage. Instead, either
 redirect user to home page, or show him 404, or show him 400 (bad
 request), or whatever else.
 
 The main point: do _not_ log errors just because user passed us an url
 that we couldn't resolve to a page/component.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/InvalidUrlException-considered-evil--tp26607291p26635840.html
Sent from the Wicket - User 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



Wicket.Ajax.Call.failure: after update wicket from 1.4.1 to 1.4.3

2009-12-04 Thread Michał Letyński
Hi i have simple select with AjaxFormSubmitBehavior attached to it. 
After changing selection i get:

Error:
Wicket.Ajax.Call.failure: Error while parsing response: Could not find root 
ajax-response element

Is it a known problem ?

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



Re: close a ModalWindow when session expired

2009-12-04 Thread Johan Compagner
it could be that if you do that then in normal use
the serverside doesnt know that the modal window isnt shown anymore.
So i guess you should also try to let the server know.

On Fri, Dec 4, 2009 at 10:16, Bernard Lupin beal6...@yahoo.fr wrote:


 Hi again,
 After a lot of various tries, I finally found a solution that seems to
 work.
 On my ModalWindow close button, I don't need javacode anymore, I just have
 this small javascript command in the markup file:

 onclick=window.parent.Wicket.Window.close();

 Do you think that it's a good way to solve my problem ?
 Regards,
 Bernard


 Bernard Lupin wrote:
 
  Hi,
  On my ModalWindow's close button, I only want to ... close the modal
  window. It seems that myWindow.close(target) calls some Ajax request,
  which is failing when session is expired.
  But if I click on the cross button in the upper right of the modal
 window,
  everything works well : the modal window is closed and the original
 window
  becomes active again.
  I searched in source page and in wicket source code, but can't find what
  code is behind this cross button.
  Could you tell me which javascript code I could invoke on my close
 button,
  to close the window without ajax request ?
  Thanks a lot
  Bernard
 
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

 --
 View this message in context:
 http://old.nabble.com/close-a-ModalWindow-when-session-expired-tp26622679p26635817.html
 Sent from the Wicket - User 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: Resource Location

2009-12-04 Thread Stefan Droog
If you use CompressedResourceReference(MyPage.class, MyPage.css); it will 
expect to have the CSS file in the same package as the MyPage.class.

So in your case the css file should be in the following package:
myPackage/Application.java
myPackage/css/jquery/cupertino/jquery-ui-1.7.2.custom.css

Regards,
Stefan

-Original Message-
From: Lester Chua [mailto:cicowic...@gmail.com]
Sent: Friday, December 04, 2009 9:34 AM
To: users@wicket.apache.org
Subject: Re: Resource Location

Do u mean that I did not specify the path?
I thought it's done with css/jquery/cupertino/jquery-ui-1.7.2.custom.css.
Do I need to do a exact path? Or can wicket infer from the webapp
context path?


Marat Radchenko wrote:
 2009/12/4 Lester Chua cicowic...@gmail.com:

 Hi,

 I'm attempting to load a css resource.

 The example in the wicket reference was using:
 private static final CompressedResourceReference MYPAGE_CSS = new
 CompressedResourceReference(MyPage.class, MyPage.css);

 I understand that this is scoped to MyPage.class

 I used
 CompressedResourceReference MYPAGE_CSS = new
 CompressedResourceReference(css/jquery/cupertino/jquery-ui-1.7.2.custom.css);

 add(CSSPackageResource.getHeaderContribution(MYPAGE_CSS));

 It is scoped to the application, which it should. But the generated link is:

 link rel=stylesheet type=text/css
 href=resources/org.apache.wicket.Application/css/jquery/cupertino/jquery-ui-1.7.2.custom.css
 view-source:http://localhost:/mirage/resources/org.apache.wicket.Application/css/jquery/cupertino/jquery-ui-1.7.2.custom.css
 /

 which my browser cannot find. What should be the correct way to do this? I
 tried hard referencing as well but did not get it to work as well.

 Lester


 You didn't say where your css file is located.

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





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


The information contained in this communication is confidential, intended 
solely for the use of the individual or entity to whom it is addressed and may 
be legally privileged and protected by professional secrecy. Access to this 
message by anyone else is unauthorized. If you are not the intended recipient, 
any disclosure, copying, or distribution of the message, or any action or 
omission taken by you in reliance on it is prohibited and may be unlawful. 
Please immediately contact the sender if you have received this message in 
error. This email does not constitute any commitment from Cordys Holding BV or 
any of its subsidiaries except when expressly agreed in a written agreement 
between the intended recipient and Cordys Holding BV or its subsidiaries. 
Cordys is neither liable for the proper and complete transmission of the 
information contained in this communication nor for any delay in its receipt. 
Cordys does not guarantee that the integrity of this communication has been 
maintained nor that the communication is free of viruses, interceptions or 
interference. If you are not the intended recipient of this communication 
please return the communication to the sender and delete and destroy all copies.


DropDownChoiceWithStylingOptionsT

2009-12-04 Thread Martin Makundi
Free4U

public class DropDownChoiceWithStylingOptionsT extends DropDownChoiceT {
  private String previouslyAppendedOptGroupLabel;
  private int choices;

  /**
   * @param id
   * @param choices
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id,
  IModel? extends List? extends T choices,
  IChoiceRenderer? super T renderer) {
super(id, choices, renderer);
  }

  /**
   * @param id
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id,
  IModel? extends List? extends T choices) {
super(id, choices);
  }

  /**
   * @param id
   * @param model
   * @param choices
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  IModel? extends List? extends T choices,
  IChoiceRenderer? super T renderer) {
super(id, model, choices, renderer);
  }

  /**
   * @param id
   * @param model
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  IModel? extends List? extends T choices) {
super(id, model, choices);
  }

  /**
   * @param id
   * @param model
   * @param data
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  List? extends T data, IChoiceRenderer? super T renderer) {
super(id, model, data, renderer);
  }

  /**
   * @param id
   * @param model
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  List? extends T choices) {
super(id, model, choices);
  }

  /**
   * @param id
   * @param data
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, List? extends T data,
  IChoiceRenderer? super T renderer) {
super(id, data, renderer);
  }

  /**
   * @param id
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, List? extends T
choices) {
super(id, choices);
  }

  /**
   * @param id
   */
  public DropDownChoiceWithStylingOptions(String id) {
super(id);
  }

  /**
   * @see 
org.apache.wicket.markup.html.form.AbstractChoice#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
org.apache.wicket.markup.ComponentTag)
   */
  @Override
  protected void onComponentTagBody(MarkupStream markupStream,
  ComponentTag openTag) {
previouslyAppendedOptGroupLabel = null;
choices = getChoices().size();
super.onComponentTagBody(markupStream, openTag);
  }

  /**
   * @see 
org.apache.wicket.markup.html.form.AbstractChoice#appendOptionHtml(org.apache.wicket.util.string.AppendingStringBuffer,
java.lang.Object, int, java.lang.String)
   */
  @Override
  protected void appendOptionHtml(AppendingStringBuffer buffer, T choice,
  int index, String selected) {
AppendingStringBuffer tmp = new AppendingStringBuffer(50);
super.appendOptionHtml(tmp, choice, index, selected);

if (getChoiceRenderer() instanceof IStyledChoiceRenderer) {
  IStyledChoiceRendererT styledChoiceRenderer =
(IStyledChoiceRendererT) getChoiceRenderer();

  String currentOptGroupLabel =
styledChoiceRenderer.getOptGroupLabel(choice);

  if (!Utils.equalsOrNull(currentOptGroupLabel,
previouslyAppendedOptGroupLabel)) {
// OptGroup changed
if (previouslyAppendedOptGroupLabel != null) {
  endOptGroup(tmp);
}
if (currentOptGroupLabel != null) {
  // OptGroup started
  int start = tmp.indexOf(option);
  StringBuilder label = new
StringBuilder(currentOptGroupLabel.length() + 19);
  label.append(optgroup
label=\).append(currentOptGroupLabel).append(\);
  tmp.insert(start, label);
}
  }

  if ((currentOptGroupLabel != null)  (index == (choices-1))) {
// Last option group must end too
endOptGroup(tmp);
  }

  {
String cssClass = styledChoiceRenderer.getOptionCssClassName(choice);
if (cssClass != null) {
  int start = tmp.indexOf(option);
  tmp.insert(start + 7, new StringBuilder(
class=\).append(cssClass).append(\));
}
  }

  previouslyAppendedOptGroupLabel = currentOptGroupLabel;
}

buffer.append(tmp);
  }

  /**
   * @param tmp
   */
  private void endOptGroup(AppendingStringBuffer tmp) {
// OptGroup ended
int start = tmp.indexOf(/option);
tmp.insert(start + 9, /optgroup);
  }
}



public interface IStyledChoiceRendererT extends IChoiceRendererT {
  /**
   * @param t
   * @return String
   */
  public String getOptGroupLabel(T t);

  /**
   * @param t
   * @return String
   */
  public String getOptionCssClassName(T t);
}

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



Re: Wicket.Ajax.Call.failure: after update wicket from 1.4.1 to 1.4.3

2009-12-04 Thread Michał Letyński
The problem came in wicket 1.4.2 and its connected with NullPointer 
exception which came from wicket-ajax.js - line 1133


Here is the code:

   if (submitButton!=null) {
   try {
   var btn = document.createElement(input type='hidden' 
name='+submitButton+' id='+iframe.id+-btn' 
value='1'/);

   } catch (ex) {
   var btn = document.createElement(input);
   btn.type=hidden;
   btn.name=submitButton;
   btn.id=iframe.id+-btn;
   btn.value=1;
   }
   }
   form.appendChild(btn);  -- buggy line

This line should be inside the if (submitButton!=null)  statement 
because in my case submitButton is null. Why its null ? In 
AjaxFormSubmitBehavior#getEventHandler() the submitButton is set only 
when getComponent() instanceof IFormSubmittingComponent .
DropDownChoice is not an instace of IFormSubmittingComponent. Fast 
workaround ? Just change IFormSubmittingComponent to FormComponent both 
of them have key method #getInputName() (with the same logic, this also 
should be changed i think :) )


Should i add a jira issue for that problem ?


Michał Letyński pisze:
Hi i have simple select with AjaxFormSubmitBehavior attached to it. 
After changing selection i get:

Error:
Wicket.Ajax.Call.failure: Error while parsing response: Could not find 
root ajax-response element


Is it a known problem ?

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



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



Re: DropDownChoiceWithStylingOptionsT

2009-12-04 Thread nino martinez wael
Martin, why not put something like this in minis?

2009/12/4 Martin Makundi martin.maku...@koodaripalvelut.com

 Free4U

 public class DropDownChoiceWithStylingOptionsT extends DropDownChoiceT
 {
  private String previouslyAppendedOptGroupLabel;
  private int choices;

  /**
   * @param id
   * @param choices
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id,
  IModel? extends List? extends T choices,
  IChoiceRenderer? super T renderer) {
super(id, choices, renderer);
  }

  /**
   * @param id
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id,
  IModel? extends List? extends T choices) {
super(id, choices);
  }

  /**
   * @param id
   * @param model
   * @param choices
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  IModel? extends List? extends T choices,
  IChoiceRenderer? super T renderer) {
super(id, model, choices, renderer);
  }

  /**
   * @param id
   * @param model
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  IModel? extends List? extends T choices) {
super(id, model, choices);
  }

  /**
   * @param id
   * @param model
   * @param data
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  List? extends T data, IChoiceRenderer? super T renderer) {
super(id, model, data, renderer);
  }

  /**
   * @param id
   * @param model
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
  List? extends T choices) {
super(id, model, choices);
  }

  /**
   * @param id
   * @param data
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, List? extends T data,
  IChoiceRenderer? super T renderer) {
super(id, data, renderer);
  }

  /**
   * @param id
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, List? extends T
 choices) {
super(id, choices);
  }

  /**
   * @param id
   */
  public DropDownChoiceWithStylingOptions(String id) {
super(id);
  }

  /**
   * @see
 org.apache.wicket.markup.html.form.AbstractChoice#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
 org.apache.wicket.markup.ComponentTag)
   */
  @Override
  protected void onComponentTagBody(MarkupStream markupStream,
  ComponentTag openTag) {
previouslyAppendedOptGroupLabel = null;
choices = getChoices().size();
super.onComponentTagBody(markupStream, openTag);
  }

  /**
   * @see
 org.apache.wicket.markup.html.form.AbstractChoice#appendOptionHtml(org.apache.wicket.util.string.AppendingStringBuffer,
 java.lang.Object, int, java.lang.String)
   */
  @Override
  protected void appendOptionHtml(AppendingStringBuffer buffer, T choice,
  int index, String selected) {
AppendingStringBuffer tmp = new AppendingStringBuffer(50);
super.appendOptionHtml(tmp, choice, index, selected);

if (getChoiceRenderer() instanceof IStyledChoiceRenderer) {
  IStyledChoiceRendererT styledChoiceRenderer =
 (IStyledChoiceRendererT) getChoiceRenderer();

  String currentOptGroupLabel =
 styledChoiceRenderer.getOptGroupLabel(choice);

  if (!Utils.equalsOrNull(currentOptGroupLabel,
 previouslyAppendedOptGroupLabel)) {
// OptGroup changed
if (previouslyAppendedOptGroupLabel != null) {
  endOptGroup(tmp);
}
if (currentOptGroupLabel != null) {
  // OptGroup started
  int start = tmp.indexOf(option);
  StringBuilder label = new
 StringBuilder(currentOptGroupLabel.length() + 19);
  label.append(optgroup
 label=\).append(currentOptGroupLabel).append(\);
  tmp.insert(start, label);
}
  }

  if ((currentOptGroupLabel != null)  (index == (choices-1))) {
// Last option group must end too
endOptGroup(tmp);
  }

  {
String cssClass =
 styledChoiceRenderer.getOptionCssClassName(choice);
if (cssClass != null) {
  int start = tmp.indexOf(option);
  tmp.insert(start + 7, new StringBuilder(
 class=\).append(cssClass).append(\));
}
  }

  previouslyAppendedOptGroupLabel = currentOptGroupLabel;
}

buffer.append(tmp);
  }

  /**
   * @param tmp
   */
  private void endOptGroup(AppendingStringBuffer tmp) {
// OptGroup ended
int start = tmp.indexOf(/option);
tmp.insert(start + 9, /optgroup);
  }
 }



 public interface IStyledChoiceRendererT extends IChoiceRendererT {
  /**
   * @param t
   * @return String
   */
  public String getOptGroupLabel(T t);

  /**
   * @param t
   * @return String
   */
  public String getOptionCssClassName(T t);
 }

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




Re: DropDownChoiceWithStylingOptionsT

2009-12-04 Thread Martin Makundi
Busy... sorry. Feel free to put it.

2009/12/4 nino martinez wael nino.martinez.w...@gmail.com:
 Martin, why not put something like this in minis?

 2009/12/4 Martin Makundi martin.maku...@koodaripalvelut.com

 Free4U

 public class DropDownChoiceWithStylingOptionsT extends DropDownChoiceT
 {
  private String previouslyAppendedOptGroupLabel;
  private int choices;

  /**
   * @param id
   * @param choices
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id,
      IModel? extends List? extends T choices,
      IChoiceRenderer? super T renderer) {
    super(id, choices, renderer);
  }

  /**
   * @param id
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id,
      IModel? extends List? extends T choices) {
    super(id, choices);
  }

  /**
   * @param id
   * @param model
   * @param choices
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
      IModel? extends List? extends T choices,
      IChoiceRenderer? super T renderer) {
    super(id, model, choices, renderer);
  }

  /**
   * @param id
   * @param model
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
      IModel? extends List? extends T choices) {
    super(id, model, choices);
  }

  /**
   * @param id
   * @param model
   * @param data
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
      List? extends T data, IChoiceRenderer? super T renderer) {
    super(id, model, data, renderer);
  }

  /**
   * @param id
   * @param model
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, IModelT model,
      List? extends T choices) {
    super(id, model, choices);
  }

  /**
   * @param id
   * @param data
   * @param renderer
   */
  public DropDownChoiceWithStylingOptions(String id, List? extends T data,
      IChoiceRenderer? super T renderer) {
    super(id, data, renderer);
  }

  /**
   * @param id
   * @param choices
   */
  public DropDownChoiceWithStylingOptions(String id, List? extends T
 choices) {
    super(id, choices);
  }

  /**
   * @param id
   */
  public DropDownChoiceWithStylingOptions(String id) {
    super(id);
  }

  /**
   * @see
 org.apache.wicket.markup.html.form.AbstractChoice#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
 org.apache.wicket.markup.ComponentTag)
   */
 �...@override
  protected void onComponentTagBody(MarkupStream markupStream,
      ComponentTag openTag) {
    previouslyAppendedOptGroupLabel = null;
    choices = getChoices().size();
    super.onComponentTagBody(markupStream, openTag);
  }

  /**
   * @see
 org.apache.wicket.markup.html.form.AbstractChoice#appendOptionHtml(org.apache.wicket.util.string.AppendingStringBuffer,
 java.lang.Object, int, java.lang.String)
   */
 �...@override
  protected void appendOptionHtml(AppendingStringBuffer buffer, T choice,
      int index, String selected) {
    AppendingStringBuffer tmp = new AppendingStringBuffer(50);
    super.appendOptionHtml(tmp, choice, index, selected);

    if (getChoiceRenderer() instanceof IStyledChoiceRenderer) {
      IStyledChoiceRendererT styledChoiceRenderer =
 (IStyledChoiceRendererT) getChoiceRenderer();

      String currentOptGroupLabel =
 styledChoiceRenderer.getOptGroupLabel(choice);

      if (!Utils.equalsOrNull(currentOptGroupLabel,
 previouslyAppendedOptGroupLabel)) {
        // OptGroup changed
        if (previouslyAppendedOptGroupLabel != null) {
          endOptGroup(tmp);
        }
        if (currentOptGroupLabel != null) {
          // OptGroup started
          int start = tmp.indexOf(option);
          StringBuilder label = new
 StringBuilder(currentOptGroupLabel.length() + 19);
          label.append(optgroup
 label=\).append(currentOptGroupLabel).append(\);
          tmp.insert(start, label);
        }
      }

      if ((currentOptGroupLabel != null)  (index == (choices-1))) {
        // Last option group must end too
        endOptGroup(tmp);
      }

      {
        String cssClass =
 styledChoiceRenderer.getOptionCssClassName(choice);
        if (cssClass != null) {
          int start = tmp.indexOf(option);
          tmp.insert(start + 7, new StringBuilder(
 class=\).append(cssClass).append(\));
        }
      }

      previouslyAppendedOptGroupLabel = currentOptGroupLabel;
    }

    buffer.append(tmp);
  }

  /**
   * @param tmp
   */
  private void endOptGroup(AppendingStringBuffer tmp) {
    // OptGroup ended
    int start = tmp.indexOf(/option);
    tmp.insert(start + 9, /optgroup);
  }
 }



 public interface IStyledChoiceRendererT extends IChoiceRendererT {
  /**
   * @param t
   * @return String
   */
  public String getOptGroupLabel(T t);

  /**
   * @param t
   * @return String
   */
  public String getOptionCssClassName(T t);
 }

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

Re: DropDownChoiceWithStylingOptionsT

2009-12-04 Thread nino martinez wael
Ahh, me too :/ So anyone able feel free to put this in minis.

2009/12/4 Martin Makundi martin.maku...@koodaripalvelut.com

 Busy... sorry. Feel free to put it.

 2009/12/4 nino martinez wael nino.martinez.w...@gmail.com:
  Martin, why not put something like this in minis?
 
  2009/12/4 Martin Makundi martin.maku...@koodaripalvelut.com
 
  Free4U
 
  public class DropDownChoiceWithStylingOptionsT extends
 DropDownChoiceT
  {
   private String previouslyAppendedOptGroupLabel;
   private int choices;
 
   /**
* @param id
* @param choices
* @param renderer
*/
   public DropDownChoiceWithStylingOptions(String id,
   IModel? extends List? extends T choices,
   IChoiceRenderer? super T renderer) {
 super(id, choices, renderer);
   }
 
   /**
* @param id
* @param choices
*/
   public DropDownChoiceWithStylingOptions(String id,
   IModel? extends List? extends T choices) {
 super(id, choices);
   }
 
   /**
* @param id
* @param model
* @param choices
* @param renderer
*/
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
   IModel? extends List? extends T choices,
   IChoiceRenderer? super T renderer) {
 super(id, model, choices, renderer);
   }
 
   /**
* @param id
* @param model
* @param choices
*/
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
   IModel? extends List? extends T choices) {
 super(id, model, choices);
   }
 
   /**
* @param id
* @param model
* @param data
* @param renderer
*/
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
   List? extends T data, IChoiceRenderer? super T renderer) {
 super(id, model, data, renderer);
   }
 
   /**
* @param id
* @param model
* @param choices
*/
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
   List? extends T choices) {
 super(id, model, choices);
   }
 
   /**
* @param id
* @param data
* @param renderer
*/
   public DropDownChoiceWithStylingOptions(String id, List? extends T
 data,
   IChoiceRenderer? super T renderer) {
 super(id, data, renderer);
   }
 
   /**
* @param id
* @param choices
*/
   public DropDownChoiceWithStylingOptions(String id, List? extends T
  choices) {
 super(id, choices);
   }
 
   /**
* @param id
*/
   public DropDownChoiceWithStylingOptions(String id) {
 super(id);
   }
 
   /**
* @see
 
 org.apache.wicket.markup.html.form.AbstractChoice#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
  org.apache.wicket.markup.ComponentTag)
*/
   @Override
   protected void onComponentTagBody(MarkupStream markupStream,
   ComponentTag openTag) {
 previouslyAppendedOptGroupLabel = null;
 choices = getChoices().size();
 super.onComponentTagBody(markupStream, openTag);
   }
 
   /**
* @see
 
 org.apache.wicket.markup.html.form.AbstractChoice#appendOptionHtml(org.apache.wicket.util.string.AppendingStringBuffer,
  java.lang.Object, int, java.lang.String)
*/
   @Override
   protected void appendOptionHtml(AppendingStringBuffer buffer, T choice,
   int index, String selected) {
 AppendingStringBuffer tmp = new AppendingStringBuffer(50);
 super.appendOptionHtml(tmp, choice, index, selected);
 
 if (getChoiceRenderer() instanceof IStyledChoiceRenderer) {
   IStyledChoiceRendererT styledChoiceRenderer =
  (IStyledChoiceRendererT) getChoiceRenderer();
 
   String currentOptGroupLabel =
  styledChoiceRenderer.getOptGroupLabel(choice);
 
   if (!Utils.equalsOrNull(currentOptGroupLabel,
  previouslyAppendedOptGroupLabel)) {
 // OptGroup changed
 if (previouslyAppendedOptGroupLabel != null) {
   endOptGroup(tmp);
 }
 if (currentOptGroupLabel != null) {
   // OptGroup started
   int start = tmp.indexOf(option);
   StringBuilder label = new
  StringBuilder(currentOptGroupLabel.length() + 19);
   label.append(optgroup
  label=\).append(currentOptGroupLabel).append(\);
   tmp.insert(start, label);
 }
   }
 
   if ((currentOptGroupLabel != null)  (index == (choices-1))) {
 // Last option group must end too
 endOptGroup(tmp);
   }
 
   {
 String cssClass =
  styledChoiceRenderer.getOptionCssClassName(choice);
 if (cssClass != null) {
   int start = tmp.indexOf(option);
   tmp.insert(start + 7, new StringBuilder(
  class=\).append(cssClass).append(\));
 }
   }
 
   previouslyAppendedOptGroupLabel = currentOptGroupLabel;
 }
 
 buffer.append(tmp);
   }
 
   /**
* @param tmp
*/
   private void endOptGroup(AppendingStringBuffer tmp) {
 // OptGroup ended
 int start = tmp.indexOf(/option);
 tmp.insert(start + 9, /optgroup);
   }
  }
 
 
 
  public interface IStyledChoiceRendererT extends IChoiceRendererT {
   /**
* @param t

Re: wicket enclosure not finding child!?

2009-12-04 Thread Douglas Ferguson
Is there a way to test this with maven?

On Dec 4, 2009, at 12:45 AM, Girts Ziemelis wrote:

 You might want to try first the development snapshot first. There is 
 additional enclosure fix  waiting for 1.4.4:
 https://issues.apache.org/jira/browse/WICKET-2519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 
 Do not know, if this will fix your problem, but might be worth a try 
 before you create a quickstart ...
 
 Douglas Ferguson wrote:
 Are there instructions for this?
 
 D/
 
 On Dec 3, 2009, at 4:51 PM, Igor Vaynberg wrote:
 
 
 create a quickstart or a testcase and attach it to the jira issue
 
 -igor
 
 On Thu, Dec 3, 2009 at 2:18 PM, Douglas Ferguson
 doug...@douglasferguson.us wrote:
 
 I have no idea where that http: came from I pasted this:
 
 I do not have : and I'm still getting the error.
 I had to revert to 1.4.1
 
 
  wicket:enclosure child=mediaOutlet.name
  div class=details-subhead font-xsmall font-dgray 
 strongMedia Outlet (span wicket:id=mediaOutlet.name/):BR
 
 On Dec 3, 2009, at 3:43 PM, Igor Vaynberg wrote:
 
 
 the colon character is a path separator, if it has worked previously
 it was only by mistake. you should not use ids that contain :
 
 -igor
 
 On Thu, Dec 3, 2009 at 1:40 PM, Douglas Ferguson
 doug...@douglasferguson.us wrote:
 
 I just upgraded to 1.4.3 from 1.4.0 and now I'm getting this:
 
 org.apache.wicket.WicketRuntimeException:Could not find child with id: 
 mediaOutlet.namehttp://mediaOutlet.name in the wicket:enclosure 
 org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:220)
 org.apache.wicket.markup.html.internal.Enclosure.ensureAllChildrenPresent(Enclosure.java:262)
 org.apache.wicket.markup.html.internal.Enclosure.onComponentTagBody(Enclosure.java:169)
 org.apache.wicket.Component.renderComponent(Component.java:2617)
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
 org.apache.wicket.Component.render(Component.java:2448)
 org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229)
 
 
 wicket:enclosure child=mediaOutlet.namehttp://mediaOutlet.name
  div class=details-subhead font-xsmall font-dgray strongMedia Outlet 
 (span wicket:id=mediaOutlet.namehttp://mediaOutlet.name/):BR
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 


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



Ajax Wizard and feedback

2009-12-04 Thread John Armstrong
Still working on this darn sign-up form in my spare time. I currently
can not get feedback to show up. If I disable javascript it shows up
but using ajax it does not.

In my WizardStep I have the code to add the feedback panel to the
target as a placeholder. (confirmed, its in the DOM hidden). Adding
feedback panel to a RadioGroup:

===
private final class SelectPlan extends WizardStep implements
IDynamicWizardStep {

group.setRequired(true);
final FeedbackPanel feedback = new FeedbackPanel(feedback);
feedback.setOutputMarkupId(true);
feedback.setOutputMarkupPlaceholderTag(true);
if(target != null){
target.addComponent(feedback);
}
group.add(feedback);
===

But on submit I still get this in my dev log
WARN  - WebSession - Component-targetted feedback
message was left unrendered. This could be because you are missing a
FeedbackPanel on the page.  Message: [FeedbackMessage message = Field
'planselection' is required., reporter = planselection, level =
ERROR]

What simple thing am I missing?

John-

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



Re: Resource Location

2009-12-04 Thread Lester Chua

Is there a way to load the css from webapp's context path?

Stefan Droog wrote:

If you use CompressedResourceReference(MyPage.class, MyPage.css); it will 
expect to have the CSS file in the same package as the MyPage.class.

So in your case the css file should be in the following package:
myPackage/Application.java
myPackage/css/jquery/cupertino/jquery-ui-1.7.2.custom.css

Regards,
Stefan

-Original Message-
From: Lester Chua [mailto:cicowic...@gmail.com]
Sent: Friday, December 04, 2009 9:34 AM
To: users@wicket.apache.org
Subject: Re: Resource Location

Do u mean that I did not specify the path?
I thought it's done with css/jquery/cupertino/jquery-ui-1.7.2.custom.css.
Do I need to do a exact path? Or can wicket infer from the webapp
context path?


Marat Radchenko wrote:
  

2009/12/4 Lester Chua cicowic...@gmail.com:



Hi,

I'm attempting to load a css resource.

The example in the wicket reference was using:
private static final CompressedResourceReference MYPAGE_CSS = new
CompressedResourceReference(MyPage.class, MyPage.css);

I understand that this is scoped to MyPage.class

I used
CompressedResourceReference MYPAGE_CSS = new
CompressedResourceReference(css/jquery/cupertino/jquery-ui-1.7.2.custom.css);

add(CSSPackageResource.getHeaderContribution(MYPAGE_CSS));

It is scoped to the application, which it should. But the generated link is:

link rel=stylesheet type=text/css
href=resources/org.apache.wicket.Application/css/jquery/cupertino/jquery-ui-1.7.2.custom.css
view-source:http://localhost:/mirage/resources/org.apache.wicket.Application/css/jquery/cupertino/jquery-ui-1.7.2.custom.css
/

which my browser cannot find. What should be the correct way to do this? I
tried hard referencing as well but did not get it to work as well.

Lester

  

You didn't say where your css file is located.

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







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


The information contained in this communication is confidential, intended 
solely for the use of the individual or entity to whom it is addressed and may 
be legally privileged and protected by professional secrecy. Access to this 
message by anyone else is unauthorized. If you are not the intended recipient, 
any disclosure, copying, or distribution of the message, or any action or 
omission taken by you in reliance on it is prohibited and may be unlawful. 
Please immediately contact the sender if you have received this message in 
error. This email does not constitute any commitment from Cordys Holding BV or 
any of its subsidiaries except when expressly agreed in a written agreement 
between the intended recipient and Cordys Holding BV or its subsidiaries. 
Cordys is neither liable for the proper and complete transmission of the 
information contained in this communication nor for any delay in its receipt. 
Cordys does not guarantee that the integrity of this communication has been 
maintained nor that the communication is free of viruses, interceptions or 
interference. If you are not the intended recipient of this communication 
please return the communication to the sender and delete and destroy all copies.
  




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



Re: Component feedback

2009-12-04 Thread Martin Makundi
You can filter feedback messages.. have a look inside FeedbackPanel.

**
Martin

2009/12/4 Sam Barrow s...@sambarrow.com:
 Hi. I have a FormComponentPanel called MoneyField with a couple of text
 boxes inside.
 Is there any way to make a new MoneyField with a ComponentFeedbackPanel
 that collects all the feedback from the components inside MoneyField?


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



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



Re: Ajax Wizard and feedback

2009-12-04 Thread Martin Makundi
When does the error occur?

**
Martin

2009/12/4 John Armstrong siber...@siberian.org:
 Still working on this darn sign-up form in my spare time. I currently
 can not get feedback to show up. If I disable javascript it shows up
 but using ajax it does not.

 In my WizardStep I have the code to add the feedback panel to the
 target as a placeholder. (confirmed, its in the DOM hidden). Adding
 feedback panel to a RadioGroup:

 ===
 private final class SelectPlan extends WizardStep implements
 IDynamicWizardStep {

 group.setRequired(true);
 final FeedbackPanel feedback = new FeedbackPanel(feedback);
 feedback.setOutputMarkupId(true);
 feedback.setOutputMarkupPlaceholderTag(true);
 if(target != null){
    target.addComponent(feedback);
 }
 group.add(feedback);
 ===

 But on submit I still get this in my dev log
 WARN  - WebSession                 - Component-targetted feedback
 message was left unrendered. This could be because you are missing a
 FeedbackPanel on the page.  Message: [FeedbackMessage message = Field
 'planselection' is required., reporter = planselection, level =
 ERROR]

 What simple thing am I missing?

 John-

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



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



Re: Ajax Wizard and feedback

2009-12-04 Thread John Armstrong
When I click next in the wizard and have not selected an item from the
RadioGroup.

J

On Fri, Dec 4, 2009 at 7:26 AM, Martin Makundi
martin.maku...@koodaripalvelut.com wrote:
 When does the error occur?

 **
 Martin

 2009/12/4 John Armstrong siber...@siberian.org:
 Still working on this darn sign-up form in my spare time. I currently
 can not get feedback to show up. If I disable javascript it shows up
 but using ajax it does not.

 In my WizardStep I have the code to add the feedback panel to the
 target as a placeholder. (confirmed, its in the DOM hidden). Adding
 feedback panel to a RadioGroup:

 ===
 private final class SelectPlan extends WizardStep implements
 IDynamicWizardStep {

 group.setRequired(true);
 final FeedbackPanel feedback = new FeedbackPanel(feedback);
 feedback.setOutputMarkupId(true);
 feedback.setOutputMarkupPlaceholderTag(true);
 if(target != null){
    target.addComponent(feedback);
 }
 group.add(feedback);
 ===

 But on submit I still get this in my dev log
 WARN  - WebSession                 - Component-targetted feedback
 message was left unrendered. This could be because you are missing a
 FeedbackPanel on the page.  Message: [FeedbackMessage message = Field
 'planselection' is required., reporter = planselection, level =
 ERROR]

 What simple thing am I missing?

 John-

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



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



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



onClick Handle ?

2009-12-04 Thread Peter Arnulf Lustig
Hi,

I'd like to create an own Link in the template document. When I create an Link 
via Wicket with an onClick attribute, then it calls the page everytime  I click 
on it. What I need is a Link in that way:

a onclick=funci('8912aja')Click for Item/a

But the 8912aja is created dynamicially, so I can't create them in the template 
manually. Is there any wicket feature, which can helps me? 
Actually I need only the value 8912aja, so I can build it manually.

Thanks.


__
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen 
Massenmails. 
http://mail.yahoo.com

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



Re: Wicket.Ajax.Call.failure: after update wicket from 1.4.1 to 1.4.3

2009-12-04 Thread Igor Vaynberg
first try with latest wicket-1.4.x branch build. if its still there
then open a jira issue.

-igor

2009/12/4 Michał Letyński mletyn...@consol.pl:
 The problem came in wicket 1.4.2 and its connected with NullPointer
 exception which came from wicket-ajax.js - line 1133

 Here is the code:

       if (submitButton!=null) {
           try {
               var btn = document.createElement(input type='hidden'
 name='+submitButton+'                     id='+iframe.id+-btn'
 value='1'/);
           } catch (ex) {
               var btn = document.createElement(input);
               btn.type=hidden;
               btn.name=submitButton;
               btn.id=iframe.id+-btn;
               btn.value=1;
           }
       }
       form.appendChild(btn);      -- buggy line

 This line should be inside the if (submitButton!=null)  statement because in
 my case submitButton is null. Why its null ? In
 AjaxFormSubmitBehavior#getEventHandler() the submitButton is set only when
 getComponent() instanceof IFormSubmittingComponent .
 DropDownChoice is not an instace of IFormSubmittingComponent. Fast
 workaround ? Just change IFormSubmittingComponent to FormComponent both of
 them have key method #getInputName() (with the same logic, this also should
 be changed i think :) )

 Should i add a jira issue for that problem ?


 Michał Letyński pisze:

 Hi i have simple select with AjaxFormSubmitBehavior attached to it. After
 changing selection i get:
 Error:
 Wicket.Ajax.Call.failure: Error while parsing response: Could not find
 root ajax-response element

 Is it a known problem ?

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


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



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



Re: DropDownChoiceWithStylingOptionsT

2009-12-04 Thread Igor Vaynberg
lol

-igor

On Fri, Dec 4, 2009 at 6:43 AM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 Ahh, me too :/ So anyone able feel free to put this in minis.

 2009/12/4 Martin Makundi martin.maku...@koodaripalvelut.com

 Busy... sorry. Feel free to put it.

 2009/12/4 nino martinez wael nino.martinez.w...@gmail.com:
  Martin, why not put something like this in minis?
 
  2009/12/4 Martin Makundi martin.maku...@koodaripalvelut.com
 
  Free4U
 
  public class DropDownChoiceWithStylingOptionsT extends
 DropDownChoiceT
  {
   private String previouslyAppendedOptGroupLabel;
   private int choices;
 
   /**
    * @param id
    * @param choices
    * @param renderer
    */
   public DropDownChoiceWithStylingOptions(String id,
       IModel? extends List? extends T choices,
       IChoiceRenderer? super T renderer) {
     super(id, choices, renderer);
   }
 
   /**
    * @param id
    * @param choices
    */
   public DropDownChoiceWithStylingOptions(String id,
       IModel? extends List? extends T choices) {
     super(id, choices);
   }
 
   /**
    * @param id
    * @param model
    * @param choices
    * @param renderer
    */
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
       IModel? extends List? extends T choices,
       IChoiceRenderer? super T renderer) {
     super(id, model, choices, renderer);
   }
 
   /**
    * @param id
    * @param model
    * @param choices
    */
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
       IModel? extends List? extends T choices) {
     super(id, model, choices);
   }
 
   /**
    * @param id
    * @param model
    * @param data
    * @param renderer
    */
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
       List? extends T data, IChoiceRenderer? super T renderer) {
     super(id, model, data, renderer);
   }
 
   /**
    * @param id
    * @param model
    * @param choices
    */
   public DropDownChoiceWithStylingOptions(String id, IModelT model,
       List? extends T choices) {
     super(id, model, choices);
   }
 
   /**
    * @param id
    * @param data
    * @param renderer
    */
   public DropDownChoiceWithStylingOptions(String id, List? extends T
 data,
       IChoiceRenderer? super T renderer) {
     super(id, data, renderer);
   }
 
   /**
    * @param id
    * @param choices
    */
   public DropDownChoiceWithStylingOptions(String id, List? extends T
  choices) {
     super(id, choices);
   }
 
   /**
    * @param id
    */
   public DropDownChoiceWithStylingOptions(String id) {
     super(id);
   }
 
   /**
    * @see
 
 org.apache.wicket.markup.html.form.AbstractChoice#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
  org.apache.wicket.markup.ComponentTag)
    */
  �...@override
   protected void onComponentTagBody(MarkupStream markupStream,
       ComponentTag openTag) {
     previouslyAppendedOptGroupLabel = null;
     choices = getChoices().size();
     super.onComponentTagBody(markupStream, openTag);
   }
 
   /**
    * @see
 
 org.apache.wicket.markup.html.form.AbstractChoice#appendOptionHtml(org.apache.wicket.util.string.AppendingStringBuffer,
  java.lang.Object, int, java.lang.String)
    */
  �...@override
   protected void appendOptionHtml(AppendingStringBuffer buffer, T choice,
       int index, String selected) {
     AppendingStringBuffer tmp = new AppendingStringBuffer(50);
     super.appendOptionHtml(tmp, choice, index, selected);
 
     if (getChoiceRenderer() instanceof IStyledChoiceRenderer) {
       IStyledChoiceRendererT styledChoiceRenderer =
  (IStyledChoiceRendererT) getChoiceRenderer();
 
       String currentOptGroupLabel =
  styledChoiceRenderer.getOptGroupLabel(choice);
 
       if (!Utils.equalsOrNull(currentOptGroupLabel,
  previouslyAppendedOptGroupLabel)) {
         // OptGroup changed
         if (previouslyAppendedOptGroupLabel != null) {
           endOptGroup(tmp);
         }
         if (currentOptGroupLabel != null) {
           // OptGroup started
           int start = tmp.indexOf(option);
           StringBuilder label = new
  StringBuilder(currentOptGroupLabel.length() + 19);
           label.append(optgroup
  label=\).append(currentOptGroupLabel).append(\);
           tmp.insert(start, label);
         }
       }
 
       if ((currentOptGroupLabel != null)  (index == (choices-1))) {
         // Last option group must end too
         endOptGroup(tmp);
       }
 
       {
         String cssClass =
  styledChoiceRenderer.getOptionCssClassName(choice);
         if (cssClass != null) {
           int start = tmp.indexOf(option);
           tmp.insert(start + 7, new StringBuilder(
  class=\).append(cssClass).append(\));
         }
       }
 
       previouslyAppendedOptGroupLabel = currentOptGroupLabel;
     }
 
     buffer.append(tmp);
   }
 
   /**
    * @param tmp
    */
   private void endOptGroup(AppendingStringBuffer tmp) {
     // OptGroup ended
     int start = tmp.indexOf(/option);
     tmp.insert(start + 9, /optgroup);
   

Re: Resource Location

2009-12-04 Thread Igor Vaynberg
if its in your context path you can simply link to it in the markup
with its context-relative path.

-igor

On Fri, Dec 4, 2009 at 7:13 AM, Lester Chua cicowic...@gmail.com wrote:
 Is there a way to load the css from webapp's context path?

 Stefan Droog wrote:

 If you use CompressedResourceReference(MyPage.class, MyPage.css); it
 will expect to have the CSS file in the same package as the MyPage.class.

 So in your case the css file should be in the following package:
 myPackage/Application.java
 myPackage/css/jquery/cupertino/jquery-ui-1.7.2.custom.css

 Regards,
 Stefan

 -Original Message-
 From: Lester Chua [mailto:cicowic...@gmail.com]
 Sent: Friday, December 04, 2009 9:34 AM
 To: users@wicket.apache.org
 Subject: Re: Resource Location

 Do u mean that I did not specify the path?
 I thought it's done with
 css/jquery/cupertino/jquery-ui-1.7.2.custom.css.
 Do I need to do a exact path? Or can wicket infer from the webapp
 context path?


 Marat Radchenko wrote:


 2009/12/4 Lester Chua cicowic...@gmail.com:



 Hi,

 I'm attempting to load a css resource.

 The example in the wicket reference was using:
 private static final CompressedResourceReference MYPAGE_CSS = new
 CompressedResourceReference(MyPage.class, MyPage.css);

 I understand that this is scoped to MyPage.class

 I used
 CompressedResourceReference MYPAGE_CSS = new

 CompressedResourceReference(css/jquery/cupertino/jquery-ui-1.7.2.custom.css);

 add(CSSPackageResource.getHeaderContribution(MYPAGE_CSS));

 It is scoped to the application, which it should. But the generated link
 is:

 link rel=stylesheet type=text/css

 href=resources/org.apache.wicket.Application/css/jquery/cupertino/jquery-ui-1.7.2.custom.css

 view-source:http://localhost:/mirage/resources/org.apache.wicket.Application/css/jquery/cupertino/jquery-ui-1.7.2.custom.css
 /

 which my browser cannot find. What should be the correct way to do this?
 I
 tried hard referencing as well but did not get it to work as well.

 Lester



 You didn't say where your css file is located.

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






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


 The information contained in this communication is confidential, intended
 solely for the use of the individual or entity to whom it is addressed and
 may be legally privileged and protected by professional secrecy. Access to
 this message by anyone else is unauthorized. If you are not the intended
 recipient, any disclosure, copying, or distribution of the message, or any
 action or omission taken by you in reliance on it is prohibited and may be
 unlawful. Please immediately contact the sender if you have received this
 message in error. This email does not constitute any commitment from Cordys
 Holding BV or any of its subsidiaries except when expressly agreed in a
 written agreement between the intended recipient and Cordys Holding BV or
 its subsidiaries. Cordys is neither liable for the proper and complete
 transmission of the information contained in this communication nor for any
 delay in its receipt. Cordys does not guarantee that the integrity of this
 communication has been maintained nor that the communication is free of
 viruses, interceptions or interference. If you are not the intended
 recipient of this communication please return the communication to the
 sender and delete and destroy all copies.




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



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



Re: FormComponentPanel

2009-12-04 Thread Igor Vaynberg
override convertinput() and check that all three are filled in by
calling getconvertedinput() on the child components

-igor

On Fri, Dec 4, 2009 at 8:39 AM, Sam Barrow s...@sambarrow.com wrote:

 I have a FormComponentPanel called Name with 3 fields.
 Is there a way to set it up so that by filling out one of the fields,
 this makes the other ones required?

 For example if there is an optional Name field on a form it can be
 completely filled out or completely empty, but i dont want somebody
 filling out just one of the fields.



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



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



Re: DropDownChoiceWithStylingOptionsT

2009-12-04 Thread Marat Radchenko
Definitely, lol :)

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



TextArea with list of strings.

2009-12-04 Thread Sam Barrow

I am trying to make a TextArea that allows you to input a list of
strings (separated by a newline) and turns that list into a Collection.
I had it working but it was kind of hacked together, I'm trying to do it
the clean way now.
I have it working except for two things:

If I give it an empty collection for the model object then it display
square brackets [] inside the text area.
I don't have the conversion 100% working. Like when you have a
TextFieldDate, I'm trying to make it do the same thing to each line.
It works, but when it is an invalid value, instead of a nice error
message X is not a valid Y I get a runtime exception from whatever
IConverter I am using.

Source:

public final class CollectionTextAreaType extends
TextAreaCollectionType {

private static final long serialVersionUID = 7147538499297387635L;

private Class? elementType;

public CollectionTextArea(final String id, final Class? elementType)
{
super(id);
setElementType(elementType);
}
public CollectionTextArea(final String id, final Class? elementType,
final IModelCollectionType model) {
super(id, model);
setElementType(elementType);
}

public Class? getElementType() {
return elementType;
}
public void setElementType(Class? elementType) {
this.elementType = elementType;
}

@Override
protected void onBeforeRender() {
super.onBeforeRender();
}
@Override
@SuppressWarnings(unchecked)
protected void convertInput() {
final String text = getRawInput();
final ListType lines = new ArrayListType();
if (text != null) {
for (final String line: text.split(\\r\\n)) {
if (StringUtils.isNotBlank(line)) {
Type value = (Type)
getApplication().getConverterLocator().getConverter(getElementType()).convertToObject(line,
 getLocale());
lines.add(value);
}
}
}
setConvertedInput(lines);
}

}




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



Re: Ajax Wizard and feedback

2009-12-04 Thread John Armstrong
The button itself lives in my ButtonBar class and the buttons
themselves are extensions of AjaxFallbackButtons

public class AjaxWizardButtonBar extends WizardButtonBar

public abstract class AjaxWizardButton extends AjaxFallbackButton

The buttonbar class has an onSubmit method that knows when things are
good or bad (confirmed in a non-AJAX context) but when I run as AJAX
enabled (enabling javascript) onSubmit never fires.

John-


On Fri, Dec 4, 2009 at 9:00 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 where is the code of the ajax button that submits the step?

 -igor

 On Fri, Dec 4, 2009 at 7:08 AM, John Armstrong siber...@siberian.org wrote:
 Still working on this darn sign-up form in my spare time. I currently
 can not get feedback to show up. If I disable javascript it shows up
 but using ajax it does not.

 In my WizardStep I have the code to add the feedback panel to the
 target as a placeholder. (confirmed, its in the DOM hidden). Adding
 feedback panel to a RadioGroup:

 ===
 private final class SelectPlan extends WizardStep implements
 IDynamicWizardStep {

 group.setRequired(true);
 final FeedbackPanel feedback = new FeedbackPanel(feedback);
 feedback.setOutputMarkupId(true);
 feedback.setOutputMarkupPlaceholderTag(true);
 if(target != null){
    target.addComponent(feedback);
 }
 group.add(feedback);
 ===

 But on submit I still get this in my dev log
 WARN  - WebSession                 - Component-targetted feedback
 message was left unrendered. This could be because you are missing a
 FeedbackPanel on the page.  Message: [FeedbackMessage message = Field
 'planselection' is required., reporter = planselection, level =
 ERROR]

 What simple thing am I missing?

 John-

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



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



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



Re: TextArea with list of strings.

2009-12-04 Thread Igor Vaynberg
you should do convertToObject() call in a try block, catch any
exception and throw a conversionexception

-igor

On Fri, Dec 4, 2009 at 11:32 AM, Sam Barrow s...@sambarrow.com wrote:

 I am trying to make a TextArea that allows you to input a list of
 strings (separated by a newline) and turns that list into a Collection.
 I had it working but it was kind of hacked together, I'm trying to do it
 the clean way now.
 I have it working except for two things:

 If I give it an empty collection for the model object then it display
 square brackets [] inside the text area.
 I don't have the conversion 100% working. Like when you have a
 TextFieldDate, I'm trying to make it do the same thing to each line.
 It works, but when it is an invalid value, instead of a nice error
 message X is not a valid Y I get a runtime exception from whatever
 IConverter I am using.

 Source:

 public final class CollectionTextAreaType extends
 TextAreaCollectionType {

        private static final long serialVersionUID = 7147538499297387635L;

        private Class? elementType;

        public CollectionTextArea(final String id, final Class? elementType)
 {
                super(id);
                setElementType(elementType);
        }
        public CollectionTextArea(final String id, final Class? elementType,
 final IModelCollectionType model) {
                super(id, model);
                setElementType(elementType);
        }

        public Class? getElementType() {
                return elementType;
        }
        public void setElementType(Class? elementType) {
                this.elementType = elementType;
        }

       �...@override
        protected void onBeforeRender() {
                super.onBeforeRender();
        }
       �...@override
       �...@suppresswarnings(unchecked)
        protected void convertInput() {
                final String text = getRawInput();
                final ListType lines = new ArrayListType();
                if (text != null) {
                        for (final String line: text.split(\\r\\n)) {
                                if (StringUtils.isNotBlank(line)) {
                                        Type value = (Type)
 getApplication().getConverterLocator().getConverter(getElementType()).convertToObject(line,
  getLocale());
                                        lines.add(value);
                                }
                        }
                }
                setConvertedInput(lines);
        }

 }




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



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



Re: Ajax Wizard and feedback

2009-12-04 Thread Igor Vaynberg
does your button also properly implement onerror() ?

-igor

On Fri, Dec 4, 2009 at 11:35 AM, John Armstrong siber...@siberian.org wrote:
 The button itself lives in my ButtonBar class and the buttons
 themselves are extensions of AjaxFallbackButtons

 public class AjaxWizardButtonBar extends WizardButtonBar

 public abstract class AjaxWizardButton extends AjaxFallbackButton

 The buttonbar class has an onSubmit method that knows when things are
 good or bad (confirmed in a non-AJAX context) but when I run as AJAX
 enabled (enabling javascript) onSubmit never fires.

 John-


 On Fri, Dec 4, 2009 at 9:00 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 where is the code of the ajax button that submits the step?

 -igor

 On Fri, Dec 4, 2009 at 7:08 AM, John Armstrong siber...@siberian.org wrote:
 Still working on this darn sign-up form in my spare time. I currently
 can not get feedback to show up. If I disable javascript it shows up
 but using ajax it does not.

 In my WizardStep I have the code to add the feedback panel to the
 target as a placeholder. (confirmed, its in the DOM hidden). Adding
 feedback panel to a RadioGroup:

 ===
 private final class SelectPlan extends WizardStep implements
 IDynamicWizardStep {

 group.setRequired(true);
 final FeedbackPanel feedback = new FeedbackPanel(feedback);
 feedback.setOutputMarkupId(true);
 feedback.setOutputMarkupPlaceholderTag(true);
 if(target != null){
    target.addComponent(feedback);
 }
 group.add(feedback);
 ===

 But on submit I still get this in my dev log
 WARN  - WebSession                 - Component-targetted feedback
 message was left unrendered. This could be because you are missing a
 FeedbackPanel on the page.  Message: [FeedbackMessage message = Field
 'planselection' is required., reporter = planselection, level =
 ERROR]

 What simple thing am I missing?

 John-

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



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



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



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



wizard and datagrid

2009-12-04 Thread Fernando Wermus
Hi all,
I have,

Step 1 which the user selects something

Steps 2 which a datagrid is shown which depends in a model that is
associated with the selection from step 1.


The fact is that I never see any change in the datagrid. I review several
times if the model associated with the datagrid has accurate info and it
does have.

I cannot figure it out how to refresh the datagrid the time the step 2 is
shown (I dont have any need to setModel again)

thanks in advance


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: wizard and datagrid

2009-12-04 Thread Fernando Wermus
I added this to make it work, but I dont see the need. Why?

@Override

protected void onBeforeRender() {

final UsersModel w=(UsersModel) getModelObject();

DataGrid g=(DataGrid) get(grid);

g.setModel(w.lookForUsers());

super.onBeforeRender();

}

This model was set up before. The only difference it is that the model
injected in DataGrid depends in another model that was set up in the first
step.

If I dont do this it actually  ignores the right data.


On Fri, Dec 4, 2009 at 6:41 PM, Fernando Wermus
fernando.wer...@gmail.comwrote:

 Hi all,
 I have,

 Step 1 which the user selects something

 Steps 2 which a datagrid is shown which depends in a model that is
 associated with the selection from step 1.


 The fact is that I never see any change in the datagrid. I review several
 times if the model associated with the datagrid has accurate info and it
 does have.

 I cannot figure it out how to refresh the datagrid the time the step 2 is
 shown (I dont have any need to setModel again)

 thanks in advance


 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: TextArea with list of strings.

2009-12-04 Thread Igor Vaynberg
so walk the code and see where your ConversionException is being
wrapped by a RuntimeException

-igor

On Fri, Dec 4, 2009 at 1:08 PM, Sam Barrow s...@sambarrow.com wrote:
 That's what I'm doing, but i still get the conversion exception

 public final class EmailAddressConverter implements IConverter {

        private static final long serialVersionUID = -4264887925119691218L;

       �...@override
        public Object convertToObject(final String value, final Locale locale)
 {
                if (StringUtils.isNotBlank(value)) {
                        if (Valid.emailAddress(value)) {
                                return new EmailAddress(value);
                        }
                        else {
                                throw new ConversionException(Invalid email 
 address.);
                        }
                }
                else {
                        return null;
                }
        }
       �...@override
        public String convertToString(final Object value, final Locale locale)
 {
                return value.toString();
        }

 }


 On Fri, 2009-12-04 at 12:16 -0800, Igor Vaynberg wrote:
 you should do convertToObject() call in a try block, catch any
 exception and throw a conversionexception

 -igor

 On Fri, Dec 4, 2009 at 11:32 AM, Sam Barrow s...@sambarrow.com wrote:
 
  I am trying to make a TextArea that allows you to input a list of
  strings (separated by a newline) and turns that list into a Collection.
  I had it working but it was kind of hacked together, I'm trying to do it
  the clean way now.
  I have it working except for two things:
 
  If I give it an empty collection for the model object then it display
  square brackets [] inside the text area.
  I don't have the conversion 100% working. Like when you have a
  TextFieldDate, I'm trying to make it do the same thing to each line.
  It works, but when it is an invalid value, instead of a nice error
  message X is not a valid Y I get a runtime exception from whatever
  IConverter I am using.
 
  Source:
 
  public final class CollectionTextAreaType extends
  TextAreaCollectionType {
 
         private static final long serialVersionUID = 7147538499297387635L;
 
         private Class? elementType;
 
         public CollectionTextArea(final String id, final Class? 
  elementType)
  {
                 super(id);
                 setElementType(elementType);
         }
         public CollectionTextArea(final String id, final Class? 
  elementType,
  final IModelCollectionType model) {
                 super(id, model);
                 setElementType(elementType);
         }
 
         public Class? getElementType() {
                 return elementType;
         }
         public void setElementType(Class? elementType) {
                 this.elementType = elementType;
         }
 
        �...@override
         protected void onBeforeRender() {
                 super.onBeforeRender();
         }
        �...@override
        �...@suppresswarnings(unchecked)
         protected void convertInput() {
                 final String text = getRawInput();
                 final ListType lines = new ArrayListType();
                 if (text != null) {
                         for (final String line: text.split(\\r\\n)) {
                                 if (StringUtils.isNotBlank(line)) {
                                         Type value = (Type)
  getApplication().getConverterLocator().getConverter(getElementType()).convertToObject(line,
   getLocale());
                                         lines.add(value);
                                 }
                         }
                 }
                 setConvertedInput(lines);
         }
 
  }
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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



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



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



Re: TextArea with list of strings.

2009-12-04 Thread Sam Barrow
No I'm getting a ConversionException, I must have made a typo. But for
the single text field I get a message in the feedback panel.

On Fri, 2009-12-04 at 13:25 -0800, Igor Vaynberg wrote:
 so walk the code and see where your ConversionException is being
 wrapped by a RuntimeException
 
 -igor
 
 On Fri, Dec 4, 2009 at 1:08 PM, Sam Barrow s...@sambarrow.com wrote:
  That's what I'm doing, but i still get the conversion exception
 
  public final class EmailAddressConverter implements IConverter {
 
 private static final long serialVersionUID = -4264887925119691218L;
 
 @Override
 public Object convertToObject(final String value, final Locale 
  locale)
  {
 if (StringUtils.isNotBlank(value)) {
 if (Valid.emailAddress(value)) {
 return new EmailAddress(value);
 }
 else {
 throw new ConversionException(Invalid email 
  address.);
 }
 }
 else {
 return null;
 }
 }
 @Override
 public String convertToString(final Object value, final Locale 
  locale)
  {
 return value.toString();
 }
 
  }
 
 
  On Fri, 2009-12-04 at 12:16 -0800, Igor Vaynberg wrote:
  you should do convertToObject() call in a try block, catch any
  exception and throw a conversionexception
 
  -igor
 
  On Fri, Dec 4, 2009 at 11:32 AM, Sam Barrow s...@sambarrow.com wrote:
  
   I am trying to make a TextArea that allows you to input a list of
   strings (separated by a newline) and turns that list into a Collection.
   I had it working but it was kind of hacked together, I'm trying to do it
   the clean way now.
   I have it working except for two things:
  
   If I give it an empty collection for the model object then it display
   square brackets [] inside the text area.
   I don't have the conversion 100% working. Like when you have a
   TextFieldDate, I'm trying to make it do the same thing to each line.
   It works, but when it is an invalid value, instead of a nice error
   message X is not a valid Y I get a runtime exception from whatever
   IConverter I am using.
  
   Source:
  
   public final class CollectionTextAreaType extends
   TextAreaCollectionType {
  
  private static final long serialVersionUID = 7147538499297387635L;
  
  private Class? elementType;
  
  public CollectionTextArea(final String id, final Class? 
   elementType)
   {
  super(id);
  setElementType(elementType);
  }
  public CollectionTextArea(final String id, final Class? 
   elementType,
   final IModelCollectionType model) {
  super(id, model);
  setElementType(elementType);
  }
  
  public Class? getElementType() {
  return elementType;
  }
  public void setElementType(Class? elementType) {
  this.elementType = elementType;
  }
  
  @Override
  protected void onBeforeRender() {
  super.onBeforeRender();
  }
  @Override
  @SuppressWarnings(unchecked)
  protected void convertInput() {
  final String text = getRawInput();
  final ListType lines = new ArrayListType();
  if (text != null) {
  for (final String line: text.split(\\r\\n)) {
  if (StringUtils.isNotBlank(line)) {
  Type value = (Type)
   getApplication().getConverterLocator().getConverter(getElementType()).convertToObject(line,
getLocale());
  lines.add(value);
  }
  }
  }
  setConvertedInput(lines);
  }
  
   }
  
  
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 


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

Re: TextArea with list of strings.

2009-12-04 Thread Igor Vaynberg
ok, override convertValue() instead of convertInput() and then the
exception will be handled for you

-igor

On Fri, Dec 4, 2009 at 1:39 PM, Sam Barrow s...@sambarrow.com wrote:
 No I'm getting a ConversionException, I must have made a typo. But for
 the single text field I get a message in the feedback panel.

 On Fri, 2009-12-04 at 13:25 -0800, Igor Vaynberg wrote:
 so walk the code and see where your ConversionException is being
 wrapped by a RuntimeException

 -igor

 On Fri, Dec 4, 2009 at 1:08 PM, Sam Barrow s...@sambarrow.com wrote:
  That's what I'm doing, but i still get the conversion exception
 
  public final class EmailAddressConverter implements IConverter {
 
         private static final long serialVersionUID = -4264887925119691218L;
 
        �...@override
         public Object convertToObject(final String value, final Locale 
  locale)
  {
                 if (StringUtils.isNotBlank(value)) {
                         if (Valid.emailAddress(value)) {
                                 return new EmailAddress(value);
                         }
                         else {
                                 throw new ConversionException(Invalid 
  email address.);
                         }
                 }
                 else {
                         return null;
                 }
         }
        �...@override
         public String convertToString(final Object value, final Locale 
  locale)
  {
                 return value.toString();
         }
 
  }
 
 
  On Fri, 2009-12-04 at 12:16 -0800, Igor Vaynberg wrote:
  you should do convertToObject() call in a try block, catch any
  exception and throw a conversionexception
 
  -igor
 
  On Fri, Dec 4, 2009 at 11:32 AM, Sam Barrow s...@sambarrow.com wrote:
  
   I am trying to make a TextArea that allows you to input a list of
   strings (separated by a newline) and turns that list into a Collection.
   I had it working but it was kind of hacked together, I'm trying to do it
   the clean way now.
   I have it working except for two things:
  
   If I give it an empty collection for the model object then it display
   square brackets [] inside the text area.
   I don't have the conversion 100% working. Like when you have a
   TextFieldDate, I'm trying to make it do the same thing to each line.
   It works, but when it is an invalid value, instead of a nice error
   message X is not a valid Y I get a runtime exception from whatever
   IConverter I am using.
  
   Source:
  
   public final class CollectionTextAreaType extends
   TextAreaCollectionType {
  
          private static final long serialVersionUID = 
   7147538499297387635L;
  
          private Class? elementType;
  
          public CollectionTextArea(final String id, final Class? 
   elementType)
   {
                  super(id);
                  setElementType(elementType);
          }
          public CollectionTextArea(final String id, final Class? 
   elementType,
   final IModelCollectionType model) {
                  super(id, model);
                  setElementType(elementType);
          }
  
          public Class? getElementType() {
                  return elementType;
          }
          public void setElementType(Class? elementType) {
                  this.elementType = elementType;
          }
  
         �...@override
          protected void onBeforeRender() {
                  super.onBeforeRender();
          }
         �...@override
         �...@suppresswarnings(unchecked)
          protected void convertInput() {
                  final String text = getRawInput();
                  final ListType lines = new ArrayListType();
                  if (text != null) {
                          for (final String line: text.split(\\r\\n)) {
                                  if (StringUtils.isNotBlank(line)) {
                                          Type value = (Type)
   getApplication().getConverterLocator().getConverter(getElementType()).convertToObject(line,
getLocale());
                                          lines.add(value);
                                  }
                          }
                  }
                  setConvertedInput(lines);
          }
  
   }
  
  
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

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

Re: TextArea with list of strings.

2009-12-04 Thread Sam Barrow
I'll try that.
What about the problem with the square brackets? I can't find a function
to override that allows me to format the text inside the textarea

On Fri, 2009-12-04 at 14:01 -0800, Igor Vaynberg wrote:
 ok, override convertValue() instead of convertInput() and then the
 exception will be handled for you
 
 -igor
 
 On Fri, Dec 4, 2009 at 1:39 PM, Sam Barrow s...@sambarrow.com wrote:
  No I'm getting a ConversionException, I must have made a typo. But for
  the single text field I get a message in the feedback panel.
 
  On Fri, 2009-12-04 at 13:25 -0800, Igor Vaynberg wrote:
  so walk the code and see where your ConversionException is being
  wrapped by a RuntimeException
 
  -igor
 
  On Fri, Dec 4, 2009 at 1:08 PM, Sam Barrow s...@sambarrow.com wrote:
   That's what I'm doing, but i still get the conversion exception
  
   public final class EmailAddressConverter implements IConverter {
  
  private static final long serialVersionUID = 
   -4264887925119691218L;
  
  @Override
  public Object convertToObject(final String value, final Locale 
   locale)
   {
  if (StringUtils.isNotBlank(value)) {
  if (Valid.emailAddress(value)) {
  return new EmailAddress(value);
  }
  else {
  throw new ConversionException(Invalid 
   email address.);
  }
  }
  else {
  return null;
  }
  }
  @Override
  public String convertToString(final Object value, final Locale 
   locale)
   {
  return value.toString();
  }
  
   }
  
  
   On Fri, 2009-12-04 at 12:16 -0800, Igor Vaynberg wrote:
   you should do convertToObject() call in a try block, catch any
   exception and throw a conversionexception
  
   -igor
  
   On Fri, Dec 4, 2009 at 11:32 AM, Sam Barrow s...@sambarrow.com wrote:
   
I am trying to make a TextArea that allows you to input a list of
strings (separated by a newline) and turns that list into a 
Collection.
I had it working but it was kind of hacked together, I'm trying to do 
it
the clean way now.
I have it working except for two things:
   
If I give it an empty collection for the model object then it display
square brackets [] inside the text area.
I don't have the conversion 100% working. Like when you have a
TextFieldDate, I'm trying to make it do the same thing to each line.
It works, but when it is an invalid value, instead of a nice error
message X is not a valid Y I get a runtime exception from whatever
IConverter I am using.
   
Source:
   
public final class CollectionTextAreaType extends
TextAreaCollectionType {
   
   private static final long serialVersionUID = 
7147538499297387635L;
   
   private Class? elementType;
   
   public CollectionTextArea(final String id, final Class? 
elementType)
{
   super(id);
   setElementType(elementType);
   }
   public CollectionTextArea(final String id, final Class? 
elementType,
final IModelCollectionType model) {
   super(id, model);
   setElementType(elementType);
   }
   
   public Class? getElementType() {
   return elementType;
   }
   public void setElementType(Class? elementType) {
   this.elementType = elementType;
   }
   
   @Override
   protected void onBeforeRender() {
   super.onBeforeRender();
   }
   @Override
   @SuppressWarnings(unchecked)
   protected void convertInput() {
   final String text = getRawInput();
   final ListType lines = new ArrayListType();
   if (text != null) {
   for (final String line: text.split(\\r\\n)) {
   if (StringUtils.isNotBlank(line)) {
   Type value = (Type)
getApplication().getConverterLocator().getConverter(getElementType()).convertToObject(line,
 getLocale());
   lines.add(value);
   }
   }
   }
   setConvertedInput(lines);
   }
   
}
   
   
   
   
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
  
   

Re: Ajax Wizard and feedback

2009-12-04 Thread John Armstrong
My problem was 4 fold (after multiple iterations of problems)

1) I was overriding onError in both AjaxButton and AjaxButtonBar so my
AjaxButton version was ignored
2) I am using the default ButtonBar html which has a component called
'feedback' in it, this dup'd my nested feedback form (merely
confusing for me)
4) I was showing the -wrong- feedback panel (see 2)
5) My signup feedback was within the RadioGroup which made its path
unique across my wizard steps. I had to move it out of a nested
context so it was generalized.

So my final result at the button level.

protected void onError(AjaxRequestTarget target, Form form) {
Component feedback = form.get(view:signupfeedback);
target.addComponent(feedback);
}

The form.get(view:signupfeedback) seems fragile to me but I guess in
this case its general enough that it won't break as long as I put my
feedback panel at the top level.

Tips/suggestions welcome but its working now, thanks for the
direction, it made my day-

J

On Fri, Dec 4, 2009 at 12:16 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 does your button also properly implement onerror() ?

 -igor

 On Fri, Dec 4, 2009 at 11:35 AM, John Armstrong siber...@siberian.org wrote:
 The button itself lives in my ButtonBar class and the buttons
 themselves are extensions of AjaxFallbackButtons

 public class AjaxWizardButtonBar extends WizardButtonBar

 public abstract class AjaxWizardButton extends AjaxFallbackButton

 The buttonbar class has an onSubmit method that knows when things are
 good or bad (confirmed in a non-AJAX context) but when I run as AJAX
 enabled (enabling javascript) onSubmit never fires.

 John-


 On Fri, Dec 4, 2009 at 9:00 AM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 where is the code of the ajax button that submits the step?

 -igor

 On Fri, Dec 4, 2009 at 7:08 AM, John Armstrong siber...@siberian.org 
 wrote:
 Still working on this darn sign-up form in my spare time. I currently
 can not get feedback to show up. If I disable javascript it shows up
 but using ajax it does not.

 In my WizardStep I have the code to add the feedback panel to the
 target as a placeholder. (confirmed, its in the DOM hidden). Adding
 feedback panel to a RadioGroup:

 ===
 private final class SelectPlan extends WizardStep implements
 IDynamicWizardStep {

 group.setRequired(true);
 final FeedbackPanel feedback = new FeedbackPanel(feedback);
 feedback.setOutputMarkupId(true);
 feedback.setOutputMarkupPlaceholderTag(true);
 if(target != null){
    target.addComponent(feedback);
 }
 group.add(feedback);
 ===

 But on submit I still get this in my dev log
 WARN  - WebSession                 - Component-targetted feedback
 message was left unrendered. This could be because you are missing a
 FeedbackPanel on the page.  Message: [FeedbackMessage message = Field
 'planselection' is required., reporter = planselection, level =
 ERROR]

 What simple thing am I missing?

 John-

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



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



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



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



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



Re: TextArea with list of strings.

2009-12-04 Thread Igor Vaynberg
overrwrite getmodelvalue() and convert it to string there

-igor

On Fri, Dec 4, 2009 at 2:10 PM, Sam Barrow s...@sambarrow.com wrote:
 I'll try that.
 What about the problem with the square brackets? I can't find a function
 to override that allows me to format the text inside the textarea

 On Fri, 2009-12-04 at 14:01 -0800, Igor Vaynberg wrote:
 ok, override convertValue() instead of convertInput() and then the
 exception will be handled for you

 -igor

 On Fri, Dec 4, 2009 at 1:39 PM, Sam Barrow s...@sambarrow.com wrote:
  No I'm getting a ConversionException, I must have made a typo. But for
  the single text field I get a message in the feedback panel.
 
  On Fri, 2009-12-04 at 13:25 -0800, Igor Vaynberg wrote:
  so walk the code and see where your ConversionException is being
  wrapped by a RuntimeException
 
  -igor
 
  On Fri, Dec 4, 2009 at 1:08 PM, Sam Barrow s...@sambarrow.com wrote:
   That's what I'm doing, but i still get the conversion exception
  
   public final class EmailAddressConverter implements IConverter {
  
          private static final long serialVersionUID = 
   -4264887925119691218L;
  
         �...@override
          public Object convertToObject(final String value, final Locale 
   locale)
   {
                  if (StringUtils.isNotBlank(value)) {
                          if (Valid.emailAddress(value)) {
                                  return new EmailAddress(value);
                          }
                          else {
                                  throw new ConversionException(Invalid 
   email address.);
                          }
                  }
                  else {
                          return null;
                  }
          }
         �...@override
          public String convertToString(final Object value, final Locale 
   locale)
   {
                  return value.toString();
          }
  
   }
  
  
   On Fri, 2009-12-04 at 12:16 -0800, Igor Vaynberg wrote:
   you should do convertToObject() call in a try block, catch any
   exception and throw a conversionexception
  
   -igor
  
   On Fri, Dec 4, 2009 at 11:32 AM, Sam Barrow s...@sambarrow.com wrote:
   
I am trying to make a TextArea that allows you to input a list of
strings (separated by a newline) and turns that list into a 
Collection.
I had it working but it was kind of hacked together, I'm trying to 
do it
the clean way now.
I have it working except for two things:
   
If I give it an empty collection for the model object then it display
square brackets [] inside the text area.
I don't have the conversion 100% working. Like when you have a
TextFieldDate, I'm trying to make it do the same thing to each 
line.
It works, but when it is an invalid value, instead of a nice error
message X is not a valid Y I get a runtime exception from whatever
IConverter I am using.
   
Source:
   
public final class CollectionTextAreaType extends
TextAreaCollectionType {
   
       private static final long serialVersionUID = 
7147538499297387635L;
   
       private Class? elementType;
   
       public CollectionTextArea(final String id, final Class? 
elementType)
{
               super(id);
               setElementType(elementType);
       }
       public CollectionTextArea(final String id, final Class? 
elementType,
final IModelCollectionType model) {
               super(id, model);
               setElementType(elementType);
       }
   
       public Class? getElementType() {
               return elementType;
       }
       public void setElementType(Class? elementType) {
               this.elementType = elementType;
       }
   
      �...@override
       protected void onBeforeRender() {
               super.onBeforeRender();
       }
      �...@override
      �...@suppresswarnings(unchecked)
       protected void convertInput() {
               final String text = getRawInput();
               final ListType lines = new ArrayListType();
               if (text != null) {
                       for (final String line: text.split(\\r\\n)) 
{
                               if (StringUtils.isNotBlank(line)) {
                                       Type value = (Type)
getApplication().getConverterLocator().getConverter(getElementType()).convertToObject(line,
 getLocale());
                                       lines.add(value);
                               }
                       }
               }
               setConvertedInput(lines);
       }
   
}
   
   
   
   
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
  
   

Re: Ajax Wizard and feedback

2009-12-04 Thread Igor Vaynberg
 protected void onError(final AjaxRequestTarget target, Form form) {
   form.visit(FormComponentPanel.class, new
VisitorFormComponentPanel() {
   visitComponent(FormComponentPanel component) {
   target.addComponent(feedback);
   return CONTINUE_TRAVERSAL_BUT_DO_NOT_GO_DEEPER;
  }}}

-igor

On Fri, Dec 4, 2009 at 2:28 PM, John Armstrong siber...@siberian.org wrote:
 My problem was 4 fold (after multiple iterations of problems)

 1) I was overriding onError in both AjaxButton and AjaxButtonBar so my
 AjaxButton version was ignored
 2) I am using the default ButtonBar html which has a component called
 'feedback' in it, this dup'd my nested feedback form (merely
 confusing for me)
 4) I was showing the -wrong- feedback panel (see 2)
 5) My signup feedback was within the RadioGroup which made its path
 unique across my wizard steps. I had to move it out of a nested
 context so it was generalized.

 So my final result at the button level.

        protected void onError(AjaxRequestTarget target, Form form) {
                Component feedback = form.get(view:signupfeedback);
                target.addComponent(feedback);
        }

 The form.get(view:signupfeedback) seems fragile to me but I guess in
 this case its general enough that it won't break as long as I put my
 feedback panel at the top level.

 Tips/suggestions welcome but its working now, thanks for the
 direction, it made my day-

 J

 On Fri, Dec 4, 2009 at 12:16 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 does your button also properly implement onerror() ?

 -igor

 On Fri, Dec 4, 2009 at 11:35 AM, John Armstrong siber...@siberian.org 
 wrote:
 The button itself lives in my ButtonBar class and the buttons
 themselves are extensions of AjaxFallbackButtons

 public class AjaxWizardButtonBar extends WizardButtonBar

 public abstract class AjaxWizardButton extends AjaxFallbackButton

 The buttonbar class has an onSubmit method that knows when things are
 good or bad (confirmed in a non-AJAX context) but when I run as AJAX
 enabled (enabling javascript) onSubmit never fires.

 John-


 On Fri, Dec 4, 2009 at 9:00 AM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 where is the code of the ajax button that submits the step?

 -igor

 On Fri, Dec 4, 2009 at 7:08 AM, John Armstrong siber...@siberian.org 
 wrote:
 Still working on this darn sign-up form in my spare time. I currently
 can not get feedback to show up. If I disable javascript it shows up
 but using ajax it does not.

 In my WizardStep I have the code to add the feedback panel to the
 target as a placeholder. (confirmed, its in the DOM hidden). Adding
 feedback panel to a RadioGroup:

 ===
 private final class SelectPlan extends WizardStep implements
 IDynamicWizardStep {

 group.setRequired(true);
 final FeedbackPanel feedback = new FeedbackPanel(feedback);
 feedback.setOutputMarkupId(true);
 feedback.setOutputMarkupPlaceholderTag(true);
 if(target != null){
    target.addComponent(feedback);
 }
 group.add(feedback);
 ===

 But on submit I still get this in my dev log
 WARN  - WebSession                 - Component-targetted feedback
 message was left unrendered. This could be because you are missing a
 FeedbackPanel on the page.  Message: [FeedbackMessage message = Field
 'planselection' is required., reporter = planselection, level =
 ERROR]

 What simple thing am I missing?

 John-

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



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



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



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



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



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



Re: FileUploadField in a ModalWindow (wicket 1.4.3)?

2009-12-04 Thread Igor Vaynberg
1.4

-igor

On Fri, Dec 4, 2009 at 2:13 PM, Doug Leeper douglee...@yahoo.com wrote:

 1.4 trunk or 1.5 trunk?
 --
 View this message in context: 
 http://old.nabble.com/FileUploadField-in-a-ModalWindow-%28wicket-1.4.3%29--tp26577255p26641953.html
 Sent from the Wicket - User 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



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



Closing ModalWindows on page with multiple modal windows

2009-12-04 Thread Ed _

Hi,

I have a page with several panels each of them them have links that open modal 
windows. Essentially there are a number of modal windows on the page most are 
hidden.  They all open up and I am able to close them with the Cross (X) link. 


In one of the modal windows the content has an ajaxLink that closes the modal 
window.


AjaxLink cancelSyncLink = new AjaxLink(CloseWindowLink) {
@Override
public void onClick(AjaxRequestTarget target) {

log.info(CloseWindowLink called);
modalWindow.closeCurrent(target);
   // modalWindow.close(target);
}
};


The function gets called but the modal window does not close. 

I have tried both closeCurrent and close calls.


The same works on a page that has only one ModalWindow. 


Any ideas how I can fix this. 


thanks!
  
_
Windows Live Hotmail gives you a free,exclusive  gift.
http://www.microsoft.com/windows/windowslive/hotmail_bl1/hotmail_bl1.aspx?ocid=PID23879::T:WLMTAGL:ON:WL:en-ww:WM_IMHM_7:092009

RE: Closing ModalWindows on page with multiple modal windows

2009-12-04 Thread Ed _

Using version 1.4.3

Would really ppreciate suggestions.

 From: ed_b...@hotmail.com
 To: users@wicket.apache.org
 Subject: Closing ModalWindows on page with multiple modal windows
 Date: Fri, 4 Dec 2009 15:09:22 -0800
 
 
 Hi,
 
 I have a page with several panels each of them them have links that open 
 modal windows. Essentially there are a number of modal windows on the page 
 most are hidden.  They all open up and I am able to close them with the Cross 
 (X) link. 
 
 
 In one of the modal windows the content has an ajaxLink that closes the modal 
 window.
 
 
 AjaxLink cancelSyncLink = new AjaxLink(CloseWindowLink) {
 @Override
 public void onClick(AjaxRequestTarget target) {
 
 log.info(CloseWindowLink called);
 modalWindow.closeCurrent(target);
// modalWindow.close(target);
 }
 };
 
 
 The function gets called but the modal window does not close. 
 
 I have tried both closeCurrent and close calls.
 
 
 The same works on a page that has only one ModalWindow. 
 
 
 Any ideas how I can fix this. 
 
 
 thanks!
 
 _
 Windows Live Hotmail gives you a free,exclusive  gift.
 http://www.microsoft.com/windows/windowslive/hotmail_bl1/hotmail_bl1.aspx?ocid=PID23879::T:WLMTAGL:ON:WL:en-ww:WM_IMHM_7:092009
  
_
Windows 7: Unclutter your desktop. Learn more.
http://www.microsoft.com/windows/windows-7/videos-tours.aspx?h=7secslideid=1media=aero-shake-7secondlistid=1stop=1ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_7secdemo:122009

RE: Closing ModalWindows on page with multiple modal windows

2009-12-04 Thread Ed _

And the application is  throwing an exception. On repeated tries to close the 
ModalWindow via the AjaxLink

[2009-12-04 16:45:34,942]ERROR [http-8080-4] (RequestCycle.java:1521) - 
org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap 
modal-dialog-pagemap is still locked by: Thread[http-8080-6,5,main], giving up 
trying to get the page for path: 2:CloseWindowLink
Begin of stack trace of Thread[http-8080-6,5,main]
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:474)
org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:416)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)
java.lang.Thread.run(Thread.java:613)
End of stack trace of Thread[http-8080-6,5,main]
org.apache.wicket.protocol.http.request.InvalidUrlException: 
org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap 
modal-dialog-pagemap is still locked by: Thread[http-8080-6,5,main], giving up 
trying to get the page for path: 2:CloseWindowLink
Begin of stack trace of Thread[http-8080-6,5,main]
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:474)
org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:416)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)
java.lang.Thread.run(Thread.java:613)
End of stack trace of Thread[http-8080-6,5,main]
at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468)
at 
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:613)
Caused by: org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap 
modal-dialog-pagemap is still locked by: Thread[http-8080-6,5,main], giving up 
trying to get the page for path: 2:CloseWindowLink
Begin of stack trace of Thread[http-8080-6,5,main]
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:474)
org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:416)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)
java.lang.Thread.run(Thread.java:613)
End of stack trace of Thread[http-8080-6,5,main]
at org.apache.wicket.Session.getPage(Session.java:769)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:458)
at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
... 20 more


 From: ed_b...@hotmail.com
 To: users@wicket.apache.org
 Subject: RE: Closing ModalWindows on page with multiple modal windows
 Date: Fri, 4 Dec 2009 15:21:36 -0800
 
 
 Using version 1.4.3
 
 Would really ppreciate suggestions.
 
  From: ed_b...@hotmail.com
  To: users@wicket.apache.org
  Subject: Closing ModalWindows on page with multiple modal windows
  Date: Fri, 4 Dec 2009 15:09:22 -0800
  
  
  Hi,
  
  I have a page with several panels each of them them have links that open 
  modal windows. Essentially there are a number of modal windows on the page 
  most are hidden.  They all open up and I am able to close them with the 
  Cross (X) link. 
  
  
  In one of the modal windows the content has an ajaxLink that closes the 
  modal window.
  
  
  AjaxLink cancelSyncLink = new AjaxLink(CloseWindowLink) {
  @Override
  public void onClick(AjaxRequestTarget target) {
 

Re: FileUploadField in a ModalWindow (wicket 1.4.3)?

2009-12-04 Thread Doug Leeper

I have created a quick start and attached it to WICKET-2595.  I have also
included my suggested fixes to Form.java and wicket-ajax.js.  It got past
the problem of not submitting in an iframe but my AjaxButton.onSubmit is not
being called  and there are no errors generated.

Hope this helps.

- Doug
-- 
View this message in context: 
http://old.nabble.com/FileUploadField-in-a-ModalWindow-%28wicket-1.4.3%29--tp26577255p26652425.html
Sent from the Wicket - User 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



Add method in wicket 1.4.3

2009-12-04 Thread Johan den Boer
Hi

I am new to wicket so this question may already been answered. In my java
class which is extended from WebPage I can not add a Label.

add(new Label(message, Hello World))

does not work. Is this method been replaced in 1.4.3

can you point me to the url so i can read about it or can you give me an
answer

thanks a lot


Johan


Re: Add method in wicket 1.4.3

2009-12-04 Thread Igor Vaynberg
im pretty sure its still there

-igor

On Fri, Dec 4, 2009 at 10:12 PM, Johan den Boer
johanj.denb...@gmail.com wrote:
 Hi

 I am new to wicket so this question may already been answered. In my java
 class which is extended from WebPage I can not add a Label.

 add(new Label(message, Hello World))

 does not work. Is this method been replaced in 1.4.3

 can you point me to the url so i can read about it or can you give me an
 answer

 thanks a lot


 Johan


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



Re: Add method in wicket 1.4.3

2009-12-04 Thread Johan den Boer

No is not working. 

the error message is 

The method add(Component[]) in the type MarkupContainer is not applicable
for the arguments (Label)

I am using eclipse 3.5 and maven. In my pom file 

  dependencies
dependency
  groupIdorg.apache.wicket/groupId
  artifactIdwicket/artifactId
  version1.4.3/version
/dependency
  /dependencies

here is my java class

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;

public class Index extends WebPage {

public Index() {
add(new Label(message, Hello Wicket));  
}
}

the add method
 




igor.vaynberg wrote:
 
 im pretty sure its still there
 
 -igor
 
 On Fri, Dec 4, 2009 at 10:12 PM, Johan den Boer
 johanj.denb...@gmail.com wrote:
 Hi

 I am new to wicket so this question may already been answered. In my java
 class which is extended from WebPage I can not add a Label.

 add(new Label(message, Hello World))

 does not work. Is this method been replaced in 1.4.3

 can you point me to the url so i can read about it or can you give me an
 answer

 thanks a lot


 Johan

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

-- 
View this message in context: 
http://old.nabble.com/Add-method-in-wicket-1.4.3-tp26653262p26653357.html
Sent from the Wicket - User 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: Add method in wicket 1.4.3

2009-12-04 Thread Igor Vaynberg
wicket 1.4.3 is jdk5+

-igor

On Fri, Dec 4, 2009 at 10:46 PM, Johan den Boer
johanj.denb...@gmail.com wrote:

 No is not working.

 the error message is

 The method add(Component[]) in the type MarkupContainer is not applicable
 for the arguments (Label)

 I am using eclipse 3.5 and maven. In my pom file

  dependencies
    dependency
      groupIdorg.apache.wicket/groupId
      artifactIdwicket/artifactId
      version1.4.3/version
    /dependency
  /dependencies

 here is my java class

 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;

 public class Index extends WebPage {

        public Index() {
                add(new Label(message, Hello Wicket));
        }
 }

 the add method





 igor.vaynberg wrote:

 im pretty sure its still there

 -igor

 On Fri, Dec 4, 2009 at 10:12 PM, Johan den Boer
 johanj.denb...@gmail.com wrote:
 Hi

 I am new to wicket so this question may already been answered. In my java
 class which is extended from WebPage I can not add a Label.

 add(new Label(message, Hello World))

 does not work. Is this method been replaced in 1.4.3

 can you point me to the url so i can read about it or can you give me an
 answer

 thanks a lot


 Johan


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




 --
 View this message in context: 
 http://old.nabble.com/Add-method-in-wicket-1.4.3-tp26653262p26653357.html
 Sent from the Wicket - User 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



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



Re: Add method in wicket 1.4.3

2009-12-04 Thread Johan den Boer

Hi,

ok, now is working

thanks





igor.vaynberg wrote:
 
 wicket 1.4.3 is jdk5+
 
 -igor
 
 On Fri, Dec 4, 2009 at 10:46 PM, Johan den Boer
 johanj.denb...@gmail.com wrote:

 No is not working.

 the error message is

 The method add(Component[]) in the type MarkupContainer is not applicable
 for the arguments (Label)

 I am using eclipse 3.5 and maven. In my pom file

  dependencies
    dependency
      groupIdorg.apache.wicket/groupId
      artifactIdwicket/artifactId
      version1.4.3/version
    /dependency
  /dependencies

 here is my java class

 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;

 public class Index extends WebPage {

        public Index() {
                add(new Label(message, Hello Wicket));
        }
 }

 the add method





 igor.vaynberg wrote:

 im pretty sure its still there

 -igor

 On Fri, Dec 4, 2009 at 10:12 PM, Johan den Boer
 johanj.denb...@gmail.com wrote:
 Hi

 I am new to wicket so this question may already been answered. In my
 java
 class which is extended from WebPage I can not add a Label.

 add(new Label(message, Hello World))

 does not work. Is this method been replaced in 1.4.3

 can you point me to the url so i can read about it or can you give me
 an
 answer

 thanks a lot


 Johan


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




 --
 View this message in context:
 http://old.nabble.com/Add-method-in-wicket-1.4.3-tp26653262p26653357.html
 Sent from the Wicket - User 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


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

-- 
View this message in context: 
http://old.nabble.com/Add-method-in-wicket-1.4.3-tp26653262p26653404.html
Sent from the Wicket - User 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



How to return specific HTTP result code on HTTP request

2009-12-04 Thread Petr Fejfar
Hi all,

I'm not able to find-out how to respond on HTTP request
(via mounted URL) by setting HTTP result code
to specific value e.g. 402 (Payment required) etc...

Pls, could somebody push me forward?


Thx, pf

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



Remote Image Generation Null Pointer

2009-12-04 Thread bassglider
Hi Everyone,

I am attempting to load an image that takes some time.  I can load a
remote image using the URL, but when it takes time to gather the data
and then get the url, I get this:

[java] 11174 [btpool0-1] ERROR org.apache.wicket.RequestCycle -
Exception in rendering component: [Component id = image]
[java] org.apache.wicket.WicketRuntimeException: Exception in
rendering component: [Component id = image]
[java] at
org.apache.wicket.Component.renderComponent(Component.java:2656)
[java] at
org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:62)
[java] at org.apache.wicket.Component.render(Component.java:2448)


I read that it could be from the thread expiring or the page trying to
modify itself after it is rendered(?)

So I tried adding this to my Application

 @Override
 protected void init() {
   super.init();

   //remove thread monitoring from resource watcher
   this.getResourceSettings().setResourcePollFrequency(null);
 }


It had no effect on the issue.  Any suggestions or remedies would be
greatly appreciated.

Here is the code I am using:


 Image dynamicImage = new Image(image);
   dynamicImage.add(new AttributeModifier(src, true, new
AbstractReadOnlyModelObject() {

 private static final long serialVersionUID = 1L;

 /**
  * {...@inheritdoc}
  */
 @Override
 public final Object getObject() {
   GoogleChart chart = new GoogleChart(http://xx:/x/;);
   String url = chart.getChart (value, 2009-11-15, 2009-11-15,
   , july, true, false );
   System.out.println(GETCHART URL:  + url);
   //String url = http://xx/PleaseStandBy.jpg;;
   return url;
 }
   }));
   dynamicImage.setOutputMarkupId(true);
   add(dynamicImage);

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