IntegerConverter cannot parse or display locale specific format like 999,999

2008-04-07 Thread MYoung

[Sorry if this shows up twice. I emailed this in the morning but that didn't
show.]

I want a Label to display Integer as 999,999,999 but it's not happening.

The problem is in abstractIntegerConverter:

public NumberFormat getNumberFormat(Locale locale)
{
NumberFormat numberFormat = (NumberFormat)numberFormats.get(locale);
if (numberFormat == null)
{
numberFormat = NumberFormat.getIntegerInstance(locale);
numberFormat.setParseIntegerOnly(true);
numberFormat.setGroupingUsed(false); //
 !!! why set to false?
numberFormats.put(locale, numberFormat);
}
return (NumberFormat)numberFormat.clone();
}


Because setGroupingUsed(false), IntegerConverter cannot parse locale
formatted input like 999,999(raise conversion exception) or output in
locale specific format. DecimalConverter is not like this.

Is there some specific reason to call setGroupingUsed(false)?  Can we have
this remove?
-- 
View this message in context: 
http://www.nabble.com/IntegerConverter-cannot-parse-or-display-locale-specific-format-like-%22999%2C999%22-tp16540785p16540785.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to make a PopupWindow non-resizable?

2008-03-05 Thread MYoung

The default new PopupSettings() makes a resizable popup and I don't see a
flag to turn resizable to off.
-- 
View this message in context: 
http://www.nabble.com/How-to-make-a-PopupWindow-non-resizable--tp15863664p15863664.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Why PopupCloseLink doesn't close my popup?

2008-03-05 Thread MYoung

I must be doing it wrong.  I have this in my  popup template:

lt;a wicket:id=closeMegt;Closelt;/agt;


In java:

add(new PopupCloseLink(closeMe) {
 @Override public void onClick() {
   // HERE HERE
}
});

onClick() is called but the popup window stays.

Another question, how to get notify  when the popup is close by clicking on
the close box on the browser window's title bar?
-- 
View this message in context: 
http://www.nabble.com/Why-PopupCloseLink-doesn%27t-close-my-popup--tp15863742p15863742.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to make Eclipse 3.3 run JUnit4 Test?

2008-02-28 Thread MYoung

Sorry for being way off topic here but I couldn't find the answer with my
search.  I would be very grateful if someone give me some help with this.

Basically I have the JUnit 4.4 jar in my Build Path, I decorated my test
methods with @Test, code compile with no error.  But when I try to run as a
JUnit test, Eclipse complaints:

No test found with test runner 'JUnit 3'.

What do I need to do to make Eclipse run JUnit4?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/How-to-make-Eclipse-3.3-run-JUnit4-Test--tp15748485p15748485.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to make Eclipse 3.3 run JUnit4 Test?

2008-02-28 Thread MYoung

Never mind. I found the answer.  RunOpen Run Dialog... and change to JUnit4
runner.
-- 
View this message in context: 
http://www.nabble.com/How-to-make-Eclipse-3.3-run-JUnit4-Test--tp15748485p15752427.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Where to put external css file for mvn jetty:run?

2008-02-23 Thread MYoung

I use the Quickstart mvn archetype to generate my project, then use mvn
jetty:run to run the project.

In my template, I have:

head
titleMy Project/title
link rel=stylesheet type=text/css href=css/aquastyle.css
/head

Where should aquastyle.css be in my source so mvn jetty:run can place in
the right place for Wicket when I run my project?

-- 
View this message in context: 
http://www.nabble.com/Where-to-put-external-css-file-for-mvn-jetty%3Arun--tp15657334p15657334.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Where to put external css file for mvn jetty:run?

2008-02-23 Thread MYoung

Never mind.  I figured it out.  Put css/aquastyle.css next to WEB-INF in the
source.
-- 
View this message in context: 
http://www.nabble.com/Where-to-put-external-css-file-for-mvn-jetty%3Arun--tp15657334p15657629.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DataTable: how to make a column showing the row number?

2008-02-23 Thread MYoung

Like the first column here, just whatever the row's number is:

++-+
| No.   |  Names |
++-+
| 1 | AAA   |
++-+
| 2 | AAA   |
++-+
| 3 | AAA   |
++-+
| 4 | AAA   |
++-+
| 5 | AAA   |
++-+
| 6 | AAA   |
++-+
| 7 | AAA   |
++-+
| 8 | AAA   |
++-+

I can't find a way to determine the row number in
AbstractColumn.populateItem:

columnOne = new AbstractColumn() {
public void populateItem(Item cell, String compId, IModel rowModel) {
int whatIsMyRowNumber
cell.add(new Label(compId, whatIsMyRowNumber);
}
};

columnTwo = 

-- 
View this message in context: 
http://www.nabble.com/DataTable%3A-how-to-make-a-column-showing-the-row-number--tp15660105p15660105.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Howto use .xhtml instead of .html for template file extension

2008-02-23 Thread MYoung

I follow this: 

http://cwiki.apache.org/confluence/display/WICKET/Use+a+different+extension+for+template+files

added this to MyPage:

@Override
public String getMarkupType() {
return xhtml;
}

and it doesn't work.  Firefox wants to download the file instead of showing
the page.
http://www.nabble.com/file/p15660192/no-go-xhtml.jpg 

IE7 cannot even download the file.

What am I doing wrong?
-- 
View this message in context: 
http://www.nabble.com/Howto-use-.xhtml-instead-of-.html-for-template-file-extension-tp15660192p15660192.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DataTable: how to make a column showing the row number?

2008-02-23 Thread MYoung


igor.vaynberg wrote:
 
 ...item.getparent()
 

I tried it and gives me a RepeatingView, not a Item.


igor.vaynberg wrote:
 
  public void populateItem(Item cell, String compId, IModel rowModel) {
 item.getindex() is cell, ((item)item.getparent()).getindex() is row
 
 -igor
 
 
 On Sat, Feb 23, 2008 at 6:43 PM, MYoung [EMAIL PROTECTED] wrote:

  Like the first column here, just whatever the row's number is:

  ++-+
  | No.   |  Names |
  ++-+
  | 1 | AAA   |
  ++-+
  | 2 | AAA   |
  ++-+
  | 3 | AAA   |
  ++-+
  | 4 | AAA   |
  ++-+
  | 5 | AAA   |
  ++-+
  | 6 | AAA   |
  ++-+
  | 7 | AAA   |
  ++-+
  | 8 | AAA   |
  ++-+

  I can't find a way to determine the row number in
  AbstractColumn.populateItem:

  columnOne = new AbstractColumn() {
 public void populateItem(Item cell, String compId, IModel rowModel) {
 int whatIsMyRowNumber
 cell.add(new Label(compId, whatIsMyRowNumber);
 }
  };

  columnTwo = 

  --
  View this message in context:
 http://www.nabble.com/DataTable%3A-how-to-make-a-column-showing-the-row-number--tp15660105p15660105.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/DataTable%3A-how-to-make-a-column-showing-the-row-number--tp15660105p15660310.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DataTable: how to make a column showing the row number?

2008-02-23 Thread MYoung

Ok, I got it.

item.getParent() is a RepeatingView

item.getParent().getParent() is the row's Item.  So

((Item)item.getParent().getParent()).getIndex()

gives me the answer.

Thanks!


igor.vaynberg wrote:
 
  public void populateItem(Item cell, String compId, IModel rowModel) {
 item.getindex() is cell, ((item)item.getparent()).getindex() is row
 
 -igor
 
 
 On Sat, Feb 23, 2008 at 6:43 PM, MYoung [EMAIL PROTECTED] wrote:

  Like the first column here, just whatever the row's number is:

  ++-+
  | No.   |  Names |
  ++-+
  | 1 | AAA   |
  ++-+
  | 2 | AAA   |
  ++-+
  | 3 | AAA   |
  ++-+
  | 4 | AAA   |
  ++-+
  | 5 | AAA   |
  ++-+
  | 6 | AAA   |
  ++-+
  | 7 | AAA   |
  ++-+
  | 8 | AAA   |
  ++-+

  I can't find a way to determine the row number in
  AbstractColumn.populateItem:

  columnOne = new AbstractColumn() {
 public void populateItem(Item cell, String compId, IModel rowModel) {
 int whatIsMyRowNumber
 cell.add(new Label(compId, whatIsMyRowNumber);
 }
  };

  columnTwo = 

  --
  View this message in context:
 http://www.nabble.com/DataTable%3A-how-to-make-a-column-showing-the-row-number--tp15660105p15660105.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/DataTable%3A-how-to-make-a-column-showing-the-row-number--tp15660105p15660521.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Howto use .xhtml instead of .html for template file extension

2008-02-22 Thread MYoung

I follow this: 

http://cwiki.apache.org/confluence/display/WICKET/Use+a+different+extension+for+template+files

added this to MyPage:

@Override
public String getMarkupType() {
return xhtml;
}

and it doesn't work.  Firefox wants to download the file instead of showing
the page.
http://www.nabble.com/file/p15641885/no-go-xhtml.jpg 

IE7 cannot even download the file.

What am I doing wrong?
-- 
View this message in context: 
http://www.nabble.com/Howto-use-.xhtml-instead-of-.html-for-template-file-extension-tp15641885p15641885.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Where to find the Wicket DTD file?

2008-02-21 Thread MYoung

Is it available somewhere?  I need it for validation in the Eclipse Amsteras
HTML editor and to get rid of all its warning about wicket tags in html
file.
-- 
View this message in context: 
http://www.nabble.com/Where-to-find-the-Wicket-DTD-file--tp15618525p15618525.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Where to find documentation for Wicket tags?

2008-02-21 Thread MYoung

Are they documented?
-- 
View this message in context: 
http://www.nabble.com/Where-to-find-documentation-for-Wicket-tags--tp15618680p15618680.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket for beginners?

2008-02-21 Thread MYoung

try this:
http://www.theserverside.com/tt/articles/article.tss?l=IntroducingApacheWicket

It explains the basic very well.


tdope21 wrote:
 
 
 I am a fairly new developer and I'm going to be using Wicket on and
 upcoming project. Are there any materials for beginners out there covering
 Wicket? 
 
 
 Tony
 

-- 
View this message in context: 
http://www.nabble.com/Wicket-for-beginners--tp15618724p15619063.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Where to find the Wicket DTD file?

2008-02-21 Thread MYoung


...place the following in your HTML template...
 
 html xmlns:wicket=http://wicket.sourceforge.net/;
 xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 
That doesn't seem to make it stop the warnings.  Seems Amsteras actually
validates and it wants to have the DTD. Is there a Wicket DTD File
somewhere?  Here is its Eclipse Preference to the real DTDs:

http://www.nabble.com/file/p15620940/amsteras.png 



robert.mcguinness wrote:
 
 
 MYoung wrote:
 
 Is it available somewhere?  I need it for validation in the Eclipse
 Amsteras HTML editor and to get rid of all its warning about wicket tags
 in html file.
 
 
 ...place the following in your HTML template...
 
 html xmlns:wicket=http://wicket.sourceforge.net/;
 xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 
 ...this should remove the warnings in Eclipse.  
 
 

-- 
View this message in context: 
http://www.nabble.com/Where-to-find-the-Wicket-DTD-file--tp15618525p15620940.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to make a Form work both Ajax and no Ajax?

2008-02-21 Thread MYoung

I have the Ajax stuff working in my form.  I want to use the same form
(placed on a WebPage) to handle when JS is off, I override the onSubmit()
for when JS is off.  But this must be wrong because the
AjaxFormSubmitBehavior no longer gets call, only the onSubmit is called.

Form f = new Form(f, new CompoundPropertyModel(this)) {
@Override
public void onSubmit() {
handleRatingChanged(null);   // good when JS if off, 
but how to
make the Ajax stuff work
   // when JS is
back on?
}
};
f.setOutputMarkupId(true);
f.add(new TextField(rating, Integer.class));
add(f);
  
//
// Ajax stuff, after the onSubmit is overridden in the form, this is
no longer work!
//
f.add(new AjaxFormSubmitBehavior(onsubmit) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
handleRatingChanged(target);
}
@Override
protected void onError(AjaxRequestTarget target) {

}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
public CharSequence decorateScript(CharSequence 
script) {
return script +  return false;;   
}
};
}
});



-- 
View this message in context: 
http://www.nabble.com/How-to-make-a-Form-work-both-Ajax-and-no-Ajax--tp15628207p15628207.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What is the Wicket way to redirect?

2008-02-20 Thread MYoung

In my Checkout page if there is nothing to checkout, I want to bounce to the
ShowCatalog page with an error message.  I did it this way:

class Checkout extends WebPage {
public Checkout() {
if (thereIsNothingToCheckout()) {
error(You have nothing to checkout);
setResponsePage(ShowCatalog.class);
return;
}

// continue to checkout

}
}

Is this the right way?
-- 
View this message in context: 
http://www.nabble.com/What-is-the-Wicket-way-to-redirect--tp15600869p15600869.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Wicket DTD?

2008-02-20 Thread MYoung

I use the Amateras Eclipse HTML editor, it raises warnings on wicket element.

It can register DTD (Window  Preferences  Amateras  DTD /
XMLSchema).  Where is the Wicket DTD?  Better yet, anyone exactly how to
configure Amateras to know the Wicket namespace?
-- 
View this message in context: 
http://www.nabble.com/Wicket-DTD--tp15605079p15605079.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to find all error resourceKeys of a form field?

2008-02-19 Thread MYoung

Hi, I'm learning wicket and I have a hard time determining the resourceKey of
a component.

In my code:

Form form = new Form(myForm) 

TextField weight = new TextField(weight, Integer.class);
weight.setRequired(true);
weight.add(NumberValidator.minimum(0));
form.add(weight);


Since I call

weight.setRequired(true);
weight.add(NumberValidator.minimum(0));

I know I need at least the resourceKeys for these two cases.

By looking into the NumberValidator.java source, I can find the resourceKey
for 'minimum' is myForm.weight.NumberValidator.minimum.  I know
setRequired corresponds to 'myForm.weight.Required' from other example.

But what about other resourceKey?  How do I find what they are?  For
example, entering 'xyz' will result in 'xyz' is not a valid Integer.  How to
find what this resourceKey is?

In general, what is the way to find out all possible error resourceKeys?
-- 
View this message in context: 
http://www.nabble.com/How-to-find-all-error-resourceKeys-of-a-form-field--tp15577859p15577859.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to find all error resourceKeys of a form field?

2008-02-19 Thread MYoung

Ok, for the validators I added to the component, I can lookup the source. 
What about the TextField's data conversion error message?  Where to look
that up?


igor.vaynberg wrote:
 
 there is no way to find out what resource key the validator will check
 other then read the javadoc where they should be specified. by default
 we follow a convention that validator uses the resource key of its
 class name
 
 so NumberValidator will use a resource key NumberValidator
 StringValidator.minimum will use StringValidator.minimum, etc
 
 -igor
 
 
 On Feb 19, 2008 2:54 PM, MYoung [EMAIL PROTECTED] wrote:

 Hi, I'm learning wicket and I have a hard time determining the
 resourceKey of
 a component.

 In my code:

 Form form = new Form(myForm) 

 TextField weight = new TextField(weight, Integer.class);
 weight.setRequired(true);
 weight.add(NumberValidator.minimum(0));
 form.add(weight);


 Since I call

 weight.setRequired(true);
 weight.add(NumberValidator.minimum(0));

 I know I need at least the resourceKeys for these two cases.

 By looking into the NumberValidator.java source, I can find the
 resourceKey
 for 'minimum' is myForm.weight.NumberValidator.minimum.  I know
 setRequired corresponds to 'myForm.weight.Required' from other example.

 But what about other resourceKey?  How do I find what they are?  For
 example, entering 'xyz' will result in 'xyz' is not a valid Integer.  How
 to
 find what this resourceKey is?

 In general, what is the way to find out all possible error resourceKeys?
 --
 View this message in context:
 http://www.nabble.com/How-to-find-all-error-resourceKeys-of-a-form-field--tp15577859p15577859.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-find-all-error-resourceKeys-of-a-form-field--tp15577859p15579102.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]