Feedback panel message

2008-10-20 Thread Steve Thompson
I've got a panel for which I am building a number of DropDownChoices.
Each must be selected, and if any one of them is not, a message must
be displayed in the corresponding feedback panel.  The problem however
is that, with my HTML as such:

table
   tr wicket:id=reasons
  tdspan wicket:id=description//td
  tdselect wicket:id=options name=options//td
   /tr
/table

the ${label} is always 'options' of course.  How could I associate
different DropDownChoice components in this scenario with a little bit
more legible name (like 'description')

Let me know and best regards,


Steve

--

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



Re: Feedback panel message

2008-10-20 Thread Steve Thompson
Dane -

Thanks, this worked like a charm!

On 10/20/08, Dane Laverty [EMAIL PROTECTED] wrote:
 Like so:

   DropDownChoice myDropDownChoice = new DropDownChoice(...);
   myDropDownChoice.setLabel(new Model(Description));
   add(myDropDownChoice);

 Hope that helps.

 -Original Message-
 From: Steve Thompson [mailto:[EMAIL PROTECTED]
 Sent: Monday, October 20, 2008 12:49 PM
 To: users@wicket.apache.org
 Subject: Feedback panel message

 I've got a panel for which I am building a number of DropDownChoices.
 Each must be selected, and if any one of them is not, a message must
 be displayed in the corresponding feedback panel.  The problem however
 is that, with my HTML as such:

 table
tr wicket:id=reasons
   tdspan wicket:id=description//td
   tdselect wicket:id=options name=options//td
/tr
 /table

 the ${label} is always 'options' of course.  How could I associate
 different DropDownChoice components in this scenario with a little bit
 more legible name (like 'description')

 Let me know and best regards,


 Steve

 --

 -
 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]



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



Custom Text Field...

2008-10-07 Thread Steve Thompson
Hi,

I'm attempting to create a custom validator for social security number
strings.  I've got the following code for this:

static Pattern pattern = Pattern.compile((\\d{3})[ \\-]*(\\d{2})[
\\-]*(\\d{4}));

public final IConverterString getConverter(Class type)
{
return new IConverterString()
{

public String convertToObject(String value, Locale 
locale)
{
String result = ;
result = value.substring(0, 3) + - + 
value.substring(3, 5) + -
+ value.substring(5, 8);
return result;
}

public String convertToString(String value, Locale 
locale)
{
String result = ;
Matcher fit = pattern.matcher(value);
if(fit.find())
for(int index = 1; index = fit.groupCount(); index++)
result += fit.group(index);
return result;
}

};
}

When I use this with a text field, I can intercept the calls to
convertToString.  However, convertToObject never seems to be getting
called.  Is there something that I am doing wrong/not understanding?

Thanks and best regards,


Steve

--

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



Need some clarification on AjaxBehaviors

2008-10-07 Thread Steve Thompson
I was recently working on creating some Ajax functionality that, when
a record was added/updated/deleted in my form would display some
informational label that would gradually fade away.  While I can get
this to work, I would like to refactor this into some type of reusable
behavior.  Is this possible, and if so, how might it be done?

One approach that I've tried that did not work was adding a custom
AjaxBehavior to the submit (itself an AjaxButton).  I was expecting
that perhaps the behavior could be invoked after the buttons onSubmit
method, but I haven't figured out how to make this happen.  Am I on
the right track?

Any ideas would be greatly appreciated,


Steve

--

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



Re: Custom Text Field...

2008-10-07 Thread Steve Thompson
Timo -

Thanks for your response.

I did use a PatternValidator alone in my first approach, but while I
could verify that '123-45-6789' was a legitimate SSN, what I wanted to
additionally do was fill in my model object's string with '123456789'.
 Now, if the setSsn() in the model object needs to incorporate this
behavior, I can live with that, but I thought it would be cleaner to
convert to/from the model using a custom converter.

Here is the full text (sans imports) of the SsnTextField:

public class SsnTextFieldT extends TextFieldT
{
static Pattern pattern = Pattern.compile((\\d{3})[ \\-]*(\\d{2})[
\\-]*(\\d{4}));
public SsnTextField(String id)
{
this(id, null);
}

public SsnTextField(String id, IModelT object)
{
super(id, object);
add(new PatternValidator(pattern));
}

@Override
public final IConverterString getConverter(Class type)
{
return new IConverterString()
{

public String convertToObject(String value, Locale 
locale)
{
String result = ;
result = value.substring(0, 3) + - + 
value.substring(3, 5) + -
+ value.substring(5, 8);
return result;
}

public String convertToString(String value, Locale 
locale)
{
String result = ;
Matcher fit = pattern.matcher(value);
if(fit.find())
for(int index = 1; index = fit.groupCount(); index++)
result += fit.group(index);
return result;
}

};
}

}


On 10/7/08, Timo Rantalaiho [EMAIL PROTECTED] wrote:
 On Tue, 07 Oct 2008, Steve Thompson wrote:
 I'm attempting to create a custom validator for social security number
 strings.  I've got the following code for this:
 ...
  public final IConverterString getConverter(Class type)

 Are you overriding getConverter?

 For custom validation, your better off using validators
 rather than converter for that. Check out the form
 validation examples.

 Basically your approach should work as well, it's just
 weird design to do validation in conversion, especially as
 your IConverter returns Strings and not ready-made
 SocialSecurityNumbers. But we'd need to see more code to be
 able to help debugging it. Make sure that your form
 component gets submitted.

 Best wishes,
 Timo


 -
 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]



Extra control needed for PropertyColumn

2008-06-03 Thread Steve Thompson
I'm creating a AjaxFallbackDefaultDataTable, just as shown in the live
examples, and things are working great.  My only problem though is
that I would like to scramble one of the columns of information that I
present depending on the user (in this case, the column holds SSN, and
I want it to appear as XXX-XX-1234 for most users).

Is there a way to do this easily?  Does it require building a custom
version of AbstractColumn?

Let me know and best regards as always,


Steve

--

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



Forcing An AjaxTabbedPanel To Refresh...

2008-05-09 Thread Steve Thompson
I've set up a page such that it contains two panels - one with a form
for selecting an individual, and the other with an AjaxTabbedPanel to
show information on different aspects of a given individual.  The
hierarchy is roughly like so:

Page
- Panel
---Form with drop down to select individual
- Panel
---AjaxTabbedPanel

My problem is that when I select the individual from the first panel
and capture this event via Ajax, I can't seem to make the current tab
page of the AjaxTabbedPanel refresh.  Other tab pages indicate the
individual chosen, but not the tab page visible when the choice was
made.  Is there any easy way to tell the whole AjaxTabbedPanel (or
even its parent panel) to update all tab pages immediately?

Let me know and best regards to all,


Steve

--

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



Re: good WicketTester info page?

2008-04-16 Thread Steve Thompson
Check out Kent Tong's book, in which he has an excellent chapter on testing
Wicket pages/forms/components.

On Wed, Apr 16, 2008 at 6:40 AM, Michael Perkonigg 
[EMAIL PROTECTED] wrote:

 Hello,

 is there a page explaining what one can do with the WicketTester and how?
 And yes, I already read http://cwiki.apache.org/WICKET/testing-pages.htmlit's 
 just not very clear what can be done and, more important, cannot be
 done.

 Thanks,
 Mike


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




Wicket - Servlet - Wicket

2008-03-05 Thread Steve Thompson
My team is currently working on a web project composed of a entirely
of plain old servlets.  We are looking at potentially replacing it
with Wicket, but we do not have the luxury of rewriting the entire
project, and would need to integrate Wicket gradually with the
existant functionality.

Is there an easy way via Wicket to create the request parameters that
would need to be passed to the servlets?  Any examples you could
provide would be very much appreciated, as would any insights from
those who might have taken such a hybrid approach in the past.

Thanks and best regards,


Steve

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



Re: Question About Locale

2008-01-25 Thread Steve Thompson
On 1/25/08, Michael Sparer [EMAIL PROTECTED] wrote:

 steve,

 wicket by default checks the user's locale (i.e. the locale of the session)
 and looks for matching files. e.g. if your user accesses Foo.html with the
 german locale de wicket checks whether there is a Foo_de.html (and/or
 Foo_de.properties) file existing.
 Have a look at http://cwiki.apache.org/WICKET/general-i18n-in-wicket.html


Thanks for the link Michael.  Unfortunately, this doesn't really
address my issue.  Let me explain it a bit better.

I have a client that has a page consisting of a number of terms and
definitions, akin conceptually to a dictionary.  What the client wants
is for each term to possibly be shown in a number of different
languages.  So picture if you will a bunch of flags associated with a
particular term.  If I click on the French flag, I see not only the
default locale version of the term and its definition, but also the
French as well.  Likewise, if I then click on the Chinese flag, I'm
looking at the term in three languages.

My issue is that support for locales will be an incremental thing;
while I have produced the English version of the terms and
definitions, the client can come up with support for other languages
at their leisure.  As this is the case, I would like to make this
support as intelligent as possible, which means that the application
should be able to detect when there is a new property file (Spanish
say) and automatically offer support for it on the page.

I'll be the first to confess that to me, this sounds like an unusual
scenario.  If it can't be done in a clean fashion, I am open to other
suggestions as well.

Thanks and best regards as always,


Steve

--

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



Question About Locale

2008-01-24 Thread Steve Thompson
I have a customer who has requested the ability to view multiple
locales on a page.  It looks like I can do this fine with Wicket
through the use of properties files, but what I would like to do is
automatically detect which locales there are properties files for.  Is
this possible, and if so, how?

Best regards to all,


Steve Thompson

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