Re: Custom implementation of IStringResourceLoader not working

2011-01-31 Thread armandoxxx

will try .. 10x ! 

Regards

Armando
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-implementation-of-IStringResourceLoader-not-working-tp3244747p3248311.html
Sent from the Users forum 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: Submit form after onchange of Field

2011-01-31 Thread MattyDE

No one has any idea? Cant believe it 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submit-form-after-onchange-of-Field-tp3236003p3248332.html
Sent from the Users forum 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: Use Byte for CheckBox instead of Boolean

2011-01-31 Thread MattyDE

@ rolandpeng: Thanks alot. It works great!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-Byte-for-CheckBox-instead-of-Boolean-tp3236065p3248333.html
Sent from the Users forum 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



[SOLVED] Custom implementation of IStringResourceLoader not working

2011-01-31 Thread armandoxxx

it works .. 

thank you ! 

Regards

Armando

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-implementation-of-IStringResourceLoader-not-working-tp3244747p3248335.html
Sent from the Users forum 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



[SOLVED] Nesting Links

2011-01-31 Thread armandoxxx

Here we go ... 



//... from code ... 
AjaxFallbackLink link1  = new AjaxFallbackLinkT(article-link-1, new
ModelT((T)this.getDefaultModelObject())) {

private static final long serialVersionUID = 
8011531891135888415L;

@Override
public void onClick(final AjaxRequestTarget theTarget) {
LOG.info(LINK 1 clicked);
}

};

SimpleAttributeModifier sam = new 
SimpleAttributeModifier(onclick,
stopEvent(window.event);) {

public void onComponentTag(final Component 
theComponent, final
ComponentTag theTag) {
String onClick  = stopEvent(window.event); +
theTag.getAttribute(onclick);
theTag.put(onclick, onClick);
}
};
link1.add(sam);




//javascript function
function stopEvent(e) {
if (!e) e = window.event;
if (e.stopPropagation) {
e.stopPropagation();
} else {
e.cancelBubble = true;
}
}

(tried it on IE7 - IE8 and firefox (linux) and chrome (for linux)

regards

Armando
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Nesting-Links-tp1885368p3248475.html
Sent from the Users forum 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



correct way to get css classes of component

2011-01-31 Thread Patrick Petermair

Hi!

I was trying to solve the problem of replacing a specific css class of a 
wicket component with another css class. Google pointed me to the 
following thread:


http://apache-wicket.1842946.n4.nabble.com/How-to-add-and-remove-css-classes-the-right-way-td1868408.html

The nice and simple solution was something like this:

String oldCss = String.valueOf(this.getMarkupAttributes().get(class));
String newCss = oldCss.replaceFirst(old, new);
new SimpleAttributeModifier(class, newCss);

I've used it and it works just fine.
Unfortunately - as I've just found out - the method 
getMarkupAttributes() has the following javadoc:


THIS IS WICKET INTERNAL ONLY. DO NOT USE IT.

If I'm not supposed to use getMarkupAttributes(), what would be the 
correct way then to get the current css classes of a wicket component?


Cheers,
Patrick

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



Re: correct way to get css classes of component

2011-01-31 Thread Pedro Santos
You can override the
Component#onComponentTag or AbstractBehavior#onComponentTag  method and use
the ComponentTag API to deal with the tag attributes.

On Mon, Jan 31, 2011 at 9:07 AM, Patrick Petermair 
patrick.peterm...@openforce.com wrote:

 Hi!

 I was trying to solve the problem of replacing a specific css class of a
 wicket component with another css class. Google pointed me to the following
 thread:


 http://apache-wicket.1842946.n4.nabble.com/How-to-add-and-remove-css-classes-the-right-way-td1868408.html

 The nice and simple solution was something like this:

 String oldCss = String.valueOf(this.getMarkupAttributes().get(class));
 String newCss = oldCss.replaceFirst(old, new);
 new SimpleAttributeModifier(class, newCss);

 I've used it and it works just fine.
 Unfortunately - as I've just found out - the method getMarkupAttributes()
 has the following javadoc:

 THIS IS WICKET INTERNAL ONLY. DO NOT USE IT.

 If I'm not supposed to use getMarkupAttributes(), what would be the correct
 way then to get the current css classes of a wicket component?

 Cheers,
 Patrick

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Submit form after onchange of Field

2011-01-31 Thread Pedro Santos
You can iterate over your form components and add an AjaxFormSubmitBehavior
for the event onchange

On Mon, Jan 31, 2011 at 7:11 AM, MattyDE ufer.mar...@gmail.com wrote:


 No one has any idea? Cant believe it
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Submit-form-after-onchange-of-Field-tp3236003p3248332.html
 Sent from the Users forum 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




-- 
Pedro Henrique Oliveira dos Santos


Cheap chaining of compound property model to propertymodel

2011-01-31 Thread Brown, Berlin [GCG-PFS]
In this code, do you think I am using the method
CompoundPropertyModel.bind properly?  See my example in Code2, below.
In my snippet Code1, the values for the propertymodel were lost when I
did an ajax onClick.
 
But in Code2, the values are retained...
 
 
Code1:
 
 
Panel {
   Panel() {  
  CompoundPropertyModel compoundPropertyModel = new
CompoundPropertyModel(someObject);
  Form f = new Form(compoundPropertyModel);
   
  f.add(new TextField(name));   This works fine, data able to
setObject and getObject on ajax and other cases
 
  f.add(new TextField(name, new PropertyModel(someObject); --- ON
AJAX, VALUES LOST
 
  f.add(new AjaxLink() {
  onClick() { 
 target.add(form);
 }
  }

   }
}
 
...
...
 
Code2:
As a fix, I did the following:
 

final PropertyModel pm = new
PropertyModel(compoundPropertyModel, number) {
@Override
public Object getObject() {
return ((CompoundPropertyModel)
form.getDefaultModel()).bind(number).getObject();
}

public void setObject(final Object obj) {
((CompoundPropertyModel)
billingForm.getDefaultModel()).bind(number).setObject(obj);
}
};

  f.add(new TextField(name));   This works fine, data able to
setObject and getObject on ajax and other cases
 
  f.add(new TextField(name, pm)--- ON AJAX, NOW VALUES ARE
AVAILABLE, FIXED!

 
 
Berlin Brown
 


Re: Cheap chaining of compound property model to propertymodel

2011-01-31 Thread Pedro Santos
Two possible problems:

- duplicated instances, then you set some property at instance 1 expecting
to see it changed at instance 2
- missing Component#modelChanged, since you need to signal the form
component that you have set some property into its model

the best would be you send a quickstart showing the problem

On Mon, Jan 31, 2011 at 1:01 PM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 In this code, do you think I am using the method
 CompoundPropertyModel.bind properly?  See my example in Code2, below.
 In my snippet Code1, the values for the propertymodel were lost when I
 did an ajax onClick.

 But in Code2, the values are retained...


 Code1:


 Panel {
   Panel() {
  CompoundPropertyModel compoundPropertyModel = new
 CompoundPropertyModel(someObject);
  Form f = new Form(compoundPropertyModel);

  f.add(new TextField(name));   This works fine, data able to
 setObject and getObject on ajax and other cases

  f.add(new TextField(name, new PropertyModel(someObject); --- ON
 AJAX, VALUES LOST

  f.add(new AjaxLink() {
  onClick() {
 target.add(form);
 }
  }

   }
 }

 ...
 ...

 Code2:
 As a fix, I did the following:


final PropertyModel pm = new
 PropertyModel(compoundPropertyModel, number) {
@Override
public Object getObject() {
return ((CompoundPropertyModel)
 form.getDefaultModel()).bind(number).getObject();
}

public void setObject(final Object obj) {
((CompoundPropertyModel)
 billingForm.getDefaultModel()).bind(number).setObject(obj);
}
};

  f.add(new TextField(name));   This works fine, data able to
 setObject and getObject on ajax and other cases

  f.add(new TextField(name, pm)--- ON AJAX, NOW VALUES ARE
 AVAILABLE, FIXED!



 Berlin Brown




-- 
Pedro Henrique Oliveira dos Santos


Re: setResponsePage weirdness

2011-01-31 Thread msj121

You might want to use a Wizard for the record. Just curious does first page
add anything to the page, perhaps a new url and redirect is not necessary if
no Wicket Components were added, try adding some Wicket Label about a
redirect or something (just trying to narrow this down).

Just curious, the way you have it, in theory a user really could enter the
second or third page without the previous page(s), with the url, no? I
suggest look into making a wizard component
http://www.wicket-library.com/wicket-examples/wizard/ .

Matthew


syg6 wrote:
 
 I have a few mounts set up:
 
 mount(new QueryStringUrlCodingStrategy(/first, FirstPage.class));
 mount(new QueryStringUrlCodingStrategy(/second, SecondPage.class));
 mount(new QueryStringUrlCodingStrategy(/third, ThirdPage.class));
 
 And in HomePage I have a link to FirstPage:
 
 add(new BookmarkablePageLinkFirstPage(firstPageLink,
 FirstPage.class, parameters));
 
 All FirstPage does is verify some parameters sent to it and do a
 setResponse() to SecondPage.
 
 Why is it that when I click on the link in HomePage, to FirstPage, when
 setResponsePage(SecondPage.class) in FirstPage's constructor is called the
 url remains:
 
 http://localhost:8080/myapp/first
 
 when I am actually now on SecondPage? But when I call
 setResponsePage(ThirdPage.class) from SecondPageForm's onSubmit()
 (SecondPage contains SecondPageForm), the url is:
 
 http://localhost:8080/myapp/third
 
 I've tried sticking setRedirect(true) in a few places but that seems to
 mess up my custom session; my custom session is constantly reset, previous
 info stored in the session is wiped out.
 
 I've also tried using setResponsePage(new SecondPage()) but it doesn't
 seem to change the url and SecondPage.html breaks, it's telling me none of
 my form components are present!
 
 Both SecondPage and ThirdPage *can* (and should!) be tied to the session,
 the user must never be able to enter directly into either one, but rather
 first enter FirstPage.
 
 Can someone tell me what I am doing wrong?
 
 Thanks,
 Bob
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3249002.html
Sent from the Users forum 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



Static member wicket version... post 1.4.13

2011-01-31 Thread Brown, Berlin [GCG-PFS]
Is there a way to print the wicket version number from wicket class
files or property files?
 
E.g. Version.buildNum or something similar?
 
 
 
Berlin Brown


Re: Static member wicket version... post 1.4.13

2011-01-31 Thread James Carman
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/settings/IFrameworkSettings.html#getVersion%28%29

On Mon, Jan 31, 2011 at 11:16 AM, Brown, Berlin [GCG-PFS]
berlin.br...@primerica.com wrote:
 Is there a way to print the wicket version number from wicket class
 files or property files?

 E.g. Version.buildNum or something similar?



 Berlin Brown


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



Re: Static member wicket version... post 1.4.13

2011-01-31 Thread MZemeck
The Wicket version and deployment mode are also output during startup...



From:   James Carman ja...@carmanconsulting.com
To: users@wicket.apache.org
Date:   01/31/2011 11:33 AM
Subject:Re: Static member wicket version... post 1.4.13
Sent by:jcar...@carmanconsulting.com



http://wicket.apache.org/apidocs/1.4/org/apache/wicket/settings/IFrameworkSettings.html#getVersion%28%29


On Mon, Jan 31, 2011 at 11:16 AM, Brown, Berlin [GCG-PFS]
berlin.br...@primerica.com wrote:
 Is there a way to print the wicket version number from wicket class
 files or property files?

 E.g. Version.buildNum or something similar?



 Berlin Brown


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






Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

Re: setResponsePage weirdness

2011-01-31 Thread msj121

Okay,
  So don't use a link on the html page for FirstPage. Try redirecting when
there is an html page with some filler, try adding a wicket label if plain
html doesn't work. Although it's not the best solution it will narrow down
the problem!

   The Wizard is useful in the sense, you can go back and forth for the user
and it is all in one page etc There is nothing amazing about the
wizard, just that it seems your trying to do the same thing, and it would
handle making each step and not allowing one to skip to the second page
because they bookmarked the url

  No worries about the ranting, I do it all the time.

Matthew


syg6 wrote:
 
 Hi and thanks for the response.
 
 No, FirstPage doesn't add anything to the page. It checks a param passed
 to it and redirects to one page or the other. Just for a test, I made a
 FirstPage.html with a link to SecondPage and had FirstPage.java just bring
 me to FirstPage.html, instead of doing a redirect.  When I click on it the
 url changes correctly, unlike when I do a setResponsePage(SecondPage) from
 HomePage. But I don't need to 'stop' on FirstPage ... in fact I don't even
 have a FirstPage.html because I always redirect somewhere else.
 
 As for using a Wizard ... I thought about it and looked into it but it
 doesn't seem do too much. I only have 3 pages in my wizard and and
 controlling access to the 2nd and 3rd pages with a custom session object.
 ie, when you click on the link in the HomePage, if everything is correct
 (right parameters), I stick something in the session and redirect to
 page2. I do the same with page2. So access to the pages is controlled by
 my custom session object. Would it be that much easier with a wizard? I
 guess it would control the order of the pages but I would still need to
 stick my own logic in there because it's not just about the order of the
 pages, it also needs to validate other stuff.
 
 Anyway ...sorry to rant. Thanks for your help. Any other ideas much
 appreciated.
 
 Bob
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3249263.html
Sent from the Users forum 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: correct way to get css classes of component

2011-01-31 Thread msj121

You can also use an AttributeModifier, which will give you the old value (as
I recall).

overriding the method onComponentTag(ComponentTag tag), will let you easily
put a new variable for your class etc... but you will need to use tag.get(),
and tag.put(tag.get()+...). Looks somewhat messy when you start using
StringBuffers, unless your doing a lot of tag modifications might as well
use AttributeModifier.

In fact use, SimpleAttributeModifier:

component.add(new SimpleAttributeModifier(class, my-css-class));


More methods can be seen here:
https://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/correct-way-to-get-css-classes-of-component-tp3248490p3249278.html
Sent from the Users forum 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



Newbie Question

2011-01-31 Thread Fernando O.
Hi All, how are you?

   I'm new in this list, actually I'm new to wicket and I'm trying to learn
it. So far I hadn't found any issues and it worked great until I came across
this anoying problem, I have as part of my html:
I wanted to add to a page a button with a text, on click the button hits the
sever, performs some action and it should remove the button from the page
(make it not visible)

I added:
a class=button wicket:id=ajaxbuttonlabel
wicket:id=button-text/label/a

and then In the java Page I have

(this code is inside a populateItem method from a ListView)
.
.
.
protected void populateItem(final ListItemPoll
item) {
  final AjaxLinkTest button = new
AjaxLinkTest(ajaxbutton, item.getModel()) {

public void onClick(AjaxRequestTarget target) {
//Do whatever I have
to do
System.out.println(works?);
this.setEnabled(false); //Also tried removing the label component,
setVisible(false)
}

};
 Label label = new Label(button-text, AText);
label.setOutputMarkupId(true);
button.add(label);
button.setOutputMarkupId(true);//these are desparates attemps to solve it
item.setOutputMarkupId(true);
button.setEnabled(!item.getModelObject().shouldBeDisabled()); //this works,
those that should be disabled do not show a button.
item.add(button);
  }
.
.


Any idea of what I'm doing wrong?

Thanks!


Re: Newbie Question

2011-01-31 Thread Igor Vaynberg
onclick (target) { setvisible(false); target.add(this); }

-igor

On Mon, Jan 31, 2011 at 4:46 PM, Fernando O. fot...@gmail.com wrote:
 Hi All, how are you?

   I'm new in this list, actually I'm new to wicket and I'm trying to learn
 it. So far I hadn't found any issues and it worked great until I came across
 this anoying problem, I have as part of my html:
 I wanted to add to a page a button with a text, on click the button hits the
 sever, performs some action and it should remove the button from the page
 (make it not visible)

 I added:
 a class=button wicket:id=ajaxbuttonlabel
 wicket:id=button-text/label/a

 and then In the java Page I have

 (this code is inside a populateItem method from a ListView)
 .
 .
 .
                            protected void populateItem(final ListItemPoll
 item) {
                                      final AjaxLinkTest button = new
 AjaxLinkTest(ajaxbutton, item.getModel()) {

 public void onClick(AjaxRequestTarget target) {
                                                        //Do whatever I have
 to do
 System.out.println(works?);
 this.setEnabled(false); //Also tried removing the label component,
 setVisible(false)
 }

 };
  Label label = new Label(button-text, AText);
 label.setOutputMarkupId(true);
 button.add(label);
 button.setOutputMarkupId(true);//these are desparates attemps to solve it
 item.setOutputMarkupId(true);
 button.setEnabled(!item.getModelObject().shouldBeDisabled()); //this works,
 those that should be disabled do not show a button.
 item.add(button);
                          }
 .
 .


 Any idea of what I'm doing wrong?

 Thanks!


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



Re: Newbie Question

2011-01-31 Thread Fernando O.
Thanks!!! worked!

On Mon, Jan 31, 2011 at 9:50 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 onclick (target) { setvisible(false); target.add(this); }

 -igor

 On Mon, Jan 31, 2011 at 4:46 PM, Fernando O. fot...@gmail.com wrote:
  Hi All, how are you?
 
I'm new in this list, actually I'm new to wicket and I'm trying to
 learn
  it. So far I hadn't found any issues and it worked great until I came
 across
  this anoying problem, I have as part of my html:
  I wanted to add to a page a button with a text, on click the button hits
 the
  sever, performs some action and it should remove the button from the page
  (make it not visible)
 
  I added:
  a class=button wicket:id=ajaxbuttonlabel
  wicket:id=button-text/label/a
 
  and then In the java Page I have
 
  (this code is inside a populateItem method from a ListView)
  .
  .
  .
 protected void populateItem(final
 ListItemPoll
  item) {
   final AjaxLinkTest button = new
  AjaxLinkTest(ajaxbutton, item.getModel()) {
 
  public void onClick(AjaxRequestTarget target) {
 //Do whatever I
 have
  to do
  System.out.println(works?);
  this.setEnabled(false); //Also tried removing the label component,
  setVisible(false)
  }
 
  };
   Label label = new Label(button-text, AText);
  label.setOutputMarkupId(true);
  button.add(label);
  button.setOutputMarkupId(true);//these are desparates attemps to solve it
  item.setOutputMarkupId(true);
  button.setEnabled(!item.getModelObject().shouldBeDisabled()); //this
 works,
  those that should be disabled do not show a button.
  item.add(button);
   }
  .
  .
 
 
  Any idea of what I'm doing wrong?
 
  Thanks!
 

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




Mapping wicket:id to component without changing Java code

2011-01-31 Thread Alec Swan
Hello,

I would like to add credit card processing form to many different pages in
my application. However, I don't know which pages it will be added to and it
is up to the web designer to decide.

I would like to allow the web designer to be able to put div
wicket:id=creditCardForm/ anywhere in HTML. This would typically cause
Wicket to throw an error saying that a matching component was not added.

Is there a way to configure Wicket to somehow add an instance of
CreditCardForm class whenever it sees div wicket:id=creditCardForm/?

Thanks,

Alec


JWicket drag/drop handle

2011-01-31 Thread flavius


I'm trying to create a widget/gadget (similar to google's home page or
yahoo).
I've got it largely figured out except for one thing.  I'm trying to
restrict the
drag operation to just the top div (the header).  So my widget will look
like this:

div class=widget
  div class=wheaderDrag here/div
  div class=wbodystuff goes here.../div
/div

This functionality is described in JQuery here:
http://jqueryui.com/demos/draggable/#handle

It seems like DraggableBehavior should have a setHandle method so I can
define
the draggable region.

Any thoughts?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JWicket-drag-drop-handle-tp3250469p3250469.html
Sent from the Users forum 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