Re: Default Focus Behavior?

2008-03-10 Thread Nino Saturnino Martinez Vazquez Wael
What I mean is commonly used when users must enter data quickly, eg no 
mouse clicks. Not sure if the use case is large enough, though..


So the following thing can happend:

When you fill a textfield to a certain length(or press enter) or choose 
a radio button it automaticly passes on to the next tab order.. :


User comes to the form page(or wizard with multible steps)
Fills in data by using only keyboard and numeric pad(for selecting 
radios etc)...


Does that clarify anything?

And yes tab order should be followed..

regards Nino

Sebastiaan van Erk wrote:
I think he means that, suppose you have a username and password field; 
then if the username is already filled in (e.g. from a cookie), then 
focus should go to the next field (password field).


It probably should be the same as the tab order (first empty field in 
tab order gets focus) from a ui perspective...


Regards,
Sebastiaan

James Carman wrote:

I don't think I understand what you mean here.  Do you mean something
like setting the tab order like in Swing?

On 3/9/08, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

What about a chaining component?

 EG you enter something in form.field a, and when thats filled then it
 jumps to form field b..? Etc...



 regards Nino

 James Carman wrote:


On 3/9/08, Warren [EMAIL PROTECTED] wrote:

 
  WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag);
   bodyTag.add(new SimpleAttributeModifier(onload,
   form.username.focus();));
 
 
  Ok, but wouldn't it be cooler/easier/more java-oriented to do:
 
  TextField userName = new TextField(userName);
  userName.addBehavior(new DefaultFocusBehavior());
 
  or
 
  Behaviors.defaultFocus(userName); // Assuming Behaviors existed.
 
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of James Carman
Sent: Sunday, March 09, 2008 7:58 AM
To: users@wicket.apache.org
Subject: Default Focus Behavior?
   
   
Is there a behavior (or some other way) for having a field 
receive the
focus when the page loads?  For instance, in a login form, 
you'd want
the focus to go to the username field or perhaps the password 
field if

you've got remember me turned on.
   
 
 
  
-

 
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]
 
 
 

 --

-Wicket for love
 -Jme for fun

 Nino Martinez Wael
 Java Specialist @ Jayway DK
 http://www.jayway.dk
 +45 2936 7684


 -

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]



--
-Wicket for love
-Jme for fun

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: AjaxBehaviour how to question

2008-03-10 Thread Igor Vaynberg
there are two ways to do it:

either use ajaxrequesttarget.appendjavascript() instead of behavior

or write a behavior that uses renderhead() to output the javascript
and override istemporary to return true - that way it is removed at
the end of the request.

-igor


On Sun, Mar 9, 2008 at 6:39 PM, atul singh [EMAIL PROTECTED] wrote:
 How can i write an ajax behaviour which does not have its own callback, but
  just appends javascript to an existing AjaxRequestTarget.
  I want this so that i can write a fading feed back panel, which will be
  added to AjaxRequestTarget of an ajax form submission.

  What I want is something like this::
  *the behaviour---*
  public class AjaxFadeBehaviour extends AbstractAjaxBehavior{
 private IModel fadingNeededIModel;
 public AjaxFadeBehaviour() {
 super();
 }

 /**
  * Use a boolean value wrapped in an IModel to know if fading effect is
  needed.
  * This can be useful in situations for example when info messages need
  to fade away while error messages need not.
  * @param fadingNeededIModel
  */
 public AjaxFadeBehaviour(IModel fadingNeededIModel) {
 super();
 this.fadingNeededIModel = fadingNeededIModel;
 }

 public void onRequest() {
 System.out.println(on request called);
 if(fadingNeededIModel!=null){
 if(Strings.isTrue((String) fadingNeededIModel.getObject()))

  
 ((AjaxRequestTarget)RequestCycle.get().getRequestTarget()).appendJavascript(new
  Effect.Fade($('
 + getComponent().getMarkupId() + ')););
 }
 }
  }

  *the feedback component ---
  *public class AjaxFadingFeedbackPanel extends FeedbackPanel{

 public AjaxFadingFeedbackPanel(String id, IFeedbackMessageFilter filter)
  {
 super(id, filter);
 setOutputMarkupId(true);
 final AbstractReadOnlyModel fadingNeededModel=new
  AbstractReadOnlyModel(){
 @Override
 public Object getObject() {
 return anyMessage(FeedbackMessage.INFO);
 }
 };
 add(new AjaxFadeBehaviour(fadingNeededModel));
 }

 public AjaxFadingFeedbackPanel(String id) {
 this(id,null);
 }

  }

  I am not able to achieve this because onRequest() does not get called for
  AjaxFadeBehaviour.
  I am confused about which class I should extend to achieve this??


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



Re: append a converter or coversion function

2008-03-10 Thread Igor Vaynberg
no, upper case string is not a special type, not unless you do not
use String to represent it...like i said, my suggestion is to do this
via a model decorator. further, something like this doesnt even sound
like it belongs in the web layer - sounds like a business requirement
which should be enforced by the setter of the bussiness pojo.

-igor


On Sun, Mar 9, 2008 at 7:57 PM,  [EMAIL PROTECTED] wrote:
 I used the trick it worked great. Thanks very much.
  Should it be considered a bug?
  What is interesting before using setType is that getConverter is actually
   called (from my simple tracing), but after that its methods were
  not called (I guess somewhere it learned the modelobject was a String so
  it simply call the built-in converter.
  I'd think if the getConverter is overriden, its methods should be called
  regardless of what type was it.  Besides, UppercaseString is
  a special Type so it does not conflict with the rules.
  (Any custom converter could be considered to target a special type
  even though it could be just uppercasing or prepend a * to the string)
  Built-in converter might follow the default rules but
  if custom converter is provided, wicket should totally depend
  on the custom converter to do whatever it does.

  Anyway, thanks again.



  if you set the type yourself by hand then getConverter() will be called and
  you can do what ever you want
  We dont do that automatic yes (resolveType doesn't set it to the
  String.class)
  
  johan
  
  
  
  On Sun, Mar 9, 2008 at 5:45 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:
  
   i thought we agreed converters were type converters...so they shouldnt
   be invoked if you are doing string-string :|
  
   -igor
  
  
   On Sun, Mar 9, 2008 at 5:47 AM, Johan Compagner [EMAIL PROTECTED]
   wrote:
call setTYpe(String.class) on the textfield
 or use that constructor with the type param
   
 does that help?
   
   
   
 On Sun, Mar 9, 2008 at 1:35 PM, [EMAIL PROTECTED] wrote:
   
  Below is a custom component with overrding the getConverter
  for testing purpose. As you could see, it is plain simple one
  with simple output debugging. But it is not working.
  the getConverter is called (output here)
  but the convertToObject never called (no there)
  I basically cut and paste the WicketinAction example.
  What I am doing wrong here?
 
 
  public class RequiredUppperCaseTextField extends TextField {
 
 public RequiredUppperCaseTextField(String id) {
 super(id);
 setRequired(true);
 
 }
 @Override
 public final IConverter getConverter(Class arg000){
 System.out.println(here+ arg0);
IConverter icAppend = new IConverter(){
 
 public Object convertToObject(String arg0, Locale arg1) {
 System.out.println(there+ arg0);
 String s = sss;
 return s;
 }
 
 public String convertToString(Object arg0, Locale arg1) {
 return (String)arg0;
 }
 
 };
 return icAppend;
  }
 
  }
 
 
  Override the getConverter() method. First call super and with that
  result call the special one (camel casing?)
  
  On 3/9/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   Hello:
   I wonder how to append a converter or java method to a component
   so
  that
  I
   would affect what is already defined. For example, I want
   camelize a
   TextField(or some customized subclass) so that after the converter
  already
   defined completes the conversion (regardless what has been done in
   the
   chain) , I could use the added converted/method to make the final
  conversion
   to my need. The example I am seeing appears to overide and only
   one
  can
  be
   defined for a component, unlike validators, that I could add a
   chain of
   them. Let me know if I am wrong about this.
   Thanks
  
 
   -
  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]
  
  

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



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

Re: Default Focus Behavior?

2008-03-10 Thread Igor Vaynberg
On Sun, Mar 9, 2008 at 1:37 PM, James Carman [EMAIL PROTECTED] wrote:
 On 3/9/08, djo.mos [EMAIL PROTECTED] wrote:
  
  
   This simply looks great ! I think this should make it into the core Wicket
behaviors as the componenet focus is quite useful.
  

  Me too!  That's why I submitted:

  https://issues.apache.org/jira/browse/WICKET-1404

  I was pretty surprised something didn't exist for this already.  I
  don't mean any offense by that at all.  It's just that it seems like
  every time I think to myself there should be a way to do x with
  Wicket, there's already something for that!  This Wicket stuff is
  pretty cool!

i dont think something like this should go into core. it seems pretty
clear from this thread that there are very many ways to do this and
each project will use their own. what you have proposed seems trivial
to construct, so for projects that want to use it its a nobrainer. i
think things that go into core should at least satisfy the majority of
common usecases or be at least of moderate complexity. if we start
putting every trivial thing like this into core we will end up with a
huge surface area - at which point you have to start thinking of the
find/build tradeoff - is it easier to find something that does what i
want in core or simply roll my own which will only take fifteen
minutes...

now, for example, if this behavior was meant to be attached to a form
and would set focus on the first component that is not valid...

-igor






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



Simple question about alert string

2008-03-10 Thread tsuresh

 Hello, 
I have a delete link in a list of names. If  I click on the delete link of
name then the message should be are you sure to delete selectedName?

String selectedName = user1;
deleteLink.add(new SimpleAttributeModifier(onclick, return confirm('Are
you sure to delete?');));

I am not able to append this selectedName after: Are you sure to delete 
How to append this?
thanks
-- 
View this message in context: 
http://www.nabble.com/Simple-question-about-alert-string-tp15950581p15950581.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: Simple question about alert string

2008-03-10 Thread Martijn Dashorst
onclick, return confirm('Are you sure to delete  + selectedName + ?');));


On 3/10/08, tsuresh [EMAIL PROTECTED] wrote:

   Hello,
  I have a delete link in a list of names. If  I click on the delete link of
  name then the message should be are you sure to delete selectedName?

  String selectedName = user1;
  deleteLink.add(new SimpleAttributeModifier(onclick, return confirm('Are
  you sure to delete?');));

  I am not able to append this selectedName after: Are you sure to delete
  How to append this?
  thanks

 --
  View this message in context: 
 http://www.nabble.com/Simple-question-about-alert-string-tp15950581p15950581.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]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: append a converter or coversion function

2008-03-10 Thread Johan Compagner
A converter is only called when type is set for converting from string
to object. Maybe we should document this a bit better.

The type is tried to be resolved for you, but if it is a string  then
it is ignored so that normal convert() processing happens. This is a
bit weird but dont know how we can make this easier

On 3/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I used the trick it worked great. Thanks very much.
 Should it be considered a bug?
 What is interesting before using setType is that getConverter is actually
  called (from my simple tracing), but after that its methods were
 not called (I guess somewhere it learned the modelobject was a String so
 it simply call the built-in converter.
 I'd think if the getConverter is overriden, its methods should be called
 regardless of what type was it.  Besides, UppercaseString is
 a special Type so it does not conflict with the rules.
 (Any custom converter could be considered to target a special type
 even though it could be just uppercasing or prepend a * to the string)
 Built-in converter might follow the default rules but
 if custom converter is provided, wicket should totally depend
 on the custom converter to do whatever it does.

 Anyway, thanks again.

 if you set the type yourself by hand then getConverter() will be called and
 you can do what ever you want
 We dont do that automatic yes (resolveType doesn't set it to the
 String.class)
 
 johan
 
 
 
 On Sun, Mar 9, 2008 at 5:45 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
 
  i thought we agreed converters were type converters...so they shouldnt
  be invoked if you are doing string-string :|
 
  -igor
 
 
  On Sun, Mar 9, 2008 at 5:47 AM, Johan Compagner [EMAIL PROTECTED]
  wrote:
   call setTYpe(String.class) on the textfield
or use that constructor with the type param
  
does that help?
  
  
  
On Sun, Mar 9, 2008 at 1:35 PM, [EMAIL PROTECTED] wrote:
  
 Below is a custom component with overrding the getConverter
 for testing purpose. As you could see, it is plain simple one
 with simple output debugging. But it is not working.
 the getConverter is called (output here)
 but the convertToObject never called (no there)
 I basically cut and paste the WicketinAction example.
 What I am doing wrong here?


 public class RequiredUppperCaseTextField extends TextField {

public RequiredUppperCaseTextField(String id) {
super(id);
setRequired(true);

}
@Override
public final IConverter getConverter(Class arg000){
System.out.println(here+ arg0);
   IConverter icAppend = new IConverter(){

public Object convertToObject(String arg0, Locale arg1) {
System.out.println(there+ arg0);
String s = sss;
return s;
}

public String convertToString(Object arg0, Locale arg1) {
return (String)arg0;
}

};
return icAppend;
 }

 }


 Override the getConverter() method. First call super and with that
 result call the special one (camel casing?)
 
 On 3/9/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Hello:
  I wonder how to append a converter or java method to a
 component
  so
 that
 I
  would affect what is already defined. For example, I want
  camelize a
  TextField(or some customized subclass) so that after the
 converter
 already
  defined completes the conversion (regardless what has been done
 in
  the
  chain) , I could use the added converted/method to make the final
 conversion
  to my need. The example I am seeing appears to overide and only
  one
 can
 be
  defined for a component, unlike validators, that I could add a
  chain of
  them. Let me know if I am wrong about this.
  Thanks
 

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

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



Re: Intention of PropertyModel in 1.3

2008-03-10 Thread Johan Compagner
What level is this reported to?
Its not error right?

On 3/10/08, David Leangen [EMAIL PROTECTED] wrote:

 Just to follow up on this...

 You're right, it does still work. The thing is that during the algorithm
 when the properties of the bean are being tested the entire exception
 stack is being printed out.

 This is a bit confusing because it can lead the developer to think that
 an error occurred.


 I propose to log information instead of printing out the entire
 exception stack. If you agree to this, I don't mind submitting a patch.


 dml



 On Wed, 2008-02-13 at 09:38 -0800, Igor Vaynberg wrote:
  hmm, this should still work. mind filing a jira bug with a quickstart?
 
  -igor
 
 
  On Feb 13, 2008 12:00 AM, David Leangen [EMAIL PROTECTED] wrote:
  
   Hello!
  
   I'm (finally!) migrating to 1.3, so have a few wrinkles to iron out.
  
   Is somebody able to tell me the intention of the PropertyModel? I'm
   wondering if something has changed, or if I just wasn't using it
   correctly before...
  
  
   In one of my panels, I use this type of property:
  
PropertyModel languageModel = new PropertyModel( this, language );
  
   And in the same class, I have a getter like this:
  
 public String getLanguage()
 {
 return getSession().getLocale().getLanguage();
 }
  
   There is no setter and no language property.
  
  
  
   This used to work in 1.2.6, but now 1.3.1 complains that there is no
   setter for this class.
  
   Now, I don't even _want_ a setter, but just to see what happens, I add
   in a dummy setter, but wicket still complains that it can't find a
   language property.
  
  
   Am I not using the PropertyModel correctly (i.e. according to what
   PropertyModel is intended for)? (If so, this means that I've been using
   it incorrectly for many months without noticing, since it used to work.)
  
   Or, should I be using some other type of model for this?
  
  
   Thanx!
   Dave
  
  
  
  
   -
   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]



fileuploadfield - preset the filepath

2008-03-10 Thread Ken Leung
I am trying to pre-populate the filepath in the edit box in the fileuploadfield 
? How can I do that ?

Any ideas ?
Thanks


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Re: fileuploadfield - preset the filepath

2008-03-10 Thread Ken Leung
that's true.  ok, I guess I need to add a new field/label to reflect the 
previously selected file path then.

thanks




- Original Message 
From: Maurice Marrink [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Monday, March 10, 2008 1:09:42 AM
Subject: Re: fileuploadfield - preset the filepath

It is not possible for security reasons. your browser will prevent it.
Imagine a malicious server presetting the path to some sensitive data,
and triggering an onsubmit in the onload.

Maurice

On Mon, Mar 10, 2008 at 9:06 AM, Ken Leung [EMAIL PROTECTED] wrote:
 I am trying to pre-populate the filepath in the edit box in the 
 fileuploadfield ? How can I do that ?

  Any ideas ?
  Thanks



  
 
  Looking for last minute shopping deals?
  Find them fast with Yahoo! Search.  
 http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Custom Exception/Error page

2008-03-10 Thread Edvin Syse

Hi. In my application I do:

getApplicationSettings().setInternalErrorPage(ErrorPage.class);
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); 



to display a custom page for error messages. I would also like to email 
myself the exception - is it possible that I can get a hold of the 
throwable from the ErrorPage.class, or do I have to explicitly catch and 
rethrow a RestartResponseException to obtain the exception?


-- Edvin



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



FeedbackMessages per field

2008-03-10 Thread Alonso Sanchez, Daniel
 

 

 

De: Alonso Sanchez, Daniel 
Enviado el: lunes, 10 de marzo de 2008 10:39
Para: '[EMAIL PROTECTED]'
Asunto: FeedbackMessages per field

 

Hello everybody! I'm a newbie with wicket and during my first examples I
have had a problem that I don't know how to solve. The fact is that I
have the typical login form, and I want to notify the users possible
errors by showing an icon error next to each input field, just like
showed in the image attached.

 

Is there an easy way to do it, because I have been googleing, looking
the wiki, reading the ajax examples... but nothing suits at all. 

 

Thanks in advance for your kindness ;D

 

Daniel Alonso Sanchez

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

Re: append a converter or coversion function

2008-03-10 Thread dvd
You could resolve the type because a converted is already registered
for that type.  I could make a special class called UpperCaseString
and register a converter and new TextField( . UpperCaseString.class).
From this perspective, if I override getConverter to provide my own,
wicket should use it directly instead of infer the type and what to do
since I have give a definite converter. As I had observed,
the custom getConverter was actually called, so all that takes
is to call its methods instead of using builtin rules. The provider
of the custom converter would be responsible for the outcome.

A converter is only called when type is set for converting from string
to object. Maybe we should document this a bit better.

The type is tried to be resolved for you, but if it is a string  then
it is ignored so that normal convert() processing happens. This is a
bit weird but dont know how we can make this easier

On 3/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I used the trick it worked great. Thanks very much.
 Should it be considered a bug?
 What is interesting before using setType is that getConverter is actually
  called (from my simple tracing), but after that its methods were
 not called (I guess somewhere it learned the modelobject was a String so
 it simply call the built-in converter.
 I'd think if the getConverter is overriden, its methods should be called
 regardless of what type was it.  Besides, UppercaseString is
 a special Type so it does not conflict with the rules.
 (Any custom converter could be considered to target a special type
 even though it could be just uppercasing or prepend a * to the string)
 Built-in converter might follow the default rules but
 if custom converter is provided, wicket should totally depend
 on the custom converter to do whatever it does.

 Anyway, thanks again.

 if you set the type yourself by hand then getConverter() will be called 
and
 you can do what ever you want
 We dont do that automatic yes (resolveType doesn't set it to the
 String.class)
 
 johan
 
 
 
 On Sun, Mar 9, 2008 at 5:45 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
 
  i thought we agreed converters were type converters...so they shouldnt
  be invoked if you are doing string-string :|
 
  -igor
 
 
  On Sun, Mar 9, 2008 at 5:47 AM, Johan Compagner [EMAIL PROTECTED]
  wrote:
   call setTYpe(String.class) on the textfield
or use that constructor with the type param
  
does that help?
  
  
  
On Sun, Mar 9, 2008 at 1:35 PM, [EMAIL PROTECTED] wrote:
  
 Below is a custom component with overrding the getConverter
 for testing purpose. As you could see, it is plain simple one
 with simple output debugging. But it is not working.
 the getConverter is called (output here)
 but the convertToObject never called (no there)
 I basically cut and paste the WicketinAction example.
 What I am doing wrong here?


 public class RequiredUppperCaseTextField extends TextField {

public RequiredUppperCaseTextField(String id) {
super(id);
setRequired(true);

}
@Override
public final IConverter getConverter(Class arg000){
System.out.println(here+ arg0);
   IConverter icAppend = new IConverter(){

public Object convertToObject(String arg0, Locale arg1) 
{
System.out.println(there+ arg0);
String s = sss;
return s;
}

public String convertToString(Object arg0, Locale arg1) 
{
return (String)arg0;
}

};
return icAppend;
 }

 }


 Override the getConverter() method. First call super and with that
 result call the special one (camel casing?)
 
 On 3/9/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Hello:
  I wonder how to append a converter or java method to a
 component
  so
 that
 I
  would affect what is already defined. For example, I want
  camelize a
  TextField(or some customized subclass) so that after the
 converter
 already
  defined completes the conversion (regardless what has been done
 in
  the
  chain) , I could use the added converted/method to make the 
final
 conversion
  to my need. The example I am seeing appears to overide and 
only
  one
 can
 be
  defined for a component, unlike validators, that I could add a
  chain of
  them. Let me know if I am wrong about this.
  Thanks
 

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


  
 
  

Re: append a converter or coversion function

2008-03-10 Thread dvd
I'd consider it a generic business component that applies
to so many apps/business pojos that would justify it to become a web component,
much like RequiredTextField or even PasswordTextField.

Could you illustrate how to do it better with model decorator
to use it like using RequiredTextField?



no, upper case string is not a special type, not unless you do not
use String to represent it...like i said, my suggestion is to do this
via a model decorator. further, something like this doesnt even sound
like it belongs in the web layer - sounds like a business requirement
which should be enforced by the setter of the bussiness pojo.

-igor


On Sun, Mar 9, 2008 at 7:57 PM,  [EMAIL PROTECTED] wrote:
 I used the trick it worked great. Thanks very much.
  Should it be considered a bug?
  What is interesting before using setType is that getConverter is actually
   called (from my simple tracing), but after that its methods were
  not called (I guess somewhere it learned the modelobject was a String so
  it simply call the built-in converter.
  I'd think if the getConverter is overriden, its methods should be called
  regardless of what type was it.  Besides, UppercaseString is
  a special Type so it does not conflict with the rules.
  (Any custom converter could be considered to target a special type
  even though it could be just uppercasing or prepend a * to the string)
  Built-in converter might follow the default rules but
  if custom converter is provided, wicket should totally depend
  on the custom converter to do whatever it does.

  Anyway, thanks again.



  if you set the type yourself by hand then getConverter() will be called 
and
  you can do what ever you want
  We dont do that automatic yes (resolveType doesn't set it to the
  String.class)
  
  johan
  
  
  
  On Sun, Mar 9, 2008 at 5:45 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:
  
   i thought we agreed converters were type converters...so they shouldnt
   be invoked if you are doing string-string :|
  
   -igor
  
  
   On Sun, Mar 9, 2008 at 5:47 AM, Johan Compagner [EMAIL PROTECTED]
   wrote:
call setTYpe(String.class) on the textfield
 or use that constructor with the type param
   
 does that help?
   
   
   
 On Sun, Mar 9, 2008 at 1:35 PM, [EMAIL PROTECTED] wrote:
   
  Below is a custom component with overrding the getConverter
  for testing purpose. As you could see, it is plain simple one
  with simple output debugging. But it is not working.
  the getConverter is called (output here)
  but the convertToObject never called (no there)
  I basically cut and paste the WicketinAction example.
  What I am doing wrong here?
 
 
  public class RequiredUppperCaseTextField extends TextField {
 
 public RequiredUppperCaseTextField(String id) {
 super(id);
 setRequired(true);
 
 }
 @Override
 public final IConverter getConverter(Class arg000){
 System.out.println(here+ arg0);
IConverter icAppend = new IConverter(){
 
 public Object convertToObject(String arg0, Locale arg1) 
{
 System.out.println(there+ arg0);
 String s = sss;
 return s;
 }
 
 public String convertToString(Object arg0, Locale arg1) 
{
 return (String)arg0;
 }
 
 };
 return icAppend;
  }
 
  }
 
 
  Override the getConverter() method. First call super and with 
that
  result call the special one (camel casing?)
  
  On 3/9/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   Hello:
   I wonder how to append a converter or java method to a 
component
   so
  that
  I
   would affect what is already defined. For example, I want
   camelize a
   TextField(or some customized subclass) so that after the 
converter
  already
   defined completes the conversion (regardless what has been done 
in
   the
   chain) , I could use the added converted/method to make the 
final
  conversion
   to my need. The example I am seeing appears to overide and 
only
   one
  can
  be
   defined for a component, unlike validators, that I could add a
   chain of
   them. Let me know if I am wrong about this.
   Thanks
  
 
   -
  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]

Class aliases for shared resources

2008-03-10 Thread Kaspar Fischer
I have a shared resource that I add in my application's init() method  
via


SharedResources sharedResources = getSharedResources();
sharedResources.add(repo, new MyResouce());
sharedResources.putClassAlias(Application.class, app);
sharedResources.putClassAlias(MyResouce.class, tmp);

I can access my resource via e.g.

  http://localhost:8080/app/resources/org.apache.wicket.Application/repo?nid=12

but both

  http://localhost:8080/app/resources/app/repo?nid=12
  http://localhost:8080/app/resources/tmp/repo?nid=12

do not work. Any ideas why?

Thanks!
Kaspar

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



Display text depending on user being logged in and intercept pages

2008-03-10 Thread Jörn Zaefferer
Hi,

I'd need some help on getting the following to work properly:

If the user is logged in, display some text Hello {name}. If he
isn't logged in, display a text Please register or login instead,
where register is a link to the register page. If he clicks that
link and submits the register form, go back to the former page - use
the register page as an intercept page.

To start with, I don't know how to embed a link inside the label only
if the user is logged in - how should I structure the markup for that?
A Label component discards its body, so just nesting the link doesn't
work.

The other problem is that redirectToInterceptPage does the redirect,
but if I submit the register form I get a MarkupException about a
missing component. It looks like the intercept mechanism redirects
back to the original page, but loads the wrong template, here the
register-page-template. I've got no idea how to get that to work, so
far I replaced the intercept with a normal setResponsePage, which is
far from optimal.

Thanks
Jörn Zaefferer

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



How to flush(?) page without using setResponsePage

2008-03-10 Thread Jörn Zaefferer
Hi,

our application has a login form on every page, defined in a Base
WebPage. So far we have to use
setResponsePage(getApplication().getHomePage()); to update the page,
otherwise it looks like the login didn't work, even if it did. But we
don't want to go to the homepage, the user wants to stay on the
current page instead.

How can I flush the current page?

Thanks
Jörn Zaefferer

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



Re: How to flush(?) page without using setResponsePage

2008-03-10 Thread Maurice Marrink
If you don't set a responsepage the current page will be served again.
For determining what might be the problem of the login not working we
need to see some code and a better description of what is not working.

Maurice

On Mon, Mar 10, 2008 at 11:39 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Hi,

  our application has a login form on every page, defined in a Base
  WebPage. So far we have to use
  setResponsePage(getApplication().getHomePage()); to update the page,
  otherwise it looks like the login didn't work, even if it did. But we
  don't want to go to the homepage, the user wants to stay on the
  current page instead.

  How can I flush the current page?

  Thanks
  Jörn Zaefferer

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



Re: AjaxBehaviour how to question

2008-03-10 Thread atul singh
Thank you for the isTemporary() suggestion.. . BTW before i got your reply i
tried implementing following way, by extending AbstractBehavior , not sure
if this is a good way..
@Override
public void onRendered(Component component) {
IRequestTarget reqTarget = RequestCycle.get()
.getRequestTarget();
if (reqTarget!=null  reqTarget instanceof AjaxRequestTarget) {
AjaxRequestTarget ajaxTarget = (AjaxRequestTarget)
RequestCycle
.get().getRequestTarget();
if (ajaxTarget != null) {
ajaxTarget.appendJavascript(new Effect.Fade($('
+ component.getMarkupId() + ')););
}
}
}

Is it possible to have a chaining behaviour class in wicket which is not a
request listener??



On Mon, Mar 10, 2008 at 12:11 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 there are two ways to do it:

 either use ajaxrequesttarget.appendjavascript() instead of behavior

 or write a behavior that uses renderhead() to output the javascript
 and override istemporary to return true - that way it is removed at
 the end of the request.

 -igor


 On Sun, Mar 9, 2008 at 6:39 PM, atul singh [EMAIL PROTECTED] wrote:
  How can i write an ajax behaviour which does not have its own callback,
 but
   just appends javascript to an existing AjaxRequestTarget.
   I want this so that i can write a fading feed back panel, which will be
   added to AjaxRequestTarget of an ajax form submission.
 
   What I want is something like this::
   *the behaviour---*
   public class AjaxFadeBehaviour extends AbstractAjaxBehavior{
  private IModel fadingNeededIModel;
  public AjaxFadeBehaviour() {
  super();
  }
 
  /**
   * Use a boolean value wrapped in an IModel to know if fading effect
 is
   needed.
   * This can be useful in situations for example when info messages
 need
   to fade away while error messages need not.
   * @param fadingNeededIModel
   */
  public AjaxFadeBehaviour(IModel fadingNeededIModel) {
  super();
  this.fadingNeededIModel = fadingNeededIModel;
  }
 
  public void onRequest() {
  System.out.println(on request called);
  if(fadingNeededIModel!=null){
  if(Strings.isTrue((String) fadingNeededIModel.getObject()))
 
 
  
 ((AjaxRequestTarget)RequestCycle.get().getRequestTarget()).appendJavascript(new
   Effect.Fade($('
  + getComponent().getMarkupId() + ')););
  }
  }
   }
 
   *the feedback component ---
   *public class AjaxFadingFeedbackPanel extends FeedbackPanel{
 
  public AjaxFadingFeedbackPanel(String id, IFeedbackMessageFilter
 filter)
   {
  super(id, filter);
  setOutputMarkupId(true);
  final AbstractReadOnlyModel fadingNeededModel=new
   AbstractReadOnlyModel(){
  @Override
  public Object getObject() {
  return anyMessage(FeedbackMessage.INFO);
  }
  };
  add(new AjaxFadeBehaviour(fadingNeededModel));
  }
 
  public AjaxFadingFeedbackPanel(String id) {
  this(id,null);
  }
 
   }
 
   I am not able to achieve this because onRequest() does not get called
 for
   AjaxFadeBehaviour.
   I am confused about which class I should extend to achieve this??
 

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




Re: Custom Exception/Error page

2008-03-10 Thread Sebastiaan van Erk
I would say that the standard practice is probably to use your logging 
subsystem to email you the exception.


For example, if you are using log4j to log, you could add something like 
this to your log4j.xml file:


appender name=ERRORMAILER
class=org.apache.log4j.net.SMTPAppender
param name=from value=[EMAIL PROTECTED] /
param name=to value=[EMAIL PROTECTED] /
param name=subject value=[mydomain] ERROR /
param name=SMTPHost value=localhost /
param name=threshold value=ERROR /
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d %-5p - [%C:%L] 
%m%n /
/layout
/appender

Regards,
Sebastiaan


Edvin Syse wrote:

Hi. In my application I do:

getApplicationSettings().setInternalErrorPage(ErrorPage.class);
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); 



to display a custom page for error messages. I would also like to email 
myself the exception - is it possible that I can get a hold of the 
throwable from the ErrorPage.class, or do I have to explicitly catch and 
rethrow a RestartResponseException to obtain the exception?


-- Edvin



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



smime.p7s
Description: S/MIME Cryptographic Signature


FeedbackMessages per field

2008-03-10 Thread Daniel Alonso

Hello everybody! I’m a newbie with wicket and during my first examples I have
had a problem that I don’t know how to solve. The fact is that I have the
typical login form, and I want to notify the users possible errors by
showing an icon error next to each input field, just like showed in the
image attached.

http://www.nabble.com/file/p15950642/sample.jpg 

Is there an easy way to do it, because I have been googleing, looking the
wiki, reading the ajax examples… but nothing suits at all. I'm developing
with wicket 1.3.1

Thanks in advance for your kindness ;D

-- 
View this message in context: 
http://www.nabble.com/FeedbackMessages-per-field-tp15950642p15950642.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: AjaxBehaviour how to question

2008-03-10 Thread atul singh
Also, does returning true for isTemporary re-render any javascript resource
reference??


On Mon, Mar 10, 2008 at 4:30 PM, atul singh [EMAIL PROTECTED] wrote:

 Thank you for the isTemporary() suggestion.. . BTW before i got your reply
 i tried implementing following way, by extending AbstractBehavior , not sure
 if this is a good way..
 @Override
 public void onRendered(Component component) {
 IRequestTarget reqTarget = RequestCycle.get()
 .getRequestTarget();
 if (reqTarget!=null  reqTarget instanceof AjaxRequestTarget) {
 AjaxRequestTarget ajaxTarget = (AjaxRequestTarget)
 RequestCycle
 .get().getRequestTarget();
 if (ajaxTarget != null) {
 ajaxTarget.appendJavascript(new Effect.Fade($('
 + component.getMarkupId() + ')););
 }
 }
 }

 Is it possible to have a chaining behaviour class in wicket which is not a
 request listener??




 On Mon, Mar 10, 2008 at 12:11 PM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

  there are two ways to do it:
 
  either use ajaxrequesttarget.appendjavascript() instead of behavior
 
  or write a behavior that uses renderhead() to output the javascript
  and override istemporary to return true - that way it is removed at
  the end of the request.
 
  -igor
 
 
  On Sun, Mar 9, 2008 at 6:39 PM, atul singh [EMAIL PROTECTED]
  wrote:
   How can i write an ajax behaviour which does not have its own
  callback, but
just appends javascript to an existing AjaxRequestTarget.
I want this so that i can write a fading feed back panel, which will
  be
added to AjaxRequestTarget of an ajax form submission.
  
What I want is something like this::
*the behaviour---*
public class AjaxFadeBehaviour extends AbstractAjaxBehavior{
   private IModel fadingNeededIModel;
   public AjaxFadeBehaviour() {
   super();
   }
  
   /**
* Use a boolean value wrapped in an IModel to know if fading
  effect is
needed.
* This can be useful in situations for example when info messages
  need
to fade away while error messages need not.
* @param fadingNeededIModel
*/
   public AjaxFadeBehaviour(IModel fadingNeededIModel) {
   super();
   this.fadingNeededIModel = fadingNeededIModel;
   }
  
   public void onRequest() {
   System.out.println(on request called);
   if(fadingNeededIModel!=null){
   if(Strings.isTrue((String) fadingNeededIModel.getObject
  ()))
  
  
   
  ((AjaxRequestTarget)RequestCycle.get().getRequestTarget()).appendJavascript(new
Effect.Fade($('
   + getComponent().getMarkupId() + ')););
   }
   }
}
  
*the feedback component ---
*public class AjaxFadingFeedbackPanel extends FeedbackPanel{
  
   public AjaxFadingFeedbackPanel(String id, IFeedbackMessageFilter
  filter)
{
   super(id, filter);
   setOutputMarkupId(true);
   final AbstractReadOnlyModel fadingNeededModel=new
AbstractReadOnlyModel(){
   @Override
   public Object getObject() {
   return anyMessage(FeedbackMessage.INFO);
   }
   };
   add(new AjaxFadeBehaviour(fadingNeededModel));
   }
  
   public AjaxFadingFeedbackPanel(String id) {
   this(id,null);
   }
  
}
  
I am not able to achieve this because onRequest() does not get called
  for
AjaxFadeBehaviour.
I am confused about which class I should extend to achieve this??
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Is there any way to avoid a creation of the component still having a tag in an html file?

2008-03-10 Thread Vitaly Tsaplin
   Hi people,

   I have a panel which is not visible in some cases. Wicket complans
if I do not create it at all so I have to make it invisible. Is there
any way to avoid a creation of the component still having a tag in an
html file?

   Vitaly

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



Re: Display text depending on user being logged in and intercept pages

2008-03-10 Thread Martijn Dashorst
Use fragments for that instead to switch between the two. So you have
a UserRegistrationPanel that provides this functionality. On the panel
you create 2 fragments: one for just the label, another for the label
and link. Now you can do in onbeforerender:

if(loggedIn)
addOrReplace(new WelcomeFragment());
else addOrReplace(new HaveToSigninFragment());


Martijn

On 3/10/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Hi,

  I'd need some help on getting the following to work properly:

  If the user is logged in, display some text Hello {name}. If he
  isn't logged in, display a text Please register or login instead,
  where register is a link to the register page. If he clicks that
  link and submits the register form, go back to the former page - use
  the register page as an intercept page.

  To start with, I don't know how to embed a link inside the label only
  if the user is logged in - how should I structure the markup for that?
  A Label component discards its body, so just nesting the link doesn't
  work.

  The other problem is that redirectToInterceptPage does the redirect,
  but if I submit the register form I get a MarkupException about a
  missing component. It looks like the intercept mechanism redirects
  back to the original page, but loads the wrong template, here the
  register-page-template. I've got no idea how to get that to work, so
  far I replaced the intercept with a normal setResponsePage, which is
  far from optimal.

  Thanks
  Jörn Zaefferer

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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: Confine feedback messages to a panel

2008-03-10 Thread Gerolf Seitz
Construct the feedbackpanels with and IFeedbackMessageFilter.

  Gerolf

On Mon, Mar 10, 2008 at 12:22 PM, atul singh [EMAIL PROTECTED] wrote:

 hi,
 I have an ajax checkbox, which when checked, i show a feedback at the top
 of
 the panel. Due to this event another panel on the same page is repainted
 and
 made visible. The problem is I see the feedback message in the feedback
 component present in the other panel as well. I feel this is because the
 feedback messages are shared in the session??
 I thought I will be able to google out the solution, but could not find
 anything...Any suggestion about this problem ??



Confine feedback messages to a panel

2008-03-10 Thread atul singh
hi,
I have an ajax checkbox, which when checked, i show a feedback at the top of
the panel. Due to this event another panel on the same page is repainted and
made visible. The problem is I see the feedback message in the feedback
component present in the other panel as well. I feel this is because the
feedback messages are shared in the session??
I thought I will be able to google out the solution, but could not find
anything...Any suggestion about this problem ??


Re: Is there any way to avoid a creation of the component still having a tag in an html file?

2008-03-10 Thread Martijn Dashorst
No. The hierarchy needs to match. Otherwise it is impossible to
distinguish a programming error from a non programming error.

Martijn

On 3/10/08, Vitaly Tsaplin [EMAIL PROTECTED] wrote:
Hi people,

I have a panel which is not visible in some cases. Wicket complans
  if I do not create it at all so I have to make it invisible. Is there
  any way to avoid a creation of the component still having a tag in an
  html file?

Vitaly

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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: Is there any way to avoid a creation of the component still having a tag in an html file?

2008-03-10 Thread James Carman
On 3/10/08, Martijn Dashorst [EMAIL PROTECTED] wrote:
 No. The hierarchy needs to match. Otherwise it is impossible to
  distinguish a programming error from a non programming error.


Can't you put in a placeholder empty Panel in the case where you don't
want stuff to show?  This assumes that the component you want to hide
is more complex than just a TextField or something.  So, when you want
to show the complex panel, you instantiate it and add it.  When you
don't, you add some empty panel (both having the same ids).  This way,
the hierarchy matches.

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



Re: append a converter or coversion function

2008-03-10 Thread Johan Compagner
We do call it
you only have to specify the type
And if the type can be resolved and is NOT String.class your converter is
called

The only issue is if we cant resolve the type or the type is String then we
do by default something else

You have to set the type yourself then then your converter is called



On Mon, Mar 10, 2008 at 11:25 AM, [EMAIL PROTECTED] wrote:

 You could resolve the type because a converted is already registered
 for that type.  I could make a special class called UpperCaseString
 and register a converter and new TextField( . UpperCaseString.class).
 From this perspective, if I override getConverter to provide my own,
 wicket should use it directly instead of infer the type and what to do
 since I have give a definite converter. As I had observed,
 the custom getConverter was actually called, so all that takes
 is to call its methods instead of using builtin rules. The provider
 of the custom converter would be responsible for the outcome.

 A converter is only called when type is set for converting from string
 to object. Maybe we should document this a bit better.
 
 The type is tried to be resolved for you, but if it is a string  then
 it is ignored so that normal convert() processing happens. This is a
 bit weird but dont know how we can make this easier
 
 On 3/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  I used the trick it worked great. Thanks very much.
  Should it be considered a bug?
  What is interesting before using setType is that getConverter is
 actually
   called (from my simple tracing), but after that its methods were
  not called (I guess somewhere it learned the modelobject was a String
 so
  it simply call the built-in converter.
  I'd think if the getConverter is overriden, its methods should be
 called
  regardless of what type was it.  Besides, UppercaseString is
  a special Type so it does not conflict with the rules.
  (Any custom converter could be considered to target a special type
  even though it could be just uppercasing or prepend a * to the string)
  Built-in converter might follow the default rules but
  if custom converter is provided, wicket should totally depend
  on the custom converter to do whatever it does.
 
  Anyway, thanks again.
 
  if you set the type yourself by hand then getConverter() will be
 called
 and
  you can do what ever you want
  We dont do that automatic yes (resolveType doesn't set it to the
  String.class)
  
  johan
  
  
  
  On Sun, Mar 9, 2008 at 5:45 PM, Igor Vaynberg [EMAIL PROTECTED]
 
  wrote:
  
   i thought we agreed converters were type converters...so they
 shouldnt
   be invoked if you are doing string-string :|
  
   -igor
  
  
   On Sun, Mar 9, 2008 at 5:47 AM, Johan Compagner 
 [EMAIL PROTECTED]
   wrote:
call setTYpe(String.class) on the textfield
 or use that constructor with the type param
   
 does that help?
   
   
   
 On Sun, Mar 9, 2008 at 1:35 PM, [EMAIL PROTECTED] wrote:
   
  Below is a custom component with overrding the getConverter
  for testing purpose. As you could see, it is plain simple one
  with simple output debugging. But it is not working.
  the getConverter is called (output here)
  but the convertToObject never called (no there)
  I basically cut and paste the WicketinAction example.
  What I am doing wrong here?
 
 
  public class RequiredUppperCaseTextField extends TextField {
 
 public RequiredUppperCaseTextField(String id) {
 super(id);
 setRequired(true);
 
 }
 @Override
 public final IConverter getConverter(Class arg000){
 System.out.println(here+ arg0);
IConverter icAppend = new IConverter(){
 
 public Object convertToObject(String arg0, Locale
 arg1)
 {
 System.out.println(there+ arg0);
 String s = sss;
 return s;
 }
 
 public String convertToString(Object arg0, Locale
 arg1)
 {
 return (String)arg0;
 }
 
 };
 return icAppend;
  }
 
  }
 
 
  Override the getConverter() method. First call super and with
 that
  result call the special one (camel casing?)
  
  On 3/9/08, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
   Hello:
   I wonder how to append a converter or java method to a
  component
   so
  that
  I
   would affect what is already defined. For example, I want
   camelize a
   TextField(or some customized subclass) so that after the
  converter
  already
   defined completes the conversion (regardless what has been
 done
  in
   the
   chain) , I could use the added converted/method to make the
 final
  conversion
   to my need. The example I am seeing appears to overide and
 only
   one
  can
  be
   defined for a component, unlike validators, 

Re: Display text depending on user being logged in and intercept pages

2008-03-10 Thread Jörn Zaefferer
Hi Martijn,

thanks for the response.

Though your suggestion doesn't solve the problem of embedding a Link
within a Label. I need to be able to translate the text surrounding
the link and the text of the link itself. Depending on the language,
the position of the link varies. I can't embed a Link within a Label
and I can't wrap the Link with Labels, because then the position would
be fixed.

In other words: How would you implement the HaveToSigninFragment?

Thanks
Jörn

On Mon, Mar 10, 2008 at 12:25 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 Use fragments for that instead to switch between the two. So you have
  a UserRegistrationPanel that provides this functionality. On the panel
  you create 2 fragments: one for just the label, another for the label
  and link. Now you can do in onbeforerender:

  if(loggedIn)
  addOrReplace(new WelcomeFragment());
  else addOrReplace(new HaveToSigninFragment());


  Martijn



  On 3/10/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
   Hi,
  
I'd need some help on getting the following to work properly:
  
If the user is logged in, display some text Hello {name}. If he
isn't logged in, display a text Please register or login instead,
where register is a link to the register page. If he clicks that
link and submits the register form, go back to the former page - use
the register page as an intercept page.
  
To start with, I don't know how to embed a link inside the label only
if the user is logged in - how should I structure the markup for that?
A Label component discards its body, so just nesting the link doesn't
work.
  
The other problem is that redirectToInterceptPage does the redirect,
but if I submit the register form I get a MarkupException about a
missing component. It looks like the intercept mechanism redirects
back to the original page, but loads the wrong template, here the
register-page-template. I've got no idea how to get that to work, so
far I replaced the intercept with a normal setResponsePage, which is
far from optimal.
  
Thanks
Jörn Zaefferer
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  


  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.1 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: How to flush(?) page without using setResponsePage

2008-03-10 Thread Jörn Zaefferer
Ok. An example for the basic problem:

There is a label that displays Loggein as ... when the user is
logged in, and Not logged in when he's not. If the user logins in
using the login form, the label doesn't change, unless I use
setResponsePage.

I figured out that I can use setResponsePage(getPage().getClass()); to
keep the user on the same page, but that still looks like a workaround
to me, not a solution.

Jörn

On Mon, Mar 10, 2008 at 11:46 AM, Maurice Marrink [EMAIL PROTECTED] wrote:
 If you don't set a responsepage the current page will be served again.
  For determining what might be the problem of the login not working we
  need to see some code and a better description of what is not working.

  Maurice



  On Mon, Mar 10, 2008 at 11:39 AM, Jörn Zaefferer
  [EMAIL PROTECTED] wrote:
   Hi,
  
our application has a login form on every page, defined in a Base
WebPage. So far we have to use
setResponsePage(getApplication().getHomePage()); to update the page,
otherwise it looks like the login didn't work, even if it did. But we
don't want to go to the homepage, the user wants to stay on the
current page instead.
  
How can I flush the current page?
  
Thanks
Jörn Zaefferer
  
-
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]



Re: Display text depending on user being logged in and intercept pages

2008-03-10 Thread Martijn Dashorst
wicket:message key=beforeLink/wicket:messagea
href=#wicket:message
key=insideLink/wicket:message/awicket:message
key=afterLink/wicket:message



On 3/10/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Hi Martijn,

  thanks for the response.

  Though your suggestion doesn't solve the problem of embedding a Link
  within a Label. I need to be able to translate the text surrounding
  the link and the text of the link itself. Depending on the language,
  the position of the link varies. I can't embed a Link within a Label
  and I can't wrap the Link with Labels, because then the position would
  be fixed.

  In other words: How would you implement the HaveToSigninFragment?

  Thanks

 Jörn


  On Mon, Mar 10, 2008 at 12:25 PM, Martijn Dashorst
  [EMAIL PROTECTED] wrote:
   Use fragments for that instead to switch between the two. So you have
a UserRegistrationPanel that provides this functionality. On the panel
you create 2 fragments: one for just the label, another for the label
and link. Now you can do in onbeforerender:
  
if(loggedIn)
addOrReplace(new WelcomeFragment());
else addOrReplace(new HaveToSigninFragment());
  
  
Martijn
  
  
  
On 3/10/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Hi,

  I'd need some help on getting the following to work properly:

  If the user is logged in, display some text Hello {name}. If he
  isn't logged in, display a text Please register or login instead,
  where register is a link to the register page. If he clicks that
  link and submits the register form, go back to the former page - use
  the register page as an intercept page.

  To start with, I don't know how to embed a link inside the label only
  if the user is logged in - how should I structure the markup for that?
  A Label component discards its body, so just nesting the link doesn't
  work.

  The other problem is that redirectToInterceptPage does the redirect,
  but if I submit the register form I get a MarkupException about a
  missing component. It looks like the intercept mechanism redirects
  back to the original page, but loads the wrong template, here the
  register-page-template. I've got no idea how to get that to work, so
  far I replaced the intercept with a normal setResponsePage, which is
  far from optimal.

  Thanks
  Jörn Zaefferer

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


  
  
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1
  
-
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]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: Is there any way to avoid a creation of the component still having a tag in an html file?

2008-03-10 Thread Martijn Dashorst
Yep, that is making the hierarchies match.

Martijn

On 3/10/08, James Carman [EMAIL PROTECTED] wrote:
 On 3/10/08, Martijn Dashorst [EMAIL PROTECTED] wrote:
   No. The hierarchy needs to match. Otherwise it is impossible to
distinguish a programming error from a non programming error.
  


 Can't you put in a placeholder empty Panel in the case where you don't
  want stuff to show?  This assumes that the component you want to hide
  is more complex than just a TextField or something.  So, when you want
  to show the complex panel, you instantiate it and add it.  When you
  don't, you add some empty panel (both having the same ids).  This way,
  the hierarchy matches.


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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: Custom Exception/Error page

2008-03-10 Thread Edvin Syse

Wow, that's a very nice solution. Thanks :))

-- Edvin

Sebastiaan van Erk skrev:
I would say that the standard practice is probably to use your logging 
subsystem to email you the exception.


For example, if you are using log4j to log, you could add something like 
this to your log4j.xml file:


appender name=ERRORMAILER
class=org.apache.log4j.net.SMTPAppender
param name=from value=[EMAIL PROTECTED] /
param name=to value=[EMAIL PROTECTED] /
param name=subject value=[mydomain] ERROR /
param name=SMTPHost value=localhost /
param name=threshold value=ERROR /
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d %-5p - [%C:%L] 
%m%n /

/layout
/appender

Regards,
Sebastiaan


Edvin Syse wrote:

Hi. In my application I do:

getApplicationSettings().setInternalErrorPage(ErrorPage.class);
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); 



to display a custom page for error messages. I would also like to 
email myself the exception - is it possible that I can get a hold of 
the throwable from the ErrorPage.class, or do I have to explicitly 
catch and rethrow a RestartResponseException to obtain the exception?


-- Edvin



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



Re: How to flush(?) page without using setResponsePage

2008-03-10 Thread Maurice Marrink
The way you describe it, it sounds to me like you are not properly
using a model to update the label.
I am guessing you are doing something like new Label(id,Logged in)
or new Label(id,new Model(Logged in)).
What you have to remember is that you are in the constructor here,
rendering the same page does not trigger a new page object and thus no
constructor call.
In order to solve this you need a model to dynamically return whether
a user is logged in or not.
Something like this should do the job:
class MyModel extends loadableDetachableModel
{
 public Object load()
 {
  //pseudo code:
  if(Session.get().getUser()!=null)
   return Logged in;
  return Not logged in;
  }
}

See 
http://www.theserverside.com/tt/articles/article.tss?l=IntroducingApacheWicket
for an introduction to Wicket including models

Maurice

On Mon, Mar 10, 2008 at 1:10 PM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Ok. An example for the basic problem:

  There is a label that displays Loggein as ... when the user is
  logged in, and Not logged in when he's not. If the user logins in
  using the login form, the label doesn't change, unless I use
  setResponsePage.

  I figured out that I can use setResponsePage(getPage().getClass()); to
  keep the user on the same page, but that still looks like a workaround
  to me, not a solution.

  Jörn



  On Mon, Mar 10, 2008 at 11:46 AM, Maurice Marrink [EMAIL PROTECTED] wrote:
   If you don't set a responsepage the current page will be served again.
For determining what might be the problem of the login not working we
need to see some code and a better description of what is not working.
  
Maurice
  
  
  
On Mon, Mar 10, 2008 at 11:39 AM, Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Hi,

  our application has a login form on every page, defined in a Base
  WebPage. So far we have to use
  setResponsePage(getApplication().getHomePage()); to update the page,
  otherwise it looks like the login didn't work, even if it did. But we
  don't want to go to the homepage, the user wants to stay on the
  current page instead.

  How can I flush the current page?

  Thanks
  Jörn Zaefferer

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



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



Re: DropDownChoice getting value into the model

2008-03-10 Thread rmattler

I don't understand.  Vendor.state and SelectOption.state are both Strings.

I cut down my form to only have state on the form so I can post all the
code.  The code pulls the correct data from the database and displays it on
the form but when I save it is gives me the following error.

java.lang.UnsupportedOperationException: Model class
com.myprepress.pages.vendor.profile.VendorEntry2$1 does not support
setObject(Object)


html
form wicket:id=vendorEntryForm2
select wicket:id=state
option/option
/select
input type=submit wicket:id=save value=Savebr
/form
/html

public class VendorEntry2 extends BasePage {

@SpringBean
VendorDAO vendorDAO;
private long tblId;
private Integer oldVersionNumber;

public VendorEntry2(long id) {

tblId = id;
// get the version number to ensure that the object hasn't been 
saved to
// the database by another users
// -1 is a new object
if (id != -1) {
Vendor vendor = null;
try {
vendor = vendorDAO.load(id);
oldVersionNumber = vendor.getVersionNumber();
} catch (DataObjectNotFoundException donfe) {
getSession().error(Object not found);
throw new RestartResponseException(new 
ErrorObjectNotFound(new
VendorList()));
}
}

// load the object to be displayed to the screen
// make it LoadableDetachableModel so it is not stored in the 
session
// -1 is a new object
IModel vendorModel = new LoadableDetachableModel() {
protected Object load() {
if (tblId == -1) {
return new Vendor();
} else {
return vendorDAO.load(tblId);
}
}
};

// add form
Form form = new Form(vendorEntryForm2, new
CompoundPropertyModel(vendorModel)) {
protected void onSubmit() {
Vendor updatedVendor = (Vendor) 
getModelObject();
try {
vendorDAO.save(updatedVendor, 
oldVersionNumber);
setResponsePage(VendorList.class);
} catch (DataObjectModifiedException dome) {
// try again);
setResponsePage(new VendorEntryError(
Data changed by 
another user.  Please refresh and try again.,
tblId));
}
}
};
add(form); // must add form before adding other components

// add state
ArrayListSelectOption states = new ArrayListSelectOption();
states.add(new SelectOption(AL, Alabama));
states.add(new SelectOption(OH, Ohio));
states.add(new SelectOption(NY, New York));
ChoiceRenderer choiceRenderer = new ChoiceRenderer(display, 
state);

DropDownChoice stateFC = new DropDownChoice(state, 
vendorModel, new
Model(states),
choiceRenderer);
form.add(stateFC);

// add submit button
form.add(new Button(save));

}

}

@Entity
@Table(name = vendor, schema = public)
public class Vendor implements java.io.Serializable {

private long tblId;
private String state;

@Column(name = state, length = 2)
public String getState() {
return this.state;
}

public void setState(String state) {
this.state = state;
}





Johan Compagner wrote:
 
 This has to work yes, the only thing is do build up the new
 Model(states) as States so the same type of object as vendor.state
 returns.
 
 On 3/7/08, Kai Mutz [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED]  wrote:
  It is nice to know I'm not the only one struggling with
  DropDownChoices.  I'm new to Wicket and I'm pretty far with
  rebuilding an application we are using internally.  Has anybody
  proposed an alternative or a wrapper to DropDownChoices?

 Have you tried something like:

 Vendor vendor = (Vendor) vendorModel.getObject();

 DropDownChoice stateFC = new DropDownChoice(state, new
 PropertyModel(vendor, state), new Model(states), choiceRenderer);

 This should work.

 Kai


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

AjaxFallbackDefaultDataTable and DropDownChoice

2008-03-10 Thread jnorris

Hi All,

I have implemented an AjaxFallbackDefaultDataTable and would like to put a
DropDownChoice in one of the columns to list values.  For example in a table
of users a roles column would show the roles assigned to the user as a
dropdown list.  I haven't been able to find any examples of doing this.  If
anyone has already done something like this or has any suggestions on how to
do it, I'd appreciate the help.  I tried to extend AbstractColumn but
couldn't get it to work due to cellItem.add( ddc ) throwing an exception
(Component cell must be applied to a tag of type 'select', not '' ). 

Thanks,
Jim


-- 
View this message in context: 
http://www.nabble.com/AjaxFallbackDefaultDataTable-and-DropDownChoice-tp15950744p15950744.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: Russian localization

2008-03-10 Thread Juha Alatalo

Frank Bille wrote:

On Thu, Mar 6, 2008 at 3:16 PM, Juha Alatalo [EMAIL PROTECTED]
wrote:


Hi,

Russian language supports seems to be broken. Calling getString() causes
class cast exception (stack trace in the end of the mail).

Removing file org\apache\wicket\Application_ru.xml seems to be fixing
the provlem. Should I create a jire issue for that?



Yes please. I don't think the solution is to remove the file but instead fix
the problem itself. :-)


Yes :)

Created an issue with simple test case:
https://issues.apache.org/jira/browse/WICKET-1407

- Juha

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



styling thead in DataTable

2008-03-10 Thread Eyal Golan
Hey all,
I am having an issue that seems to be simple, but still, no success.

I have a normal DataTable.
I add to it the toptoolbars manually:
HeadersToolbar thead = new HeadersToolbar(entityDataTable,
entitiesProvider);
entityDataTable.addTopToolbar(thead);
This is how it looks in the HTML:
table wicket:id=entitiesList class=browserTable

This is how (part of) the generated HTML looks like:
table class=browserTable wicket:id=entitiesList
thead
tr class=headers
th wicket:id=header class=wicket_orderUpwicket:border
_moz-userdefined=a wicket:id=orderByLink class=
href=?wicket:interface=:4:tabs:browserTabbedPanel:panel:entitiesList:topToolbars:2:toolbar:headers:1:header:orderByLink::ILinkListener::wicket:body
_moz-userdefined=span wicket:id=labelPerson
ID/span/wicket:body/a/wicket:border
/th

I want a simple thing: I want to align the header labels to the left.
The problem(s):
- style doesn't have an attribute of align. Only vertical-align.
- I tried to add to the HeadersToolbar an AttributeModifier:
thead.add(new AttributeModifier(align, true, new Model(left)));

Nothing seems working.
I am using Firebug and the label thead keeps with no attribute.

Can anyone help?

Thank a lot


-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: How to flush(?) page without using setResponsePage

2008-03-10 Thread Jörn Zaefferer
Kudos Maurice! That was the one little thing that fixed most of the
issue I was having with Wicket. I've rewrote now most of the code,
using models and overwriting isVisible methods, works much better now.

Thanks
Jörn

On Mon, Mar 10, 2008 at 1:58 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
 The way you describe it, it sounds to me like you are not properly
  using a model to update the label.
  I am guessing you are doing something like new Label(id,Logged in)
  or new Label(id,new Model(Logged in)).
  What you have to remember is that you are in the constructor here,
  rendering the same page does not trigger a new page object and thus no
  constructor call.
  In order to solve this you need a model to dynamically return whether
  a user is logged in or not.
  Something like this should do the job:
  class MyModel extends loadableDetachableModel
  {
   public Object load()
   {
   //pseudo code:
   if(Session.get().getUser()!=null)
return Logged in;
   return Not logged in;
   }
  }

  See 
 http://www.theserverside.com/tt/articles/article.tss?l=IntroducingApacheWicket
  for an introduction to Wicket including models

  Maurice

  On Mon, Mar 10, 2008 at 1:10 PM, Jörn Zaefferer


 [EMAIL PROTECTED] wrote:
   Ok. An example for the basic problem:
  
There is a label that displays Loggein as ... when the user is
logged in, and Not logged in when he's not. If the user logins in
using the login form, the label doesn't change, unless I use
setResponsePage.
  
I figured out that I can use setResponsePage(getPage().getClass()); to
keep the user on the same page, but that still looks like a workaround
to me, not a solution.
  
Jörn
  
  
  
On Mon, Mar 10, 2008 at 11:46 AM, Maurice Marrink [EMAIL PROTECTED] 
 wrote:
 If you don't set a responsepage the current page will be served again.
  For determining what might be the problem of the login not working we
  need to see some code and a better description of what is not working.

  Maurice



  On Mon, Mar 10, 2008 at 11:39 AM, Jörn Zaefferer
  [EMAIL PROTECTED] wrote:
   Hi,
  
our application has a login form on every page, defined in a Base
WebPage. So far we have to use
setResponsePage(getApplication().getHomePage()); to update the page,
otherwise it looks like the login didn't work, even if it did. But 
 we
don't want to go to the homepage, the user wants to stay on the
current page instead.
  
How can I flush the current page?
  
Thanks
Jörn Zaefferer
  

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

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



Re: DropDownChoice getting value into the model

2008-03-10 Thread Martijn Dashorst
First:

You bind the DDC to the wrong model. You bind it directly to the LDM
instead of the vendor's state property.

DropDownChoice stateFC = new DropDownChoice(state, states, choiceRenderer);

should be sufficient.

Second:

Your current setup assumes that the Vendor#state is of type
SelectOption (from the point of view of the DDC's model setup). I
would rewrite your setup to the following: make State a first class
citizen. Something like:

public class State {
private String short;
private String name;

. geters/setters
}

and then:

public class Vendor {
private State state;
}

ArrayListState states = Arrays.asList(new State(AL, Alabama), ...);

DropDownChoice stateFC = new DropDownChoice(state, new
PropertyModel(vendorModel, state), states, new
ChoiceRenderer(short, name);

(I've added the propertymodel to clarify to which property you
actually bind). Now everything should line up correctly.

Martijn

On 3/10/08, rmattler [EMAIL PROTECTED] wrote:

  I don't understand.  Vendor.state and SelectOption.state are both Strings.

  I cut down my form to only have state on the form so I can post all the
  code.  The code pulls the correct data from the database and displays it on
  the form but when I save it is gives me the following error.


  java.lang.UnsupportedOperationException: Model class

 com.myprepress.pages.vendor.profile.VendorEntry2$1 does not support
  setObject(Object)


  html
  form wicket:id=vendorEntryForm2
 select wicket:id=state
 option/option
 /select
 input type=submit wicket:id=save value=Savebr
  /form
  /html

  public class VendorEntry2 extends BasePage {

 @SpringBean
 VendorDAO vendorDAO;
 private long tblId;
 private Integer oldVersionNumber;

 public VendorEntry2(long id) {

 tblId = id;
 // get the version number to ensure that the object hasn't 
 been saved to
 // the database by another users
 // -1 is a new object
 if (id != -1) {
 Vendor vendor = null;
 try {
 vendor = vendorDAO.load(id);
 oldVersionNumber = vendor.getVersionNumber();
 } catch (DataObjectNotFoundException donfe) {
 getSession().error(Object not found);
 throw new RestartResponseException(new 
 ErrorObjectNotFound(new
  VendorList()));
 }
 }

 // load the object to be displayed to the screen
 // make it LoadableDetachableModel so it is not stored in the 
 session
 // -1 is a new object

 IModel vendorModel = new LoadableDetachableModel() {
 protected Object load() {

 if (tblId == -1) {
 return new Vendor();
 } else {
 return vendorDAO.load(tblId);
 }
 }
 };

 // add form
 Form form = new Form(vendorEntryForm2, new
  CompoundPropertyModel(vendorModel)) {
 protected void onSubmit() {
 Vendor updatedVendor = (Vendor) 
 getModelObject();
 try {
 vendorDAO.save(updatedVendor, 
 oldVersionNumber);
 setResponsePage(VendorList.class);
 } catch (DataObjectModifiedException dome) {
 // try again);
 setResponsePage(new VendorEntryError(
 Data changed by 
 another user.  Please refresh and try again.,
  tblId));
 }
 }
 };
 add(form); // must add form before adding other components


 // add state
 ArrayListSelectOption states = new 
 ArrayListSelectOption();
 states.add(new SelectOption(AL, Alabama));
 states.add(new SelectOption(OH, Ohio));
 states.add(new SelectOption(NY, New York));
 ChoiceRenderer choiceRenderer = new ChoiceRenderer(display, 
 state);

 DropDownChoice stateFC = new DropDownChoice(state, 
 vendorModel, new
  Model(states),
 choiceRenderer);

 form.add(stateFC);

 // add submit button
 form.add(new Button(save));

 }

  }

  @Entity
  @Table(name = vendor, schema = public)

 public class Vendor implements java.io.Serializable {


 

Re: Custom Exception/Error page

2008-03-10 Thread Martijn Dashorst
It is a really good way to blow up your exchange server... We had a
bug somewhere that generated exceptions in an endless loop. It took
exchange over a whole day to empty the queue.

Martijn

On 3/10/08, Edvin Syse [EMAIL PROTECTED] wrote:
 Wow, that's a very nice solution. Thanks :))

  -- Edvin

  Sebastiaan van Erk skrev:

  I would say that the standard practice is probably to use your logging
   subsystem to email you the exception.
  
   For example, if you are using log4j to log, you could add something like
   this to your log4j.xml file:
  
   appender name=ERRORMAILER
   class=org.apache.log4j.net.SMTPAppender
   param name=from value=[EMAIL PROTECTED] /
   param name=to value=[EMAIL PROTECTED] /
   param name=subject value=[mydomain] ERROR /
   param name=SMTPHost value=localhost /
   param name=threshold value=ERROR /
   layout class=org.apache.log4j.PatternLayout
   param name=ConversionPattern value=%d %-5p - [%C:%L]
   %m%n /
   /layout
   /appender
  
   Regards,
   Sebastiaan
  
  
   Edvin Syse wrote:
   Hi. In my application I do:
  
   getApplicationSettings().setInternalErrorPage(ErrorPage.class);
   
 getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
  
  
   to display a custom page for error messages. I would also like to
   email myself the exception - is it possible that I can get a hold of
   the throwable from the ErrorPage.class, or do I have to explicitly
   catch and rethrow a RestartResponseException to obtain the exception?
  
   -- Edvin
  
  
  
   -
   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]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: AjaxFallbackDefaultDataTable and DropDownChoice

2008-03-10 Thread Martijn Dashorst
Instead of directly adding the DDC to the column, add a panel or
fragment containing the DDC.

Martijn

On 3/10/08, jnorris [EMAIL PROTECTED] wrote:

  Hi All,

  I have implemented an AjaxFallbackDefaultDataTable and would like to put a
  DropDownChoice in one of the columns to list values.  For example in a table
  of users a roles column would show the roles assigned to the user as a
  dropdown list.  I haven't been able to find any examples of doing this.  If
  anyone has already done something like this or has any suggestions on how to
  do it, I'd appreciate the help.  I tried to extend AbstractColumn but
  couldn't get it to work due to cellItem.add( ddc ) throwing an exception
  (Component cell must be applied to a tag of type 'select', not '' ).

  Thanks,
  Jim



  --
  View this message in context: 
 http://www.nabble.com/AjaxFallbackDefaultDataTable-and-DropDownChoice-tp15950744p15950744.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]




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: Simple question about alert string

2008-03-10 Thread john_wicket



The link should be AjaxLink or AJaxSubmitButton or AjaxSubmitLink



public onSubmit(AJaxtarget target,Form form){

//do your operations...

String javaScript = alert(' + are you sure to delete
+ ');
target.addJavascript(javaScript);
}






tsuresh wrote:
 
  Hello, 
 I have a delete link in a list of names. If  I click on the delete link of
 name then the message should be are you sure to delete selectedName?
 
 String selectedName = user1;
 deleteLink.add(new SimpleAttributeModifier(onclick, return confirm('Are
 you sure to delete?');));
 
 I am not able to append this selectedName after: Are you sure to delete 
 How to append this?
 thanks
 

-- 
View this message in context: 
http://www.nabble.com/Simple-question-about-alert-string-tp15950581p15950760.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: Custom Exception/Error page

2008-03-10 Thread Sebastiaan van Erk
Logging stuff in endless loops is generally a good way to blow things 
up. ;-) I remember back in my university days a friend of mine did some 
logging on /tmp on 150 or so Sun workstations. It  went into an endless 
loop and all of the workstations became inaccessible (/tmp and virtual 
memory were connected, don't ask why, so login failed with an out of 
memory error :-))


What you can do in case your mail server doesn't throttle and protect 
you against DOS-attacks, is use log4j's triggering event evaluator and 
put throttling into that.


See:

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/net/SMTPAppender.html

and:

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/spi/TriggeringEventEvaluator.html)

Thus by limiting your buffer size of the SMTPAppender and make sure you 
can only have N triggering events per hour, you can easily avoid this 
problem.


Good point though, Martijn. :-)

Regards,
Sebastiaan



Martijn Dashorst wrote:

It is a really good way to blow up your exchange server... We had a
bug somewhere that generated exceptions in an endless loop. It took
exchange over a whole day to empty the queue.

Martijn

On 3/10/08, Edvin Syse [EMAIL PROTECTED] wrote:

Wow, that's a very nice solution. Thanks :))

 -- Edvin

 Sebastiaan van Erk skrev:


I would say that the standard practice is probably to use your logging

  subsystem to email you the exception.
 
  For example, if you are using log4j to log, you could add something like
  this to your log4j.xml file:
 
  appender name=ERRORMAILER
  class=org.apache.log4j.net.SMTPAppender
  param name=from value=[EMAIL PROTECTED] /
  param name=to value=[EMAIL PROTECTED] /
  param name=subject value=[mydomain] ERROR /
  param name=SMTPHost value=localhost /
  param name=threshold value=ERROR /
  layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern value=%d %-5p - [%C:%L]
  %m%n /
  /layout
  /appender
 
  Regards,
  Sebastiaan
 
 
  Edvin Syse wrote:
  Hi. In my application I do:
 
  getApplicationSettings().setInternalErrorPage(ErrorPage.class);
  
getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
 
 
  to display a custom page for error messages. I would also like to
  email myself the exception - is it possible that I can get a hold of
  the throwable from the ErrorPage.class, or do I have to explicitly
  catch and rethrow a RestartResponseException to obtain the exception?
 
  -- Edvin
 
 
 
  -
  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]







smime.p7s
Description: S/MIME Cryptographic Signature


Double submit problem

2008-03-10 Thread Joel Hill
I'm trying to prevent the double submit problem, where the user clicks the 
submit button more than once causing a double post.

I tried implementing the soluion suggested here: 
http://www.nabble.com/Re%3A-double-form-submission-handling---p13850262.html

The problem is if there's a validation error and the user gets sent back to the 
same page (without a call to setResponsePage), the page still registers as 
submitted, so when the user fixes the form and submits, it's stuck in the 
resubmit state (which in my case sends the user to an error page).  I even have 
one page where I don't call setResponsePage on a successful submit, because it 
just returns to that same page after a submit because there's a lot of overhead 
in constructing the page the first time.  I don't want the submit to take a 
long time.

I tried resetting the submitted boolean during the submit process, but no 
matter where I could find to put that code, it always seems to get executed 
before the 2nd submit get processed by wicket.

I'd prefer not to implment a javascript solution (e.g. disabling the submit 
button after the first click), becuase I think the soultion linked above lends 
itself better to reusability across any form.  So is there any way to 
differentiate between a double submit situation, and simply not calling 
setResponsePage?  Or is there anywhere in wicket I can reset the submitted flag 
AFTER the double submit has begun to process (I'd prefer not to implement an 
artificial timer to reset the flag after a hard-coded number of seconds).  Some 
point in the request cycle that occurs after the old page is unloaded?

Now that I think about it, maybe some ajax that fires on the onunload event 
would be appropriate here.  I'll try that while I wait to see of anyone has any 
better suggestions.

Thanks.

Joel


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



Re: Double submit problem

2008-03-10 Thread Martijn Dashorst
Not 100% sure, but you could implement a NoDoubleSubmitForm with a
couple of tweaks:

form ...
input type=hidden wicket:id=submitNr /

/form

class NoDoubleSubmitForm {
private int submitNr;

NoDoubleSubmitForm(String id, IModel model) {
super(id, model);
add(new HiddenField(submitNr, new Model(submitNr)).add(new
AbstractValidator() { boolean validate() {  return submitNr == input;
} );

}
public void onSubmit() {
submitNr++;
}
}

It needs some refining, but this should prevent a double submit from
happening (the validation fails for the second submit).

Martijn

On 3/10/08, Joel Hill [EMAIL PROTECTED] wrote:
 I'm trying to prevent the double submit problem, where the user clicks the 
 submit button more than once causing a double post.

  I tried implementing the soluion suggested here: 
 http://www.nabble.com/Re%3A-double-form-submission-handling---p13850262.html

  The problem is if there's a validation error and the user gets sent back to 
 the same page (without a call to setResponsePage), the page still registers 
 as submitted, so when the user fixes the form and submits, it's stuck in the 
 resubmit state (which in my case sends the user to an error page).  I even 
 have one page where I don't call setResponsePage on a successful submit, 
 because it just returns to that same page after a submit because there's a 
 lot of overhead in constructing the page the first time.  I don't want the 
 submit to take a long time.

  I tried resetting the submitted boolean during the submit process, but no 
 matter where I could find to put that code, it always seems to get executed 
 before the 2nd submit get processed by wicket.

  I'd prefer not to implment a javascript solution (e.g. disabling the submit 
 button after the first click), becuase I think the soultion linked above 
 lends itself better to reusability across any form.  So is there any way to 
 differentiate between a double submit situation, and simply not calling 
 setResponsePage?  Or is there anywhere in wicket I can reset the submitted 
 flag AFTER the double submit has begun to process (I'd prefer not to 
 implement an artificial timer to reset the flag after a hard-coded number of 
 seconds).  Some point in the request cycle that occurs after the old page is 
 unloaded?

  Now that I think about it, maybe some ajax that fires on the onunload event 
 would be appropriate here.  I'll try that while I wait to see of anyone has 
 any better suggestions.

  Thanks.

  Joel


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




-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: Display text depending on user being logged in and intercept pages

2008-03-10 Thread Jörn Zaefferer
Thanks, that worked.

Jörn

On Mon, Mar 10, 2008 at 1:25 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 wicket:message key=beforeLink/wicket:messagea
  href=#wicket:message
  key=insideLink/wicket:message/awicket:message
  key=afterLink/wicket:message





  On 3/10/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
   Hi Martijn,
  
thanks for the response.
  
Though your suggestion doesn't solve the problem of embedding a Link
within a Label. I need to be able to translate the text surrounding
the link and the text of the link itself. Depending on the language,
the position of the link varies. I can't embed a Link within a Label
and I can't wrap the Link with Labels, because then the position would
be fixed.
  
In other words: How would you implement the HaveToSigninFragment?
  
Thanks
  
   Jörn
  
  
On Mon, Mar 10, 2008 at 12:25 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 Use fragments for that instead to switch between the two. So you have
  a UserRegistrationPanel that provides this functionality. On the panel
  you create 2 fragments: one for just the label, another for the label
  and link. Now you can do in onbeforerender:

  if(loggedIn)
  addOrReplace(new WelcomeFragment());
  else addOrReplace(new HaveToSigninFragment());


  Martijn



  On 3/10/08, Jörn Zaefferer [EMAIL PROTECTED] wrote:
   Hi,
  
I'd need some help on getting the following to work properly:
  
If the user is logged in, display some text Hello {name}. If he
isn't logged in, display a text Please register or login instead,
where register is a link to the register page. If he clicks that
link and submits the register form, go back to the former page - use
the register page as an intercept page.
  
To start with, I don't know how to embed a link inside the label 
 only
if the user is logged in - how should I structure the markup for 
 that?
A Label component discards its body, so just nesting the link 
 doesn't
work.
  
The other problem is that redirectToInterceptPage does the redirect,
but if I submit the register form I get a MarkupException about a
missing component. It looks like the intercept mechanism redirects
back to the original page, but loads the wrong template, here the
register-page-template. I've got no idea how to get that to work, so
far I replaced the intercept with a normal setResponsePage, which is
far from optimal.
  
Thanks
Jörn Zaefferer
  

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


  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.1 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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


  --
  Buy Wicket in Action: http://manning.com/dashorst
  Apache Wicket 1.3.1 is released
  Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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



Re: Problem when MIgrating from 1.2 to 1.3 - Parameters removed from HomePage URL

2008-03-10 Thread Rajiv Jivan
This doesnt work. The QueryStringUrlCodingStrategy class isn't hit.
When going to URL
http://localhost/helloworld?name=John

the code first calls the method
WicketServlet.doGet(..)
which delegates the call to WicketFilter.doGet(..)

As pointed in my first post, WicketFilter.doGet checks if the URL is
the home page and if so, redirects without appending the parameters.


On Fri, Mar 7, 2008 at 8:32 PM, David Leangen [EMAIL PROTECTED] wrote:

  I dunno.

  I thought you were talking about mounted urls, whose urls displays are
  rendered by a UrlCodingStrategy. If you're using the
  QueryStringUrlCodingStrategy, then my guess is that it's relevant.

  If you want to know for sure, try applying the patch to your local wicket,
  or maybe try adding a break and debugging at the lines changed by the patch.
  If that doesn't work, then I guess you'd better post your question again.



  Cheers,
  Dave




   -Original Message-
   From: Rajiv Jivan [mailto:[EMAIL PROTECTED]

  Sent: 8 March 2008 00:28
   To: users@wicket.apache.org


  Subject: Re: Problem when MIgrating from 1.2 to 1.3 - Parameters
   removed from HomePage URL
  
  
   Are we talking about the same thing? Your patch removes the trailing /
   while in my case without the trailing / the parameters aren't
   recognized.
  
   On Thu, Mar 6, 2008 at 6:11 PM, David Leangen [EMAIL PROTECTED] wrote:
   
 I've already filed an issue and submitted a patch for this:
   
  https://issues.apache.org/jira/browse/WICKET-1385
   
   
 Cheers,
 Dave
   
   
   
   
   
  -Original Message-
  From: Rajiv Jivan [mailto:[EMAIL PROTECTED]
  Sent: 7 March 2008 05:47
  To: users@wicket.apache.org
  Subject: Problem when MIgrating from 1.2 to 1.3 - Parameters
  removed from HomePage URL
 
 
  We have a site developed using Wicket 1.2. One of the use cases we
  have is to pass in a parameter on the home page, and based on that we
  perform some actions. e.g
 
  http://localhost/helloworld?name=John
 
  This functionality seem to be broken in 1.3. When passing in
  parameters on the home page URL they are stripped. Going through the
  Wicket I have narrowed down to an issue in WicketFilter
 
  // Special-case for home page - we redirect to add a
  trailing slash.
  if (relativePath.length() == 0 
 
 
   !Strings.stripJSessionId(servletRequest.getRequestURI()).endsWith(/))
  {
  final String redirectUrl =
  servletRequest.getRequestURI() + /;
 
  servletResponse.sendRedirect(servletResponse.encodeRedirectURL(red
  irectUrl));
  return;
  }
 
  The only workaround I have is to change the URL to
  http://localhost/helloworld/?name=John
  Notice the traling / after helloworld
 
  Am I missing something or is this a bug ?
 
  Thanks,
 
  Rajiv
 
  -
  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]
  
  


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



Go edit a list item and come back. How-to?

2008-03-10 Thread Johnnie

Hi,

I have a list (DataTable) of items and when I choose one I want to be taken
to a page where I can edit the it (with a form). Upon completion (OK button
is clicked) I want to be taken back to the page I was on the list and see my
changes reflected there. How do I do this?

Best regards,

Johnny
-- 
View this message in context: 
http://www.nabble.com/Go-edit-a-list-item-and-come-back.-How-to--tp15950856p15950856.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: Go edit a list item and come back. How-to?

2008-03-10 Thread João Ferreira
Hi Maurice,

Thank you for your quick response.

Best regards,

Johnny

-Original Message-
From: Maurice Marrink [mailto:[EMAIL PROTECTED] 
Sent: segunda-feira, 10 de Março de 2008 16:17
To: users@wicket.apache.org
Subject: Re: Go edit a list item and come back. How-to?

Upon clicking the list item, pass the page to your edit page and store
it there. e.g.
onclick()
{
 setResponsePage(new EditPage(...,this.getPage());
}
Then in the onsubmit of your editpage set the responsepage to that page.

Maurice

On Mon, Mar 10, 2008 at 5:03 PM, Johnnie [EMAIL PROTECTED] wrote:

  Hi,

  I have a list (DataTable) of items and when I choose one I want to be taken
  to a page where I can edit the it (with a form). Upon completion (OK button
  is clicked) I want to be taken back to the page I was on the list and see my
  changes reflected there. How do I do this?

  Best regards,

  Johnny
  --
  View this message in context: 
 http://www.nabble.com/Go-edit-a-list-item-and-come-back.-How-to--tp15950856p15950856.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]


Este email e quaisquer ficheiros a ele anexados são confidenciais e 
destinados, exclusivamente, à pessoa ou entidade a quem foi endereçado. 
Se recebeu este email por erro, por favor, contacte-nos. 

Obrigado 

Prologica, SA 

[EMAIL PROTECTED] 

***
 

This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they 
are addressed. If you have received this email in error please notify us. 

Thank you. 

Prologica, SA 

[EMAIL PROTECTED] 

***
 


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



Re: FeedbackMessages per field

2008-03-10 Thread Igor Vaynberg
see ComponentFeedbackPanel

-igor


On Mon, Mar 10, 2008 at 2:56 AM, Daniel Alonso [EMAIL PROTECTED] wrote:

  Hello everybody! I'm a newbie with wicket and during my first examples I have
  had a problem that I don't know how to solve. The fact is that I have the
  typical login form, and I want to notify the users possible errors by
  showing an icon error next to each input field, just like showed in the
  image attached.

  http://www.nabble.com/file/p15950642/sample.jpg

  Is there an easy way to do it, because I have been googleing, looking the
  wiki, reading the ajax examples… but nothing suits at all. I'm developing
  with wicket 1.3.1

  Thanks in advance for your kindness ;D

  --
  View this message in context: 
 http://www.nabble.com/FeedbackMessages-per-field-tp15950642p15950642.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]



Re: Go edit a list item and come back. How-to?

2008-03-10 Thread Johnnie

Maurice said:

Upon clicking the list item, pass the page to your edit page and store it
there. e.g.
onclick()
{
 setResponsePage(new EditPage(...,this.getPage()); } Then in the onsubmit of
your editpage set the responsepage to that page.

Thank you, Maurice.


Johnnie wrote:
 
 Hi,
 
 I have a list (DataTable) of items and when I choose one I want to be
 taken to a page where I can edit the it (with a form). Upon completion (OK
 button is clicked) I want to be taken back to the page I was on the list
 and see my changes reflected there. How do I do this?
 
 Best regards,
 
 Johnny
 

-- 
View this message in context: 
http://www.nabble.com/Go-edit-a-list-item-and-come-back.-How-to--tp15950856p15950893.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]



Using single instance of page per browser window

2008-03-10 Thread damischa

Hi,
I've used JSF (MyFaces + ICEfaces) before and I found it quite handy to be
able to use one instance of page per session. User can navigate away from a
view and the changes he has made to that view are remembered when the user
returns to the view. I like this especially when implementing tab-like
navigation: every page is its own tab and every tab has its own URL. There
is no need to make one mammoth page with all the tabs and user can move
between the tabs and the changes are remembered.

Of course since its possible in wicket I think that the best way to
implement this kind of behavior in wicket is to use one instance of page per
browser window or browser tab rather than per session. This avoids confusion
when user has multiple windows open.

I think that this kind of feature has been discussed before, but I could not
find any suggestion how to implement it in wicket 1.3. So what would be a
good way to implement one page instance per browser window/browser tab in
1.3?

I tried saving pageClassName + pageMapName = pageId entries to session
attributes in page's onRender method and using a specialized link to lookup
the page instance every time it is needed. This seems to work but it feels
kind of hacky.

Is this feature something that could be easily implemented as a framework
feature? Or do others even consider it useful?

Thanks in advance,
Mika
-- 
View this message in context: 
http://www.nabble.com/Using-single-instance-of-page-per-browser-window-tp15950920p15950920.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: Using single instance of page per browser window

2008-03-10 Thread Igor Vaynberg
actually it should already be done for you...

when you open a page in a different tab/window wicket clones the page
into a different pagemap so now you have two copies of the page that
can be manipulated individually...

-igor


On Mon, Mar 10, 2008 at 10:58 AM, damischa [EMAIL PROTECTED] wrote:

  Hi,
  I've used JSF (MyFaces + ICEfaces) before and I found it quite handy to be
  able to use one instance of page per session. User can navigate away from a
  view and the changes he has made to that view are remembered when the user
  returns to the view. I like this especially when implementing tab-like
  navigation: every page is its own tab and every tab has its own URL. There
  is no need to make one mammoth page with all the tabs and user can move
  between the tabs and the changes are remembered.

  Of course since its possible in wicket I think that the best way to
  implement this kind of behavior in wicket is to use one instance of page per
  browser window or browser tab rather than per session. This avoids confusion
  when user has multiple windows open.

  I think that this kind of feature has been discussed before, but I could not
  find any suggestion how to implement it in wicket 1.3. So what would be a
  good way to implement one page instance per browser window/browser tab in
  1.3?

  I tried saving pageClassName + pageMapName = pageId entries to session
  attributes in page's onRender method and using a specialized link to lookup
  the page instance every time it is needed. This seems to work but it feels
  kind of hacky.

  Is this feature something that could be easily implemented as a framework
  feature? Or do others even consider it useful?

  Thanks in advance,
  Mika
  --
  View this message in context: 
 http://www.nabble.com/Using-single-instance-of-page-per-browser-window-tp15950920p15950920.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]



Re: append a converter or coversion function

2008-03-10 Thread Eelco Hillenius
On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 i thought we agreed converters were type converters...

Did we? :-)

Eelco

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



Re: append a converter or coversion function

2008-03-10 Thread Igor Vaynberg
yes, since the converter interface now has

convertToObject(String value);
convertToString(Object value);

not just a single convertTo(Object object, Class type)

it makes it rather explicit that the converter is meant to convert
something to a string and back...no?

-igor


On Mon, Mar 10, 2008 at 11:35 AM, Eelco Hillenius
[EMAIL PROTECTED] wrote:
 On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:

  i thought we agreed converters were type converters...

  Did we? :-)

  Eelco



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



Re: append a converter or coversion function

2008-03-10 Thread Eelco Hillenius
On Mon, Mar 10, 2008 at 11:37 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 yes, since the converter interface now has

  convertToObject(String value);
  convertToString(Object value);

  not just a single convertTo(Object object, Class type)

  it makes it rather explicit that the converter is meant to convert
  something to a string and back...no?

It does.

Eelco

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



Authentication and Assigning a Session Id

2008-03-10 Thread Zappaterrini, Larry
Hi Everyone,
 
Is it possible to control when Wicket issues a valid session identifier to the 
user? The use case I am trying to support is only assign a valid session id to 
the user after they successfully authenticate. This is important to prevent 
possible session hijacking. When dealing with HTTP sessions directly you can 
copy the session contents, invalidate the session, request a new session, and 
put the contents of the original session into the new one. I've browsed through 
some of Wicket's source code to see if this is easily accomplished but I 
haven't been able to figure it out. Does anyone have any input or suggestions?
 
Thanks,
Larry
 

__

The information contained in this message is proprietary and/or confidential. 
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not 
disclose, 
distribute or use the message in any manner; and (iii) notify the sender 
immediately. In addition, 
please be aware that any message addressed to our domain is subject to 
archiving and review by 
persons other than the intended recipient. Thank you.
_

Re: Authentication and Assigning a Session Id

2008-03-10 Thread Igor Vaynberg
session management is handled by the servlet container and is outside
wicket's control. perhaps you can use a cookie in conjunction with a
check in requestcycle.onbeginrequest to do something like what you
want...

-igor


On Mon, Mar 10, 2008 at 12:43 PM, Zappaterrini, Larry
[EMAIL PROTECTED] wrote:
 Hi Everyone,

  Is it possible to control when Wicket issues a valid session identifier to 
 the user? The use case I am trying to support is only assign a valid session 
 id to the user after they successfully authenticate. This is important to 
 prevent possible session hijacking. When dealing with HTTP sessions directly 
 you can copy the session contents, invalidate the session, request a new 
 session, and put the contents of the original session into the new one. I've 
 browsed through some of Wicket's source code to see if this is easily 
 accomplished but I haven't been able to figure it out. Does anyone have any 
 input or suggestions?

  Thanks,
  Larry


  __

  The information contained in this message is proprietary and/or 
 confidential. If you are not the
  intended recipient, please: (i) delete the message and all copies; (ii) do 
 not disclose,
  distribute or use the message in any manner; and (iii) notify the sender 
 immediately. In addition,
  please be aware that any message addressed to our domain is subject to 
 archiving and review by
  persons other than the intended recipient. Thank you.
  _

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



Re: Authentication and Assigning a Session Id

2008-03-10 Thread Maurice Marrink
Igor,

I thought that as long as you only use stateless pages and don't throw
RestartResponseExceptions the http session remained temporary (as
in is not assigned an id).

Anyway Wicket-Security automatically binds the wicket session (assigns
id to http session) after a successful login, if the session is not
already bound. But there is no guarantee that the session is not bound
until then.

Maurice

On Mon, Mar 10, 2008 at 9:01 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 session management is handled by the servlet container and is outside
  wicket's control. perhaps you can use a cookie in conjunction with a
  check in requestcycle.onbeginrequest to do something like what you
  want...

  -igor




  On Mon, Mar 10, 2008 at 12:43 PM, Zappaterrini, Larry
  [EMAIL PROTECTED] wrote:
   Hi Everyone,
  
Is it possible to control when Wicket issues a valid session identifier 
 to the user? The use case I am trying to support is only assign a valid 
 session id to the user after they successfully authenticate. This is 
 important to prevent possible session hijacking. When dealing with HTTP 
 sessions directly you can copy the session contents, invalidate the session, 
 request a new session, and put the contents of the original session into the 
 new one. I've browsed through some of Wicket's source code to see if this is 
 easily accomplished but I haven't been able to figure it out. Does anyone 
 have any input or suggestions?
  
Thanks,
Larry
  
  
__
  
The information contained in this message is proprietary and/or 
 confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) 
 do not disclose,
distribute or use the message in any manner; and (iii) notify the sender 
 immediately. In addition,
please be aware that any message addressed to our domain is subject to 
 archiving and review by
persons other than the intended recipient. Thank you.
_

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



Re: Authentication and Assigning a Session Id

2008-03-10 Thread Igor Vaynberg
yes, if all that is true. but you still do not control the jsessionid token...

-igor


On Mon, Mar 10, 2008 at 1:21 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
 Igor,

  I thought that as long as you only use stateless pages and don't throw
  RestartResponseExceptions the http session remained temporary (as
  in is not assigned an id).

  Anyway Wicket-Security automatically binds the wicket session (assigns
  id to http session) after a successful login, if the session is not
  already bound. But there is no guarantee that the session is not bound
  until then.

  Maurice



  On Mon, Mar 10, 2008 at 9:01 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
   session management is handled by the servlet container and is outside
wicket's control. perhaps you can use a cookie in conjunction with a
check in requestcycle.onbeginrequest to do something like what you
want...
  
-igor
  
  
  
  
On Mon, Mar 10, 2008 at 12:43 PM, Zappaterrini, Larry
[EMAIL PROTECTED] wrote:
 Hi Everyone,

  Is it possible to control when Wicket issues a valid session 
 identifier to the user? The use case I am trying to support is only assign a 
 valid session id to the user after they successfully authenticate. This is 
 important to prevent possible session hijacking. When dealing with HTTP 
 sessions directly you can copy the session contents, invalidate the session, 
 request a new session, and put the contents of the original session into the 
 new one. I've browsed through some of Wicket's source code to see if this is 
 easily accomplished but I haven't been able to figure it out. Does anyone 
 have any input or suggestions?

  Thanks,
  Larry


  __

  The information contained in this message is proprietary and/or 
 confidential. If you are not the
  intended recipient, please: (i) delete the message and all copies; 
 (ii) do not disclose,
  distribute or use the message in any manner; and (iii) notify the 
 sender immediately. In addition,
  please be aware that any message addressed to our domain is subject to 
 archiving and review by
  persons other than the intended recipient. Thank you.
  _
  
-
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]



RE: Authentication and Assigning a Session Id

2008-03-10 Thread Zappaterrini, Larry
While it is true that the jsessionid token is not controlled by application 
code, you can request a new one be generated by calling invalidate on the 
session then request a new session by calling getSession(true) on the request 
as I mentioned in my original message. Essentially it creates the illusion of 
one contiguous session to the user when it is actually two different sessions. 
I suppose I could attempt to do the same thing from within my application code 
in Wicket and use the HTTP request to accomplish it. I was just hoping to 
preserve Wicket's approach of treating HTTP as an implementation detail and not 
having to include any references to it in my code.



From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Mon 3/10/2008 4:24 PM
To: users@wicket.apache.org
Subject: Re: Authentication and Assigning a Session Id



yes, if all that is true. but you still do not control the jsessionid token...

-igor


On Mon, Mar 10, 2008 at 1:21 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
 Igor,

  I thought that as long as you only use stateless pages and don't throw
  RestartResponseExceptions the http session remained temporary (as
  in is not assigned an id).

  Anyway Wicket-Security automatically binds the wicket session (assigns
  id to http session) after a successful login, if the session is not
  already bound. But there is no guarantee that the session is not bound
  until then.

  Maurice



  On Mon, Mar 10, 2008 at 9:01 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
   session management is handled by the servlet container and is outside
wicket's control. perhaps you can use a cookie in conjunction with a
check in requestcycle.onbeginrequest to do something like what you
want...
  
-igor
  
  
  
  
On Mon, Mar 10, 2008 at 12:43 PM, Zappaterrini, Larry
[EMAIL PROTECTED] wrote:
 Hi Everyone,

  Is it possible to control when Wicket issues a valid session 
 identifier to the user? The use case I am trying to support is only assign a 
 valid session id to the user after they successfully authenticate. This is 
 important to prevent possible session hijacking. When dealing with HTTP 
 sessions directly you can copy the session contents, invalidate the session, 
 request a new session, and put the contents of the original session into the 
 new one. I've browsed through some of Wicket's source code to see if this is 
 easily accomplished but I haven't been able to figure it out. Does anyone 
 have any input or suggestions?

  Thanks,
  Larry


  __

  The information contained in this message is proprietary and/or 
 confidential. If you are not the
  intended recipient, please: (i) delete the message and all copies; 
 (ii) do not disclose,
  distribute or use the message in any manner; and (iii) notify the 
 sender immediately. In addition,
  please be aware that any message addressed to our domain is subject to 
 archiving and review by
  persons other than the intended recipient. Thank you.
  _
  
-
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]



__

The information contained in this message is proprietary and/or confidential. 
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not 
disclose, 
distribute or use the message in any manner; and (iii) notify the sender 
immediately. In addition, 
please be aware that any message addressed to our domain is subject to 
archiving and review by 
persons other than the intended recipient. Thank you.
_
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: append a converter or coversion function

2008-03-10 Thread Johan Compagner
But why cant converToObject(String) not return a string??
Thats up to the developer.

So

textfield = new TextField()
{
  getConverter(Class clz)
  {
  }
}
textfield.setType(String.class)

that should work fine (and it does if i am not mistaken)

johan



On Mon, Mar 10, 2008 at 7:37 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 yes, since the converter interface now has

 convertToObject(String value);
 convertToString(Object value);

 not just a single convertTo(Object object, Class type)

 it makes it rather explicit that the converter is meant to convert
 something to a string and back...no?

 -igor


 On Mon, Mar 10, 2008 at 11:35 AM, Eelco Hillenius
 [EMAIL PROTECTED] wrote:
  On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
 
   i thought we agreed converters were type converters...
 
   Did we? :-)
 
   Eelco
 
 
 
   -
   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]




form submit to popup

2008-03-10 Thread [EMAIL PROTECTED]

Hello folks.

Time for me to use the knowledge of the community again. Some background 
to enlighten my problem:


In a form I have a textarea and a few buttons (cancel, reload, update 
and preview). Upon creation I load into the textarea some html that is 
stored in the database.

The html is used as a template for creating emails. Eg:
html
body
Dear 'customername'.

bla bla
/body
/html

To the preview button is actually a BookmarkablePageLink created as 
suggested in the Linkomatic example (except that I have PageParameters 
as well) and it opens a popup.


PageParameters pp = new PageParameters();
pp.add(content, txtArea.getModelObjectAsString());
PopupSettings popupSettings = new 
PopupSettings(PageMap.forName(popuppagemap)).setHeight(500).setWidth(500);
add(new BookmarkablePageLink(popupButtonLink, Popup.class, 
pp).setPopupSettings(popupSettings));


Now, the problem is that the PageParameter is added at creation time, 
hence no matter what changes are made in the text area, I can not pass 
it to the Popup so that I can view the changes.


How can I make this happen?

Sorry if this is a stupid question, but bare with me, I'm just a newbie. 
Also, let me know if you need clarification.


TIA,
Jörgen

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



Re: Authentication and Assigning a Session Id

2008-03-10 Thread Igor Vaynberg
wicket's Session has invalidate() and invalidateNow()

-igor


On Mon, Mar 10, 2008 at 1:38 PM, Zappaterrini, Larry
[EMAIL PROTECTED] wrote:
 While it is true that the jsessionid token is not controlled by application 
 code, you can request a new one be generated by calling invalidate on the 
 session then request a new session by calling getSession(true) on the request 
 as I mentioned in my original message. Essentially it creates the illusion of 
 one contiguous session to the user when it is actually two different 
 sessions. I suppose I could attempt to do the same thing from within my 
 application code in Wicket and use the HTTP request to accomplish it. I was 
 just hoping to preserve Wicket's approach of treating HTTP as an 
 implementation detail and not having to include any references to it in my 
 code.

  

  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Mon 3/10/2008 4:24 PM
  To: users@wicket.apache.org
  Subject: Re: Authentication and Assigning a Session Id





  yes, if all that is true. but you still do not control the jsessionid 
 token...

  -igor


  On Mon, Mar 10, 2008 at 1:21 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
   Igor,
  
I thought that as long as you only use stateless pages and don't throw
RestartResponseExceptions the http session remained temporary (as
in is not assigned an id).
  
Anyway Wicket-Security automatically binds the wicket session (assigns
id to http session) after a successful login, if the session is not
already bound. But there is no guarantee that the session is not bound
until then.
  
Maurice
  
  
  
On Mon, Mar 10, 2008 at 9:01 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 session management is handled by the servlet container and is outside
  wicket's control. perhaps you can use a cookie in conjunction with a
  check in requestcycle.onbeginrequest to do something like what you
  want...

  -igor




  On Mon, Mar 10, 2008 at 12:43 PM, Zappaterrini, Larry
  [EMAIL PROTECTED] wrote:
   Hi Everyone,
  
Is it possible to control when Wicket issues a valid session 
 identifier to the user? The use case I am trying to support is only assign a 
 valid session id to the user after they successfully authenticate. This is 
 important to prevent possible session hijacking. When dealing with HTTP 
 sessions directly you can copy the session contents, invalidate the session, 
 request a new session, and put the contents of the original session into the 
 new one. I've browsed through some of Wicket's source code to see if this is 
 easily accomplished but I haven't been able to figure it out. Does anyone 
 have any input or suggestions?
  
Thanks,
Larry
  
  
__
  
The information contained in this message is proprietary and/or 
 confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; 
 (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the 
 sender immediately. In addition,
please be aware that any message addressed to our domain is subject 
 to archiving and review by
persons other than the intended recipient. Thank you.
_

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



  __

  The information contained in this message is proprietary and/or 
 confidential. If you are not the
  intended recipient, please: (i) delete the message and all copies; (ii) do 
 not disclose,
  distribute or use the message in any manner; and (iii) notify the sender 
 immediately. In addition,
  please be aware that any message addressed to our domain is subject to 
 archiving and review by
  persons other than the intended recipient. Thank you.
  _

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



Re: append a converter or coversion function

2008-03-10 Thread Igor Vaynberg
sure, it works. but it seems rather silly that a String type converter
is invoked to convert what already is a String to a String - seems
like a noop to me

-igor


On Mon, Mar 10, 2008 at 1:39 PM, Johan Compagner [EMAIL PROTECTED] wrote:
 But why cant converToObject(String) not return a string??
  Thats up to the developer.

  So

  textfield = new TextField()
  {
   getConverter(Class clz)
   {
   }
  }
  textfield.setType(String.class)

  that should work fine (and it does if i am not mistaken)

  johan



  On Mon, Mar 10, 2008 at 7:37 PM, Igor Vaynberg [EMAIL PROTECTED]


 wrote:

   yes, since the converter interface now has
  
   convertToObject(String value);
   convertToString(Object value);
  
   not just a single convertTo(Object object, Class type)
  
   it makes it rather explicit that the converter is meant to convert
   something to a string and back...no?
  
   -igor
  
  
   On Mon, Mar 10, 2008 at 11:35 AM, Eelco Hillenius
   [EMAIL PROTECTED] wrote:
On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg [EMAIL PROTECTED]
   wrote:
   
 i thought we agreed converters were type converters...
   
 Did we? :-)
   
 Eelco
   
   
   
 -
 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]



Wicket-Stuff mini's and junit tests

2008-03-10 Thread Maurice Marrink
For those of you having done work on Wicket-Stuff mini's i have a question.
Why are there no tests in src/test ?
I did find some tests in src/sandbox/test but they are not on the
sourcepath (eclipse nor maven) and thus are never run.
Bamboo build for this project failed because it was expecting
testresults, i fixed this by configuring it so that it does not look
for tests but it would be nice if we can move the tests from
src/sandbox/test to src/test/java.

Maurice

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



Re: form submit to popup

2008-03-10 Thread Igor Vaynberg
if you want this to work with a bookmarkable link then the only way to
do it is to use javascript to add textarea's content to the url. but
it isnt really safe to pass this on the url because those have a
character limit...

-igor


On Mon, Mar 10, 2008 at 2:36 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hello folks.

  Time for me to use the knowledge of the community again. Some background
  to enlighten my problem:

  In a form I have a textarea and a few buttons (cancel, reload, update
  and preview). Upon creation I load into the textarea some html that is
  stored in the database.
  The html is used as a template for creating emails. Eg:
  html
  body
  Dear 'customername'.

  bla bla
  /body
  /html

  To the preview button is actually a BookmarkablePageLink created as
  suggested in the Linkomatic example (except that I have PageParameters
  as well) and it opens a popup.

  PageParameters pp = new PageParameters();
  pp.add(content, txtArea.getModelObjectAsString());
  PopupSettings popupSettings = new
  PopupSettings(PageMap.forName(popuppagemap)).setHeight(500).setWidth(500);
  add(new BookmarkablePageLink(popupButtonLink, Popup.class,
  pp).setPopupSettings(popupSettings));

  Now, the problem is that the PageParameter is added at creation time,
  hence no matter what changes are made in the text area, I can not pass
  it to the Popup so that I can view the changes.

  How can I make this happen?

  Sorry if this is a stupid question, but bare with me, I'm just a newbie.
  Also, let me know if you need clarification.

  TIA,
  Jörgen

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



Re: Wicket-Stuff mini's and junit tests

2008-03-10 Thread Igor Vaynberg
move them

-igor


On Mon, Mar 10, 2008 at 3:04 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
 For those of you having done work on Wicket-Stuff mini's i have a question.
  Why are there no tests in src/test ?
  I did find some tests in src/sandbox/test but they are not on the
  sourcepath (eclipse nor maven) and thus are never run.
  Bamboo build for this project failed because it was expecting
  testresults, i fixed this by configuring it so that it does not look
  for tests but it would be nice if we can move the tests from
  src/sandbox/test to src/test/java.

  Maurice

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



Re: form submit to popup

2008-03-10 Thread [EMAIL PROTECTED]

Igor, thanks for your reply.

To me it doesn't matter how it's done, as long as I can do it :)

Do you have any suggestion of a safer way?

/Jörgen


Igor Vaynberg skrev:

if you want this to work with a bookmarkable link then the only way to
do it is to use javascript to add textarea's content to the url. but
it isnt really safe to pass this on the url because those have a
character limit...

-igor


On Mon, Mar 10, 2008 at 2:36 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
  

Hello folks.

 Time for me to use the knowledge of the community again. Some background
 to enlighten my problem:

 In a form I have a textarea and a few buttons (cancel, reload, update
 and preview). Upon creation I load into the textarea some html that is
 stored in the database.
 The html is used as a template for creating emails. Eg:
 html
 body
 Dear 'customername'.

 bla bla
 /body
 /html

 To the preview button is actually a BookmarkablePageLink created as
 suggested in the Linkomatic example (except that I have PageParameters
 as well) and it opens a popup.

 PageParameters pp = new PageParameters();
 pp.add(content, txtArea.getModelObjectAsString());
 PopupSettings popupSettings = new
 PopupSettings(PageMap.forName(popuppagemap)).setHeight(500).setWidth(500);
 add(new BookmarkablePageLink(popupButtonLink, Popup.class,
 pp).setPopupSettings(popupSettings));

 Now, the problem is that the PageParameter is added at creation time,
 hence no matter what changes are made in the text area, I can not pass
 it to the Popup so that I can view the changes.

 How can I make this happen?

 Sorry if this is a stupid question, but bare with me, I'm just a newbie.
 Also, let me know if you need clarification.

 TIA,
 Jörgen

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



Re: form submit to popup

2008-03-10 Thread Igor Vaynberg
safer way would be to replace the textarea with a label that displays
the html. that way you are not passing anything on the url...

-igor


On Mon, Mar 10, 2008 at 3:14 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Igor, thanks for your reply.

  To me it doesn't matter how it's done, as long as I can do it :)

  Do you have any suggestion of a safer way?

  /Jörgen


  Igor Vaynberg skrev:


  if you want this to work with a bookmarkable link then the only way to
   do it is to use javascript to add textarea's content to the url. but
   it isnt really safe to pass this on the url because those have a
   character limit...
  
   -igor
  
  
   On Mon, Mar 10, 2008 at 2:36 PM, [EMAIL PROTECTED]
   [EMAIL PROTECTED] wrote:
  
   Hello folks.
  
Time for me to use the knowledge of the community again. Some background
to enlighten my problem:
  
In a form I have a textarea and a few buttons (cancel, reload, update
and preview). Upon creation I load into the textarea some html that is
stored in the database.
The html is used as a template for creating emails. Eg:
html
body
Dear 'customername'.
  
bla bla
/body
/html
  
To the preview button is actually a BookmarkablePageLink created as
suggested in the Linkomatic example (except that I have PageParameters
as well) and it opens a popup.
  
PageParameters pp = new PageParameters();
pp.add(content, txtArea.getModelObjectAsString());
PopupSettings popupSettings = new

 PopupSettings(PageMap.forName(popuppagemap)).setHeight(500).setWidth(500);
add(new BookmarkablePageLink(popupButtonLink, Popup.class,
pp).setPopupSettings(popupSettings));
  
Now, the problem is that the PageParameter is added at creation time,
hence no matter what changes are made in the text area, I can not pass
it to the Popup so that I can view the changes.
  
How can I make this happen?
  
Sorry if this is a stupid question, but bare with me, I'm just a newbie.
Also, let me know if you need clarification.
  
TIA,
Jörgen
  
-
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]



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



Re: styling thead in DataTable

2008-03-10 Thread Eyal Golan
well, I can and this is what I actually did.
I found out that I can use in style, the attribute: *text-align*
that has solved me the problem.

But my (more general) question is: what if there is an attribute that can't
be set in style? as what I understand, it can't be set in a CSS (if I'm
mistaken, please tell me how it's done).

How can I add attributes to thead of a DataTable?
Hope I'm clear enough.

Eyal
On Mon, Mar 10, 2008 at 7:17 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 can you not use css?

 -igor


 On Mon, Mar 10, 2008 at 6:17 AM, Eyal Golan [EMAIL PROTECTED] wrote:
  Hey all,
   I am having an issue that seems to be simple, but still, no success.
 
   I have a normal DataTable.
   I add to it the toptoolbars manually:
   HeadersToolbar thead = new HeadersToolbar(entityDataTable,
   entitiesProvider);
   entityDataTable.addTopToolbar(thead);
   This is how it looks in the HTML:
   table wicket:id=entitiesList class=browserTable
 
   This is how (part of) the generated HTML looks like:
   table class=browserTable wicket:id=entitiesList
   thead
   tr class=headers
   th wicket:id=header class=wicket_orderUpwicket:border
   _moz-userdefined=a wicket:id=orderByLink class=
 
  
 href=?wicket:interface=:4:tabs:browserTabbedPanel:panel:entitiesList:topToolbars:2:toolbar:headers:1:header:orderByLink::ILinkListener::wicket:body
   _moz-userdefined=span wicket:id=labelPerson
   ID/span/wicket:body/a/wicket:border
   /th
 
   I want a simple thing: I want to align the header labels to the left.
   The problem(s):
   - style doesn't have an attribute of align. Only vertical-align.
   - I tried to add to the HeadersToolbar an AttributeModifier:
   thead.add(new AttributeModifier(align, true, new Model(left)));
 
   Nothing seems working.
   I am using Firebug and the label thead keeps with no attribute.
 
   Can anyone help?
 
   Thank a lot
 
 
   --
   Eyal Golan
   [EMAIL PROTECTED]
 
   Visit: http://jvdrums.sourceforge.net/
 

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




-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/


Re: Wicket-Stuff mini's and junit tests

2008-03-10 Thread Maurice Marrink
done

On Mon, Mar 10, 2008 at 11:05 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 move them

  -igor




  On Mon, Mar 10, 2008 at 3:04 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
   For those of you having done work on Wicket-Stuff mini's i have a question.
Why are there no tests in src/test ?
I did find some tests in src/sandbox/test but they are not on the
sourcepath (eclipse nor maven) and thus are never run.
Bamboo build for this project failed because it was expecting
testresults, i fixed this by configuring it so that it does not look
for tests but it would be nice if we can move the tests from
src/sandbox/test to src/test/java.
  
Maurice
  
-
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]



Re: append a converter or coversion function

2008-03-10 Thread dvd
Yes, but the issue I encountered that wicket first
 call getConverter method, yet not using
what was returned as supposed to be. Class based
converter is a way to write one default converter
for one class, but if a special converter is provided
for a subset of that class, then the special convert should be used

yes, since the converter interface now has

convertToObject(String value);
convertToString(Object value);

not just a single convertTo(Object object, Class type)

it makes it rather explicit that the converter is meant to convert
something to a string and back...no?

-igor


On Mon, Mar 10, 2008 at 11:35 AM, Eelco Hillenius
[EMAIL PROTECTED] wrote:
 On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg [EMAIL PROTECTED] 
wrote:

  i thought we agreed converters were type converters...

  Did we? :-)

  Eelco



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



cd app example

2008-03-10 Thread Maurice Marrink
On http://www.wicket-library.com/ there is a cdapp example.
I am interested in the source code for this example. I found some
source in the wicket-stuff svn (1.2 branch), does anybody now if there
is a 1.3 source somewhere?

Maurice

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



Re: append a converter or coversion function

2008-03-10 Thread dvd
Another level of indirection?
for compoundpropertymode Could I could do
add(new textfield(foo).setModel(new uppercasingmodel(this))) ?

if this is the webpage with the foo field.

Compared to
add(new UpperCaseTextfield(foo));

the latter would be more efficient and clean.



class uppercasingmodel implements imodel {
  private final imodel delegate;

  public void setobject(object) {
  delegate.setobject(uppercase((string)object));
  }
  ...
}

add(new textfield(foo, new uppercasingmodel(model)));

-igor


On Mon, Mar 10, 2008 at 3:31 AM,  [EMAIL PROTECTED] wrote:
 I'd consider it a generic business component that applies
  to so many apps/business pojos that would justify it to become a web 
component,
  much like RequiredTextField or even PasswordTextField.

  Could you illustrate how to do it better with model decorator
  to use it like using RequiredTextField?




  no, upper case string is not a special type, not unless you do not
  use String to represent it...like i said, my suggestion is to do this
  via a model decorator. further, something like this doesnt even sound
  like it belongs in the web layer - sounds like a business requirement
  which should be enforced by the setter of the bussiness pojo.
  
  -igor


 
  
  On Sun, Mar 9, 2008 at 7:57 PM,  [EMAIL PROTECTED] wrote:
   I used the trick it worked great. Thanks very much.
Should it be considered a bug?
What is interesting before using setType is that getConverter is 
actually
 called (from my simple tracing), but after that its methods were
not called (I guess somewhere it learned the modelobject was a String 
so
it simply call the built-in converter.
I'd think if the getConverter is overriden, its methods should be 
called
regardless of what type was it.  Besides, UppercaseString is
a special Type so it does not conflict with the rules.
(Any custom converter could be considered to target a special type
even though it could be just uppercasing or prepend a * to the string)
Built-in converter might follow the default rules but
if custom converter is provided, wicket should totally depend
on the custom converter to do whatever it does.
  
Anyway, thanks again.
  
  
  
if you set the type yourself by hand then getConverter() will be 
called
  and
you can do what ever you want
We dont do that automatic yes (resolveType doesn't set it to the
String.class)

johan



On Sun, Mar 9, 2008 at 5:45 PM, Igor Vaynberg 
[EMAIL PROTECTED]
wrote:

 i thought we agreed converters were type converters...so they 
shouldnt
 be invoked if you are doing string-string :|

 -igor


 On Sun, Mar 9, 2008 at 5:47 AM, Johan Compagner 
[EMAIL PROTECTED]
 wrote:
  call setTYpe(String.class) on the textfield
   or use that constructor with the type param
 
   does that help?
 
 
 
   On Sun, Mar 9, 2008 at 1:35 PM, [EMAIL PROTECTED] wrote:
 
Below is a custom component with overrding the getConverter
for testing purpose. As you could see, it is plain simple one
with simple output debugging. But it is not working.
the getConverter is called (output here)
but the convertToObject never called (no there)
I basically cut and paste the WicketinAction example.
What I am doing wrong here?
   
   
public class RequiredUppperCaseTextField extends TextField {
   
   public RequiredUppperCaseTextField(String id) {
   super(id);
   setRequired(true);
   
   }
   @Override
   public final IConverter getConverter(Class arg000){
   System.out.println(here+ arg0);
  IConverter icAppend = new IConverter(){
   
   public Object convertToObject(String arg0, Locale 
arg1)
  {
   System.out.println(there+ arg0);
   String s = sss;
   return s;
   }
   
   public String convertToString(Object arg0, Locale 
arg1)
  {
   return (String)arg0;
   }
   
   };
   return icAppend;
}
   
}
   
   
Override the getConverter() method. First call super and with
  that
result call the special one (camel casing?)

On 3/9/08, [EMAIL PROTECTED] [EMAIL PROTECTED] 
wrote:
 Hello:
 I wonder how to append a converter or java method to a
  component
 so
that
I
 would affect what is already defined. For example, I want
 camelize a
 TextField(or some customized subclass) so that after the
  converter
already
 defined completes the conversion (regardless what has been 
done
  in
 the
 chain) , I could use the added converted/method to make the
  final

Re: append a converter or coversion function

2008-03-10 Thread Johan Compagner
yes i think i explained that before
the first call you see is the getConverter call that calls objectToString()
on it
but if type is not set on a field getConverter is not called for
StringToObject

johan



On Mon, Mar 10, 2008 at 11:44 PM, [EMAIL PROTECTED] wrote:

 Yes, but the issue I encountered that wicket first
  call getConverter method, yet not using
 what was returned as supposed to be. Class based
 converter is a way to write one default converter
 for one class, but if a special converter is provided
 for a subset of that class, then the special convert should be used

 yes, since the converter interface now has
 
 convertToObject(String value);
 convertToString(Object value);
 
 not just a single convertTo(Object object, Class type)
 
 it makes it rather explicit that the converter is meant to convert
 something to a string and back...no?
 
 -igor
 
 
 On Mon, Mar 10, 2008 at 11:35 AM, Eelco Hillenius
 [EMAIL PROTECTED] wrote:
  On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
 
   i thought we agreed converters were type converters...
 
   Did we? :-)
 
   Eelco
 
 
 
   -
   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]




Re: append a converter or coversion function

2008-03-10 Thread dvd
I missed this one. That explains what I just posted.
I'd say the logic could be 
if a converter is provided, the its stringtoobject is
called. otherwise, check the set type and use the types'registered
converter. 

yes i think i explained that before
the first call you see is the getConverter call that calls objectToString()
on it
but if type is not set on a field getConverter is not called for
StringToObject

johan



On Mon, Mar 10, 2008 at 11:44 PM, [EMAIL PROTECTED] wrote:

 Yes, but the issue I encountered that wicket first
  call getConverter method, yet not using
 what was returned as supposed to be. Class based
 converter is a way to write one default converter
 for one class, but if a special converter is provided
 for a subset of that class, then the special convert should be used

 yes, since the converter interface now has
 
 convertToObject(String value);
 convertToString(Object value);
 
 not just a single convertTo(Object object, Class type)
 
 it makes it rather explicit that the converter is meant to convert
 something to a string and back...no?
 
 -igor
 
 
 On Mon, Mar 10, 2008 at 11:35 AM, Eelco Hillenius
 [EMAIL PROTECTED] wrote:
  On Sun, Mar 9, 2008 at 9:45 AM, Igor Vaynberg [EMAIL PROTECTED]
 wrote:
 
   i thought we agreed converters were type converters...
 
   Did we? :-)
 
   Eelco
 
 
 
   -
   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]



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



RE: Problem when MIgrating from 1.2 to 1.3 - Parameters removed from HomePage URL

2008-03-10 Thread David Leangen

Maybe you're right and that it's not related, but this really smells like
URL encoding to me... I've had to deal with this problem before.

Did you try changing the url encoding strategy to your own custom one? If
you do and you still get this problem, then I'll believe you. :-)


dml




 -Original Message-
 From: Rajiv Jivan [mailto:[EMAIL PROTECTED]
 Sent: 11 March 2008 00:43
 To: users@wicket.apache.org
 Subject: Re: Problem when MIgrating from 1.2 to 1.3 - Parameters
 removed from HomePage URL


 This doesnt work. The QueryStringUrlCodingStrategy class isn't hit.
 When going to URL
 http://localhost/helloworld?name=John

 the code first calls the method
 WicketServlet.doGet(..)
 which delegates the call to WicketFilter.doGet(..)

 As pointed in my first post, WicketFilter.doGet checks if the URL is
 the home page and if so, redirects without appending the parameters.


 On Fri, Mar 7, 2008 at 8:32 PM, David Leangen [EMAIL PROTECTED] wrote:
 
   I dunno.
 
   I thought you were talking about mounted urls, whose urls displays are
   rendered by a UrlCodingStrategy. If you're using the
   QueryStringUrlCodingStrategy, then my guess is that it's relevant.
 
   If you want to know for sure, try applying the patch to your
 local wicket,
   or maybe try adding a break and debugging at the lines changed
 by the patch.
   If that doesn't work, then I guess you'd better post your
 question again.
 
 
 
   Cheers,
   Dave
 
 
 
 
-Original Message-
From: Rajiv Jivan [mailto:[EMAIL PROTECTED]
 
   Sent: 8 March 2008 00:28
To: users@wicket.apache.org
 
 
   Subject: Re: Problem when MIgrating from 1.2 to 1.3 - Parameters
removed from HomePage URL
   
   
Are we talking about the same thing? Your patch removes the
 trailing /
while in my case without the trailing / the parameters aren't
recognized.
   
On Thu, Mar 6, 2008 at 6:11 PM, David Leangen
 [EMAIL PROTECTED] wrote:

  I've already filed an issue and submitted a patch for this:

   https://issues.apache.org/jira/browse/WICKET-1385


  Cheers,
  Dave





   -Original Message-
   From: Rajiv Jivan [mailto:[EMAIL PROTECTED]
   Sent: 7 March 2008 05:47
   To: users@wicket.apache.org
   Subject: Problem when MIgrating from 1.2 to 1.3 - Parameters
   removed from HomePage URL
  
  
   We have a site developed using Wicket 1.2. One of the
 use cases we
   have is to pass in a parameter on the home page, and
 based on that we
   perform some actions. e.g
  
   http://localhost/helloworld?name=John
  
   This functionality seem to be broken in 1.3. When passing in
   parameters on the home page URL they are stripped.
 Going through the
   Wicket I have narrowed down to an issue in WicketFilter
  
   // Special-case for home page - we redirect to add a
   trailing slash.
   if (relativePath.length() == 0 
  
  
   
 !Strings.stripJSessionId(servletRequest.getRequestURI()).endsWith(/))
   {
   final String redirectUrl =
   servletRequest.getRequestURI() + /;
  
  
 servletResponse.sendRedirect(servletResponse.encodeRedirectURL(red
   irectUrl));
   return;
   }
  
   The only workaround I have is to change the URL to
   http://localhost/helloworld/?name=John
   Notice the traling / after helloworld
  
   Am I missing something or is this a bug ?
  
   Thanks,
  
   Rajiv
  
  
 -
   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]
   
   
 
 
   -
   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]



Re: Javascript not evaluating with AbstractAutoCompleteBehavior

2008-03-10 Thread Andrew Berman
For the record, I was able to accomplish what I want a lot easier using
OnChangeAjaxBehavior.


On Sat, Mar 8, 2008 at 3:24 PM, Andrew Berman [EMAIL PROTECTED] wrote:

 I'm doing a custom autocomplete and simply wanted to use
 AbstractAutoCompleteBehavior to at least pass me back the search term.  I
 want to return a JavaScript call with the results which opens up a custom
 results panel.  I'm not looking to pass back HTML with the results.

 I think Wicket should either change the behavior to use the same pipeline
 as Ajax event or make the respond method final and make sure that
 AjaxTargetRequest.get() returns null or an exception.

 On Sat, Mar 8, 2008 at 7:35 AM, Ryan Sonnek [EMAIL PROTECTED] wrote:

  FYI:
  you might want to check out the wicketstuff-scriptaculous auto
  complete component instead.
 
 
  http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior
 
 
  On Sat, Mar 8, 2008 at 6:38 AM, i ii [EMAIL PROTECTED] wrote:
  
that does suck! why would wicket use a different pipeline??? that
  is misleading!!!
  
 Date: Sat, 8 Mar 2008 00:21:26 -0800
 From: [EMAIL PROTECTED]
 To: users@wicket.apache.org
 Subject: Re: Javascript not evaluating with
  AbstractAutoCompleteBehavior
  
  
   
 Oh, that sucks.  That's VERY misleading because I can override
  respond and I
 have the AjaxRequestTarget or call AjaxRequestTarget.get() and get
  a valid
 object.  Doesn't really make much sense that a different pipeline
  would be
 used.  I guess I'll have to come up with a better solution using
 WicketAjaxEvent.

 Thanks for your help!

 On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp [EMAIL PROTECTED]
  wrote:

  The autocomplete component doesn't use the wicket ajax pipeline
  so
  that ajaxrequesttarget methods will not work for request invoked
  by
  the autocomplete behavior.
 
  -Matej
 
  On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman [EMAIL PROTECTED]
  wrote:
   Hello,
  
If I have the following code:
  
 textField.add(new AbstractAutoCompleteBehavior() {
   /**
*
*/
   private static final long serialVersionUID = 1L;
  
   @Override
   protected void onRequest(final String input,
   RequestCycle requestCycle) {
   }
  
   @Override
   protected void respond(AjaxRequestTarget target) {
 target.appendJavascript(alert(\hello\););
   }
   });
  
When the page renders, the textfield is calling this event and
  I see
  the
response in the Wicket debug box, but the response is never
  being
  parsed and
the alert never shows up.   Am I missing something here?  I
  tested
  using an
AjaxEventBehavior with onkeypress and it works great.  The
  only problem
  is
that I have no way of getting the text typed into the text
  field, which
  is
why I used the auto complete stuff.  Any thoughts?
  
Thanks for your help!
  
 
 
 
  --
  Resizable and reorderable grid components.
  http://www.inmethod.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]
 
 



Re: styling thead in DataTable

2008-03-10 Thread Igor Vaynberg
there shouldnt be anything you cannot do through css that you can do
through adding things to markup

that said you can always subclass datatable and provide your own markup

-igor

On Mon, Mar 10, 2008 at 3:31 PM, Eyal Golan [EMAIL PROTECTED] wrote:
 well, I can and this is what I actually did.
  I found out that I can use in style, the attribute: *text-align*
  that has solved me the problem.

  But my (more general) question is: what if there is an attribute that can't
  be set in style? as what I understand, it can't be set in a CSS (if I'm
  mistaken, please tell me how it's done).

  How can I add attributes to thead of a DataTable?
  Hope I'm clear enough.

  Eyal
  On Mon, Mar 10, 2008 at 7:17 PM, Igor Vaynberg [EMAIL PROTECTED]
  wrote:



   can you not use css?
  
   -igor
  
  
   On Mon, Mar 10, 2008 at 6:17 AM, Eyal Golan [EMAIL PROTECTED] wrote:
Hey all,
 I am having an issue that seems to be simple, but still, no success.
   
 I have a normal DataTable.
 I add to it the toptoolbars manually:
 HeadersToolbar thead = new HeadersToolbar(entityDataTable,
 entitiesProvider);
 entityDataTable.addTopToolbar(thead);
 This is how it looks in the HTML:
 table wicket:id=entitiesList class=browserTable
   
 This is how (part of) the generated HTML looks like:
 table class=browserTable wicket:id=entitiesList
 thead
 tr class=headers
 th wicket:id=header class=wicket_orderUpwicket:border
 _moz-userdefined=a wicket:id=orderByLink class=
   

 href=?wicket:interface=:4:tabs:browserTabbedPanel:panel:entitiesList:topToolbars:2:toolbar:headers:1:header:orderByLink::ILinkListener::wicket:body
 _moz-userdefined=span wicket:id=labelPerson
 ID/span/wicket:body/a/wicket:border
 /th
   
 I want a simple thing: I want to align the header labels to the left.
 The problem(s):
 - style doesn't have an attribute of align. Only vertical-align.
 - I tried to add to the HeadersToolbar an AttributeModifier:
 thead.add(new AttributeModifier(align, true, new Model(left)));
   
 Nothing seems working.
 I am using Firebug and the label thead keeps with no attribute.
   
 Can anyone help?
   
 Thank a lot
   
   
 --
 Eyal Golan
 [EMAIL PROTECTED]
   
 Visit: http://jvdrums.sourceforge.net/
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  


  --


 Eyal Golan
  [EMAIL PROTECTED]

  Visit: http://jvdrums.sourceforge.net/


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



Re: cd app example

2008-03-10 Thread Johan Compagner
i dont think that project is updated or maintained to 1.3



On Mon, Mar 10, 2008 at 11:46 PM, Maurice Marrink [EMAIL PROTECTED] wrote:

 On http://www.wicket-library.com/ there is a cdapp example.
 I am interested in the source code for this example. I found some
 source in the wicket-stuff svn (1.2 branch), does anybody now if there
 is a 1.3 source somewhere?

 Maurice

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




RE: Authentication and Assigning a Session Id

2008-03-10 Thread Zappaterrini, Larry
That was my initial inclination, but I don't see an easy way to get the data 
out of the session, request a new session, then populate the new session with 
the original data.

 


From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Mon 3/10/2008 6:00 PM
To: users@wicket.apache.org
Subject: Re: Authentication and Assigning a Session Id



wicket's Session has invalidate() and invalidateNow()

-igor


On Mon, Mar 10, 2008 at 1:38 PM, Zappaterrini, Larry
[EMAIL PROTECTED] wrote:
 While it is true that the jsessionid token is not controlled by application 
 code, you can request a new one be generated by calling invalidate on the 
 session then request a new session by calling getSession(true) on the request 
 as I mentioned in my original message. Essentially it creates the illusion of 
 one contiguous session to the user when it is actually two different 
 sessions. I suppose I could attempt to do the same thing from within my 
 application code in Wicket and use the HTTP request to accomplish it. I was 
 just hoping to preserve Wicket's approach of treating HTTP as an 
 implementation detail and not having to include any references to it in my 
 code.

  

  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Mon 3/10/2008 4:24 PM
  To: users@wicket.apache.org
  Subject: Re: Authentication and Assigning a Session Id





  yes, if all that is true. but you still do not control the jsessionid 
 token...

  -igor


  On Mon, Mar 10, 2008 at 1:21 PM, Maurice Marrink [EMAIL PROTECTED] wrote:
   Igor,
  
I thought that as long as you only use stateless pages and don't throw
RestartResponseExceptions the http session remained temporary (as
in is not assigned an id).
  
Anyway Wicket-Security automatically binds the wicket session (assigns
id to http session) after a successful login, if the session is not
already bound. But there is no guarantee that the session is not bound
until then.
  
Maurice
  
  
  
On Mon, Mar 10, 2008 at 9:01 PM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 session management is handled by the servlet container and is outside
  wicket's control. perhaps you can use a cookie in conjunction with a
  check in requestcycle.onbeginrequest to do something like what you
  want...

  -igor




  On Mon, Mar 10, 2008 at 12:43 PM, Zappaterrini, Larry
  [EMAIL PROTECTED] wrote:
   Hi Everyone,
  
Is it possible to control when Wicket issues a valid session 
 identifier to the user? The use case I am trying to support is only assign a 
 valid session id to the user after they successfully authenticate. This is 
 important to prevent possible session hijacking. When dealing with HTTP 
 sessions directly you can copy the session contents, invalidate the session, 
 request a new session, and put the contents of the original session into the 
 new one. I've browsed through some of Wicket's source code to see if this is 
 easily accomplished but I haven't been able to figure it out. Does anyone 
 have any input or suggestions?
  
Thanks,
Larry
  
  
__
  
The information contained in this message is proprietary and/or 
 confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; 
 (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the 
 sender immediately. In addition,
please be aware that any message addressed to our domain is subject 
 to archiving and review by
persons other than the intended recipient. Thank you.
_

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



  __

  The information contained in this message is proprietary and/or 
 confidential. If you are not the
  intended recipient, please: (i) delete the message and all copies; (ii) do 
 not disclose,
  distribute or use the message in any manner; and (iii) notify the sender 
 immediately. In addition,
  please be aware that any message addressed to our domain is subject to 
 archiving and review by
  persons other than the intended recipient. Thank you.
  _

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



Re: styling thead in DataTable

2008-03-10 Thread Christian Alejandro Marquez Grabia
You can change tag attributes by overriding the onComponentTag() method, at
least that is what I do when modifying any class or other attribute. (you
should get the attribute from the tag parameter, and then set it there as
well)

I'm not sure where you should add that for the thead builder, but if you
find it, then you'll get it done. You may also use IBehaviours, like
SimpleAttributeModifier.

Or as Igor well said, use your own markup (you could see the default markup
inside the jar, and simply add the attribute you want)

Rgds,
Christian

On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote:

 there shouldnt be anything you cannot do through css that you can do
 through adding things to markup

 that said you can always subclass datatable and provide your own markup


 -igor


 On Mon, Mar 10, 2008 at 3:31 PM, Eyal Golan [EMAIL PROTECTED] wrote:
  well, I can and this is what I actually did.
   I found out that I can use in style, the attribute: *text-align*
   that has solved me the problem.
 
   But my (more general) question is: what if there is an attribute that
 can't
   be set in style? as what I understand, it can't be set in a CSS (if I'm
   mistaken, please tell me how it's done).
 
   How can I add attributes to thead of a DataTable?
   Hope I'm clear enough.
 
   Eyal
   On Mon, Mar 10, 2008 at 7:17 PM, Igor Vaynberg [EMAIL PROTECTED]
 
   wrote:
 
 
 
can you not use css?
   
-igor
   
   
On Mon, Mar 10, 2008 at 6:17 AM, Eyal Golan [EMAIL PROTECTED]
 wrote:
 Hey all,
  I am having an issue that seems to be simple, but still, no
 success.

  I have a normal DataTable.
  I add to it the toptoolbars manually:
  HeadersToolbar thead = new HeadersToolbar(entityDataTable,
  entitiesProvider);
  entityDataTable.addTopToolbar(thead);
  This is how it looks in the HTML:
  table wicket:id=entitiesList class=browserTable

  This is how (part of) the generated HTML looks like:
  table class=browserTable wicket:id=entitiesList
  thead
  tr class=headers
  th wicket:id=header class=wicket_orderUpwicket:border
  _moz-userdefined=a wicket:id=orderByLink class=


 
  href=?wicket:interface=:4:tabs:browserTabbedPanel:panel:entitiesList:topToolbars:2:toolbar:headers:1:header:orderByLink::ILinkListener::wicket:body
  _moz-userdefined=span wicket:id=labelPerson
  ID/span/wicket:body/a/wicket:border
  /th

  I want a simple thing: I want to align the header labels to the
 left.
  The problem(s):
  - style doesn't have an attribute of align. Only vertical-align.
  - I tried to add to the HeadersToolbar an AttributeModifier:
  thead.add(new AttributeModifier(align, true, new
 Model(left)));

  Nothing seems working.
  I am using Firebug and the label thead keeps with no attribute.

  Can anyone help?

  Thank a lot


  --
  Eyal Golan
  [EMAIL PROTECTED]

  Visit: http://jvdrums.sourceforge.net/

   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
 
 
   --
 
 
  Eyal Golan
   [EMAIL PROTECTED]
 
   Visit: http://jvdrums.sourceforge.net/
 

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




Re: Authentication and Assigning a Session Id

2008-03-10 Thread Igor Vaynberg
same us you would do with http session directly i guess...

-igor


On Mon, Mar 10, 2008 at 6:08 PM, Zappaterrini, Larry
[EMAIL PROTECTED] wrote:
 That was my initial inclination, but I don't see an easy way to get the data 
 out of the session, request a new session, then populate the new session with 
 the original data.



  

  From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
  Sent: Mon 3/10/2008 6:00 PM


 To: users@wicket.apache.org
  Subject: Re: Authentication and Assigning a Session Id



  wicket's Session has invalidate() and invalidateNow()

  -igor


  On Mon, Mar 10, 2008 at 1:38 PM, Zappaterrini, Larry
  [EMAIL PROTECTED] wrote:
   While it is true that the jsessionid token is not controlled by 
 application code, you can request a new one be generated by calling 
 invalidate on the session then request a new session by calling 
 getSession(true) on the request as I mentioned in my original message. 
 Essentially it creates the illusion of one contiguous session to the user 
 when it is actually two different sessions. I suppose I could attempt to do 
 the same thing from within my application code in Wicket and use the HTTP 
 request to accomplish it. I was just hoping to preserve Wicket's approach of 
 treating HTTP as an implementation detail and not having to include any 
 references to it in my code.
  

  
From: Igor Vaynberg [mailto:[EMAIL PROTECTED]
Sent: Mon 3/10/2008 4:24 PM
To: users@wicket.apache.org
Subject: Re: Authentication and Assigning a Session Id
  
  
  
  
  
yes, if all that is true. but you still do not control the jsessionid 
 token...
  
-igor
  
  
On Mon, Mar 10, 2008 at 1:21 PM, Maurice Marrink [EMAIL PROTECTED] 
 wrote:
 Igor,

  I thought that as long as you only use stateless pages and don't throw
  RestartResponseExceptions the http session remained temporary (as
  in is not assigned an id).

  Anyway Wicket-Security automatically binds the wicket session (assigns
  id to http session) after a successful login, if the session is not
  already bound. But there is no guarantee that the session is not bound
  until then.

  Maurice



  On Mon, Mar 10, 2008 at 9:01 PM, Igor Vaynberg [EMAIL PROTECTED] 
 wrote:
   session management is handled by the servlet container and is outside
wicket's control. perhaps you can use a cookie in conjunction with a
check in requestcycle.onbeginrequest to do something like what you
want...
  
-igor
  
  
  
  
On Mon, Mar 10, 2008 at 12:43 PM, Zappaterrini, Larry
[EMAIL PROTECTED] wrote:
 Hi Everyone,

  Is it possible to control when Wicket issues a valid session 
 identifier to the user? The use case I am trying to support is only assign a 
 valid session id to the user after they successfully authenticate. This is 
 important to prevent possible session hijacking. When dealing with HTTP 
 sessions directly you can copy the session contents, invalidate the session, 
 request a new session, and put the contents of the original session into the 
 new one. I've browsed through some of Wicket's source code to see if this is 
 easily accomplished but I haven't been able to figure it out. Does anyone 
 have any input or suggestions?

  Thanks,
  Larry


  __

  The information contained in this message is proprietary and/or 
 confidential. If you are not the
  intended recipient, please: (i) delete the message and all 
 copies; (ii) do not disclose,
  distribute or use the message in any manner; and (iii) notify 
 the sender immediately. In addition,
  please be aware that any message addressed to our domain is 
 subject to archiving and review by
  persons other than the intended recipient. Thank you.
  _
  

 -
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]
  
  
  
__
  
The information contained in this message is proprietary and/or 
 confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) 
 do not disclose,
distribute or use the message in any manner; and (iii) notify the sender 
 immediately. In addition,
please be aware that any message addressed 

Global Exception Handling...

2008-03-10 Thread James Carman
If I'm developing a Hibernate-based application and I want to install
some global StateObjectStateException handling code, what's the best
way to do it?  I could override Application.newRequestCycle()
providing my own request cycle implementation which overrides the
onRuntimeException() method.  Is there a way to plug in logic which
says if you see exception type X, use this handler?

James

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



Re: Global Exception Handling...

2008-03-10 Thread Igor Vaynberg
On Mon, Mar 10, 2008 at 7:39 PM, James Carman
[EMAIL PROTECTED] wrote:
 If I'm developing a Hibernate-based application and I want to install
  some global StateObjectStateException handling code, what's the best
  way to do it?  I could override Application.newRequestCycle()
  providing my own request cycle implementation which overrides the
  onRuntimeException() method.  Is there a way to plug in logic which
  says if you see exception type X, use this handler?

notice requestcycle.onruntimeexception() has access to the exception,
and returns a page, so

myrc.onruntimexception(runtimeexception e) {
  if (e.getrootcause() instanceof hibernateexception) {
  return new hibernateerrorpage(e);
  }
}

-igor



  James

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



Re: Global Exception Handling...

2008-03-10 Thread James Carman
On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 On Mon, Mar 10, 2008 at 7:39 PM, James Carman
  [EMAIL PROTECTED] wrote:
   If I'm developing a Hibernate-based application and I want to install
some global StateObjectStateException handling code, what's the best
way to do it?  I could override Application.newRequestCycle()
providing my own request cycle implementation which overrides the
onRuntimeException() method.  Is there a way to plug in logic which
says if you see exception type X, use this handler?


 notice requestcycle.onruntimeexception() has access to the exception,
  and returns a page, so

  myrc.onruntimexception(runtimeexception e) {
   if (e.getrootcause() instanceof hibernateexception) {
   return new hibernateerrorpage(e);
   }
  }

Okay, so this is the way to handle it, eh?  I just wanted to make sure
there was nothing out there already for this.  I may make up a
Spring-based solution that allows me to register an exception
handler for specific types of runtime exceptions.  That way, my forms
don't need to know I'm using Hibernate.  They can just deal with my
domain interface (a repository).  Thanks for the tip!

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



Can anyone recommend any good wicket books?

2008-03-10 Thread Gareth Segree


Re: Can anyone recommend any good wicket books?

2008-03-10 Thread Scott Swank
Yup

http://www.manning.com/dashorst/

On Mon, Mar 10, 2008 at 8:18 PM, Gareth Segree
[EMAIL PROTECTED] wrote:




-- 
Scott Swank
reformed mathematician

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



Re: cd app example

2008-03-10 Thread Eelco Hillenius
Yeah, it was discontinued after a bunch of discussions about choices
made in the supporting libs (wicket-extensions-data etc).

Eelco


On Mon, Mar 10, 2008 at 4:53 PM, Johan Compagner [EMAIL PROTECTED] wrote:
 i dont think that project is updated or maintained to 1.3





  On Mon, Mar 10, 2008 at 11:46 PM, Maurice Marrink [EMAIL PROTECTED] wrote:

   On http://www.wicket-library.com/ there is a cdapp example.
   I am interested in the source code for this example. I found some
   source in the wicket-stuff svn (1.2 branch), does anybody now if there
   is a 1.3 source somewhere?
  
   Maurice
  
   -
   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]



Re: Global Exception Handling...

2008-03-10 Thread James Carman
On 3/10/08, James Carman [EMAIL PROTECTED] wrote:
 On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
   On Mon, Mar 10, 2008 at 7:39 PM, James Carman
[EMAIL PROTECTED] wrote:
 If I'm developing a Hibernate-based application and I want to install
  some global StateObjectStateException handling code, what's the best
  way to do it?  I could override Application.newRequestCycle()
  providing my own request cycle implementation which overrides the
  onRuntimeException() method.  Is there a way to plug in logic which
  says if you see exception type X, use this handler?
  
  
   notice requestcycle.onruntimeexception() has access to the exception,
and returns a page, so
  
myrc.onruntimexception(runtimeexception e) {
 if (e.getrootcause() instanceof hibernateexception) {
 return new hibernateerrorpage(e);
 }
}


 Okay, so this is the way to handle it, eh?  I just wanted to make sure
  there was nothing out there already for this.  I may make up a
  Spring-based solution that allows me to register an exception
  handler for specific types of runtime exceptions.  That way, my forms
  don't need to know I'm using Hibernate.  They can just deal with my
  domain interface (a repository).  Thanks for the tip!


What if we changed IRequestCycleSettings to include these methods:

public void addRuntimeExceptionHandler(Class exceptionClass,
IRuntimeExceptionHandler handler);
public IRuntimeExceptionHandler getRuntimeExceptionHandler(RuntimeException e);


Then, add the IRuntimeExceptionHandler interface:

public interface IRuntimeExceptionHandler
{
  public Page onRuntimeException(Page page, RuntimeException e);
}

Then, RequestCycle's onRuntimeException() method as follows:

public void onRuntimeException(Page page, RuntimeException e)
{
  IRuntimeExceptionHandler handler =
Application.get().getRequestCycleSettings().getRuntimeExceptionHandler(e);
  if( handler != null )
  {
return handler.onRuntimeException(page,e);
  }
  return null;
}

This way, folks could install their own exception handlers very
easily.  The getRuntimeExceptionHandler() method would do a search up
the class hierarchy if necessary, so you could install a handler for
IOException which would cover FIleNotFoundException, for instance.
What do you think?

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



Where and how would you internationalise the following... and integrate with wicket?

2008-03-10 Thread Ned Collyer

Where and how would you internationalise the following... and integrate with
wicket?

Exceptions thrown from a remote service where you have control over the
codebase.

How would you internationalise params from this?  Would you manage the
translations in the source of the external system, or have it expose keys
and do the translations wicket side?

-- 
View this message in context: 
http://www.nabble.com/Where-and-how-would-you-internationalise-the-following...-and-integrate-with-wicket--tp15974621p15974621.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: Default Focus Behavior?

2008-03-10 Thread Gin Yeah
Can we have a faq in the wiki enumerating all the possible scenarios and
solutions?

On Sun, Mar 9, 2008 at 11:51 PM, Igor Vaynberg [EMAIL PROTECTED]
wrote:

 On Sun, Mar 9, 2008 at 1:37 PM, James Carman [EMAIL PROTECTED]
 wrote:
  On 3/9/08, djo.mos [EMAIL PROTECTED] wrote:
   
   
This simply looks great ! I think this should make it into the core
 Wicket
 behaviors as the componenet focus is quite useful.
   
 
   Me too!  That's why I submitted:
 
   https://issues.apache.org/jira/browse/WICKET-1404
 
   I was pretty surprised something didn't exist for this already.  I
   don't mean any offense by that at all.  It's just that it seems like
   every time I think to myself there should be a way to do x with
   Wicket, there's already something for that!  This Wicket stuff is
   pretty cool!

 i dont think something like this should go into core. it seems pretty
 clear from this thread that there are very many ways to do this and
 each project will use their own. what you have proposed seems trivial
 to construct, so for projects that want to use it its a nobrainer. i
 think things that go into core should at least satisfy the majority of
 common usecases or be at least of moderate complexity. if we start
 putting every trivial thing like this into core we will end up with a
 huge surface area - at which point you have to start thinking of the
 find/build tradeoff - is it easier to find something that does what i
 want in core or simply roll my own which will only take fifteen
 minutes...

 now, for example, if this behavior was meant to be attached to a form
 and would set focus on the first component that is not valid...

 -igor



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




Re: Where and how would you internationalise the following... and integrate with wicket?

2008-03-10 Thread James Carman
On 3/11/08, Ned Collyer [EMAIL PROTECTED] wrote:

  Where and how would you internationalise the following... and integrate with
  wicket?

  Exceptions thrown from a remote service where you have control over the
  codebase.

  How would you internationalise params from this?  Would you manage the
  translations in the source of the external system, or have it expose keys
  and do the translations wicket side?


I would do the translations Wicket-side, personally since it's so easy
to do.  I've done this in the past.  My application would throw
BusinessLogicException derivatives which contain the message key and
the parameters (easy to unit test that, too).  Then, the view layer
has to make sure that it has the right messages defined.


  --
  View this message in context: 
 http://www.nabble.com/Where-and-how-would-you-internationalise-the-following...-and-integrate-with-wicket--tp15974621p15974621.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]



Re: Default Focus Behavior?

2008-03-10 Thread James Carman
On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 i dont think something like this should go into core. it seems pretty
  clear from this thread that there are very many ways to do this and
  each project will use their own. what you have proposed seems trivial
  to construct, so for projects that want to use it its a nobrainer. i
  think things that go into core should at least satisfy the majority of
  common usecases or be at least of moderate complexity. if we start
  putting every trivial thing like this into core we will end up with a
  huge surface area - at which point you have to start thinking of the
  find/build tradeoff - is it easier to find something that does what i
  want in core or simply roll my own which will only take fifteen
  minutes...

Okay, suit yourself, but I was actually quite surprised that this
wasn't included in the core.  This seems like a common enough
requirement that a certain field in a form should receive the focus
when the page loads.

p.s. I might change the name to FocusOnLoadBehavior, though.  That
seems more descriptive.

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



Re: Global Exception Handling...

2008-03-10 Thread Igor Vaynberg
you might also need access to the request cycle inside the
exceptionhandler, so thats three arguments now...maybe on exception
you want to set a 503 error

also what is the search order for handler resolution? do we go root
cause-outer or outer-root cause? both can make sense in certain
situations which would make handler resolution ambiguous...

we prefer to keep wicket bare and let users come up with their own
solutions for these sorts of thing, that work exactly how they want.

-igor


On Mon, Mar 10, 2008 at 9:20 PM, James Carman
[EMAIL PROTECTED] wrote:
 On 3/10/08, James Carman [EMAIL PROTECTED] wrote:
   On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 On Mon, Mar 10, 2008 at 7:39 PM, James Carman
  [EMAIL PROTECTED] wrote:
   If I'm developing a Hibernate-based application and I want to install
some global StateObjectStateException handling code, what's the best
way to do it?  I could override Application.newRequestCycle()
providing my own request cycle implementation which overrides the
onRuntimeException() method.  Is there a way to plug in logic which
says if you see exception type X, use this handler?


 notice requestcycle.onruntimeexception() has access to the exception,
  and returns a page, so

  myrc.onruntimexception(runtimeexception e) {
   if (e.getrootcause() instanceof hibernateexception) {
   return new hibernateerrorpage(e);
   }
  }
  
  
   Okay, so this is the way to handle it, eh?  I just wanted to make sure
there was nothing out there already for this.  I may make up a
Spring-based solution that allows me to register an exception
handler for specific types of runtime exceptions.  That way, my forms
don't need to know I'm using Hibernate.  They can just deal with my
domain interface (a repository).  Thanks for the tip!
  

  What if we changed IRequestCycleSettings to include these methods:

  public void addRuntimeExceptionHandler(Class exceptionClass,
  IRuntimeExceptionHandler handler);
  public IRuntimeExceptionHandler getRuntimeExceptionHandler(RuntimeException 
 e);


  Then, add the IRuntimeExceptionHandler interface:

  public interface IRuntimeExceptionHandler
  {
   public Page onRuntimeException(Page page, RuntimeException e);
  }

  Then, RequestCycle's onRuntimeException() method as follows:

  public void onRuntimeException(Page page, RuntimeException e)
  {
   IRuntimeExceptionHandler handler =
  Application.get().getRequestCycleSettings().getRuntimeExceptionHandler(e);
   if( handler != null )
   {
 return handler.onRuntimeException(page,e);
   }
   return null;
  }

  This way, folks could install their own exception handlers very
  easily.  The getRuntimeExceptionHandler() method would do a search up
  the class hierarchy if necessary, so you could install a handler for
  IOException which would cover FIleNotFoundException, for instance.
  What do you think?



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



Re: Global Exception Handling...

2008-03-10 Thread James Carman
On 3/11/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
 you might also need access to the request cycle inside the
  exceptionhandler, so thats three arguments now...maybe on exception
  you want to set a 503 error

  also what is the search order for handler resolution? do we go root
  cause-outer or outer-root cause? both can make sense in certain
  situations which would make handler resolution ambiguous...

  we prefer to keep wicket bare and let users come up with their own
  solutions for these sorts of thing, that work exactly how they want.


The request cycle is easy enough to access anywhere, RequestCycle.get() right?

I hadn't thought of the root cause stuff, admittedly.  However, just
going up the main hierarchy is probably sufficient for a majority of
use cases.  If a user needs more advanced search capability, I guess
they could do it themselves.  Maybe the search algorithm could be put
in the RequestCycle class' onRuntimeException() method itself.  Then,
all you'd have to do is override Application.newRequestCycle() and
RequestCycle.onRuntimeException() to plug in your own advanced handler
search capability.  I think this sort of feature is a common enough
need that it could be built in, but that's just my opinion.

I'm somewhat new to the Wicket community, so maybe I just didn't get
the Wicket philosophy.  That doesn't mean that I won't offer
suggestions that I find useful anymore. :)  Keeping the core framework
bare is a good approach.

Another thought I had is that inside the new methods on Application,
maybe it could call a factory instead of doing the logic itself.
Then, the factory could be configured by subclasses to override the
default behavior rather than having to implement the method
themselves.  For instance, you could come up with a
IRequestCycleFactory interface.  So, if I were to write a little
project that does what I want w.r.t. this exception handler stuff, all
someone would have to do in their application is plug in my
IRequestCycleFactory implementation to get that functionality.  They
wouldn't have to extend my Application superclass (what if they wanted
to use another library which requires the extension of an Application
superclass also?).  The same sort of stuff could be done for Sessions,
etc.

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



Re: styling thead in DataTable

2008-03-10 Thread Martin Makundi
Does this also mean that one must add a wicket:id into the thead?

**
Martin

2008/3/11, Christian Alejandro Marquez Grabia [EMAIL PROTECTED]:
 You can change tag attributes by overriding the onComponentTag() method, at
  least that is what I do when modifying any class or other attribute. (you
  should get the attribute from the tag parameter, and then set it there as
  well)

  I'm not sure where you should add that for the thead builder, but if you
  find it, then you'll get it done. You may also use IBehaviours, like
  SimpleAttributeModifier.

  Or as Igor well said, use your own markup (you could see the default markup
  inside the jar, and simply add the attribute you want)

  Rgds,

 Christian


  On 3/10/08, Igor Vaynberg [EMAIL PROTECTED] wrote:
  
   there shouldnt be anything you cannot do through css that you can do
   through adding things to markup
  
   that said you can always subclass datatable and provide your own markup
  
  
   -igor
  
  
   On Mon, Mar 10, 2008 at 3:31 PM, Eyal Golan [EMAIL PROTECTED] wrote:
well, I can and this is what I actually did.
 I found out that I can use in style, the attribute: *text-align*
 that has solved me the problem.
   
 But my (more general) question is: what if there is an attribute that
   can't
 be set in style? as what I understand, it can't be set in a CSS (if I'm
 mistaken, please tell me how it's done).
   
 How can I add attributes to thead of a DataTable?
 Hope I'm clear enough.
   
 Eyal
 On Mon, Mar 10, 2008 at 7:17 PM, Igor Vaynberg [EMAIL PROTECTED]
   
 wrote:
   
   
   
  can you not use css?
 
  -igor
 
 
  On Mon, Mar 10, 2008 at 6:17 AM, Eyal Golan [EMAIL PROTECTED]
   wrote:
   Hey all,
I am having an issue that seems to be simple, but still, no
   success.
  
I have a normal DataTable.
I add to it the toptoolbars manually:
HeadersToolbar thead = new HeadersToolbar(entityDataTable,
entitiesProvider);
entityDataTable.addTopToolbar(thead);
This is how it looks in the HTML:
table wicket:id=entitiesList class=browserTable
  
This is how (part of) the generated HTML looks like:
table class=browserTable wicket:id=entitiesList
thead
tr class=headers
th wicket:id=header class=wicket_orderUpwicket:border
_moz-userdefined=a wicket:id=orderByLink class=
  
  
   
 href=?wicket:interface=:4:tabs:browserTabbedPanel:panel:entitiesList:topToolbars:2:toolbar:headers:1:header:orderByLink::ILinkListener::wicket:body
_moz-userdefined=span wicket:id=labelPerson
ID/span/wicket:body/a/wicket:border
/th
  
I want a simple thing: I want to align the header labels to the
   left.
The problem(s):
- style doesn't have an attribute of align. Only vertical-align.
- I tried to add to the HeadersToolbar an AttributeModifier:
thead.add(new AttributeModifier(align, true, new
   Model(left)));
  
Nothing seems working.
I am using Firebug and the label thead keeps with no attribute.
  
Can anyone help?
  
Thank a lot
  
  
--
Eyal Golan
[EMAIL PROTECTED]
  
Visit: http://jvdrums.sourceforge.net/
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
   
   
 --
   
   
Eyal Golan
 [EMAIL PROTECTED]
   
 Visit: http://jvdrums.sourceforge.net/
   
  
   -
   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]



  1   2   >