Authorization and

2010-02-12 Thread Wilhelmsen Tor Iver
We have an app with three "user types" and two "user levels" (read  or 
read-write in effect). We want to use these in authorization, and thought about 
an approach using annotations. However, at the point of the Wicket auth. 
interface methods, only class-targeted annotations are visible, and that will 
lead to excessive subclassing (especially since Java does not let you annotate 
anonymous inner classes).

Would it be a better approach to use "behaviorless Behavior" objects that we 
add to the relevant components and look for in isActionAuthorized()?

Med vennlig hilsen

TOR IVER WILHELMSEN
Senior systemutvikler
Arrive AS
T (+47) 48 16 06 18
E-post: toriv...@arrive.no
http://www.arrive.no
http://servicedesk.arrive.no





modal in a modal problem

2010-02-12 Thread Martin Asenov
Hello, everyone!

I experience a problem when triggering a modal window from another modal 
window. When a removal icon is clicked in the first modal, there's a 
confirmation dialog, that pops up. Although I've set everything up, the 
windowClosedCallback gets activated only when I confirm removal twice. I have 
no idea why it happens this way. The confirmation dialog works fine for all 
RepeaterHoldingPage-s I have, excluding the one I have placed in another modal. 
Here's the code of the conf dialog:

   public ConfirmationDialog(String question, final ModalWindow parent, 
final RepeaterHoldingPage page, final Object entry) {

 System.out.println("confirmation dialog called");

 questionLabel = new Label("question", question);
 yesButton = new AjaxButton("yes_button", new 
Model(getString("yes"))) {

private static final long serialVersionUID = 1l;

@Override
protected void onSubmit(AjaxRequestTarget target, Form 
form) {
   System.out.println("yes button clicked");
   parent.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback() {

  private static final long serialVersionUID = 
1L;

  @Override
  public void onClose(AjaxRequestTarget target) 
{
page.removeItem(entry, target);
System.out.println("removal supposed to 
be called");
  }
   });

   parent.close(target);
}
 };

What happens is that I trigger the conf dialog, press the 'yes' button and in 
the console the following gets printed:
confirmation dialog called;



RE: modal in a modal problem

2010-02-12 Thread Martin Asenov
I forgot to mention that the first time I click yes, I get:

confirmation dialog called
yes button clicked

in console, and the conf dialog closes itself. when I open it for second time, 
I get
confirmation dialog called
yes button clicked
removal supposed to be called

and the item really gets removed, but why triggering it twice?

Thanks in advance!

From: Martin Asenov
Sent: Friday, February 12, 2010 10:20 AM
To: 'users@wicket.apache.org'
Subject: modal in a modal problem

Hello, everyone!

I experience a problem when triggering a modal window from another modal 
window. When a removal icon is clicked in the first modal, there's a 
confirmation dialog, that pops up. Although I've set everything up, the 
windowClosedCallback gets activated only when I confirm removal twice. I have 
no idea why it happens this way. The confirmation dialog works fine for all 
RepeaterHoldingPage-s I have, excluding the one I have placed in another modal. 
Here's the code of the conf dialog:

   public ConfirmationDialog(String question, final ModalWindow parent, 
final RepeaterHoldingPage page, final Object entry) {

 System.out.println("confirmation dialog called");

 questionLabel = new Label("question", question);
 yesButton = new AjaxButton("yes_button", new 
Model(getString("yes"))) {

private static final long serialVersionUID = 1l;

@Override
protected void onSubmit(AjaxRequestTarget target, Form 
form) {
   System.out.println("yes button clicked");
   parent.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback() {

  private static final long serialVersionUID = 
1L;

  @Override
  public void onClose(AjaxRequestTarget target) 
{
page.removeItem(entry, target);
System.out.println("removal supposed to 
be called");
  }
   });

   parent.close(target);
}
 };

What happens is that I trigger the conf dialog, press the 'yes' button and in 
the console the following gets printed:
confirmation dialog called;



Re: quickstart POM has wrong artifactId for jetty maven plugin

2010-02-12 Thread Martijn Dashorst
It works perfect for 6.x releases. You changed the version to 7 your
self, so it is your responsibility to change the other stuff  too.
When we upgrade the version we'll be sure to modify the plugin
accordingly.

Martijn

On Thu, Feb 11, 2010 at 10:39 PM, Russell Morrisey
 wrote:
> I'm using the quickstart maven command generated by 
> http://wicket.apache.org/quickstart.html, and then running 'mvn 
> eclipse:eclipse -DdownloadSources=true'. I have the wicket version set to 
> 1.4.5.
>
> The build fails:
> Unable to find resource 
> 'org.mortbay.jetty:maven-jetty-plugin:maven-plugin:7.0.0.pre5'.
>
> Consulting my local .m2 repository, I figured out that the artifactId is 
> 'jetty-maven-plugin'; the quickstart pom says 'maven-jetty-plugin', and I had 
> to change it manually in the POM to make it build successfully.
>
> 
>
> RUSSELL E. MORRISEY
> Programmer Analyst Professional
> Mission Solutions Engineering, LLC
>
> | p: 856.252.5084 | f: 856.778.7342 | russell.morri...@missionse.com | 
> www.missionse.com
> 304 West Route 38, Moorestown, NJ 08057
>
>
> 
> This is a PRIVATE message. If you are not the intended recipient, please 
> delete without copying and kindly advise us by e-mail of the mistake in 
> delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any 
> order or other contract unless pursuant to explicit written agreement or 
> government initiative expressly permitting the use of e-mail for such purpose.
>



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

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



Re: TextArea in repeater doesn't update it's model

2010-02-12 Thread Rubén khanser
It still doesn't work. Do I need a form inside my repeater?

protected void populateItem(Item arg0) {
Label pagina;
 final Label codi;
final TextArea valor;
SubmitLink link;
  final AccTextosWrapper tWrapper = (AccTextosWrapper)arg0.getModelObject();
 pagina = new Label("pagina", tWrapper.getPagina());
 codi = new Label("codi",tWrapper.getCodi());
 codi.setOutputMarkupId(true);
valor = new TextArea("valor", new PropertyModel(tWrapper,"descripcio"));
 valor.setOutputMarkupId(true);
link = new SubmitLink("link");
 link.add(new AjaxEventBehavior("onclick") {
 @Override
 protected void onEvent(AjaxRequestTarget arg0) {
valor.validate();
 valor.updateModel();
String c = codi.getModelObjectAsString();
String v = valor.getModelObjectAsString();
 adminService.updateTextDescripcio(c,v);
 }
 });
link.setOutputMarkupId(true);
  arg0.add(pagina);
arg0.add(codi);
 arg0.add(valor);
arg0.add(link);
 }

2010/2/11 Igor Vaynberg 

> it has nothing to do with nested forms. regular links do not submit
> forms, that is how html works. you can either use a button or a
> submitlink.
>
> -igor
>
> 2010/2/11 Rubén khanser :
> > Then should I use nestedforms better than this?
> >
> > 2010/2/11 Igor Vaynberg 
> >
> >> you need to use a submit link if you want the values to be submitted
> >> back to the server
> >>
> >> -igor
> >>
> >> 2010/2/11 Rubén khanser :
> >> > I have an AjaxFallBackLink that executes an update in a service, but i
> >> need
> >> > the textArea of the same row to be updated. I have wasted all morning
> but
> >> i
> >> > can't still make it work.
> >> >
> >> > I reached this point:
> >> >
> >> > DataView dv = new DataView("dataView",ldp) {
> >> >  private static final long serialVersionUID = -3315693391867601086L;
> >> >
> >> > @Override
> >> > protected void populateItem(Item arg0) {
> >> > Label pagina;
> >> >  final Label codi;
> >> > final TextArea valor;
> >> > AjaxFallbackLink link;
> >> >  final StringBuffer vBuffer = new StringBuffer();
> >> >  final AccTextosWrapper tWrapper =
> >> (AccTextosWrapper)arg0.getModelObject();
> >> > pagina = new Label("pagina", tWrapper.getPagina());
> >> >  codi = new Label("codi",tWrapper.getCodi());
> >> > codi.setOutputMarkupId(true);
> >> >  valor = new TextArea("valor", new
> PropertyModel(tWrapper,"descripcio"));
> >> > valor.add(new AjaxEventBehavior("onblur") {
> >> >  @Override
> >> > protected void onEvent(AjaxRequestTarget arg0) {
> >> >  String val = valor.getModelObjectAsString();
> >> > vBuffer.delete(0, vBuffer.length());
> >> >  vBuffer.append((val == null)?"":val);
> >> >  }
> >> >  });
> >> > valor.setOutputMarkupId(true);
> >> > link = new AjaxFallbackLink("link") {
> >> >  private static final long serialVersionUID = 3439293533625966929L;
> >> >
> >> > @Override
> >> > public void onClick(AjaxRequestTarget arg0) {
> >> >  String c = codi.getModelObjectAsString();
> >> >  adminService.updateTextDescripcio(c,vBuffer.toString());
> >> >  }
> >> > };
> >> > link.setOutputMarkupId(true);
> >> >  arg0.add(pagina);
> >> >  arg0.add(codi);
> >> > arg0.add(valor);
> >> > arg0.add(link);
> >> >  }
> >> > };
> >> >
> >> > If i don't use validate() and updateModel() i get the same string i
> had
> >> at
> >> > the start otherwise i get null.
> >> >
> >> > All works fine but the TextArea model.
> >> > Thank you very much for your help
> >> >
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: jdbc

2010-02-12 Thread Ivan Dudko
For example..
class Honey {
int id;
int milkid;
String name;
// getters and setters
}
class Milk {
int id;
String name;
// getters and setters
}

and my query:
SELECT honey.id ID, honey.milkid MILKID, honey.name HONEYNAME,
milk.name MILKNAME FROM honey, milk
WHERE  honey.milkid=milk.id;

And i want to display table with these fields.

Which object i must use?

2010/2/11 James Carman :
> Well, what sort of object do you want to display?  Are you going to
> just create an Object[] for each row in the table?  Or, are you
> creating a DTO of some sort?
>
> On Thu, Feb 11, 2010 at 10:50 AM, Ivan Dudko  wrote:
>> Thank you.
>> I already do simple things with hibernate and spring ioc.
>> Now i want to use plain old jdbc.
>> I already get the datatable wich works with one pojo (table).
>> Now i am in trouble.. how i can get table for two joined tables, for example?
>>
>> 2010/2/11 James Carman :
>>> Yeah, but this doesn't give them an example of how to get the results
>>> out of a JDBC result set.  This is based on a static, in-memory list
>>> of Contact objects.  What I would recommend is to look at a
>>> Hibernate-based example and come up with the JDBC analog.  Here's an
>>> example from my Advanced Wicket talk I gave a while back:
>>>
>>> http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story3/page/Home.java
>>>
>>> At the bottom, there's a data provider which talks to a "repository"
>>> to get its data.
>>>
>>>
>>>
>>> On Thu, Feb 11, 2010 at 10:11 AM, Giambalvo, Christian
>>>  wrote:
 http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html

 -Ursprüngliche Nachricht-
 Von: Ivan Dudko [mailto:ivan.du...@gmail.com]
 Gesendet: Donnerstag, 11. Februar 2010 15:47
 An: users@wicket.apache.org
 Betreff: Re: jdbc

 I already have method that return my data from db as arraylist. And i
 use this in iterator() method of dataprovider.
 But which object (i think model) i must return?

 2010/2/11 James Carman :
> You need to create a "provider" for your data.  Look at what the
> constructor takes and then implement the interface.
>
> On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko  wrote:
>> Hello!
>>
>> I can't understand how to populate data from a resultset object into 
>> datatable.
>> Anyone have an example?
>>
>> Thank you!
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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


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


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

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



Re: TextArea in repeater doesn't update it's model

2010-02-12 Thread Rubén khanser
Ok i got it solved using a Form in each row that contains the textarea and
the submitlink.

Thanks

El 12 de febrero de 2010 09:53, Rubén khanser  escribió:

> It still doesn't work. Do I need a form inside my repeater?
>
> protected void populateItem(Item arg0) {
>  Label pagina;
>  final Label codi;
> final TextArea valor;
> SubmitLink link;
>   final AccTextosWrapper tWrapper =
> (AccTextosWrapper)arg0.getModelObject();
>  pagina = new Label("pagina", tWrapper.getPagina());
>  codi = new Label("codi",tWrapper.getCodi());
>  codi.setOutputMarkupId(true);
> valor = new TextArea("valor", new PropertyModel(tWrapper,"descripcio"));
>  valor.setOutputMarkupId(true);
> link = new SubmitLink("link");
>  link.add(new AjaxEventBehavior("onclick") {
>  @Override
>  protected void onEvent(AjaxRequestTarget arg0) {
> valor.validate();
>  valor.updateModel();
> String c = codi.getModelObjectAsString();
> String v = valor.getModelObjectAsString();
>  adminService.updateTextDescripcio(c,v);
>  }
>  });
> link.setOutputMarkupId(true);
>   arg0.add(pagina);
> arg0.add(codi);
>  arg0.add(valor);
> arg0.add(link);
>  }
>
> 2010/2/11 Igor Vaynberg 
>
>> it has nothing to do with nested forms. regular links do not submit
>> forms, that is how html works. you can either use a button or a
>> submitlink.
>>
>> -igor
>>
>> 2010/2/11 Rubén khanser :
>> > Then should I use nestedforms better than this?
>> >
>> > 2010/2/11 Igor Vaynberg 
>> >
>> >> you need to use a submit link if you want the values to be submitted
>> >> back to the server
>> >>
>> >> -igor
>> >>
>> >> 2010/2/11 Rubén khanser :
>> >> > I have an AjaxFallBackLink that executes an update in a service, but
>> i
>> >> need
>> >> > the textArea of the same row to be updated. I have wasted all morning
>> but
>> >> i
>> >> > can't still make it work.
>> >> >
>> >> > I reached this point:
>> >> >
>> >> > DataView dv = new DataView("dataView",ldp) {
>> >> >  private static final long serialVersionUID = -3315693391867601086L;
>> >> >
>> >> > @Override
>> >> > protected void populateItem(Item arg0) {
>> >> > Label pagina;
>> >> >  final Label codi;
>> >> > final TextArea valor;
>> >> > AjaxFallbackLink link;
>> >> >  final StringBuffer vBuffer = new StringBuffer();
>> >> >  final AccTextosWrapper tWrapper =
>> >> (AccTextosWrapper)arg0.getModelObject();
>> >> > pagina = new Label("pagina", tWrapper.getPagina());
>> >> >  codi = new Label("codi",tWrapper.getCodi());
>> >> > codi.setOutputMarkupId(true);
>> >> >  valor = new TextArea("valor", new
>> PropertyModel(tWrapper,"descripcio"));
>> >> > valor.add(new AjaxEventBehavior("onblur") {
>> >> >  @Override
>> >> > protected void onEvent(AjaxRequestTarget arg0) {
>> >> >  String val = valor.getModelObjectAsString();
>> >> > vBuffer.delete(0, vBuffer.length());
>> >> >  vBuffer.append((val == null)?"":val);
>> >> >  }
>> >> >  });
>> >> > valor.setOutputMarkupId(true);
>> >> > link = new AjaxFallbackLink("link") {
>> >> >  private static final long serialVersionUID = 3439293533625966929L;
>> >> >
>> >> > @Override
>> >> > public void onClick(AjaxRequestTarget arg0) {
>> >> >  String c = codi.getModelObjectAsString();
>> >> >  adminService.updateTextDescripcio(c,vBuffer.toString());
>> >> >  }
>> >> > };
>> >> > link.setOutputMarkupId(true);
>> >> >  arg0.add(pagina);
>> >> >  arg0.add(codi);
>> >> > arg0.add(valor);
>> >> > arg0.add(link);
>> >> >  }
>> >> > };
>> >> >
>> >> > If i don't use validate() and updateModel() i get the same string i
>> had
>> >> at
>> >> > the start otherwise i get null.
>> >> >
>> >> > All works fine but the TextArea model.
>> >> > Thank you very much for your help
>> >> >
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


Re: Authorization and

2010-02-12 Thread Daniele Dellafiore
I am facing authorization problems this days, as you see in onother message.


when I started to deal with this problem I were also uncomfortable at the
idea to use annotation on components or even specific class (like
SecureComponent). Too much noise in the code and too much interference of
authorization stuff in the operational code.

I wanted to move everything in the AuthorizationStrategy to keep the
panels/page code almost authorizazion unaware.

Actually I think that that target could be achieved only for some simple
situation. My advice is to try using the wicket component.setMetaData. You
can put there you access authorization key and check for it in
AuthorizationStrategy.

This is easy to understand and keep the code clean.


On Fri, Feb 12, 2010 at 9:07 AM, Wilhelmsen Tor Iver wrote:

> We have an app with three "user types" and two "user levels" (read  or
> read-write in effect). We want to use these in authorization, and thought
> about an approach using annotations. However, at the point of the Wicket
> auth. interface methods, only class-targeted annotations are visible, and
> that will lead to excessive subclassing (especially since Java does not let
> you annotate anonymous inner classes).
>
> Would it be a better approach to use "behaviorless Behavior" objects that
> we add to the relevant components and look for in isActionAuthorized()?
>
> Med vennlig hilsen
>
> TOR IVER WILHELMSEN
> Senior systemutvikler
> Arrive AS
> T (+47) 48 16 06 18
> E-post: toriv...@arrive.no
> http://www.arrive.no
> http://servicedesk.arrive.no
>
>
>
>


-- 
Daniele Dellafiore
http://danieledellafiore.net


Re: jdbc

2010-02-12 Thread James Carman
You could create a reference from Honey to Milk, since you have a
"milkid" field there.  Then, you'd use a list of Honey objects and
you'd display these properties:

id
milk.id
name
milk.name




On Fri, Feb 12, 2010 at 3:58 AM, Ivan Dudko  wrote:
> For example..
> class Honey {
> int id;
> int milkid;
> String name;
> // getters and setters
> }
> class Milk {
> int id;
> String name;
> // getters and setters
> }
>
> and my query:
> SELECT honey.id ID, honey.milkid MILKID, honey.name HONEYNAME,
> milk.name MILKNAME FROM honey, milk
> WHERE  honey.milkid=milk.id;
>
> And i want to display table with these fields.
>
> Which object i must use?
>
> 2010/2/11 James Carman :
>> Well, what sort of object do you want to display?  Are you going to
>> just create an Object[] for each row in the table?  Or, are you
>> creating a DTO of some sort?
>>
>> On Thu, Feb 11, 2010 at 10:50 AM, Ivan Dudko  wrote:
>>> Thank you.
>>> I already do simple things with hibernate and spring ioc.
>>> Now i want to use plain old jdbc.
>>> I already get the datatable wich works with one pojo (table).
>>> Now i am in trouble.. how i can get table for two joined tables, for 
>>> example?
>>>
>>> 2010/2/11 James Carman :
 Yeah, but this doesn't give them an example of how to get the results
 out of a JDBC result set.  This is based on a static, in-memory list
 of Contact objects.  What I would recommend is to look at a
 Hibernate-based example and come up with the JDBC analog.  Here's an
 example from my Advanced Wicket talk I gave a while back:

 http://svn.carmanconsulting.com/public/wicket-advanced/trunk/src/main/java/com/carmanconsulting/wicket/advanced/web/story3/page/Home.java

 At the bottom, there's a data provider which talks to a "repository"
 to get its data.



 On Thu, Feb 11, 2010 at 10:11 AM, Giambalvo, Christian
  wrote:
> http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
>
> -Ursprüngliche Nachricht-
> Von: Ivan Dudko [mailto:ivan.du...@gmail.com]
> Gesendet: Donnerstag, 11. Februar 2010 15:47
> An: users@wicket.apache.org
> Betreff: Re: jdbc
>
> I already have method that return my data from db as arraylist. And i
> use this in iterator() method of dataprovider.
> But which object (i think model) i must return?
>
> 2010/2/11 James Carman :
>> You need to create a "provider" for your data.  Look at what the
>> constructor takes and then implement the interface.
>>
>> On Thu, Feb 11, 2010 at 8:26 AM, Ivan Dudko  wrote:
>>> Hello!
>>>
>>> I can't understand how to populate data from a resultset object into 
>>> datatable.
>>> Anyone have an example?
>>>
>>> Thank you!
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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


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

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



RE: AbstractAjaxTimerBehavior#onTimer() doesn't work in deployment mode

2010-02-12 Thread Andreas Lüdtke
Igor,

I made a quickstart and found that it's not a wicket issue but a tomcat
issue. I installed tomcat 6.0.24 and configured it in Netbeans and now it
works as expected.

Thanks

Andreas

> -Original Message-
> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
> Sent: Tuesday, February 09, 2010 5:19 PM
> To: users@wicket.apache.org; sam.lued...@t-online.de
> Subject: Re: AbstractAjaxTimerBehavior#onTimer() doesn't work 
> in deployment mode
> 
> feel free to open a jira issue attaching a quickstart that reproduces
> the problem.
> 
> -igor
> 
> On Tue, Feb 9, 2010 at 12:37 AM, Andreas Lüdtke 
>  wrote:
> > Can someone please confirm if this is a bug? If yes, I will 
> create a JIRA
> > issue if I'm allowed to do that.
> >
> > Thanks
> >
> > Andreas
> >
> >> -Original Message-
> >> From: Andreas Lüdtke [mailto:sam.lued...@t-online.de]
> >> Sent: Saturday, February 06, 2010 7:43 PM
> >> To: users@wicket.apache.org
> >> Subject: AbstractAjaxTimerBehavior#onTimer() doesn't work in
> >> deployment mode
> >>
> >> Hi,
> >>
> >> I'm using wicket 1.4.6 and saw that the onTimer method of an
> >> AbstractAjaxTimerBehavior object isn't called, when I switch
> >> vom development
> >> mode to deployment mode. This happens also with wicket 1.4.5.
> >>
> >> Is there something I need to do to get it working in 
> deployment mode?
> >>
> >> In addition, after calling AbstractAjaxTimerBehavior.stop()
> >> the onTimer
> >> method is still called (of course only in development mode). ;-)
> >>
> >> If someone finds the time to fix this, I would be glad if
> >> this person could
> >> implement a restart() method to start the timer after it has
> >> been stopped.
> >>
> >> Andreas
> >
> >
> > 
> -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> 


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



How to disable AJAX call on ModalWindow close

2010-02-12 Thread zkn
Hi,

I'm using 

Wicket.Ajax.registerPreCallHandler(showBusyScreen);
Wicket.Ajax.registerPostCallHandler(hideBusyScreen);
Wicket.Ajax.registerFailureHandler(hideBusyScreen);

to show and hide a busy screen on the page while executing AJAX calls. But it 
also shows up when I click the close button of a modal window even though I 
don't need to do anything on the server side.
Is there are way to disable this AJAX call on modal window close?



RE: modal in a modal problem

2010-02-12 Thread Martin Asenov
Does anyone know? Please, people, I'm getting despaired of this...

-Original Message-
From: Martin Asenov [mailto:mase...@velti.com] 
Sent: Friday, February 12, 2010 10:23 AM
To: users@wicket.apache.org
Subject: RE: modal in a modal problem

I forgot to mention that the first time I click yes, I get:

confirmation dialog called
yes button clicked

in console, and the conf dialog closes itself. when I open it for second time, 
I get
confirmation dialog called
yes button clicked
removal supposed to be called

and the item really gets removed, but why triggering it twice?

Thanks in advance!

From: Martin Asenov
Sent: Friday, February 12, 2010 10:20 AM
To: 'users@wicket.apache.org'
Subject: modal in a modal problem

Hello, everyone!

I experience a problem when triggering a modal window from another modal 
window. When a removal icon is clicked in the first modal, there's a 
confirmation dialog, that pops up. Although I've set everything up, the 
windowClosedCallback gets activated only when I confirm removal twice. I have 
no idea why it happens this way. The confirmation dialog works fine for all 
RepeaterHoldingPage-s I have, excluding the one I have placed in another modal. 
Here's the code of the conf dialog:

   public ConfirmationDialog(String question, final ModalWindow parent, 
final RepeaterHoldingPage page, final Object entry) {

 System.out.println("confirmation dialog called");

 questionLabel = new Label("question", question);
 yesButton = new AjaxButton("yes_button", new 
Model(getString("yes"))) {

private static final long serialVersionUID = 1l;

@Override
protected void onSubmit(AjaxRequestTarget target, Form 
form) {
   System.out.println("yes button clicked");
   parent.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback() {

  private static final long serialVersionUID = 
1L;

  @Override
  public void onClose(AjaxRequestTarget target) 
{
page.removeItem(entry, target);
System.out.println("removal supposed to 
be called");
  }
   });

   parent.close(target);
}
 };

What happens is that I trigger the conf dialog, press the 'yes' button and in 
the console the following gets printed:
confirmation dialog called;


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



Re: TextArea in repeater doesn't update it's model

2010-02-12 Thread Igor Vaynberg
No point using a submit link if you are going to override onclick with
a non form related Ajax behavior.

-igor

On Friday, February 12, 2010, Rubén khanser  wrote:
> It still doesn't work. Do I need a form inside my repeater?
>
> protected void populateItem(Item arg0) {
> Label pagina;
>  final Label codi;
> final TextArea valor;
> SubmitLink link;
>   final AccTextosWrapper tWrapper = (AccTextosWrapper)arg0.getModelObject();
>  pagina = new Label("pagina", tWrapper.getPagina());
>  codi = new Label("codi",tWrapper.getCodi());
>  codi.setOutputMarkupId(true);
> valor = new TextArea("valor", new PropertyModel(tWrapper,"descripcio"));
>  valor.setOutputMarkupId(true);
> link = new SubmitLink("link");
>  link.add(new AjaxEventBehavior("onclick") {
> �...@override
>  protected void onEvent(AjaxRequestTarget arg0) {
> valor.validate();
>  valor.updateModel();
> String c = codi.getModelObjectAsString();
> String v = valor.getModelObjectAsString();
>  adminService.updateTextDescripcio(c,v);
>  }
>  });
> link.setOutputMarkupId(true);
>   arg0.add(pagina);
> arg0.add(codi);
>  arg0.add(valor);
> arg0.add(link);
>  }
>
> 2010/2/11 Igor Vaynberg 
>
>> it has nothing to do with nested forms. regular links do not submit
>> forms, that is how html works. you can either use a button or a
>> submitlink.
>>
>> -igor
>>
>> 2010/2/11 Rubén khanser :
>> > Then should I use nestedforms better than this?
>> >
>> > 2010/2/11 Igor Vaynberg 
>> >
>> >> you need to use a submit link if you want the values to be submitted
>> >> back to the server
>> >>
>> >> -igor
>> >>
>> >> 2010/2/11 Rubén khanser :
>> >> > I have an AjaxFallBackLink that executes an update in a service, but i
>> >> need
>> >> > the textArea of the same row to be updated. I have wasted all morning
>> but
>> >> i
>> >> > can't still make it work.
>> >> >
>> >> > I reached this point:
>> >> >
>> >> >         DataView dv = new DataView("dataView",ldp) {
>> >> >  private static final long serialVersionUID = -3315693391867601086L;
>> >> >
>> >> > @Override
>> >> > protected void populateItem(Item arg0) {
>> >> > Label pagina;
>> >> >  final Label codi;
>> >> > final TextArea valor;
>> >> > AjaxFallbackLink link;
>> >> >  final StringBuffer vBuffer = new StringBuffer();
>> >> >  final AccTextosWrapper tWrapper =
>> >> (AccTextosWrapper)arg0.getModelObject();
>> >> > pagina = new Label("pagina", tWrapper.getPagina());
>> >> >  codi = new Label("codi",tWrapper.getCodi());
>> >> > codi.setOutputMarkupId(true);
>> >> >  valor = new TextArea("valor", new
>> PropertyModel(tWrapper,"descripcio"));
>> >> > valor.add(new AjaxEventBehavior("onblur") {
>> >> > �...@override
>> >> > protected void onEvent(AjaxRequestTarget arg0) {
>> >> >  String val = valor.getModelObjectAsString();
>> >> > vBuffer.delete(0, vBuffer.length());
>> >> >  vBuffer.append((val == null)?"":val);
>> >> >  }
>> >> >  });
>> >> > valor.setOutputMarkupId(true);
>> >> > link = new AjaxFallbackLink("link") {
>> >> >  private static final long serialVersionUID = 3439293533625966929L;
>> >> >
>> >> > @Override
>> >> > public void onClick(AjaxRequestTarget arg0) {
>> >> >  String c = codi.getModelObjectAsString();
>> >> >  adminService.updateTextDescripcio(c,vBuffer.toString());
>> >> >  }
>> >> > };
>> >> > link.setOutputMarkupId(true);
>> >> >  arg0.add(pagina);
>> >> >  arg0.add(codi);
>> >> > arg0.add(valor);
>> >> > arg0.add(link);
>> >> >  }
>> >> > };
>> >> >
>> >> > If i don't use validate() and updateModel() i get the same string i
>> had
>> >> at
>> >> > the start otherwise i get null.
>> >> >
>> >> > All works fine but the TextArea model.
>> >> > Thank you very much for your help
>> >> >
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: users-un

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



Re: AbstractAjaxTimerBehavior#onTimer() doesn't work in deployment mode

2010-02-12 Thread Igor Vaynberg
QuickStart strikes again :)

-igor

On Friday, February 12, 2010, Andreas Lüdtke  wrote:
> Igor,
>
> I made a quickstart and found that it's not a wicket issue but a tomcat
> issue. I installed tomcat 6.0.24 and configured it in Netbeans and now it
> works as expected.
>
> Thanks
>
>         Andreas
>
>> -Original Message-
>> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
>> Sent: Tuesday, February 09, 2010 5:19 PM
>> To: users@wicket.apache.org; sam.lued...@t-online.de
>> Subject: Re: AbstractAjaxTimerBehavior#onTimer() doesn't work
>> in deployment mode
>>
>> feel free to open a jira issue attaching a quickstart that reproduces
>> the problem.
>>
>> -igor
>>
>> On Tue, Feb 9, 2010 at 12:37 AM, Andreas Lüdtke
>>  wrote:
>> > Can someone please confirm if this is a bug? If yes, I will
>> create a JIRA
>> > issue if I'm allowed to do that.
>> >
>> > Thanks
>> >
>> > Andreas
>> >
>> >> -Original Message-
>> >> From: Andreas Lüdtke [mailto:sam.lued...@t-online.de]
>> >> Sent: Saturday, February 06, 2010 7:43 PM
>> >> To: users@wicket.apache.org
>> >> Subject: AbstractAjaxTimerBehavior#onTimer() doesn't work in
>> >> deployment mode
>> >>
>> >> Hi,
>> >>
>> >> I'm using wicket 1.4.6 and saw that the onTimer method of an
>> >> AbstractAjaxTimerBehavior object isn't called, when I switch
>> >> vom development
>> >> mode to deployment mode. This happens also with wicket 1.4.5.
>> >>
>> >> Is there something I need to do to get it working in
>> deployment mode?
>> >>
>> >> In addition, after calling AbstractAjaxTimerBehavior.stop()
>> >> the onTimer
>> >> method is still called (of course only in development mode). ;-)
>> >>
>> >> If someone finds the time to fix this, I would be glad if
>> >> this person could
>> >> implement a restart() method to start the timer after it has
>> >> been stopped.
>> >>
>> >> Andreas
>> >
>> >
>> >
>> -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Palette selected item

2010-02-12 Thread Josh Chappelle
I have a Palette component that I need to be able to fire an event when an
item on the right side(selected side) has been clicked. Additionally I need
to know what item was clicked because I'm going to be populating another
panel based on that click. 

 

I have created my own component called SelectableOptions that extends
AbstractOptions and implements IOnChangeListener. Then I took the
implementing code that is in DropDownChoice(since it is a good example of a
component that implements IOnChangeListener) and put it in my component. 

 

I am able to receive the onSelectionChanged event and I'm able to pass the
object that the user clicked to that method. However, when you click the
option and the event is fired, a full post back happens and all the items on
the right side of the palette is lost. Basically the component is
re-initialized. 

 

Can anyone help guide me in the right direction? I have posted the code
below:

 

public class SelectableOptions extends AbstractOptions implements
IOnChangeListener

{

public SelectableOptions(String id, Palette palette, IModel
selectionModel)

{

super(id, palette);

setModel(selectionModel);

}

 

protected void onComponentTag(final ComponentTag tag)

{

checkComponentTag(tag, "select");

 

CharSequence url =
urlFor(IOnChangeListener.INTERFACE);

 

Form form = (Form)findParent(Form.class);

if (form != null)

{

RequestContext rc =
RequestContext.get();

if (rc.isPortletRequest())

{

// restore url back to real
wicket path as its going to be interpreted by the

// form itself

url =
((PortletRequestContext)rc).getLastEncodedPath();

}

tag.put("onchange",
form.getJsForInterfaceUrl(url));

}

else

{

// TODO: following doesn't work with
portlets, should be posted to a dynamic hidden

// form

// with an ActionURL or something

tag.put("onchange",
"window.location.href='" + url + (url.toString().indexOf('?') > -1 ? "&"
: "?") + getInputName() + "=' + this.options[this.selectedIndex].value;");

}

 

super.onComponentTag(tag);

IValueMap attrs = tag.getAttributes();

 

String onFocus =
getPalette().getSelectionOnFocusJS();

if (onFocus != null)

{

attrs.put("onFocus", onFocus);

}

//  tag.getAttributes().put("ondblclick",
getPalette().getRemoveOnClickJS());

}



protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)

{

final AppendingStringBuffer buffer = new
AppendingStringBuffer(128);

Iterator options = getOptionsIterator();

IChoiceRenderer renderer =
getPalette().getChoiceRenderer();

 

while (options.hasNext())

{

final Object choice = options.next();

String id = renderer.getIdValue(choice,
0);

Object displayValue =
renderer.getDisplayValue(choice);

Class displayClass = displayValue ==
null ? null : displayValue.getClass();

String value =
getConverter(displayClass).convertToString(displayValue, getLocale());

value = getLocalizer().getString(id +
"." + value, this, value);

 

buffer.append("\n").append(value).append("");

 

}

 

buffer.append("\n");

 

replaceComponentTagBody(markupStream, openTag,
buffer);

}

 

 

@Override

protected Iterator getOptionsIterator()

{

return getPalette().getSelectedChoices();

}

 

public final void onSelectionChanged()

{

Iterator iter = getOptionsIterator();

System.out.println("Still here");

while(iter.hasNext())

  

BookmarkablePage with PageParameters

2010-02-12 Thread Pierre Goupil
Good evening,

I have a BookmarkablePage which may need PageParameters or not, depending on
the business workflow. I used to mount it under /page but now that we do use
the PageParameters-providing constructor I have a problem which forced me
not to mount the page in my Application class anymore.

When I mounted the page explicitly, the PageParameters constructor call used
to gave such an URL: /page/param/0. So when asking for a resource on that
page, it gave me this error message: "URL fragment has unmatched
key/valuepairs, responding with 404".

If I don't mount the page, the URL generated is of the form:
/bookmarkablePage?class=foo¶m=0. Which is good regarding the parameter
retrieval.

My question is: is there any way to have the best of both world, I mean such
a pretty URL as /page (no Java class name in the URL) and the parameters
using the classical '?' and '&' symbols? Which would give this URL:
/page?param=0. I guess that if I don't have any trailing slashes in the URL,
the "URL fragment" message should be avoided, isn't it?

Thanks in advance and regards,

Pierre


-- 
Les deux règles universelles du bide :

1) on n'explique pas un bide

2) dans le futur, un bide sera toujours un bide.


Scroll to Anchor on Form Submit

2010-02-12 Thread Tony Wu
Is there a way in Wicket for Button form onSubmit to refresh the page and
scroll to a particular anchor? For example if I have 3 separate forms with a
FeedbackPanel in each, if I click the submit button for the final form and
there's a validation error, when the page refreshes the error messages are
at the bottom. It's not apparent to the user anything happened unless they
manually scroll down. It would be great if there's a way to scroll to
href="#someanchor". I think there's a setAnchor function in wicket, but
that's only for Links. Is there anything that works for Buttons/Form
submission?


Re: Authorization and

2010-02-12 Thread Riyad Kalla
Daniele,

I think you're exactly right to use the
get/setMetaData methods, per the Javadoc on
MetaDataKey(example
code uses ROLE) it seems that was one of the intents.

On Fri, Feb 12, 2010 at 3:39 AM, Daniele Dellafiore 
wrote:
> I am facing authorization problems this days, as you see in onother
message.
>
>
> when I started to deal with this problem I were also uncomfortable at the
> idea to use annotation on components or even specific class (like
> SecureComponent). Too much noise in the code and too much interference of
> authorization stuff in the operational code.
>
> I wanted to move everything in the AuthorizationStrategy to keep the
> panels/page code almost authorizazion unaware.
>
> Actually I think that that target could be achieved only for some simple
> situation. My advice is to try using the wicket component.setMetaData. You
> can put there you access authorization key and check for it in
> AuthorizationStrategy.
>
> This is easy to understand and keep the code clean.
>
>
> On Fri, Feb 12, 2010 at 9:07 AM, Wilhelmsen Tor Iver wrote:
>
>> We have an app with three "user types" and two "user levels" (read  or
>> read-write in effect). We want to use these in authorization, and thought
>> about an approach using annotations. However, at the point of the Wicket
>> auth. interface methods, only class-targeted annotations are visible, and
>> that will lead to excessive subclassing (especially since Java does not
let
>> you annotate anonymous inner classes).
>>
>> Would it be a better approach to use "behaviorless Behavior" objects that
>> we add to the relevant components and look for in isActionAuthorized()?
>>
>> Med vennlig hilsen
>>
>> TOR IVER WILHELMSEN
>> Senior systemutvikler
>> Arrive AS
>> T (+47) 48 16 06 18
>> E-post: toriv...@arrive.no
>> http://www.arrive.no
>> http://servicedesk.arrive.no
>>
>>
>>
>>
>
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>


Re: BookmarkablePage with PageParameters

2010-02-12 Thread vineet semwal
take a look at querystringurlcodingstrategy,mixedparamurlcodingstategy
,mixedparamhybridurlcodingstategy,
and use what suits you .


Good evening,
>
> I have a BookmarkablePage which may need PageParameters or not, depending
> on
> the business workflow. I used to mount it under /page but now that we do
> use
> the PageParameters-providing constructor I have a problem which forced me
> not to mount the page in my Application class anymore.
>
> When I mounted the page explicitly, the PageParameters constructor call
> used
> to gave such an URL: /page/param/0. So when asking for a resource on that
> page, it gave me this error message: "URL fragment has unmatched
> key/valuepairs, responding with 404".
>
> If I don't mount the page, the URL generated is of the form:
> /bookmarkablePage?class=foo¶m=0. Which is good regarding the parameter
> retrieval.
>
> My question is: is there any way to have the best of both world, I mean
> such
> a pretty URL as /page (no Java class name in the URL) and the parameters
> using the classical '?' and '&' symbols? Which would give this URL:
> /page?param=0. I guess that if I don't have any trailing slashes in the
> URL,
> the "URL fragment" message should be avoided, isn't it?
>
> Thanks in advance and regards,
>
> Pierre
>
>
> --
> Les deux règles universelles du bide :
>
> 1) on n'explique pas un bide
>
> 2) dans le futur, un bide sera toujours un bide.
>



-- 
regards,
Vineet Semwal


problem dynamic image - explorer

2010-02-12 Thread _Eynob _

Hi

Im creating a dynamic image with the DynamicImageResource, and my problem with 
this is in explorer, since my generated image is a png and there(explorer) when 
i choose 'save as..' it try to save it as a 'bmp'.

In firefox it works well and when i try to save it, i get the image as 'png'.

Someone know what should i set for explorer to know the type of the image ?


When it renders the image tag has this format:



So i guess the problem is in the 'src' attribute


Any help will be appreciated..

thanks.

  
_
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969

Re: Scroll to Anchor on Form Submit

2010-02-12 Thread Riyad Kalla
Tony,

I'm not sure if you can mess with the URL (e.g. append a #errors) from
within Wicket without causing a redirect (and loosing your errors from the
request and form state) -- someone smarter than me can address that -- but
if you wanted to get creative, maybe in the onError handler your can
contribute a behavior of some 'window.onload' JavaScript to the body of the
page that does a 'window.location=#errors' or somethig like
that, so as soon as the page comes back up, the JS "redirects" to the exact
same page but an anchor on it.

Not sure if that would cause a redirect or not...

-R

On Fri, Feb 12, 2010 at 10:26 AM, Tony Wu  wrote:

> Is there a way in Wicket for Button form onSubmit to refresh the page and
> scroll to a particular anchor? For example if I have 3 separate forms with
> a
> FeedbackPanel in each, if I click the submit button for the final form and
> there's a validation error, when the page refreshes the error messages are
> at the bottom. It's not apparent to the user anything happened unless they
> manually scroll down. It would be great if there's a way to scroll to
> href="#someanchor". I think there's a setAnchor function in wicket, but
> that's only for Links. Is there anything that works for Buttons/Form
> submission?
>


RE: quickstart POM has wrong artifactId for jetty maven plugin

2010-02-12 Thread Russell Morrisey
Martijn,

I encountered this error without making ANY changes to the POM generated by the 
quickstart archtype command, when running mvn eclipse:eclipse 
-DdownloadSources=true. The artifact it is having trouble with is the maven 
jetty plugin, not jetty itself. The POM has jetty.version 6.1.4 defined at the 
bottom. If I have some other environment setting that is specifying the plugin 
version, I'm not aware of it. Maybe you could give me some direction on where 
to look? I'm not a very experienced maven user.

RUSSELL E. MORRISEY
Programmer Analyst Professional
Mission Solutions Engineering, LLC

| russell.morri...@missionse.com | www.missionse.com
304 West Route 38, Moorestown, NJ 08057

-Original Message-
From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com]
Sent: Friday, February 12, 2010 3:33 AM
To: users@wicket.apache.org
Subject: Re: quickstart POM has wrong artifactId for jetty maven plugin

It works perfect for 6.x releases. You changed the version to 7 your
self, so it is your responsibility to change the other stuff  too.
When we upgrade the version we'll be sure to modify the plugin
accordingly.

Martijn

On Thu, Feb 11, 2010 at 10:39 PM, Russell Morrisey
 wrote:
> I'm using the quickstart maven command generated by 
> http://wicket.apache.org/quickstart.html, and then running 'mvn 
> eclipse:eclipse -DdownloadSources=true'. I have the wicket version set to 
> 1.4.5.
>
> The build fails:
> Unable to find resource 
> 'org.mortbay.jetty:maven-jetty-plugin:maven-plugin:7.0.0.pre5'.
>
> Consulting my local .m2 repository, I figured out that the artifactId is 
> 'jetty-maven-plugin'; the quickstart pom says 'maven-jetty-plugin', and I had 
> to change it manually in the POM to make it build successfully.
>
> 
>
> RUSSELL E. MORRISEY
> Programmer Analyst Professional
> Mission Solutions Engineering, LLC
>
> | p: 856.252.5084 | f: 856.778.7342 | russell.morri...@missionse.com | 
> www.missionse.com
> 304 West Route 38, Moorestown, NJ 08057
>
>
> 
> This is a PRIVATE message. If you are not the intended recipient, please 
> delete without copying and kindly advise us by e-mail of the mistake in 
> delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any 
> order or other contract unless pursuant to explicit written agreement or 
> government initiative expressly permitting the use of e-mail for such purpose.
>



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


This is a PRIVATE message. If you are not the intended recipient, please delete 
without copying and kindly advise us by e-mail of the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind MSE to any 
order or other contract unless pursuant to explicit written agreement or 
government initiative expressly permitting the use of e-mail for such purpose.

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



OnChangeAjaxBehavior: nth character

2010-02-12 Thread Steven Haines
Hi,

I
would like to add AJAX behavior to an application that sends an update
to my application after a certain number of characters have been typed.
For example, if the user is entering a zipcode, I would like a callback
to my application to be made after the user enters the fifth character.

I've
written code using OnChangeAjaxBehavior that sends messages back to my
application after every character has been typed, such as the following:

final TextField zipcodeField = new TextField( "zipcode" );
form.add( zipcodeField.setRequired( true ) );
OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
  @Override
  protected void onUpdate( AjaxRequestTarget target ) {
System.out.println( "Zipcode value: " + 
zipcodeField.getDefaultModelObjectAsString() );
  }
};
zipcodeField.add( zipcodeUpdated );


I
could check to see the size of the zipcodeField (in this example), but
it makes my application more chatty than it needs to be. I also tried
using onblur, which works fine, but does not satisfy my business
requirements:

  final TextField zipcodeField = new TextField( "zipcode" );
  form.add( zipcodeField.setRequired( true ) );

  AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new 
AjaxFormComponentUpdatingBehavior( "onblur" ) {
  @Override
  protected void onUpdate( AjaxRequestTarget target ) {
  System.out.println( "Zipcode value (form component): " + 
getFormComponent().getModelObject() );
  }
  };
  zipcodeField.add( zipcodeOnBlur );



Prior
to using Wicket (which I'm currently prototyping for my company), we
would handle this logic in JavaScript (observe changes to the field and
when the user enters the fifth character then we made an AJAX call back
our Struts 2 application.) 

What is the best way to achieve the same end using Wicket?

Thanks, in advance, for your help!
Steve

P.S.
I started using Wicket as part of an article series (because of all of
your passion for it) and I have to say all of you are doing incredible
work - I love it.. Here's the link to the article series in case any of
you are interested:
http://www.informit.com/guides/content.aspx?g=java&seqNum=529

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



Re: OnChangeAjaxBehavior: nth character

2010-02-12 Thread vineet semwal
you can do the same thing with wicket ie. on 5th char typed,make a
ajaxcallback to wicket,

1)you need to add behavior to component and implement it's respond method
the way it suits your need.
2)in the js part you  will make a callback on 5th char typed,callbackurl you
will get from the behavior you
added to the component.
take a look at
http://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript

On Sat, Feb 13, 2010 at 2:15 AM, Steven Haines  wrote:

> Hi,
>
> I
> would like to add AJAX behavior to an application that sends an update
> to my application after a certain number of characters have been typed.
> For example, if the user is entering a zipcode, I would like a callback
> to my application to be made after the user enters the fifth character.
>
> I've
> written code using OnChangeAjaxBehavior that sends messages back to my
> application after every character has been typed, such as the following:
>
>final TextField zipcodeField = new TextField( "zipcode"
> );
>form.add( zipcodeField.setRequired( true ) );
>OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
>  @Override
>  protected void onUpdate( AjaxRequestTarget target ) {
>System.out.println( "Zipcode value: " +
> zipcodeField.getDefaultModelObjectAsString() );
>  }
>};
>zipcodeField.add( zipcodeUpdated );
>
>
> I
> could check to see the size of the zipcodeField (in this example), but
> it makes my application more chatty than it needs to be. I also tried
> using onblur, which works fine, but does not satisfy my business
> requirements:
>
>  final TextField zipcodeField = new TextField( "zipcode" );
>  form.add( zipcodeField.setRequired( true ) );
>
>  AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
> AjaxFormComponentUpdatingBehavior( "onblur" ) {
>  @Override
>  protected void onUpdate( AjaxRequestTarget target ) {
>  System.out.println( "Zipcode value (form component): " +
> getFormComponent().getModelObject() );
>  }
>  };
>  zipcodeField.add( zipcodeOnBlur );
>
>
>
> Prior
> to using Wicket (which I'm currently prototyping for my company), we
> would handle this logic in JavaScript (observe changes to the field and
> when the user enters the fifth character then we made an AJAX call back
> our Struts 2 application.)
>
> What is the best way to achieve the same end using Wicket?
>
> Thanks, in advance, for your help!
> Steve
>
> P.S.
> I started using Wicket as part of an article series (because of all of
> your passion for it) and I have to say all of you are doing incredible
> work - I love it.. Here's the link to the article series in case any of
> you are interested:
> http://www.informit.com/guides/content.aspx?g=java&seqNum=529
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
regards,
Vineet Semwal


results of WebApplication.getConfigurationType() should be cached to avoid synchronization

2010-02-12 Thread Nikita Tovstoles
Below stack trace indicates that getConfigurationType() is called a lot. It,
however, consults a Hashtable, thereby hitting a synchronized block every
time. Note the resulting wait time (in seconds).

My fix is to cache the value in my WebApplication subclass (and populate
this tiny cache eagerly during app's init()):

/**
 * caches results because by default wicket consults System properties
(ie
 * hits a synchronized block in hashtable)
 */
@Override
public String getConfigurationType()
{
// not making this method synchronized because we'll call it during
init
// to cache the result

if (configurationTypeCache == null) {
configurationTypeCache = super.getConfigurationType();
}
return configurationTypeCache;
}

Using 1.4.3


>>
>> Stacks at 7:33
>
>
>>
>> http-8080-15 [BLOCKED] CPU time: 0:04
>
> java.util.Hashtable.get(Object)
>
> java.util.Properties.getProperty(String)
>
> java.lang.System.getProperty(String)
>
> org.apache.wicket.protocol.http.WebApplication.getConfigurationType()
>
> org.apache.wicket.Component.getMarkupId(boolean)
>
> org.apache.wicket.Component.getMarkupId()
>
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.getPreconditionScript()
>
>
>> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.generateCallbackScript(CharSequence)
>
>
>> org.apache.wicket.ajax.AjaxEventBehavior.generateCallbackScript(CharSequence)
>
>
>> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.getCallbackScript(boolean)
>
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.getCallbackScript()
>
> org.apache.wicket.ajax.AjaxEventBehavior.getEventHandler()
>
> org.apache.wicket.ajax.AjaxEventBehavior.onComponentTag(ComponentTag)
>
> org.apache.wicket.behavior.AbstractAjaxBehavior.onComponentTag(Component,
>> ComponentTag)
>
> org.apache.wicket.Component.renderComponentTag(ComponentTag)
>
> org.apache.wicket.Component.renderComponent(MarkupStream)
>
> org.apache.wicket.MarkupContainer.onRender(MarkupStream)
>
> org.apache.wicket.Component.render(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderNext(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.MarkupContainer.renderAssociatedMarkup(String, String)
>
> org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.Component.renderComponent(MarkupStream)
>
> org.apache.wicket.MarkupContainer.onRender(MarkupStream)
>
> org.apache.wicket.Component.render(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderNext(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.Component.renderComponent(MarkupStream)
>
> org.apache.wicket.MarkupContainer.onRender(MarkupStream)
>
> org.apache.wicket.Component.render(MarkupStream)
>
> org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(Component)
>
> org.apache.wicket.markup.repeater.AbstractRepeater.onRender(MarkupStream)
>
> org.apache.wicket.Component.render(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderNext(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.MarkupContainer.renderAssociatedMarkup(String, String)
>
> org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.Component.renderComponent(MarkupStream)
>
> org.apache.wicket.MarkupContainer.onRender(MarkupStream)
>
> org.apache.wicket.Component.render(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderNext(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.Component.renderComponent(MarkupStream)
>
> org.apache.wicket.MarkupContainer.onRender(MarkupStream)
>
> org.apache.wicket.Component.render(MarkupStream)
>
> org.apache.wicket.MarkupContainer.autoAdd(Component, MarkupStream)
>
> org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupContainer,
>> MarkupStream, ComponentTag)
>
> org.apache.wicket.markup.resolver.ComponentResolvers.resolve(Application,
>> MarkupContainer, MarkupStream, ComponentTag)
>
> org.apache.wicket.MarkupContainer.renderNext(MarkupStream)
>
> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupStream,
>> ComponentTag)
>
> org.apache.wicket.Component.renderComponent(MarkupStream)
>
> org.apache.wicket.MarkupContainer.onRender(MarkupStream)
>
> org.apache.wicket.Component.render(MarkupStream)
>
> org.apache.wicket.MarkupContainer.autoAdd(Component, MarkupStream)
>
> org.apache.wicket.markup.resolver.MarkupInheritanceResolv

Re: OnChangeAjaxBehavior: nth character

2010-02-12 Thread Riyad Kalla
Vineet is exactly right, just to further flesh it out:

You want to add a subclass of AbstractDefaultAjaxBehavior to your page, this
automatically contributes the wicket-ajax.js file to your page which exposes
these JavaScript methods for you:

===
function wicketAjaxGet(url, successHandler, failureHandler, precondition,
channel)
and
function wicketAjaxPost(url, body, successHandler, failureHandler,
precondition, channel)
===

(paraphrased from Wiki)

The part I'm not clear on is which URL do you call with the JavaScript and
which method on the server side is intercepting the GET (or POST)?

That information seems to be missing from the wiki unless it's easier than I
realize and I'm overthinking this...

On Fri, Feb 12, 2010 at 2:15 PM, vineet semwal
wrote:

> you can do the same thing with wicket ie. on 5th char typed,make a
> ajaxcallback to wicket,
>
> 1)you need to add behavior to component and implement it's respond method
> the way it suits your need.
> 2)in the js part you  will make a callback on 5th char typed,callbackurl
> you
> will get from the behavior you
> added to the component.
> take a look at
>
> http://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript
>
> On Sat, Feb 13, 2010 at 2:15 AM, Steven Haines  wrote:
>
> > Hi,
> >
> > I
> > would like to add AJAX behavior to an application that sends an update
> > to my application after a certain number of characters have been typed.
> > For example, if the user is entering a zipcode, I would like a callback
> > to my application to be made after the user enters the fifth character.
> >
> > I've
> > written code using OnChangeAjaxBehavior that sends messages back to my
> > application after every character has been typed, such as the following:
> >
> >final TextField zipcodeField = new TextField(
> "zipcode"
> > );
> >form.add( zipcodeField.setRequired( true ) );
> >OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
> >  @Override
> >  protected void onUpdate( AjaxRequestTarget target ) {
> >System.out.println( "Zipcode value: " +
> > zipcodeField.getDefaultModelObjectAsString() );
> >  }
> >};
> >zipcodeField.add( zipcodeUpdated );
> >
> >
> > I
> > could check to see the size of the zipcodeField (in this example), but
> > it makes my application more chatty than it needs to be. I also tried
> > using onblur, which works fine, but does not satisfy my business
> > requirements:
> >
> >  final TextField zipcodeField = new TextField( "zipcode"
> );
> >  form.add( zipcodeField.setRequired( true ) );
> >
> >  AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
> > AjaxFormComponentUpdatingBehavior( "onblur" ) {
> >  @Override
> >  protected void onUpdate( AjaxRequestTarget target ) {
> >  System.out.println( "Zipcode value (form component): " +
> > getFormComponent().getModelObject() );
> >  }
> >  };
> >  zipcodeField.add( zipcodeOnBlur );
> >
> >
> >
> > Prior
> > to using Wicket (which I'm currently prototyping for my company), we
> > would handle this logic in JavaScript (observe changes to the field and
> > when the user enters the fifth character then we made an AJAX call back
> > our Struts 2 application.)
> >
> > What is the best way to achieve the same end using Wicket?
> >
> > Thanks, in advance, for your help!
> > Steve
> >
> > P.S.
> > I started using Wicket as part of an article series (because of all of
> > your passion for it) and I have to say all of you are doing incredible
> > work - I love it.. Here's the link to the article series in case any of
> > you are interested:
> > http://www.informit.com/guides/content.aspx?g=java&seqNum=529
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>
>
> --
> regards,
> Vineet Semwal
>


Re: OnChangeAjaxBehavior: nth character

2010-02-12 Thread vineet semwal
Riyad,
1)url is callbackurl you will get from
abstractdefaultajaxbehavior.getcallbackurl()
2)method you need to implement is the abstractdefaultajaxbehavior's respond
method

On Sat, Feb 13, 2010 at 3:58 AM, Riyad Kalla  wrote:

> Vineet is exactly right, just to further flesh it out:
>
> You want to add a subclass of AbstractDefaultAjaxBehavior to your page,
> this
> automatically contributes the wicket-ajax.js file to your page which
> exposes
> these JavaScript methods for you:
>
> ===
> function wicketAjaxGet(url, successHandler, failureHandler, precondition,
> channel)
> and
> function wicketAjaxPost(url, body, successHandler, failureHandler,
> precondition, channel)
> ===
>
> (paraphrased from Wiki)
>
> The part I'm not clear on is which URL do you call with the JavaScript and
> which method on the server side is intercepting the GET (or POST)?
>
> That information seems to be missing from the wiki unless it's easier than
> I
> realize and I'm overthinking this...
>
> On Fri, Feb 12, 2010 at 2:15 PM, vineet semwal
> wrote:
>
> > you can do the same thing with wicket ie. on 5th char typed,make a
> > ajaxcallback to wicket,
> >
> > 1)you need to add behavior to component and implement it's respond method
> > the way it suits your need.
> > 2)in the js part you  will make a callback on 5th char typed,callbackurl
> > you
> > will get from the behavior you
> > added to the component.
> > take a look at
> >
> >
> http://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript
> >
> > On Sat, Feb 13, 2010 at 2:15 AM, Steven Haines  wrote:
> >
> > > Hi,
> > >
> > > I
> > > would like to add AJAX behavior to an application that sends an update
> > > to my application after a certain number of characters have been typed.
> > > For example, if the user is entering a zipcode, I would like a callback
> > > to my application to be made after the user enters the fifth character.
> > >
> > > I've
> > > written code using OnChangeAjaxBehavior that sends messages back to my
> > > application after every character has been typed, such as the
> following:
> > >
> > >final TextField zipcodeField = new TextField(
> > "zipcode"
> > > );
> > >form.add( zipcodeField.setRequired( true ) );
> > >OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
> > >  @Override
> > >  protected void onUpdate( AjaxRequestTarget target ) {
> > >System.out.println( "Zipcode value: " +
> > > zipcodeField.getDefaultModelObjectAsString() );
> > >  }
> > >};
> > >zipcodeField.add( zipcodeUpdated );
> > >
> > >
> > > I
> > > could check to see the size of the zipcodeField (in this example), but
> > > it makes my application more chatty than it needs to be. I also tried
> > > using onblur, which works fine, but does not satisfy my business
> > > requirements:
> > >
> > >  final TextField zipcodeField = new TextField(
> "zipcode"
> > );
> > >  form.add( zipcodeField.setRequired( true ) );
> > >
> > >  AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
> > > AjaxFormComponentUpdatingBehavior( "onblur" ) {
> > >  @Override
> > >  protected void onUpdate( AjaxRequestTarget target ) {
> > >  System.out.println( "Zipcode value (form component): " +
> > > getFormComponent().getModelObject() );
> > >  }
> > >  };
> > >  zipcodeField.add( zipcodeOnBlur );
> > >
> > >
> > >
> > > Prior
> > > to using Wicket (which I'm currently prototyping for my company), we
> > > would handle this logic in JavaScript (observe changes to the field and
> > > when the user enters the fifth character then we made an AJAX call back
> > > our Struts 2 application.)
> > >
> > > What is the best way to achieve the same end using Wicket?
> > >
> > > Thanks, in advance, for your help!
> > > Steve
> > >
> > > P.S.
> > > I started using Wicket as part of an article series (because of all of
> > > your passion for it) and I have to say all of you are doing incredible
> > > work - I love it.. Here's the link to the article series in case any of
> > > you are interested:
> > > http://www.informit.com/guides/content.aspx?g=java&seqNum=529
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> >
> >
> > --
> > regards,
> > Vineet Semwal
> >
>



-- 
regards,
Vineet Semwal


Re: OnChangeAjaxBehavior: nth character

2010-02-12 Thread Riyad Kalla
Ah! Thanks Vineet.

On Fri, Feb 12, 2010 at 3:42 PM, vineet semwal
wrote:

> Riyad,
> 1)url is callbackurl you will get from
> abstractdefaultajaxbehavior.getcallbackurl()
> 2)method you need to implement is the abstractdefaultajaxbehavior's respond
> method
>
> On Sat, Feb 13, 2010 at 3:58 AM, Riyad Kalla  wrote:
>
> > Vineet is exactly right, just to further flesh it out:
> >
> > You want to add a subclass of AbstractDefaultAjaxBehavior to your page,
> > this
> > automatically contributes the wicket-ajax.js file to your page which
> > exposes
> > these JavaScript methods for you:
> >
> > ===
> > function wicketAjaxGet(url, successHandler, failureHandler, precondition,
> > channel)
> > and
> > function wicketAjaxPost(url, body, successHandler, failureHandler,
> > precondition, channel)
> > ===
> >
> > (paraphrased from Wiki)
> >
> > The part I'm not clear on is which URL do you call with the JavaScript
> and
> > which method on the server side is intercepting the GET (or POST)?
> >
> > That information seems to be missing from the wiki unless it's easier
> than
> > I
> > realize and I'm overthinking this...
> >
> > On Fri, Feb 12, 2010 at 2:15 PM, vineet semwal
> > wrote:
> >
> > > you can do the same thing with wicket ie. on 5th char typed,make a
> > > ajaxcallback to wicket,
> > >
> > > 1)you need to add behavior to component and implement it's respond
> method
> > > the way it suits your need.
> > > 2)in the js part you  will make a callback on 5th char
> typed,callbackurl
> > > you
> > > will get from the behavior you
> > > added to the component.
> > > take a look at
> > >
> > >
> >
> http://cwiki.apache.org/confluence/display/WICKET/Calling+Wicket+from+Javascript
> > >
> > > On Sat, Feb 13, 2010 at 2:15 AM, Steven Haines 
> wrote:
> > >
> > > > Hi,
> > > >
> > > > I
> > > > would like to add AJAX behavior to an application that sends an
> update
> > > > to my application after a certain number of characters have been
> typed.
> > > > For example, if the user is entering a zipcode, I would like a
> callback
> > > > to my application to be made after the user enters the fifth
> character.
> > > >
> > > > I've
> > > > written code using OnChangeAjaxBehavior that sends messages back to
> my
> > > > application after every character has been typed, such as the
> > following:
> > > >
> > > >final TextField zipcodeField = new TextField(
> > > "zipcode"
> > > > );
> > > >form.add( zipcodeField.setRequired( true ) );
> > > >OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
> > > >  @Override
> > > >  protected void onUpdate( AjaxRequestTarget target ) {
> > > >System.out.println( "Zipcode value: " +
> > > > zipcodeField.getDefaultModelObjectAsString() );
> > > >  }
> > > >};
> > > >zipcodeField.add( zipcodeUpdated );
> > > >
> > > >
> > > > I
> > > > could check to see the size of the zipcodeField (in this example),
> but
> > > > it makes my application more chatty than it needs to be. I also tried
> > > > using onblur, which works fine, but does not satisfy my business
> > > > requirements:
> > > >
> > > >  final TextField zipcodeField = new TextField(
> > "zipcode"
> > > );
> > > >  form.add( zipcodeField.setRequired( true ) );
> > > >
> > > >  AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
> > > > AjaxFormComponentUpdatingBehavior( "onblur" ) {
> > > >  @Override
> > > >  protected void onUpdate( AjaxRequestTarget target ) {
> > > >  System.out.println( "Zipcode value (form component): " +
> > > > getFormComponent().getModelObject() );
> > > >  }
> > > >  };
> > > >  zipcodeField.add( zipcodeOnBlur );
> > > >
> > > >
> > > >
> > > > Prior
> > > > to using Wicket (which I'm currently prototyping for my company), we
> > > > would handle this logic in JavaScript (observe changes to the field
> and
> > > > when the user enters the fifth character then we made an AJAX call
> back
> > > > our Struts 2 application.)
> > > >
> > > > What is the best way to achieve the same end using Wicket?
> > > >
> > > > Thanks, in advance, for your help!
> > > > Steve
> > > >
> > > > P.S.
> > > > I started using Wicket as part of an article series (because of all
> of
> > > > your passion for it) and I have to say all of you are doing
> incredible
> > > > work - I love it.. Here's the link to the article series in case any
> of
> > > > you are interested:
> > > > http://www.informit.com/guides/content.aspx?g=java&seqNum=529
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > > For additional commands, e-mail: users-h...@wicket.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > regards,
> > > Vineet Semwal
> > >
> >
>
>
>
> --
> regards,
> Vineet Semwal
>


Re: problem dynamic image - explorer

2010-02-12 Thread Igor Vaynberg
make sure you correctly set the content type

-igor

On Fri, Feb 12, 2010 at 10:12 AM, _Eynob _  wrote:
>
> Hi
>
> Im creating a dynamic image with the DynamicImageResource, and my problem 
> with this is in explorer, since my generated image is a png and 
> there(explorer) when i choose 'save as..' it try to save it as a 'bmp'.
>
> In firefox it works well and when i try to save it, i get the image as 'png'.
>
> Someone know what should i set for explorer to know the type of the image ?
>
>
> When it renders the image tag has this format:
>
>  src="?wicket:interface=modal-dialog-pagemap:10:svgImage::IResourceListener::" 
> class="svgImage" id="id15a">
>
> So i guess the problem is in the 'src' attribute
>
>
> Any help will be appreciated..
>
> thanks.
>
>
> _
> Hotmail: Powerful Free email with security by Microsoft.
> https://signup.live.com/signup.aspx?id=60969

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



Re: OnChangeAjaxBehavior: nth character

2010-02-12 Thread Igor Vaynberg
you can use an iajaxcalldecorator to add javascript before the call is
made and interrupt it by simply "return true" until fifth character
has been pressed.

-igor

On Fri, Feb 12, 2010 at 12:45 PM, Steven Haines  wrote:
> Hi,
>
> I
> would like to add AJAX behavior to an application that sends an update
> to my application after a certain number of characters have been typed.
> For example, if the user is entering a zipcode, I would like a callback
> to my application to be made after the user enters the fifth character.
>
> I've
> written code using OnChangeAjaxBehavior that sends messages back to my
> application after every character has been typed, such as the following:
>
>    final TextField zipcodeField = new TextField( "zipcode" );
>    form.add( zipcodeField.setRequired( true ) );
>    OnChangeAjaxBehavior zipcodeUpdated = new OnChangeAjaxBehavior() {
>     �...@override
>      protected void onUpdate( AjaxRequestTarget target ) {
>        System.out.println( "Zipcode value: " + 
> zipcodeField.getDefaultModelObjectAsString() );
>      }
>    };
>    zipcodeField.add( zipcodeUpdated );
>
>
> I
> could check to see the size of the zipcodeField (in this example), but
> it makes my application more chatty than it needs to be. I also tried
> using onblur, which works fine, but does not satisfy my business
> requirements:
>
>  final TextField zipcodeField = new TextField( "zipcode" );
>  form.add( zipcodeField.setRequired( true ) );
>
>  AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new 
> AjaxFormComponentUpdatingBehavior( "onblur" ) {
>     �...@override
>      protected void onUpdate( AjaxRequestTarget target ) {
>          System.out.println( "Zipcode value (form component): " + 
> getFormComponent().getModelObject() );
>      }
>  };
>  zipcodeField.add( zipcodeOnBlur );
>
>
>
> Prior
> to using Wicket (which I'm currently prototyping for my company), we
> would handle this logic in JavaScript (observe changes to the field and
> when the user enters the fifth character then we made an AJAX call back
> our Struts 2 application.)
>
> What is the best way to achieve the same end using Wicket?
>
> Thanks, in advance, for your help!
> Steve
>
> P.S.
> I started using Wicket as part of an article series (because of all of
> your passion for it) and I have to say all of you are doing incredible
> work - I love it.. Here's the link to the article series in case any of
> you are interested:
> http://www.informit.com/guides/content.aspx?g=java&seqNum=529
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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