Re: AjaxSubmitLink not calling the onsubmit event handler

2010-01-04 Thread Pieter Degraeuwe
If you want to do some additional stuff, you can do it in the form a a
Behaviour.. I did use such behaviour to ask a javascript confirm. If user
does not confirm, the form is not submitted.

new AttributeModifier(onclick, true, new ModelString(if (!confirm(' +
msg + ')) { /* do some additional stuff if not confirmed*/return;} else {
/*do some stuff beform submitting the form*/})) {
@Override
protected String newValue(String currentValue, String
replacementValue) {
return replacementValue + currentValue;
}
};

On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran ananthakuma...@gmail.comwrote:

 is there any way to do this on the client side.I want to do some client
 side
 stuff before submitting the form.

 On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
 wicket.program...@gmail.com
  wrote:

 
  form.add ( new AjaxSubmitLink(){
 
  protected void onSubmit(AjaxRequestTarget target, Form form){
// Add  feedback and do ajax stuff.
  }
 
  protected void onError(AjaxRequestTarget target, Form form){
// Add FeedbackPanel here
target.add( feedback );
  }});
  --
  View this message in context:
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




-- 
Pieter Degraeuwe
Systemworks bvba
Belgiëlaan 61
9070 Destelbergen
GSM: +32 (0)485/68.60.85
Email: pieter.degrae...@systemworks.be
visit us at http://www.systemworks.be


Re: Wicket + Scala + Spring

2010-01-04 Thread Paul Szulc
if you guy run any blog it would be nice contrib to community to write about
your experience in scala  + wicket. I would definitely love to read about
it.

On Mon, Jan 4, 2010 at 1:43 AM, Gary Thomas gar...@gmail.com wrote:

 P.S. though one slight difficulty I've run into is the need to translate
 between Scala and Java collections.
 Perfectly doable, and not a Wicket problem, but takes a way some of the
 elegance of coding purely in Scala.

 Happy to hear if anyone has tips on elegant ways of dealing with this.



 On 1/3/10 4:38 PM, Gary Thomas wrote:

 Same here - not much more to say other than after 10 years of working with
 Java webapps,
 learning both Wicket and Scala have made the past 6 months very enjoyable.

 Immediately before trying Wicket, I was a die-hard Struts/Spring MVC user
 and didn't know what I was missing.  Scala+Wicket is a nice mix.

 Best,
 g


 On 1/3/10 11:24 AM, Giovanni wrote:

 I'm developing two new applications (a webapp + a standalone) using Scala
 + Spring + Wicket 1.4.5 (webapp) + H2 database.

 The development is nice and interesting.

 Wicket is working with Scala very well.

 If someone else has a similar experience, please share it.

 Best regards
 giovanni






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




-- 
Best regards,
Paul Szulc

http://paulszulc.wordpress.com


Re: Wicket + Scala + Spring

2010-01-04 Thread Giovanni
Here is some very small info from my blog:

http://giovanni.wordpress.com/2009/12/27/how-to-convert-a-java-list-to-a-scala-list/

I will write more in the future.







From: Paul Szulc paul.sz...@gmail.com
To: users@wicket.apache.org
Sent: Mon, January 4, 2010 9:20:25 AM
Subject: Re: Wicket + Scala + Spring

if you guy run any blog it would be nice contrib to community to write about
your experience in scala  + wicket. I would definitely love to read about
it.

On Mon, Jan 4, 2010 at 1:43 AM, Gary Thomas gar...@gmail.com wrote:

 P.S. though one slight difficulty I've run into is the need to translate
 between Scala and Java collections.
 Perfectly doable, and not a Wicket problem, but takes a way some of the
 elegance of coding purely in Scala.

 Happy to hear if anyone has tips on elegant ways of dealing with this.



 On 1/3/10 4:38 PM, Gary Thomas wrote:

 Same here - not much more to say other than after 10 years of working with
 Java webapps,
 learning both Wicket and Scala have made the past 6 months very enjoyable.

 Immediately before trying Wicket, I was a die-hard Struts/Spring MVC user
 and didn't know what I was missing.  Scala+Wicket is a nice mix.

 Best,
 g


 On 1/3/10 11:24 AM, Giovanni wrote:

 I'm developing two new applications (a webapp + a standalone) using Scala
 + Spring + Wicket 1.4.5 (webapp) + H2 database.

 The development is nice and interesting.

 Wicket is working with Scala very well.

 If someone else has a similar experience, please share it.

 Best regards
 giovanni






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




-- 
Best regards,
Paul Szulc

http://paulszulc.wordpress.com



  

SV: Hello World Portlet

2010-01-04 Thread Wilhelmsen Tor Iver
For Servlet 2.4/2.5 I have found (depending on container) that you need to add 
the dispatchers involved, like so:

   filter-mapping
   filter-namewicket.report/filter-name
   url-pattern/report/*/url-pattern
dispatcherREQUEST/dispatcher
dispatcherINCLUDE/dispatcher
dispatcherFORWARD/dispatcher
dispatcherERROR/dispatcher
   /filter-mapping

- Tor Iver

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



Re: Integrating Hibernate Validator with Wicket

2010-01-04 Thread ayman elwany
thanks Martin for the link , I used it but I had a problem;


public class CarPage extends WebPage {

*   ..*
*   ..*
UserModel user=  ((LoginSession)getSession()).getUserBean();
  *  ..*
*..*
*   ..*
private void fillPersonalInfoComponents(Form personalForm) {
 *   ..*
  *   ..   *
PropertyModel fullnamepropertyModel =new
PropertyModelString(user, fullNameValue);
fullName = new TextField(fullName, fullnamepropertyModel);
  personalForm.add(fullName);
//System.out.println(Model =
+fullnamepropertyModel.getChainedModel().getClass().getName());
fullName.add(new HibernateValidatorString(fullnamepropertyModel,
fullNameValue));

  }
}



And the user model is

public class UserModel implements Serializable {

/**
 *
 */
private static final long serialVersionUID = 1011452297289823651L;
*   ..*
*   ..*
*   ..*

@NotNull
@NotEmpty
private String fullNameValue;
*   ..*
*   ..*
*   ..*
}


but it always fails and gives me that my model is null .  but the strange
behaviour that when I changed  HibernateValidator constructor

*from*

public HibernateValidator(I*Model entityModel*, String property) {
this.property = property;
if (entityModel != null)
hibernateValidator = new ClassValidator(*entityModel.getObject().getClass()*
);
}


*TO*
public HibernateValidator(*Object bean, *String property) {
this.property = property;
//if (entityModel != null)
hibernateValidator = new ClassValidator(*bean.getClass()*);
}

and did this

fullName.add(new HibernateValidatorString(user, fullNameValue));

the validation worked *fine *!!!

so is there is any problem in the propertymodel with hibernate validator???

On Mon, Jan 4, 2010 at 8:37 AM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 http://42lines.net/content/integrating-hibernate-validator-and-wicket

 2010/1/4 ayman elwany aymanelw...@gmail.com:
  Hi,
 
  Is there any common practice to integrate wicket with hibernate validator
 ?
 

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




Wicket tester login pages

2010-01-04 Thread Pierre Goupil
Hello all,

Is there a way to access directly a page in Wicket tester? I mean:
by-passing the login page in order not to execute the whole workflow leading
to a certain page.

We use, of course, @AuthorizedInstantiation-based login. We've found
examples where people provide directly the credentials to the login form and
then browse to the desired page, but I was wondering whether something more
direct existed.

Regards,

Pierre


-- 
Ad augusta per angusta

Des résultats grandioses par des voies étroites


Re: Wicket tester login pages

2010-01-04 Thread Martin Makundi
Hi!

Depends on your login but ofcourse wicket is a whitebox so you can
inject any credentials you want. But visit the login page first to
create session.

**
Martin

2010/1/4 Pierre Goupil goupilpie...@gmail.com:
 Hello all,

 Is there a way to access directly a page in Wicket tester? I mean:
 by-passing the login page in order not to execute the whole workflow leading
 to a certain page.

 We use, of course, @AuthorizedInstantiation-based login. We've found
 examples where people provide directly the credentials to the login form and
 then browse to the desired page, but I was wondering whether something more
 direct existed.

 Regards,

 Pierre


 --
 Ad augusta per angusta

 Des résultats grandioses par des voies étroites


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



Re: Wicket tester login pages

2010-01-04 Thread Pierre Goupil
We use @AuthorizedInstantiation. But what we're looking for is not a way to
inject the credentials but rather a way to access directly a protected page
in unit tests.

We know how to provide credentials and browse to the page but find it
dangerous: what if the credentials change, what if the Website layout
changes... ?

Regards,

Pierre



On Mon, Jan 4, 2010 at 12:36 PM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

 Hi!

 Depends on your login but ofcourse wicket is a whitebox so you can
 inject any credentials you want. But visit the login page first to
 create session.

 **
 Martin

 2010/1/4 Pierre Goupil goupilpie...@gmail.com:
  Hello all,
 
  Is there a way to access directly a page in Wicket tester? I mean:
  by-passing the login page in order not to execute the whole workflow
 leading
  to a certain page.
 
  We use, of course, @AuthorizedInstantiation-based login. We've found
  examples where people provide directly the credentials to the login form
 and
  then browse to the desired page, but I was wondering whether something
 more
  direct existed.
 
  Regards,
 
  Pierre
 
 
  --
  Ad augusta per angusta
 
  Des résultats grandioses par des voies étroites
 

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




-- 
Ad augusta per angusta

Des résultats grandioses par des voies étroites


Re: Wicket tester login pages

2010-01-04 Thread Martijn Dashorst
You probably store the credentials (or isAuthenticated() == true) in
the session. Just set the credentials *on* your session during
testing.

Martijn

On Mon, Jan 4, 2010 at 12:32 PM, Pierre Goupil goupilpie...@gmail.com wrote:
 Hello all,

 Is there a way to access directly a page in Wicket tester? I mean:
 by-passing the login page in order not to execute the whole workflow leading
 to a certain page.

 We use, of course, @AuthorizedInstantiation-based login. We've found
 examples where people provide directly the credentials to the login form and
 then browse to the desired page, but I was wondering whether something more
 direct existed.

 Regards,

 Pierre


 --
 Ad augusta per angusta

 Des résultats grandioses par des voies étroites




-- 
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: AjaxSubmitLink not calling the onsubmit event handler

2010-01-04 Thread Anantha Kumaran
hi pieter

my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
which calls the onsubmit before submitting
the form.currently i am using the mousedown(can't use onclick) of the
AjaxSubmitLink to do the validation stuffs but it breaks when the user
submit the form by pressing the return.




On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe 
pieter.degrae...@systemworks.be wrote:

 If you want to do some additional stuff, you can do it in the form a a
 Behaviour.. I did use such behaviour to ask a javascript confirm. If user
 does not confirm, the form is not submitted.

 new AttributeModifier(onclick, true, new ModelString(if (!confirm(' +
 msg + ')) { /* do some additional stuff if not confirmed*/return;} else {
 /*do some stuff beform submitting the form*/})) {
@Override
protected String newValue(String currentValue, String
 replacementValue) {
return replacementValue + currentValue;
}
};

 On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran ananthakuma...@gmail.com
 wrote:

  is there any way to do this on the client side.I want to do some client
  side
  stuff before submitting the form.
 
  On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson 
  wicket.program...@gmail.com
   wrote:
 
  
   form.add ( new AjaxSubmitLink(){
  
   protected void onSubmit(AjaxRequestTarget target, Form form){
 // Add  feedback and do ajax stuff.
   }
  
   protected void onError(AjaxRequestTarget target, Form form){
 // Add FeedbackPanel here
 target.add( feedback );
   }});
   --
   View this message in context:
  
 
 http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  
 



 --
 Pieter Degraeuwe
 Systemworks bvba
 Belgiëlaan 61
 9070 Destelbergen
 GSM: +32 (0)485/68.60.85
 Email: pieter.degrae...@systemworks.be
 visit us at http://www.systemworks.be



Re: WicketTester -- No Form onSubmit when using Ajax DropDownChoice Component

2010-01-04 Thread shetc

Hi Martin,

Thanks for the quick reply. The onSubmit method of my form does actually
work with the 3 linked
DropDownChoice components, when used as part of my application. I am trying
to simulate this
functionality as part of an integration test, and that's when the onSubmit
method is not triggered.
So I assume it's some misunderstanding on my part as far as WicketTester is
concerned, not
about using AjaxFormComponentUpdatingBehavior for components within a form.

Steve
-- 
View this message in context: 
http://old.nabble.com/WicketTesterNo-Form-onSubmit-when-using-Ajax-DropDownChoice-Component-tp27006022p27012451.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: WicketTester -- No Form onSubmit when using Ajax DropDownChoice Component

2010-01-04 Thread Martin Makundi
Ah.. then the answer is: formtester can be used only for single
submit. For a new one, make a new one. It would be nice if it threw an
exception (maybe create jira issue for that?).

http://old.nabble.com/test-for-dropdownchoice-with-ajax---response-is-homepage-always-td26584582.html

**
Martin

2010/1/4 shetc sh...@bellsouth.net:

 Hi Martin,

 Thanks for the quick reply. The onSubmit method of my form does actually
 work with the 3 linked
 DropDownChoice components, when used as part of my application. I am trying
 to simulate this
 functionality as part of an integration test, and that's when the onSubmit
 method is not triggered.
 So I assume it's some misunderstanding on my part as far as WicketTester is
 concerned, not
 about using AjaxFormComponentUpdatingBehavior for components within a form.

 Steve
 --
 View this message in context: 
 http://old.nabble.com/WicketTesterNo-Form-onSubmit-when-using-Ajax-DropDownChoice-Component-tp27006022p27012451.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: images in AjaxDefaultdatable

2010-01-04 Thread Ernesto Reinaldo Barreiro
I haven't tried it but this might work

public class BooleanImageColumn extends PropertyColumnBoolean {

private static final long serialVersionUID = 1L;


private static final ResourceReference TRUE_IMG = new
ResourceReference(BooleanImageColumn.class, true.gif);
private static final ResourceReference FALSE_IMG = new
ResourceReference(BooleanImageColumn.class, false.gif);

public BooleanImageColumn(IModelString displayModel, String
propertyExpression) {
super(displayModel, propertyExpression);
}

public BooleanImageColumn(IModelString displayModel, String
sortProperty, String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);
}


@Override
public void populateItem(ItemICellPopulatorBoolean item, String
componentId, IModelBoolean rowModel) {
if(rowModel.getObject() == null ||
rowModel.getObject().equals(Boolean.FALSE))
item.add(new NonCachingImage(componentId, FALSE_IMG));
else
item.add(new NonCachingImage(componentId, TRUE_IMG));
}
}

Just place a true.gif and a false.gif on the same package as
BooleanImageColumn.

Ernesto

On Mon, Jan 4, 2010 at 1:31 PM, chinedu efoagui chinedub...@gmail.comwrote:

 hello
 I have a an object which contains a boolean field (true ,false) it renders
 well.
 I want to do is instead on of it showing true or false on the cell. I
 want it to show an image if it is true and another image if the
 attribute is false?
 Please how can i achieve this?
 Thank you

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




Re: images in AjaxDefaultdatable

2010-01-04 Thread chinedu efoagui
thank i will try it and give u feed back

On Mon, Jan 4, 2010 at 2:02 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 I haven't tried it but this might work

 public class BooleanImageColumn extends PropertyColumnBoolean {

    private static final long serialVersionUID = 1L;


    private static final ResourceReference TRUE_IMG = new
 ResourceReference(BooleanImageColumn.class, true.gif);
    private static final ResourceReference FALSE_IMG = new
 ResourceReference(BooleanImageColumn.class, false.gif);

    public BooleanImageColumn(IModelString displayModel, String
 propertyExpression) {
        super(displayModel, propertyExpression);
    }

    public BooleanImageColumn(IModelString displayModel, String
 sortProperty, String propertyExpression) {
        super(displayModel, sortProperty, propertyExpression);
    }


   �...@override
    public void populateItem(ItemICellPopulatorBoolean item, String
 componentId, IModelBoolean rowModel) {
        if(rowModel.getObject() == null ||
 rowModel.getObject().equals(Boolean.FALSE))
            item.add(new NonCachingImage(componentId, FALSE_IMG));
        else
            item.add(new NonCachingImage(componentId, TRUE_IMG));
    }
 }

 Just place a true.gif and a false.gif on the same package as
 BooleanImageColumn.

 Ernesto

 On Mon, Jan 4, 2010 at 1:31 PM, chinedu efoagui chinedub...@gmail.comwrote:

 hello
 I have a an object which contains a boolean field (true ,false) it renders
 well.
 I want to do is instead on of it showing true or false on the cell. I
 want it to show an image if it is true and another image if the
 attribute is false?
 Please how can i achieve this?
 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



Re: images in AjaxDefaultdatable

2010-01-04 Thread chinedu efoagui
I applied you class with a few modifications it gave me this error.
I think it is expecting an img tag somewhere

[code]
WicketMessage: Component cell must be applied to a tag of type 'img',
not 'span wicket:id=cell' (line 0, column 0)
[markup = 
file:/C:/Users/bond/.netbeans/6.8/apache-tomcat-6.0.20_base/work/Catalina/localhost/hr/loader/org/apache/wicket/extensions/markup/html/repeater/data/table/DataTable.html
!--

wicket:panel
thead wicket:id=topToolbars
wicket:container wicket:id=toolbar/wicket:container
/thead
thead wicket:id=bottomToolbars
wicket:container wicket:id=toolbar/wicket:container
/thead
tbody
tr wicket:id=rows
td wicket:id=cells
span wicket:id=cell[cell]/span
/td
/tr
/tbody
/wicket:panel

, index = 21, current = 'span wicket:id=cell' (line 27, column 4)]
 at 
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:465)
 at org.apache.wicket.Component.checkComponentTag(Component.java:3475)
 at org.apache.wicket.markup.html.image.Image.onComponentTag(Image.java:228)
 at 
org.apache.wicket.markup.html.image.NonCachingImage.onComponentTag(NonCachingImage.java:124)
 at org.apache.wicket.Component.renderComponent(Component.java:2597)
 at 
org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:62)
 at org.apache.wicket.Component.render(Component.java:2457)
 at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
 at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
 at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
 at org.a
[code]

On Mon, Jan 4, 2010 at 2:04 PM, chinedu efoagui chinedub...@gmail.com wrote:
 thank i will try it and give u feed back

 On Mon, Jan 4, 2010 at 2:02 PM, Ernesto Reinaldo Barreiro
 reier...@gmail.com wrote:
 I haven't tried it but this might work

 public class BooleanImageColumn extends PropertyColumnBoolean {

    private static final long serialVersionUID = 1L;


    private static final ResourceReference TRUE_IMG = new
 ResourceReference(BooleanImageColumn.class, true.gif);
    private static final ResourceReference FALSE_IMG = new
 ResourceReference(BooleanImageColumn.class, false.gif);

    public BooleanImageColumn(IModelString displayModel, String
 propertyExpression) {
        super(displayModel, propertyExpression);
    }

    public BooleanImageColumn(IModelString displayModel, String
 sortProperty, String propertyExpression) {
        super(displayModel, sortProperty, propertyExpression);
    }


   �...@override
    public void populateItem(ItemICellPopulatorBoolean item, String
 componentId, IModelBoolean rowModel) {
        if(rowModel.getObject() == null ||
 rowModel.getObject().equals(Boolean.FALSE))
            item.add(new NonCachingImage(componentId, FALSE_IMG));
        else
            item.add(new NonCachingImage(componentId, TRUE_IMG));
    }
 }

 Just place a true.gif and a false.gif on the same package as
 BooleanImageColumn.

 Ernesto

 On Mon, Jan 4, 2010 at 1:31 PM, chinedu efoagui chinedub...@gmail.comwrote:

 hello
 I have a an object which contains a boolean field (true ,false) it renders
 well.
 I want to do is instead on of it showing true or false on the cell. I
 want it to show an image if it is true and another image if the
 attribute is false?
 Please how can i achieve this?
 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



Re: images in AjaxDefaultdatable

2010-01-04 Thread Ernesto Reinaldo Barreiro
You are right Just create a panel and place the image there

Try this

import org.apache.wicket.ResourceReference;
import
org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;

public class BooleanImageColumn extends PropertyColumnBoolean {

private static final long serialVersionUID = 1L;


private static final ResourceReference TRUE_IMG = new
ResourceReference(BooleanImageColumn.class, true.gif);
private static final ResourceReference FALSE_IMG = new
ResourceReference(BooleanImageColumn.class, false.gif);

public BooleanImageColumn(IModelString displayModel, String
propertyExpression) {
super(displayModel, propertyExpression);
}

public BooleanImageColumn(IModelString displayModel, String
sortProperty, String propertyExpression) {
super(displayModel, sortProperty, propertyExpression);
}


@Override
public void populateItem(ItemICellPopulatorBoolean item, String
componentId, IModelBoolean rowModel) {
if(rowModel.getObject() == null ||
rowModel.getObject().equals(Boolean.FALSE))
item.add(new ImagePanel(componentId, FALSE_IMG));
else
item.add(new ImagePanel(componentId, TRUE_IMG));
}
}

where

import org.apache.wicket.ResourceReference;
import org.apache.wicket.markup.html.image.NonCachingImage;
import org.apache.wicket.markup.html.panel.Panel;

public class ImagePanel extends Panel {

private static final long serialVersionUID = 1L;

/**
 * @param id
 */
public ImagePanel(String id, ResourceReference image) {
super(id);
add(new NonCachingImage(image, image));
}

}

and ImagePanel.html

html
body
wicket:panel
img wicket:id=image/
/wicket:panel
/body
/html

Ernesto

On Mon, Jan 4, 2010 at 2:49 PM, chinedu efoagui chinedub...@gmail.comwrote:

 I applied you class with a few modifications it gave me this error.
 I think it is expecting an img tag somewhere

 [code]
 WicketMessage: Component cell must be applied to a tag of type 'img',
 not 'span wicket:id=cell' (line 0, column 0)
 [markup =
 file:/C:/Users/bond/.netbeans/6.8/apache-tomcat-6.0.20_base/work/Catalina/localhost/hr/loader/org/apache/wicket/extensions/markup/html/repeater/data/table/DataTable.html
 !--

 wicket:panel
 thead wicket:id=topToolbars
wicket:container wicket:id=toolbar/wicket:container
 /thead
 thead wicket:id=bottomToolbars
wicket:container wicket:id=toolbar/wicket:container
 /thead
 tbody
tr wicket:id=rows
td wicket:id=cells
span wicket:id=cell[cell]/span
/td
/tr
 /tbody
 /wicket:panel

 , index = 21, current = 'span wicket:id=cell' (line 27, column 4)]
 at
 org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:465)
 at org.apache.wicket.Component.checkComponentTag(Component.java:3475)
 at
 org.apache.wicket.markup.html.image.Image.onComponentTag(Image.java:228)
 at
 org.apache.wicket.markup.html.image.NonCachingImage.onComponentTag(NonCachingImage.java:124)
 at org.apache.wicket.Component.renderComponent(Component.java:2597)
 at
 org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:62)
 at org.apache.wicket.Component.render(Component.java:2457)
 at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
 at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
 at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
 at org.a
 [code]

 On Mon, Jan 4, 2010 at 2:04 PM, chinedu efoagui chinedub...@gmail.com
 wrote:
  thank i will try it and give u feed back
 
  On Mon, Jan 4, 2010 at 2:02 PM, Ernesto Reinaldo Barreiro
  reier...@gmail.com wrote:
  I haven't tried it but this might work
 
  public class BooleanImageColumn extends PropertyColumnBoolean {
 
 private static final long serialVersionUID = 1L;
 
 
 private static final ResourceReference TRUE_IMG = new
  ResourceReference(BooleanImageColumn.class, true.gif);
 private static final ResourceReference FALSE_IMG = new
  ResourceReference(BooleanImageColumn.class, false.gif);
 
 public BooleanImageColumn(IModelString displayModel, String
  propertyExpression) {
 super(displayModel, propertyExpression);
 }
 
 public BooleanImageColumn(IModelString displayModel, String
  sortProperty, String propertyExpression) {
 super(displayModel, sortProperty, propertyExpression);
 }
 
 
 @Override
 public void populateItem(ItemICellPopulatorBoolean item, String
  componentId, IModelBoolean rowModel) {
 if(rowModel.getObject() == null ||
  rowModel.getObject().equals(Boolean.FALSE))
 item.add(new NonCachingImage(componentId, 

Re: images in AjaxDefaultdatable

2010-01-04 Thread chinedu efoagui
k thanks

On Mon, Jan 4, 2010 at 3:07 PM, Ernesto Reinaldo Barreiro
reier...@gmail.com wrote:
 You are right Just create a panel and place the image there

 Try this

 import org.apache.wicket.ResourceReference;
 import
 org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
 import
 org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.model.IModel;

 public class BooleanImageColumn extends PropertyColumnBoolean {

    private static final long serialVersionUID = 1L;


    private static final ResourceReference TRUE_IMG = new
 ResourceReference(BooleanImageColumn.class, true.gif);
    private static final ResourceReference FALSE_IMG = new
 ResourceReference(BooleanImageColumn.class, false.gif);

    public BooleanImageColumn(IModelString displayModel, String
 propertyExpression) {
        super(displayModel, propertyExpression);
    }

    public BooleanImageColumn(IModelString displayModel, String
 sortProperty, String propertyExpression) {
        super(displayModel, sortProperty, propertyExpression);
    }


   �...@override
    public void populateItem(ItemICellPopulatorBoolean item, String
 componentId, IModelBoolean rowModel) {
        if(rowModel.getObject() == null ||
 rowModel.getObject().equals(Boolean.FALSE))
            item.add(new ImagePanel(componentId, FALSE_IMG));
        else
            item.add(new ImagePanel(componentId, TRUE_IMG));
    }
 }

 where

 import org.apache.wicket.ResourceReference;
 import org.apache.wicket.markup.html.image.NonCachingImage;
 import org.apache.wicket.markup.html.panel.Panel;

 public class ImagePanel extends Panel {

    private static final long serialVersionUID = 1L;

    /**
     * @param id
     */
    public ImagePanel(String id, ResourceReference image) {
        super(id);
        add(new NonCachingImage(image, image));
    }

 }

 and ImagePanel.html

 html
    body
        wicket:panel
        img wicket:id=image/
        /wicket:panel
    /body
 /html

 Ernesto

 On Mon, Jan 4, 2010 at 2:49 PM, chinedu efoagui chinedub...@gmail.comwrote:

 I applied you class with a few modifications it gave me this error.
 I think it is expecting an img tag somewhere

 [code]
 WicketMessage: Component cell must be applied to a tag of type 'img',
 not 'span wicket:id=cell' (line 0, column 0)
 [markup =
 file:/C:/Users/bond/.netbeans/6.8/apache-tomcat-6.0.20_base/work/Catalina/localhost/hr/loader/org/apache/wicket/extensions/markup/html/repeater/data/table/DataTable.html
 !--

 wicket:panel
 thead wicket:id=topToolbars
        wicket:container wicket:id=toolbar/wicket:container
 /thead
 thead wicket:id=bottomToolbars
        wicket:container wicket:id=toolbar/wicket:container
 /thead
 tbody
        tr wicket:id=rows
                td wicket:id=cells
                        span wicket:id=cell[cell]/span
                /td
        /tr
 /tbody
 /wicket:panel

 , index = 21, current = 'span wicket:id=cell' (line 27, column 4)]
     at
 org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:465)
     at org.apache.wicket.Component.checkComponentTag(Component.java:3475)
     at
 org.apache.wicket.markup.html.image.Image.onComponentTag(Image.java:228)
     at
 org.apache.wicket.markup.html.image.NonCachingImage.onComponentTag(NonCachingImage.java:124)
     at org.apache.wicket.Component.renderComponent(Component.java:2597)
     at
 org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:62)
     at org.apache.wicket.Component.render(Component.java:2457)
     at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
     at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
     at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
     at org.a
 [code]

 On Mon, Jan 4, 2010 at 2:04 PM, chinedu efoagui chinedub...@gmail.com
 wrote:
  thank i will try it and give u feed back
 
  On Mon, Jan 4, 2010 at 2:02 PM, Ernesto Reinaldo Barreiro
  reier...@gmail.com wrote:
  I haven't tried it but this might work
 
  public class BooleanImageColumn extends PropertyColumnBoolean {
 
     private static final long serialVersionUID = 1L;
 
 
     private static final ResourceReference TRUE_IMG = new
  ResourceReference(BooleanImageColumn.class, true.gif);
     private static final ResourceReference FALSE_IMG = new
  ResourceReference(BooleanImageColumn.class, false.gif);
 
     public BooleanImageColumn(IModelString displayModel, String
  propertyExpression) {
         super(displayModel, propertyExpression);
     }
 
     public BooleanImageColumn(IModelString displayModel, String
  sortProperty, String propertyExpression) {
         super(displayModel, sortProperty, propertyExpression);
     }
 
 
    �...@override
     public void populateItem(ItemICellPopulatorBoolean item, String
  componentId, IModelBoolean rowModel) {
         

Referring image using Resource Reference

2010-01-04 Thread sakthi vel
Hello,

I have a small issue in referring a image using Resource Reference.
The image is placed under the image directory inside the context root.
I need to refer to from Page class.


How to call the image under the image directory from the the Page class. The
page is under the package com.image.


Date Picket year navigation

2010-01-04 Thread sakthi vel
Hello,

When date picker is added, we are able to navigate only through months.
But how to navigate through years like 2010, 2011  so on. since the
option is only there to navigate through month by month.


Re: Referring image using Resource Reference

2010-01-04 Thread Ernesto Reinaldo Barreiro
Can't you use ContextImage?

On Mon, Jan 4, 2010 at 4:08 PM, sakthi vel vela@gmail.com wrote:

 Hello,

 I have a small issue in referring a image using Resource Reference.
 The image is placed under the image directory inside the context root.
 I need to refer to from Page class.


 How to call the image under the image directory from the the Page class.
 The
 page is under the package com.image.



Re: Integrating Hibernate Validator with Wicket

2010-01-04 Thread Carlos Vara
Hi,

if you prefer to use JSR 303 Bean Validation (it's very similar to Hibernate
Validator, in fact, it is the reference implementation), I made a blog post
about how to integrate it with Wicket:

http://carinae.net/2009/12/integration-of-jsr-303-bean-validation-standard-and-wicket-1-4/


On Mon, Jan 4, 2010 at 11:28 AM, ayman elwany aymanelw...@gmail.com wrote:

 thanks Martin for the link , I used it but I had a problem;


 public class CarPage extends WebPage {

 *   ..*
 *   ..*
UserModel user=  ((LoginSession)getSession()).getUserBean();
  *  ..*
 *..*
 *   ..*
 private void fillPersonalInfoComponents(Form personalForm) {
  *   ..*
  *   ..   *
PropertyModel fullnamepropertyModel =new
 PropertyModelString(user, fullNameValue);
 fullName = new TextField(fullName, fullnamepropertyModel);
  personalForm.add(fullName);
 //System.out.println(Model =
 +fullnamepropertyModel.getChainedModel().getClass().getName());
 fullName.add(new HibernateValidatorString(fullnamepropertyModel,
 fullNameValue));

  }
 }



 And the user model is

 public class UserModel implements Serializable {

 /**
  *
  */
 private static final long serialVersionUID = 1011452297289823651L;
*   ..*
 *   ..*
 *   ..*

 @NotNull
 @NotEmpty
 private String fullNameValue;
*   ..*
 *   ..*
 *   ..*
 }


 but it always fails and gives me that my model is null .  but the strange
 behaviour that when I changed  HibernateValidator constructor

 *from*

 public HibernateValidator(I*Model entityModel*, String property) {
 this.property = property;
 if (entityModel != null)
 hibernateValidator = new
 ClassValidator(*entityModel.getObject().getClass()*
 );
 }


 *TO*
 public HibernateValidator(*Object bean, *String property) {
 this.property = property;
 //if (entityModel != null)
 hibernateValidator = new ClassValidator(*bean.getClass()*);
 }

 and did this

 fullName.add(new HibernateValidatorString(user, fullNameValue));

 the validation worked *fine *!!!

 so is there is any problem in the propertymodel with hibernate validator???

 On Mon, Jan 4, 2010 at 8:37 AM, Martin Makundi 
 martin.maku...@koodaripalvelut.com wrote:

  http://42lines.net/content/integrating-hibernate-validator-and-wicket
 
  2010/1/4 ayman elwany aymanelw...@gmail.com:
   Hi,
  
   Is there any common practice to integrate wicket with hibernate
 validator
  ?
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



ListView Behavior

2010-01-04 Thread wic...@geofflancaster.com
Due to Wicket handling things in a weird order, would anyone mind giving me
a hand in solving this issue?

When I create a ListView, populateItem() is called for each item in the
list which is passed into the ListView and then it goes back and creates
the Label named chart. The problem is that I'm trying to keep a counter
on each chart item being created so I can render javascript on the
component. See below for code and output (for a test with 2 items being
passed in via the list in the ListView Constructor).

 BEGIN CODE--

addOrReplace(new ListViewStringBuilder(graphTable,xml){
@Override
protected void populateItem(ListItemStringBuilder  
item){
StringBuilder sb = (StringBuilder) 
item.getModelObject();
System.out.println(populating item number - 
+divNum);
Label chart = new Label(chart,new Model()){
@Override
protected void onComponentTag(final 
ComponentTag tag){
System.out.println(adding 
componentTag with id=+divNum);
super.onComponentTag(tag);
tag.put(id, chart_+ divNum);
}
};

item.add(chart);

Label script = new 
Label(script,parseJS(sb,chart_+divNum));

script.setRenderBodyOnly(true);
script.setEscapeModelStrings(false);

item.add(script);
divNum++;   
}
});

-- END CODE -


-- BEGIN OUTPUT -

populating item number - 0
populating item number - 1
adding componentTag with id=2
adding componentTag with id=2

--- END OUTPUT --

I need the componentTag to correspond with the numbers listed after
populating item number

for example, I need the output to show something to the affect of:

populating item number - 0
adding componentTag with id=0
populating item number - 1
adding componentTag with id=1

or 

populating item number - 0
populating item number - 1
adding componentTag with id=0
adding componentTag with id=1





mail2web.com - Microsoft® Exchange solutions from a leading provider -
http://link.mail2web.com/Business/Exchange



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



Re: ListView Behavior

2010-01-04 Thread Martin Makundi
Hi!

Why do you need to count items? You can refer to different components
using their markupid.

**
Martin

2010/1/4 wic...@geofflancaster.com wic...@geofflancaster.com:
 Due to Wicket handling things in a weird order, would anyone mind giving me
 a hand in solving this issue?

 When I create a ListView, populateItem() is called for each item in the
 list which is passed into the ListView and then it goes back and creates
 the Label named chart. The problem is that I'm trying to keep a counter
 on each chart item being created so I can render javascript on the
 component. See below for code and output (for a test with 2 items being
 passed in via the list in the ListView Constructor).

  BEGIN CODE--

 addOrReplace(new ListViewStringBuilder(graphTable,xml){
                       �...@override
                        protected void populateItem(ListItemStringBuilder  
 item){
                                StringBuilder sb = (StringBuilder) 
 item.getModelObject();
                                System.out.println(populating item number - 
 +divNum);
                                Label chart = new Label(chart,new Model()){
                                       �...@override
                                        protected void onComponentTag(final 
 ComponentTag tag){
                                                System.out.println(adding 
 componentTag with id=+divNum);
                                                super.onComponentTag(tag);
                                                tag.put(id, chart_+ 
 divNum);
                                        }
                                };

                                item.add(chart);

                                Label script = new 
 Label(script,parseJS(sb,chart_+divNum));

                                script.setRenderBodyOnly(true);
                                script.setEscapeModelStrings(false);

                                item.add(script);
                                divNum++;
                        }
                });

 -- END CODE -


 -- BEGIN OUTPUT -

 populating item number - 0
 populating item number - 1
 adding componentTag with id=2
 adding componentTag with id=2

 --- END OUTPUT --

 I need the componentTag to correspond with the numbers listed after
 populating item number

 for example, I need the output to show something to the affect of:

 populating item number - 0
 adding componentTag with id=0
 populating item number - 1
 adding componentTag with id=1

 or

 populating item number - 0
 populating item number - 1
 adding componentTag with id=0
 adding componentTag with id=1




 
 mail2web.com - Microsoft® Exchange solutions from a leading provider -
 http://link.mail2web.com/Business/Exchange



 -
 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: Asynchronous construction of page

2010-01-04 Thread Kaspar Fischer

On 02.11.2009, at 22:59, Igor Vaynberg wrote:

 if you want nonblocking you have to make each thing you are trying to
 load asynchronously its own page inside an iframe.
 
 the page itself can only be accessed synchronously, otherwise you
 would have to do your own multithreaded access handling in
 components...which would be horrific.
 
 -igor

I need to bring this topic up once more.

My current solution is to do the background processing in a separate thread and 
install a timer on the page to poll until the panel's content is ready. The 
resulting code is ok but feels heavy and unnatural. I would prefer a simpler 
solution. (I could not use iframes because they CSS does not have enough 
control over them.)

If I understand correctly, several pages can load asynchronously because only 
the state within a page is protected with synchronization. If so, can't one 
introduce a stateless component that lives in its own dummy page? I have the 
hope that if this is done nicely and the dummy page is abstracted away, it 
would feel much more natural to code asynchronous loading.

For example, such a LazyComponent would be constructed with the name of a 
wicket fragment. When rendered, it displays whatever markup has been add()'ed 
to the component (loading). When rendered, it makes an AJAX request to load 
the wicket fragment, which under the hood sits in a dummy page. I don't know 
enough about Wicket right now to code this so I want to ask whether this is 
possible and if yes, how this idea can be improved and whether somebody would 
be available with a few pointers to get me started.

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



Re: ListView Behavior

2010-01-04 Thread wic...@geofflancaster.com
Very good point. Didn't think about that. Thanks, I've solved my problem!

Original Message:
-
From: Martin Makundi martin.maku...@koodaripalvelut.com
Date: Mon, 4 Jan 2010 18:19:46 +0200
To: users@wicket.apache.org
Subject: Re: ListView Behavior


Hi!

Why do you need to count items? You can refer to different components
using their markupid.

**
Martin

2010/1/4 wic...@geofflancaster.com wic...@geofflancaster.com:
 Due to Wicket handling things in a weird order, would anyone mind giving
me
 a hand in solving this issue?

 When I create a ListView, populateItem() is called for each item in the
 list which is passed into the ListView and then it goes back and creates
 the Label named chart. The problem is that I'm trying to keep a counter
 on each chart item being created so I can render javascript on the
 component. See below for code and output (for a test with 2 items being
 passed in via the list in the ListView Constructor).

  BEGIN CODE--

 addOrReplace(new ListViewStringBuilder(graphTable,xml){
                       �...@override
                        protected void
populateItem(ListItemStringBuilder  item){
                                StringBuilder sb = (StringBuilder)
item.getModelObject();
                                System.out.println(populating item number
- +divNum);
                                Label chart = new Label(chart,new
Model()){
                                       �...@override
                                        protected void
onComponentTag(final ComponentTag tag){
                                                System.out.println(adding
componentTag with id=+divNum);
                                                super.onComponentTag(tag);
                                                tag.put(id, chart_+
divNum);
                                        }
                                };

                                item.add(chart);

                                Label script = new
Label(script,parseJS(sb,chart_+divNum));

                                script.setRenderBodyOnly(true);
                                script.setEscapeModelStrings(false);

                                item.add(script);
                                divNum++;
                        }
                });

 -- END CODE -


 -- BEGIN OUTPUT -

 populating item number - 0
 populating item number - 1
 adding componentTag with id=2
 adding componentTag with id=2

 --- END OUTPUT --

 I need the componentTag to correspond with the numbers listed after
 populating item number

 for example, I need the output to show something to the affect of:

 populating item number - 0
 adding componentTag with id=0
 populating item number - 1
 adding componentTag with id=1

 or

 populating item number - 0
 populating item number - 1
 adding componentTag with id=0
 adding componentTag with id=1




 
 mail2web.com - Microsoft® Exchange solutions from a leading provider -
 http://link.mail2web.com/Business/Exchange



 -
 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




mail2web.com - Microsoft® Exchange solutions from a leading provider -
http://link.mail2web.com/Business/Exchange



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



Re: Date Picket year navigation

2010-01-04 Thread Igor Vaynberg
see DatePicker#enableMonthYearSelection()

-igor

On Mon, Jan 4, 2010 at 7:10 AM, sakthi vel vela@gmail.com wrote:
 Hello,

 When date picker is added, we are able to navigate only through months.
 But how to navigate through years like 2010, 2011  so on. since the
 option is only there to navigate through month by month.


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



Detecting an external change to the ModelObject of a Form

2010-01-04 Thread Stijn Maller
I am currently facing an issue for which I would appreciate the input of
more experienced wicket developers. As they are sparse in the company I work
for I turn to this mailinglist.

I have in my implementation a classic master-detail page. The master part is
a RefreshingView, the detail view is a Panel with a Form on it to allow for
updates. I have 1 single Model which is shared between the Page and the
Panel. (Defined as member of the Page, passed into the Panel and the Form
via their constructors) This all works like a charm (selecting, creating,
updating, deleting, the works) even with some nice Ajax features thrown into
the mix and everything.

There is however 1 scenario that I can't get right. Things go pear shaped if
the user gets validation errors during an update and then instead of
correcting the validation errors he selects another detail in the master
view. I'd obviously then want the detail to display the values of the newly
selected ModelObject, instead I get the convertedValues from the previously
selected ModelObject.

I do know why this is happening: Model.setObject() doesn't do all the stuff
that
Form.setModelObject() does. (ie: clearing the convertedValues) What I don't
know however is how to properly solve it. Calling Form.setModelObject() is
not an option as it would mean exposing my form to the Page, which I do not
want to do. It's supposed to be internal kitchen to the panel.

What I would like to do is call Form.clearInput() whenever the ModelObject
has been changed from outside the Panel. (ie A click on a row in the
Refreshing view) But how can I detect this?

Can anybody point me in the right direction of solving this the wicket
way? So in Short:

public Page {

private Model selected = new Model();

public Page() {
RefreshingView master = new RefreshingView(master) {

protected void populateItem(Item item){
item.add(new AjaxEventBehavior(onClick){
// Problem occurs here!!! Under normal circumstances
DetailPanel is
// updated correctly with values of the new item.
// But after a validation error it is not, then the
convertedValues
// of the previous item are displayed instead
selected.setObject(item)
}
// rest of master code not relevant
// ...
}
}
Panel detail = new DetailPanel(detail, selected);
}

}

public DetailPanel() implements Panel {

public DetailPanel(String id, Model model) {
Form detailForm = new Form(detailForm, model);
// rest of detail code not relevant
// ...
}

}


Re: Detecting an external change to the ModelObject of a Form

2010-01-04 Thread Igor Vaynberg
call form.modelchanged()

-igor

On Mon, Jan 4, 2010 at 10:44 AM, Stijn Maller stijn.mal...@gmail.com wrote:
 I am currently facing an issue for which I would appreciate the input of
 more experienced wicket developers. As they are sparse in the company I work
 for I turn to this mailinglist.

 I have in my implementation a classic master-detail page. The master part is
 a RefreshingView, the detail view is a Panel with a Form on it to allow for
 updates. I have 1 single Model which is shared between the Page and the
 Panel. (Defined as member of the Page, passed into the Panel and the Form
 via their constructors) This all works like a charm (selecting, creating,
 updating, deleting, the works) even with some nice Ajax features thrown into
 the mix and everything.

 There is however 1 scenario that I can't get right. Things go pear shaped if
 the user gets validation errors during an update and then instead of
 correcting the validation errors he selects another detail in the master
 view. I'd obviously then want the detail to display the values of the newly
 selected ModelObject, instead I get the convertedValues from the previously
 selected ModelObject.

 I do know why this is happening: Model.setObject() doesn't do all the stuff
 that
 Form.setModelObject() does. (ie: clearing the convertedValues) What I don't
 know however is how to properly solve it. Calling Form.setModelObject() is
 not an option as it would mean exposing my form to the Page, which I do not
 want to do. It's supposed to be internal kitchen to the panel.

 What I would like to do is call Form.clearInput() whenever the ModelObject
 has been changed from outside the Panel. (ie A click on a row in the
 Refreshing view) But how can I detect this?

 Can anybody point me in the right direction of solving this the wicket
 way? So in Short:

 public Page {

    private Model selected = new Model();

    public Page() {
            RefreshingView master = new RefreshingView(master) {

                protected void populateItem(Item item){
                    item.add(new AjaxEventBehavior(onClick){
                        // Problem occurs here!!! Under normal circumstances
 DetailPanel is
                        // updated correctly with values of the new item.
                        // But after a validation error it is not, then the
 convertedValues
                        // of the previous item are displayed instead
                        selected.setObject(item)
                    }
                    // rest of master code not relevant
                    // ...
                }
            }
            Panel detail = new DetailPanel(detail, selected);
    }

 }

 public DetailPanel() implements Panel {

    public DetailPanel(String id, Model model) {
        Form detailForm = new Form(detailForm, model);
        // rest of detail code not relevant
        // ...
    }

 }


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



Re: Detecting an external change to the ModelObject of a Form

2010-01-04 Thread Martin Makundi
Hi!

clearinput is right.  don't know if there is a IModel that has change
listener, but sure you can make your own that detects when the master
changes. You need to repaint the components anyways
(target.addComponents), so why not clear input at the same time?

**
Martin

2010/1/4 Stijn Maller stijn.mal...@gmail.com:
 I am currently facing an issue for which I would appreciate the input of
 more experienced wicket developers. As they are sparse in the company I work
 for I turn to this mailinglist.

 I have in my implementation a classic master-detail page. The master part is
 a RefreshingView, the detail view is a Panel with a Form on it to allow for
 updates. I have 1 single Model which is shared between the Page and the
 Panel. (Defined as member of the Page, passed into the Panel and the Form
 via their constructors) This all works like a charm (selecting, creating,
 updating, deleting, the works) even with some nice Ajax features thrown into
 the mix and everything.

 There is however 1 scenario that I can't get right. Things go pear shaped if
 the user gets validation errors during an update and then instead of
 correcting the validation errors he selects another detail in the master
 view. I'd obviously then want the detail to display the values of the newly
 selected ModelObject, instead I get the convertedValues from the previously
 selected ModelObject.

 I do know why this is happening: Model.setObject() doesn't do all the stuff
 that
 Form.setModelObject() does. (ie: clearing the convertedValues) What I don't
 know however is how to properly solve it. Calling Form.setModelObject() is
 not an option as it would mean exposing my form to the Page, which I do not
 want to do. It's supposed to be internal kitchen to the panel.

 What I would like to do is call Form.clearInput() whenever the ModelObject
 has been changed from outside the Panel. (ie A click on a row in the
 Refreshing view) But how can I detect this?

 Can anybody point me in the right direction of solving this the wicket
 way? So in Short:

 public Page {

    private Model selected = new Model();

    public Page() {
            RefreshingView master = new RefreshingView(master) {

                protected void populateItem(Item item){
                    item.add(new AjaxEventBehavior(onClick){
                        // Problem occurs here!!! Under normal circumstances
 DetailPanel is
                        // updated correctly with values of the new item.
                        // But after a validation error it is not, then the
 convertedValues
                        // of the previous item are displayed instead
                        selected.setObject(item)
                    }
                    // rest of master code not relevant
                    // ...
                }
            }
            Panel detail = new DetailPanel(detail, selected);
    }

 }

 public DetailPanel() implements Panel {

    public DetailPanel(String id, Model model) {
        Form detailForm = new Form(detailForm, model);
        // rest of detail code not relevant
        // ...
    }

 }


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



Re: Question regarding DataTable and Checkbox/Radio Columns

2010-01-04 Thread Early Morning
Hi Igor,

Thanks for the information. I implemented the CheckBoxColumn with a
HeaderCheckBoxPanel, do you mean that I should do the same and create e.g. a
RadioButtonPanel and a RadioModel similar to the CheckBoxModel?

Additionally, if you don't mind, I have some questions regarding filtering
the Ajax DataTable:

1) What would be the correct way to implement the FilterToolbar /
GoAndClearFilter for the Ajax DataTable? I added the code used in the
DataTable, and although I'm able to filter the table once, the Go button
doesn't work again (and of course it refereshes the page since it doesn't
use Ajax).
2) How do you set a Renderer for the ChoiceFilteredPropertyColumn?
3) When using the PropertyColumn with a Sort property, I get an error when I
use properties such as status.description. The Display property works
using this property selection format, however the Sort Property gets an
exception saying the property isn't found. Using just status works for the
Sort property, however this is not ideal since the sorting isn't using the
proper display property to sort.

Thanks again!


Regards,

Ces

On Tue, Dec 29, 2009 at 1:16 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Mon, Dec 28, 2009 at 4:49 AM, Early Morning goodmorning...@gmail.com
 wrote:
  Hi all,
 
  I created a custom DataTable based on AjaxFallbackDefaultDataTable, as
 well
  as a ChecBoxColumn based on the CheckBoxColumn in wicket-phonebook. My
  questions:
 
  1. Would it be also possible to create a RadioColumn for the DataTable?
 From
  what I've read, I need to add the entire DataTable to the RadioGroup, so
 I'm
  not sure if it's possible to implement this as a column. How would I
  implement this as a column?

 it is possible without a RadioGroup/Radio components, simply write
 your own component that represents the input type=radio.

  2. Relatedly, is there a way for me to implement the CheckBoxColumn
 having a
  CheckGroup with a select all checkbox in the header?

 you dont need a CheckGroup for this also, it is trivial to write a
 simple javascript. every CheckBoxColumn should create a uuid when it
 is constructed, either using UUID.randomUUID or Session.nextUuid().
 then append this uuid as a class to the input type=checkbox you are
 using. once this is done you have a way to identify all related
 checkboxes in the page. then it is simply a matter of creating a
 checkbox that in onclick does some javascript like
 $(.+myuuid).checked=this.checked; and putting it into a panel that
 is used as a header of the column. phew.

 -igor


 
 
  Thanks!
 
 
  Regards,
 
  Ces
 

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




Re: Asynchronous construction of page

2010-01-04 Thread Jonathan Locke


i know i'm jumping into this in the middle and maybe someone already
proposed this or it's not a good idea for some reason that's not immediately
obvious, but i wonder if we could do some lock splitting here (in wicket
1.5?) so that the coarse grained page lock is replaced with a locking system
for component subtrees.  then multiple ajax updates of different screen
areas could happen simultaneously. i believe this could be implemented
fairly easily with a Component.getLock() method that chains up the hierarchy
looking for locks. the default page lock would be at the top and subtrees
that got locked by ajax updates would add new lock objects via Component
metadata.  of course the page lock would have to be used to add that
metadata to prevent a race condition, but it seems like it would work.  then
again, i'm not intimately familiar with our ajax implementation these days.


Kaspar Fischer-2 wrote:
 
 I am trying to find out how to load several parts (Wicket panels) of a  
 page in parallel using Ajax. The content of these parts takes long to  
 render but I still want the user to see the other, readily available  
 parts of the page, with the delayed panels appearing when available.  
 Several posts on this list indicate that AjaxLazyLoadPanel's only work  
 synchronously. Is this still the case with the latest version/snapshot  
 of Wicket? Is there maybe another approach available (one that still  
 uses Wicket for the parts)?
 
 Thanks,
 Kaspar
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Asynchronous-construction-of-page-tp26171123p27018131.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: WicketTester -- No Form onSubmit when using Ajax DropDownChoice Component

2010-01-04 Thread shetc

I am confused by something here. I am using the calls to
tester.executeAjaxEvent() in order to populate
the DropDownChoice components with items (these items are provided by a
mocked service layer).
Then I call formTester.select() in order to pick from the items provided by
the tester.executeAjaxEvent()
calls. These selected items are then used with the call to
formTester.submit().

Are you saying that tester.executeAjaxEvent()  and formTester.select()
cannot be used together?
If so then what would be the best way to supply the DropDownChoice items in
order to properly
call formTester.submit()?

Thanks!
-- 
View this message in context: 
http://old.nabble.com/WicketTesterNo-Form-onSubmit-when-using-Ajax-DropDownChoice-Component-tp27006022p27018255.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Asynchronous construction of page

2010-01-04 Thread Igor Vaynberg
this is still highly error prone. locking a component subtree is not
always enough. usually component subtrees share a model object that is
somewhere higher up, so it is the component that owns the root model
object that needs to be locked. but, once you throw in model chaining
into the mix it becomes not so easy to figure out which component
should actually own the root lock.

-igor


On Mon, Jan 4, 2010 at 11:37 AM, Jonathan Locke
jonathan.lo...@gmail.com wrote:


 i know i'm jumping into this in the middle and maybe someone already
 proposed this or it's not a good idea for some reason that's not immediately
 obvious, but i wonder if we could do some lock splitting here (in wicket
 1.5?) so that the coarse grained page lock is replaced with a locking system
 for component subtrees.  then multiple ajax updates of different screen
 areas could happen simultaneously. i believe this could be implemented
 fairly easily with a Component.getLock() method that chains up the hierarchy
 looking for locks. the default page lock would be at the top and subtrees
 that got locked by ajax updates would add new lock objects via Component
 metadata.  of course the page lock would have to be used to add that
 metadata to prevent a race condition, but it seems like it would work.  then
 again, i'm not intimately familiar with our ajax implementation these days.


 Kaspar Fischer-2 wrote:

 I am trying to find out how to load several parts (Wicket panels) of a
 page in parallel using Ajax. The content of these parts takes long to
 render but I still want the user to see the other, readily available
 parts of the page, with the delayed panels appearing when available.
 Several posts on this list indicate that AjaxLazyLoadPanel's only work
 synchronously. Is this still the case with the latest version/snapshot
 of Wicket? Is there maybe another approach available (one that still
 uses Wicket for the parts)?

 Thanks,
 Kaspar

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




 --
 View this message in context: 
 http://old.nabble.com/Asynchronous-construction-of-page-tp26171123p27018131.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



More than one access denied page

2010-01-04 Thread Fernando Wermus
I would like to have two access denied pages according to some parameters.
Is this possible?




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: More than one access denied page

2010-01-04 Thread Igor Vaynberg
what causes the page to be displayed?

-igor

On Mon, Jan 4, 2010 at 1:43 PM, Fernando Wermus
fernando.wer...@gmail.com wrote:
 I would like to have two access denied pages according to some parameters.
 Is this possible?




 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus


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



Re: Asynchronous construction of page

2010-01-04 Thread Jonathan Locke


true, but i think the component tree would be locked, not the models.
and just to play devil's advocate... such a feature could be off by default
and in development mode it could do a complete check of the tree for root
model objects being used outside the locked subtree... such that it would 
be invalid to have a fine-grained lock on a subtree with a model being 
accessed by components outside that subtree.  i'm not saying this is a great
idea, just trying to clarify this thinking-out-loud idea...


igor.vaynberg wrote:
 
 this is still highly error prone. locking a component subtree is not
 always enough. usually component subtrees share a model object that is
 somewhere higher up, so it is the component that owns the root model
 object that needs to be locked. but, once you throw in model chaining
 into the mix it becomes not so easy to figure out which component
 should actually own the root lock.
 
 -igor
 
 
 On Mon, Jan 4, 2010 at 11:37 AM, Jonathan Locke
 jonathan.lo...@gmail.com wrote:


 i know i'm jumping into this in the middle and maybe someone already
 proposed this or it's not a good idea for some reason that's not
 immediately
 obvious, but i wonder if we could do some lock splitting here (in wicket
 1.5?) so that the coarse grained page lock is replaced with a locking
 system
 for component subtrees.  then multiple ajax updates of different screen
 areas could happen simultaneously. i believe this could be implemented
 fairly easily with a Component.getLock() method that chains up the
 hierarchy
 looking for locks. the default page lock would be at the top and subtrees
 that got locked by ajax updates would add new lock objects via Component
 metadata.  of course the page lock would have to be used to add that
 metadata to prevent a race condition, but it seems like it would work.
  then
 again, i'm not intimately familiar with our ajax implementation these
 days.


 Kaspar Fischer-2 wrote:

 I am trying to find out how to load several parts (Wicket panels) of a
 page in parallel using Ajax. The content of these parts takes long to
 render but I still want the user to see the other, readily available
 parts of the page, with the delayed panels appearing when available.
 Several posts on this list indicate that AjaxLazyLoadPanel's only work
 synchronously. Is this still the case with the latest version/snapshot
 of Wicket? Is there maybe another approach available (one that still
 uses Wicket for the parts)?

 Thanks,
 Kaspar

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




 --
 View this message in context:
 http://old.nabble.com/Asynchronous-construction-of-page-tp26171123p27018131.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://old.nabble.com/Asynchronous-construction-of-page-tp26171123p27019945.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket + Scala + Spring

2010-01-04 Thread Sam Stainsby

 P.S. though one slight difficulty I've run into is the need to translate
 between Scala and Java collections. Perfectly doable, and not a Wicket
 problem, but takes a way some of the elegance of coding purely in Scala.

I can confirm that Scala 2.8 makes it considerably easier to inter-work 
with Java collections. I am also using Scala with Wicket - and loving it.


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



Unexpected RuntimeException with PagingNavigator

2010-01-04 Thread devush

Dear All,
I am trying to get a Pagingnavigator using DataView.
I get following exception(Jetty 6.1.4 DEVELOPMENT mode, Wicket 1.4.5 ):
---
Unexpected RuntimeException:
WicketMessage: The component(s) below failed to render. A common problem is
that you have added a component in code but forgot to reference it in the
markup (thus the component will never be rendered).
1. [MarkupContainer [Component id = pageLink]]
2. [Component id = pageNumber]
3. [MarkupContainer [Component id = pageLink]]
4. [Component id = pageNumber]
5. [MarkupContainer [Component id = pageLink]]
6. [Component id = pageNumber]
Root cause:org.apache.wicket.WicketRuntimeException: The component(s) below
failed to render. A common problem is that you have added a component in
code but forgot to reference it in the markup (thus the component will never
be rendered).
1. [MarkupContainer [Component id = pageLink]]
2. [Component id = pageNumber]
3. [MarkupContainer [Component id = pageLink]]
4. [Component id = pageNumber]
5. [MarkupContainer [Component id = pageLink]]
6. [Component id = pageNumber]
at org.apache.wicket.Page.checkRendering(Page.java:1162)
at org.apache.wicket.Page.renderPage(Page.java:922)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)

Current Class extends the WebPage. My code looks like:

IDataProviderContact itemDataProvider = new IDataProviderContact() {
public Iterator iterator(int first, int count) {
   Object[] objs = list.toArray();
   List outList = new ArrayList();
   for (int i = first; i  count; i++) {   // i know this is not clean
   Contact c = (Contact) objs[i];
   outList.add(c);
   }
   return outList.iterator();
}

public IModelContact model(final Contact object) {
   return new LoadableDetachableModel() {

   @Override
   protected Contact load() {
   return (Contact) object;
   }
   };
   }
   public int size() {
   return list.size();
   }
   public void detach() {}
   };
DataView dataView = new DataView(mywork, itemDataProvider, 5) {
   protected void populateItem(Item item) {
   Contact contact = (Contact) item.getModelObject();
   item.add(new Label(id, contact.getId()));
   }
};
dataView.setItemsPerPage(5);
add(dataView);
add(new PagingNavigation(nav, dataView));

It works fine if I take the PagingNavigation out of code.

My HTML Code is:
table cellspacing=0 class=dataview 
tbody
tr wicket:id=mywork
tdspan wicket:id=idTest ID/span/td
/tr
/tbody
/table
span wicket:id=navnavigation controls here/span

Apart from this, i also tried with
   new DataView(mywork, new ListDataProvider(list))

any ideas where I am wrong.
regards,
devush 



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



Re: Refresh resources in deployment mode

2010-01-04 Thread Hauke Ingmar Schmidt
Hej,
what about activating JMX and clearing the cache with it's help?
Bye
Hauke Ingmar

2009/12/10 Martijn Dashorst martijn.dasho...@gmail.com:

 Set the resource poll frequency to something other than null in your
 init() method

 On Thu, Dec 10, 2009 at 12:08 PM, Witold Czaplewski
 witold-mail...@cts-media.eu wrote:

 In deployment mode, is it possible to refresh resources like html- or
 property-files without reloading the context or server? For example if you
 have a simple typo which you want to fix.

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



Re: Unexpected RuntimeException with PagingNavigator

2010-01-04 Thread Igor Vaynberg
use PagingNavigator instead

-igor

On Mon, Jan 4, 2010 at 3:58 PM, devush devushan...@googlemail.com wrote:
 Dear All,
 I am trying to get a Pagingnavigator using DataView.
 I get following exception(Jetty 6.1.4 DEVELOPMENT mode, Wicket 1.4.5 ):
 ---
 Unexpected RuntimeException:
 WicketMessage: The component(s) below failed to render. A common problem is
 that you have added a component in code but forgot to reference it in the
 markup (thus the component will never be rendered).
 1. [MarkupContainer [Component id = pageLink]]
 2. [Component id = pageNumber]
 3. [MarkupContainer [Component id = pageLink]]
 4. [Component id = pageNumber]
 5. [MarkupContainer [Component id = pageLink]]
 6. [Component id = pageNumber]
 Root cause:org.apache.wicket.WicketRuntimeException: The component(s) below
 failed to render. A common problem is that you have added a component in
 code but forgot to reference it in the markup (thus the component will never
 be rendered).
 1. [MarkupContainer [Component id = pageLink]]
 2. [Component id = pageNumber]
 3. [MarkupContainer [Component id = pageLink]]
 4. [Component id = pageNumber]
 5. [MarkupContainer [Component id = pageLink]]
 6. [Component id = pageNumber]
 at org.apache.wicket.Page.checkRendering(Page.java:1162)
 at org.apache.wicket.Page.renderPage(Page.java:922)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)
 
 Current Class extends the WebPage. My code looks like:

 IDataProviderContact itemDataProvider = new IDataProviderContact() {
 public Iterator iterator(int first, int count) {
   Object[] objs = list.toArray();
   List outList = new ArrayList();
   for (int i = first; i  count; i++) {   // i know this is not clean
       Contact c = (Contact) objs[i];
       outList.add(c);
   }
   return outList.iterator();
 }

 public IModelContact model(final Contact object) {
   return new LoadableDetachableModel() {

   @Override
   protected Contact load() {
   return (Contact) object;
       }
   };
   }
   public int size() {
       return list.size();
   }
   public void detach() {}
   };
 DataView dataView = new DataView(mywork, itemDataProvider, 5) {
   protected void populateItem(Item item) {
       Contact contact = (Contact) item.getModelObject();
       item.add(new Label(id, contact.getId()));
   }
 };
 dataView.setItemsPerPage(5);
 add(dataView);
 add(new PagingNavigation(nav, dataView));

 It works fine if I take the PagingNavigation out of code.

 My HTML Code is:
 table cellspacing=0 class=dataview 
 tbody
 tr wicket:id=mywork
 tdspan wicket:id=idTest ID/span/td
 /tr
 /tbody
 /table
 span wicket:id=navnavigation controls here/span

 Apart from this, i also tried with
   new DataView(mywork, new ListDataProvider(list))

 any ideas where I am wrong.
 regards,
 devush

 -
 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



Slides of Wicket and Struts 2

2010-01-04 Thread Lester Chua

Hi all,

I'm attaching some slides on some thought I have gathered for a 
presentation to management for Wicket justification.

Was wondering if any of you have time to read it and comment on it =).

Lester



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

Re: Slides of Wicket and Struts 2

2010-01-04 Thread John Armstrong
Link?

Tx!
John-

On Mon, Jan 4, 2010 at 5:52 PM, Lester Chua cicowic...@gmail.com wrote:
 Hi all,

 I'm attaching some slides on some thought I have gathered for a presentation
 to management for Wicket justification.
 Was wondering if any of you have time to read it and comment on it =).

 Lester




 -
 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: WicketTester -- No Form onSubmit when using Ajax DropDownChoice Component

2010-01-04 Thread shetc

OK, I think I get it now Martin:

-- 
WicketTester tester = new WicketTester(webapp);
tester.setupRequestAndResponse();

FormTester formTester4Ajax =
tester.newFormTester(mainPanel:officeSelectorForm);
formTester4Ajax.select(brands, 0);
tester.executeAjaxEvent(mainPanel:officeSelectorForm:brands, onchange);
tester.assertComponentOnAjaxResponse(mainPanel:officeSelectorForm:categories);
 
formTester4Ajax.select(categories, 0);
tester.executeAjaxEvent(mainPanel:officeSelectorForm:categories,
onchange);
tester.assertComponentOnAjaxResponse(mainPanel:officeSelectorForm:titles); 

FormTester formTester4Submit =
tester.newFormTester(mainPanel:officeSelectorForm);
formTester4Submit.select(brands, 0);
formTester4Submit.select(categories, 0);
formTester4Submit.select(titles, 0);
formTester4Submit.submit();
-- 

Not quite sure why it works but it does. Thanks very much =)
-- 
View this message in context: 
http://old.nabble.com/WicketTesterNo-Form-onSubmit-when-using-Ajax-DropDownChoice-Component-tp27006022p27022783.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Slides of Wicket and Struts 2

2010-01-04 Thread Lester Chua

Hi John,

I thought I attached the file but here goes,

Link 
https://docs.google.com/fileview?id=0B8Wi-GkyhJ3XMDVhYzQ3YWUtNDNhMS00NzUxLTg5YzYtZmJkMTIxOTE2MGFmhl=en


Thanks!

John Armstrong wrote:

Link?

Tx!
John-

On Mon, Jan 4, 2010 at 5:52 PM, Lester Chua cicowic...@gmail.com wrote:
  

Hi all,

I'm attaching some slides on some thought I have gathered for a presentation
to management for Wicket justification.
Was wondering if any of you have time to read it and comment on it =).

Lester




-
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: Slides of Wicket and Struts 2

2010-01-04 Thread John Armstrong
Very good, thanks Lester (the attachment was stripped on my side,
probably my mailserver).

J

On Mon, Jan 4, 2010 at 6:36 PM, Lester Chua cicowic...@gmail.com wrote:
 Hi John,

 I thought I attached the file but here goes,

 Link
 https://docs.google.com/fileview?id=0B8Wi-GkyhJ3XMDVhYzQ3YWUtNDNhMS00NzUxLTg5YzYtZmJkMTIxOTE2MGFmhl=en

 Thanks!

 John Armstrong wrote:

 Link?

 Tx!
 John-

 On Mon, Jan 4, 2010 at 5:52 PM, Lester Chua cicowic...@gmail.com wrote:


 Hi all,

 I'm attaching some slides on some thought I have gathered for a
 presentation
 to management for Wicket justification.
 Was wondering if any of you have time to read it and comment on it =).

 Lester




 -
 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: error page

2010-01-04 Thread Ilja Pavkovic
Hi,

  what is the difference between
 
  @Override
  public IApplicationSettings getApplicationSettings() {
  IApplicationSettings settings= super.getApplicationSettings();
  settings.setInternalErrorPage(internalErrorPage)
  return settings;
  }
 
  settings.setInternalErrorPage(internalErrorPage) and
 
 You have no acces to the exception thrown.
 
 Perhaps this could be a RFE ?
 a) Something like: ErrorWebPage extends WebPage with ErrorWebPage(Exception
  e) as constructor?
I created a RFE, see https://issues.apache.org/jira/browse/WICKET-2659

Best Regards,
Ilja Pavkovic

-- 
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker

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



Re: Referring image using Resource Reference

2010-01-04 Thread vela

Hello again,

In the project setup, the Page class and their corresponding html files are
not placed in the same directory. The Page class are placed under the
package com.image and their corresponding html files are placed inside the
html directory under the context root.

If I place the image file inside the com.image directory or html directory,
it is getting called. But I need to call the image file inside the image
directory under the context root.

In the Page class, the context image has call been called as

form.add(new ContextImage(images, new Model(new
ResourceReference(image/calendarIcon.gif;



 
-- 
View this message in context: 
http://old.nabble.com/Referring-image-using-Resource-Reference-tp27014229p27024782.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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