Re: Show/hide form components best practice

2010-06-03 Thread Xavier López
Hi Iain,

I would do it like this, with a FormValidator. I moved the minimum length
validation also to the formValidator, because doing it with a
MinimumLenghtValidator would trigger it before the formValidator executes,
and may raise errors when the input is not valid (i.e. not mandatory) :

private class TestForm extends Form {

IModel modelAlways;
IModel modelCheckOptional;
IModel modelOptional;

 public TestForm(String id) {
   super(id);

   modelAlways =  new Model();
   modelCheckOptional = Boolean.FALSE;
   modelOptional = new Model();
   final TextField alwaysTextfield = new TextField(always, modelAlways);
   alwaysTextField.setRequired(true);
   add(alwaysTextField);
   final CheckBox useOptionalCheck = new CheckBox( useOptional,
modelCheckOptional);
   add( useOptionalCheck );
   final TextField optionalTextField = new TextField(optional,
modelOptional);
   add(optionalTextField);

   add(new IFormValidator(){
  protected FormComponent getDependentFormComponents(){ return null; }
  public boolean validate(Form f){
  if (Boolean.TRUE.equals(useOptionalCheck.getConvertedInput()){
String optionalValue =
optionalTextField.getConvertedInput();
if (Strings.isEmpty(optionalValue ){
   error (field optional is required);
}
else if (optionalValue.length  3){
   error (optional value's length must be at least 3);
}
  }.
}
});

Cheers,
Xavier

2010/6/2 Iain Reddick iain.redd...@beatsystems.com

 Here's some example code (wicket 1.3.x):

 Java:

 private class TestForm extends Form {

  private String always;
  private boolean useOptional = false;
  private String optional;

  public TestForm(String id) {
super(id);

add( new TextField(always, new PropertyModel(this,
 always)).setRequired(true) );
final CheckBox useOptionalCheck = new CheckBox( useOptional, new
 PropertyModel(this, useOptional) );
add( useOptionalCheck );
add( new TextField(optional, new PropertyModel(this, optional)) {
  @Override
  public boolean isRequired() {
return
 ((Boolean)useOptionalCheck.getConvertedInput()).booleanValue();
  }
}.add(MinimumLengthValidator.minimumLength(3)) );
  }

 }

 Markup:

 form wicket:id=testForm
  input wicket:id=always type=text /
  input wicket:id=useOptional type=checkbox /
  input wicket:id=optional type=text /
  input type=submit /
 /form

 How can I express that I want the optional text field to only be used when
 the checkbox is selected?

 - Original Message -
 From: Igor Vaynberg igor.vaynb...@gmail.com
 To: users@wicket.apache.org
 Sent: Wednesday, 2 June, 2010 4:00:57 PM
 Subject: Re: Show/hide form components best practice

 if the form contains all the state then the answer is simple: write a
 bit of javascript that does it for you.

 -igor

 On Wed, Jun 2, 2010 at 2:53 AM, Iain Reddick
 iain.redd...@beatsystems.com wrote:
  That's just a server round-trip on client-side state changem, which is
  basically (1) in my initial list.
 
  Basically, this type of form behaviour is very common and the question
  of how to implement it with Wicket has been raised by every developer
  I know
  who has worked with the framework.
 
  I know that Wicket generally works best when you round-trip
  client-side state changes to the server, but I think that in this
  situation it is silly,
  as the submitted form contains all the required state.
 
  Jeremy Thomerson wrote:
 
  return true from wantOnSelectionChangedNotifications and put your
  visibility changing code in onSelectionChanged
 
 
  
 http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications()http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications%28%29
 
 
 
 http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications()http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications%28%29
 
  On Tue, Jun 1, 2010 at 5:37 AM, Iain Reddick
  iain.redd...@beatsystems.comwrote:
 
 
 
  Say I have a form with a check box that, when checked, shows some
  other field (i.e. it controls the visibility of other form
  components).
 
  What is the best approach to handling this?
 
  From what I understand, you have 3 options:
 
  1. Add ajax behaviour to the check box (re-render relevant
  components). 2. Add javascript from the Java code (e.g. add some
  kind of show/hide
  behaviour). 3. Add javascript directly to the HTML.
 
  What are peoples experiences of the 3 methods, and which is best?
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 
 
 
 

 

Re: Override IAjaxIndicatorAware behavior

2010-06-03 Thread Aurelie Boiteux

Yes, that's exactly what I did. 

My problem is that I want that div veil shows up only if an ajax call
takes more than 2 seconds to process. If the ajax processing is short (less
than 2 seconds), I don't want this div shows up.
I don't know how to do it.

Thanks
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Override-IAjaxIndicatorAware-behavior-tp2239813p2241266.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 clustering wicket-security

2010-06-03 Thread Emond Papegaaij
On Wednesday 02 June 2010 15:54:50 david_ wrote:
 Maybe someone knows who I can contact about this?
 I wicket-security developer maybe?

Unfortunately we don't use multiple applications in the same servlet 
container. So, I can't really help you with this. Maurice probably would have 
known how to do it, but unfortunately we can't ask him anymore. I'm almost 
sure that it should be possible (wicket-security even supports multiple logins 
on the same application). Perhaps some of the old documentation at 
http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Security can help 
you, or perhaps the examples?

What I do see in WaspSession is this:
if (securityStrategy.isUserAuthenticated())
dirty();
else
invalidateNow();

I don't know what that is supposed to do, but it seems you are hitting the 
wrong branch of the if statement.

Good luck with it,
Emond

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



Regression: @Inject'ed objects cannot be passed to Threads

2010-06-03 Thread Douglas Ferguson
I've posted a similar message the other week, because I was having strange 
behavior when passing objects that have been injected into my page to child 
threads.

So, we recently upgrade from 1.4.5 - 1.4.7

Prior to the upgrade we had some runnables that would do some asynchronous work 
for us and we would just @inject the DAO into the page and pass that into 
constructor of the runnable.
This worked fine until the upgrade to 1.4.7. Now when the thread calls methods 
on the object we get the org.apache.wicket.WicketRuntimeException: There is no 
application attached to current thread pool-13-thread-16' error

D/



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



Re: Can I develop without recompiling/restarting after every change?

2010-06-03 Thread bht
Martijn,

You are making a *lot* of assumptions.

Not everybody uses Eclipse.

Nobody in this thread would consider restarts acceptable, still we are
using this subject.

HTML files location has to do with performance in the developing
process depending on how the IDE handles the files.

Please advise how to configure the NetBeans IDE to redeploy a HTML
file in a Java package in a J2EE app server with the same speed as
HTML files in the web directory (milliseconds not seconds).


Thanks

Bernard




On Sun, 30 May 2010 15:23:09 +0200, you wrote:

Huh?

Storing the HTML in the packages has *nothing* to do with requiring
restarts. Only wrongly configured IDEs may cause that.

If your HTML doesn't get reloaded when you change it, then you should
run Wicket in DEVELOPMENT mode. Also make sure you've configured
Eclipse to copy all resources (not just .properties files)

The Wicket Quickstart project and using Maven to generate your eclipse
project files (mvn eclipse:eclipse) will configure everything
correctly.

Martijn

On Sat, May 29, 2010 at 11:18 PM,  b...@actrix.gen.nz wrote:
 Hi,

 For best performance of redeploys in Wicket, consider storing HTML not
 in the Java package structure but in the web directory. So if your IDE
 and app server allow for hot deployment, then HTML changes deploy much
 faster, ie instantly. In your application init(), you add one
 statement

 getResourceSettings().addResourceFolder(wicket);

 where wicket matches the url-pattern in your filter-mapping in
 web.xml.

 PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
 background on how to take this one step further.

 Additionally, with GlassFish V3, you get session preservation on hot
 deployment of Java classes.

 You can enable deploy on save for convenience.

 If that is not fast enough, you can run your app in debug mode and hot
 swap classes after save while you are debugging it.

 All this comes with the NetBeans IDE. You really don't have to worry
 about this stuff anymore.

 Regards

 Bernard



 On Sat, 29 May 2010 16:12:46 +0100, you wrote:

have you tried JRebel?  I've not used it myself, but there was an
interview on JavaPosse recently, sounds like it'd be an ideal fit for
any Wicket developer.

Dan

On 22/07/28164 20:59, David Chang wrote:
 I am using Tomcat, any tips about how to develop out 
 recompiling/restarting after every change?

 Best.

 --- On Fri, 5/21/10, Jeremy Thomersonjer...@wickettraining.com  wrote:


 From: Jeremy Thomersonjer...@wickettraining.com
 Subject: Re: Can I develop without recompiling/restarting after every 
 change?
 To: users@wicket.apache.org
 Date: Friday, May 21, 2010, 12:17 PM
 the easiest way to do this is to use
 the Start class (Start.java) from the
 quickstart to run an embedded jetty instance in your
 IDE.  then, if you run
 it in debug mode, it will hotswap any possible changes (and
 tell you if you
 must restart if it's an incompatible change)

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Fri, May 21, 2010 at 10:53 AM, ekallevige...@ekallevig.com
 wrote:


 I'm a front-end developer trying to learn Java (total

 n00b) and working on

 a
 wicket application at work.  The whole process

 feels very slow primarily

 because I have to recompile and restart JBoss every

 time I make a change.

 So I'm wondering what the best way is to avoid having

 to do this when

 editing .java/.js/.css/.html files during development?

 I'd like to just

 make
 changes and then refresh the browser to test -- is

 this possible?

 I've seen in the FAQ that you can change the

 application settings to

 auto-reload markup .html files -- where would I insert

 this setting

 (remember I'm a total n00b).

 As to .css/.js/.java files -- do I need jRebel or

 something like that to

 get
 these files to reload automatically?

 Thanks for helping out a super-beginner :)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.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




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



formatted text fields

2010-06-03 Thread Lieven Doclo

Hi,

I'm currently looking into a problem concerning formatted text fields. 
Users need to enter a code in the format x-x-x-x. I have 
provided 4 textfields and I'd like the user to jump from one textfield 
to the other when he or she has entered 5 characters. How do I do this 
in Wicket?


Regards,

Lieven
--
Lieven Doclo
Jintec
Bredestraat 98
3293 Diest
lieven.do...@jintec.be
0476 83 51 52

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



SV: formatted text fields

2010-06-03 Thread Wilhelmsen Tor Iver

Med vennlig hilsen

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

 -Opprinnelig melding-
 Fra: Lieven Doclo [mailto:lieven.do...@jintec.be]
 Sendt: 3. juni 2010 11:27
 Til: users
 Emne: formatted text fields
 
 Hi,
 
 I'm currently looking into a problem concerning formatted text fields.
 Users need to enter a code in the format x-x-x-x. I
 have
 provided 4 textfields and I'd like the user to jump from one textfield
 to the other when he or she has entered 5 characters. How do I do this
 in Wicket?

Normally you do such things in Javascript, independent of Wicket. I.e. you have 
a key listener In each field that checks the length and then focuses on the 
next if it is five. What Wicket gives you is the bundled Yahoo Javascript 
libraries you can use to make the code less barebones.

- Tor Iver

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



Javascript string formatting problem with DateTextField and DatePicker

2010-06-03 Thread Jimi

Hi,

I tried out the DateTextField together with the Datepicker component, but it
doesn't work as expected. I want it to use the format/pattern -MM-dd,
and when the page is rendered it does show the date in that format, but the
moment I use the datepicker (even only clicking in the button do display the
datepicker calender) the date is changed to a yy-MM-dd pattern, and no
matter what I do it continues to use this pattern until I refresh the page.

I have tried both the wicket-datetime version and the wicket extensions
version of the DateTextField, with no difference in behaivor. I wanted to
try the wicket-datetime version of the DatePicker but apparently it doesn't
exist any more for wicket 1.4.

Things that I have tried:

-
//  import 
org.apache.wicket.datetime.markup.html.form.DateTextField;
//  import org.apache.wicket.extensions.yui.calendar.DatePicker;

DateTextField dateTextField =
DateTextField.forDatePattern(dateTextField, new PropertyModelDate(this,
exportDate), -MM-dd);
dateTextField.add(new DatePicker());
add(dateTextField);
-



-
//  import 
org.apache.wicket.extensions.markup.html.form.DateTextField;
//  import org.apache.wicket.extensions.yui.calendar.DatePicker;
//  
 DateTextField dateTextField = new 
DateTextField(dateTextField, new
PropertyModelDate(this, exportDate), -MM-dd);
 add(dateTextField);
 dateTextField.add(new DatePicker());
-



-
//   import 
org.apache.wicket.datetime.markup.html.form.DateTextField;
//   import org.apache.wicket.extensions.yui.calendar.DatePicker;
//  
DateTextField dateTextField = new 
DateTextField(dateTextField, new
PropertyModelDate(
this, exportDate), new StyleDateConverter(S-, true))
{
@Override
public Locale getLocale()
{
return new Locale(sv, SE);
}
};
add(dateTextField);
dateTextField.add(new DatePicker());
-

That last example is almost a copy paste of the example code from here:

http://wicketstuff.org/wicket/dates/

...with the difference that my locale is hard coded. The example on
wicketstuff works just fine when I select the same locale.

The html is simply a input field like this:

-
input type=text wicket:id=dateTextField/
-

Does anyone have any explanation to this strange behavior? What can I do to
get it to always use -MM-dd2? This is very hard for me to debug since
it is client side (ie javascript) behavior, not server side java behavior.

Regards
/Jimi
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-string-formatting-problem-with-DateTextField-and-DatePicker-tp2241433p2241433.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



DefaultDataTable column style and orderbylink

2010-06-03 Thread Sam Zilverberg
Hi,

I'm using DefaultDataTable with sortable columns.
When a column header is clicked to be sorted by the header gets a special
class : th.wiccket_orderDown/Up/None.
I'd like this whole column to have some css class so it can be highlighted.

Is there any simple way to achieve this without rolling my own
HeadersToolbar/OrderByBorder/PropertyColumn?

-Sam


Re: WebMarkupContainer as string for use in jqgrid cell

2010-06-03 Thread Sam Zilverberg
Sweet.
I looked at the changes made and now I understand what you meant by
virtual repeater.

Anyway I've decided to use a custom implementation of wicket's DataTable for
now and if
a demand for more fancy grids will be made I'l probably come back to
wijqgrid or try out inmethod grid.

Thanks
-Sam

On Wed, Jun 2, 2010 at 9:31 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi Sam,

 Yesterday I commited some changes to [1] that add the possibility to
 render Wicket cells as components. You can find an example on [2].
 There are some limitations to the kind of cells you can show (they
 cannot add JavaScript to the page) but at least you can add cells
 containing links and so on.

 Best,

 Ernesto

 References,

 1-http://code.google.com/p/wiquery-plugins/
 2-
 http://code.google.com/p/wiquery-plugins/source/browse/trunk/wiquery-plugins/example-war/src/main/java/com/wiquery/plugins/demo/NewGridPanel.java



 On Tue, May 25, 2010 at 4:04 PM, Sam Zilverberg samzilverb...@gmail.com
 wrote:
  I thought of contributing some of the changes after a while but then I
  realized they were too
  project specific and not abstract enough so no one else would be able to
 use
  em.
  Example: I created a JQGridDataProvider that the grid uses but the
 provider
  is tightly tied to hibernate
  and some other stuff i'm using in the project.
 
  I took a look at AjaxRequestTarget and its inner classes to check how
 wicket
  renders components on ajax requests.
  These components always have parent pages and the rendering process looks
  something like this:
  page.startComponentRender(comp) - comp.renderComponenet() -
  page.endComponentRender(comp)
  then the response from request cycle is set to be the ajax response so
 the
  html is directed to it.
 
  I don't see anyway I can mimic this kind of behavior and render wicket
  components without them having
  some parent page.
 
  I havn't seen jweekend's implementation in a long time because they added
  password protection to labs.jweekend.com/public.
  But what I remember is that they had wicket component as a jqgrid
 subgrid.
  If this is the case they probably just rendered a wicket page into the
  subgrid, which is a little easier...
 
  On Tue, May 25, 2010 at 2:31 PM, Ernesto Reinaldo Barreiro 
  reier...@gmail.com wrote:
 
  Hi Sam,
 
   I'm using a flavor of wijqgrid. I took wijqgrid as a base code and
 made
   major modifications to almost everything.
  
 
  It is a pity some of those modifications never made it back into the
  original:-(. But I'm still glad to hear the code was useful to you: at
  least as a starting point.
 
  What I would do in order to render arbitrary Wicket components is try
  to implement some kind of virtual repeater that is not rendered with
  normal page rendering  and that is used to render grid data (I had the
  idea of looking into the logic that render components via AJAX and see
  how to do something similar for grid data). These virtual components
  will be attached to the grid so that they exist on the server side and
  could handle events and so on. These are only ideas and haven't tried
  to implement them: but I know it is possible because jWeekends
  implementation already supports that.
 
  Best,
 
  Ernesto
 
  -
  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




ModalWindow SLL connection

2010-06-03 Thread David Meulemans
Hello

if you redirect from a ModalWindow to an external URL that uses SSL
connection, the browser doesn't recognizes this and the security lock-icon
is not shown.
Is their a workaround for this?

David


Re: Javascript string formatting problem with DateTextField and DatePicker

2010-06-03 Thread Jimi

Ok, I managed to find the problem using the javascript debug function of
Firebug, but I have no idea on how to solve it.

The problematic code lies in the file wicket-date.js:

125  /**
126  * Return the result of interpolating the value (date) argument with the
date pattern.
127  * The dateValue has to be an array, where year is in the first, month
in the second
128  * and date (day of month) in the third slot.
129  */
130  Wicket.DateTime.substituteDate = function(datePattern, date) {
131  day = date[2];
132  month = date[1];
133  year = date[0];
134  // optionally do some padding to match the pattern
135  if(datePattern.match(/dd+/)) day =
Wicket.DateTime.padDateFragment(day);
136  if(datePattern.match(/MM+/)) month =
Wicket.DateTime.padDateFragment(month);
137  if(datePattern.match(/yy+/)) year =
Wicket.DateTime.padDateFragment(year % 100);
138  // replace pattern with real values
139  return datePattern.replace(/d+/, day).replace(/M+/,
month).replace(/y+/, year);
140  } 

On the line 137 it truncates the year from 2010 to 10, and simply ignores
the fact that I want a 4 digit year.

When I did the same debugging on the example on wicketstuff.org I found that
this javascript function looked a little bit different:

80  Wicket.DateTime.substituteDate = function(datePattern, date) {
71  day = date[2];
72  month = date[1];
73  year = date[0];
74  if(datePattern.match(/dd+/)) day = Wicket.DateTime.padDateFragment(day);
75  if(datePattern.match(/MM+/)) month =
Wicket.DateTime.padDateFragment(month);
76  if(datePattern.match(/byy+/)) year =
Wicket.DateTime.padDateFragment(year % 100);
77  return datePattern.replace(/d+/, day).replace(/M+/, month).replace(/y+/,
year);
78  } 

Here on line 76 it sees if the datePattern matches byy+, I have no idea
what that 'b' i supposed to mean, but the result is that it doesn't truncate
the year from 4 to 2 digits.

I also noted that these two *different* wicket-date.js files contain the
exact same versioning information:

YAHOO.register(wicket-date, Wicket.DateTime, {version: 1.3.0, build:
rc1});

So, does anyone know what I can do to get the correct wicket-date.js? Or
should I report this as a bug somewhere? The way I see it, the javascript
should check if the datepattern matches  and then leave the year as it
is.

/Jimi
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-string-formatting-problem-with-DateTextField-and-DatePicker-tp2241433p2241559.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



SV: Dialog involving multiple pages and a VO: some best practices?

2010-06-03 Thread Wilhelmsen Tor Iver
 I've recently been wondering about the following use case: an instance
 of Foo class, used as a detached value object, is edited in a
 FooEditPage. For some reasons, let's say this page then needs to launch
 dialogs spanning over different pages. Each of these pages could then
 change some fields of the VO being passed around.

Sharing between pages is easier done by placing it in the Session which is 
accessible from all of them.

- Tor Iver

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



LinkTree and panel

2010-06-03 Thread Pratibha

Hi Team 

I have got a LinkTree, I am overriding newContentComponent of LinkTree with
Panel, what i need is When user 

clicks on Link a TextBox underneath Link should get Visible using Ajax. 

Please find below code for the above. 



treeModel = createTreeModel(); 



tree = new LinkTree(tree, treeModel) { 

@Override 
protected Component newNodeComponent(String
id, IModel model) { 

return new LinkIconPanel(id, model,
this) { 

@Override 
protected void
onNodeLinkClicked(TreeNode node, BaseTree tree, AjaxRequestTarget target) { 

   
System.out.println(onNodeLinkClicked); 

} 
@Override 
protected Component
newContentComponent(String componentId, BaseTree tree, IModel model) { 
Department item =
(Department) ((DefaultMutableTreeNode) model.getObject()).getUserObject(); 

//return new
Label(componentId, new Model(item.getName())); 
return new
MyPanel(componentId, new Model(item.getName())).setOutputMarkupId(true); 
} 
}; 
} 
}; 

add(tree); 

And MYPanel is- 


public class MyPanelForm extends Form   { 


private static final long serialVersionUID = 1L; 

MyPanelForm(String id) { 

super(id); 

setOutputMarkupId(true); 

txt = new TextField(txtname,new
PropertyModel(department, name)); 

txt.setOutputMarkupId(true); 


add(txt); 

txt.setVisible(false); 

add(new AjaxLink(name) { 

@Override 
public void onClick(AjaxRequestTarget
target) { 



txt.setOutputMarkupId(true); 

txt.setVisible(true); 

target.addComponent(txt); 


} 
}.add(new Label(cname,name))); 



} 

} 


Thanks 
Prati
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/LinkTree-and-panel-tp2241551p2241551.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: Can I develop without recompiling/restarting after every change?

2010-06-03 Thread John Krasnay
Hrm, perhaps you should have qualified your advice: If you're using
NetBeans, then for best performance...

Also, the packaging of markup on the classpath allows you to create
re-usable JARs of components and IMHO is one of the best features of
Wicket. So perhaps the qualification should really be, If you're using
NetBeans, and you're not planning on packaging your Wicket components in
a re-usable JAR, then for best performance...

The way your original post is phrased makes it sound like a best
practice, and it implies the Wicket default to fetch markup from the
classpath is inferior. I don't think this is a consensus among the
community.

jk

On Thu, Jun 03, 2010 at 08:57:43PM +1200, b...@actrix.gen.nz wrote:
 Martijn,
 
 You are making a *lot* of assumptions.
 
 Not everybody uses Eclipse.
 
 Nobody in this thread would consider restarts acceptable, still we are
 using this subject.
 
 HTML files location has to do with performance in the developing
 process depending on how the IDE handles the files.
 
 Please advise how to configure the NetBeans IDE to redeploy a HTML
 file in a Java package in a J2EE app server with the same speed as
 HTML files in the web directory (milliseconds not seconds).
 
 
 Thanks
 
 Bernard
 
 
 
 
 On Sun, 30 May 2010 15:23:09 +0200, you wrote:
 
 Huh?
 
 Storing the HTML in the packages has *nothing* to do with requiring
 restarts. Only wrongly configured IDEs may cause that.
 
 If your HTML doesn't get reloaded when you change it, then you should
 run Wicket in DEVELOPMENT mode. Also make sure you've configured
 Eclipse to copy all resources (not just .properties files)
 
 The Wicket Quickstart project and using Maven to generate your eclipse
 project files (mvn eclipse:eclipse) will configure everything
 correctly.
 
 Martijn
 
 On Sat, May 29, 2010 at 11:18 PM,  b...@actrix.gen.nz wrote:
  Hi,
 
  For best performance of redeploys in Wicket, consider storing HTML not
  in the Java package structure but in the web directory. So if your IDE
  and app server allow for hot deployment, then HTML changes deploy much
  faster, ie instantly. In your application init(), you add one
  statement
 
  getResourceSettings().addResourceFolder(wicket);
 
  where wicket matches the url-pattern in your filter-mapping in
  web.xml.
 
  PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
  background on how to take this one step further.
 
  Additionally, with GlassFish V3, you get session preservation on hot
  deployment of Java classes.
 
  You can enable deploy on save for convenience.
 
  If that is not fast enough, you can run your app in debug mode and hot
  swap classes after save while you are debugging it.
 
  All this comes with the NetBeans IDE. You really don't have to worry
  about this stuff anymore.
 
  Regards
 
  Bernard
 
 
 
  On Sat, 29 May 2010 16:12:46 +0100, you wrote:
 
 have you tried JRebel? ?I've not used it myself, but there was an
 interview on JavaPosse recently, sounds like it'd be an ideal fit for
 any Wicket developer.
 
 Dan
 
 On 22/07/28164 20:59, David Chang wrote:
  I am using Tomcat, any tips about how to develop out 
  recompiling/restarting after every change?
 
  Best.
 
  --- On Fri, 5/21/10, Jeremy Thomersonjer...@wickettraining.com ?wrote:
 
 
  From: Jeremy Thomersonjer...@wickettraining.com
  Subject: Re: Can I develop without recompiling/restarting after every 
  change?
  To: users@wicket.apache.org
  Date: Friday, May 21, 2010, 12:17 PM
  the easiest way to do this is to use
  the Start class (Start.java) from the
  quickstart to run an embedded jetty instance in your
  IDE. ?then, if you run
  it in debug mode, it will hotswap any possible changes (and
  tell you if you
  must restart if it's an incompatible change)
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Fri, May 21, 2010 at 10:53 AM, ekallevige...@ekallevig.com
  wrote:
 
 
  I'm a front-end developer trying to learn Java (total
 
  n00b) and working on
 
  a
  wicket application at work. ?The whole process
 
  feels very slow primarily
 
  because I have to recompile and restart JBoss every
 
  time I make a change.
 
  So I'm wondering what the best way is to avoid having
 
  to do this when
 
  editing .java/.js/.css/.html files during development?
 
  I'd like to just
 
  make
  changes and then refresh the browser to test -- is
 
  this possible?
 
  I've seen in the FAQ that you can change the
 
  application settings to
 
  auto-reload markup .html files -- where would I insert
 
  this setting
 
  (remember I'm a total n00b).
 
  As to .css/.js/.java files -- do I need jRebel or
 
  something like that to
 
  get
  these files to reload automatically?
 
  Thanks for helping out a super-beginner :)
  --
  View this message in context:
  http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html
  Sent from the Wicket - User mailing list archive at
 
  Nabble.com.
 

Opening a new modal window when OK is clicked on currently open modal window

2010-06-03 Thread Chris Colman
Is it possible to replace the currently open Modal window with a
different modal window from within the OK click handler of the currently
open modal window?


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



RE: how to implement multiple forms on a single page

2010-06-03 Thread Russell Simpkins

Thanks for the response - after further digging I discovered the error was one 
of my own creation.

 From: igor.vaynb...@gmail.com
 Date: Wed, 2 Jun 2010 20:07:51 -0700
 Subject: Re: how to implement multiple forms on a single page
 To: users@wicket.apache.org
 
 you should be able to have as many forms as you want. create a
 quickstart and send it to the list or attach it to jira, there is
 probably a bug in your code somewhere.
 

  
_
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3

Re: Show/hide form components best practice

2010-06-03 Thread Iain Reddick
The problem with this approach is that you throw away all the nice, 
re-usable pre-canned validators that wicket has, and that it seems very 
wrong.


I'd actually push the behaviour I would like to see even further - in 
the example I gave, I don't even want the optional field to update it's 
model when the check box isn't selected.


Effectively, I want to be able to specify logic which says ignore the 
input for this component completely. Currently, the only way to do this 
is by using component visibility (unless I'm completely wrong on this).


Xavier López wrote:

Hi Iain,

I would do it like this, with a FormValidator. I moved the minimum length
validation also to the formValidator, because doing it with a
MinimumLenghtValidator would trigger it before the formValidator executes,
and may raise errors when the input is not valid (i.e. not mandatory) :

private class TestForm extends Form {

IModel modelAlways;
IModel modelCheckOptional;
IModel modelOptional;

 public TestForm(String id) {
   super(id);

   modelAlways =  new Model();
   modelCheckOptional = Boolean.FALSE;
   modelOptional = new Model();
   final TextField alwaysTextfield = new TextField(always, modelAlways);
   alwaysTextField.setRequired(true);
   add(alwaysTextField);
   final CheckBox useOptionalCheck = new CheckBox( useOptional,
modelCheckOptional);
   add( useOptionalCheck );
   final TextField optionalTextField = new TextField(optional,
modelOptional);
   add(optionalTextField);

   add(new IFormValidator(){
  protected FormComponent getDependentFormComponents(){ return null; }
  public boolean validate(Form f){
  if (Boolean.TRUE.equals(useOptionalCheck.getConvertedInput()){
String optionalValue =
optionalTextField.getConvertedInput();
if (Strings.isEmpty(optionalValue ){
   error (field optional is required);
}
else if (optionalValue.length  3){
   error (optional value's length must be at least 3);
}
  }.
}
});

Cheers,
Xavier

2010/6/2 Iain Reddick iain.redd...@beatsystems.com

  

Here's some example code (wicket 1.3.x):

Java:

private class TestForm extends Form {

 private String always;
 private boolean useOptional = false;
 private String optional;

 public TestForm(String id) {
   super(id);

   add( new TextField(always, new PropertyModel(this,
always)).setRequired(true) );
   final CheckBox useOptionalCheck = new CheckBox( useOptional, new
PropertyModel(this, useOptional) );
   add( useOptionalCheck );
   add( new TextField(optional, new PropertyModel(this, optional)) {
 @Override
 public boolean isRequired() {
   return
((Boolean)useOptionalCheck.getConvertedInput()).booleanValue();
 }
   }.add(MinimumLengthValidator.minimumLength(3)) );
 }

}

Markup:

form wicket:id=testForm
 input wicket:id=always type=text /
 input wicket:id=useOptional type=checkbox /
 input wicket:id=optional type=text /
 input type=submit /
/form

How can I express that I want the optional text field to only be used when
the checkbox is selected?

- Original Message -
From: Igor Vaynberg igor.vaynb...@gmail.com
To: users@wicket.apache.org
Sent: Wednesday, 2 June, 2010 4:00:57 PM
Subject: Re: Show/hide form components best practice

if the form contains all the state then the answer is simple: write a
bit of javascript that does it for you.

-igor

On Wed, Jun 2, 2010 at 2:53 AM, Iain Reddick
iain.redd...@beatsystems.com wrote:


That's just a server round-trip on client-side state changem, which is
basically (1) in my initial list.

Basically, this type of form behaviour is very common and the question
of how to implement it with Wicket has been raised by every developer
I know
who has worked with the framework.

I know that Wicket generally works best when you round-trip
client-side state changes to the server, but I think that in this
situation it is silly,
as the submitted form contains all the required state.

Jeremy Thomerson wrote:
  

return true from wantOnSelectionChangedNotifications and put your
visibility changing code in onSelectionChanged





http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications()http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications%28%29



http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications()http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/CheckGroup.html#wantOnSelectionChangedNotifications%28%29


On Tue, Jun 1, 2010 at 5:37 AM, Iain Reddick
iain.redd...@beatsystems.comwrote:




Say I have a form with a check box that, when checked, shows some
other field (i.e. it controls the visibility of other form
components).

What is the best approach to handling this?

From what I 

Re: Show/hide form components best practice

2010-06-03 Thread Xavier López
I'm with you on this one, this code feels like doing something that it
shouldn't, looks kind of bloated for such a simple and common requirement.
Maybe we need some stuffing of nice, pre-canned FormValidators ? :)

The problem with wicket's validators, as I see it, is that they are at a
Component level. They do their job based on that component's input/state,
only. In fact, they are called in Form's validateComponents() one by one in
a traversal. If another component's input or state is required to perform
the validation, i'd do it inside a FormValidator. That copes with your
requirement of ignore the input for this component completely, although I
don't know how would that be achieved.

Of course, in all those comments, I assume you can not rely on javascript
nor ajax to perform those validations, in which case the visibility approach
simply couldn't work.

Cheers,
Xavier

2010/6/3 Iain Reddick iain.redd...@beatsystems.com

 The problem with this approach is that you throw away all the nice,
 re-usable pre-canned validators that wicket has, and that it seems very
 wrong.

 I'd actually push the behaviour I would like to see even further - in the
 example I gave, I don't even want the optional field to update it's model
 when the check box isn't selected.

 Effectively, I want to be able to specify logic which says ignore the
 input for this component completely. Currently, the only way to do this is
 by using component visibility (unless I'm completely wrong on this).

 Xavier López wrote:

 Hi Iain,

 I would do it like this, with a FormValidator. I moved the minimum length
 validation also to the formValidator, because doing it with a
 MinimumLenghtValidator would trigger it before the formValidator executes,
 and may raise errors when the input is not valid (i.e. not mandatory) :

 private class TestForm extends Form {

 IModel modelAlways;
 IModel modelCheckOptional;
 IModel modelOptional;

  public TestForm(String id) {
   super(id);

   modelAlways =  new Model();
   modelCheckOptional = Boolean.FALSE;
   modelOptional = new Model();
   final TextField alwaysTextfield = new TextField(always, modelAlways);
   alwaysTextField.setRequired(true);
   add(alwaysTextField);
   final CheckBox useOptionalCheck = new CheckBox( useOptional,
 modelCheckOptional);
   add( useOptionalCheck );
   final TextField optionalTextField = new TextField(optional,
 modelOptional);
   add(optionalTextField);

   add(new IFormValidator(){
  protected FormComponent getDependentFormComponents(){ return null; }
  public boolean validate(Form f){
  if (Boolean.TRUE.equals(useOptionalCheck.getConvertedInput()){
String optionalValue =
 optionalTextField.getConvertedInput();
if (Strings.isEmpty(optionalValue ){
   error (field optional is required);
}
else if (optionalValue.length  3){
   error (optional value's length must be at least 3);
}
  }.
 }
 });

 Cheers,
 Xavier

 2010/6/2 Iain Reddick iain.redd...@beatsystems.com



 Here's some example code (wicket 1.3.x):

 Java:

 private class TestForm extends Form {

  private String always;
  private boolean useOptional = false;
  private String optional;

  public TestForm(String id) {
   super(id);

   add( new TextField(always, new PropertyModel(this,
 always)).setRequired(true) );
   final CheckBox useOptionalCheck = new CheckBox( useOptional, new
 PropertyModel(this, useOptional) );
   add( useOptionalCheck );
   add( new TextField(optional, new PropertyModel(this, optional)) {
 @Override
 public boolean isRequired() {
   return
 ((Boolean)useOptionalCheck.getConvertedInput()).booleanValue();
 }
   }.add(MinimumLengthValidator.minimumLength(3)) );
  }

 }

 Markup:

 form wicket:id=testForm
  input wicket:id=always type=text /
  input wicket:id=useOptional type=checkbox /
  input wicket:id=optional type=text /
  input type=submit /
 /form

 How can I express that I want the optional text field to only be used
 when
 the checkbox is selected?

 - Original Message -
 From: Igor Vaynberg igor.vaynb...@gmail.com
 To: users@wicket.apache.org
 Sent: Wednesday, 2 June, 2010 4:00:57 PM
 Subject: Re: Show/hide form components best practice

 if the form contains all the state then the answer is simple: write a
 bit of javascript that does it for you.

 -igor

 On Wed, Jun 2, 2010 at 2:53 AM, Iain Reddick
 iain.redd...@beatsystems.com wrote:


 That's just a server round-trip on client-side state changem, which is
 basically (1) in my initial list.

 Basically, this type of form behaviour is very common and the question
 of how to implement it with Wicket has been raised by every developer
 I know
 who has worked with the framework.

 I know that Wicket generally works best when you round-trip
 client-side state changes to the server, but I think that in this
 situation it is silly,
 as the submitted form contains all 

Re: Dialog involving multiple pages and a VO: some best practices?

2010-06-03 Thread Mauro Ciancio
Hi,

On Wed, Jun 2, 2010 at 7:43 PM, Joseph Pachod
josephpac...@thomas-daily.de wrote:
 I've recently been wondering about the following use case: an instance of Foo 
 class,
 used as a detached value object, is edited in a FooEditPage. For some 
 reasons, let's
 say this page then needs to launch dialogs spanning over different pages. 
 Each of
 these pages could then change some fields of the VO being passed around.

  Have you taken a look to wicket-wizards?
http://www.wicket-library.com/wicket-examples/wizard/

 in fact, I mainly wonder about the pages' serialization... are there some 
 pitfalls to avoid ?

  If you have to track the object's state through several pages,
you'll need a serializable
object, because reloading it using a LDM in every request will throw
away all the changes
made before.
  So, your Foo must implement Serializable, or you could create some
proxy object that
tracks the changes and when the user finish the editing process, apply
the changes to
the real model object.

On Thu, Jun 3, 2010 at 9:19 AM, Wilhelmsen Tor Iver toriv...@arrive.no wrote:
 Sharing between pages is easier done by placing it in the Session which is 
 accessible
 from all of them.

  I think that storing a model object in the session is not a good
choice; if the user opens
two browser windows, what will happen?

Regards.
-- 
Mauro Ciancio maurociancio at gmail dot com

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



Replacing Links with AjaxSubmitLinks in AjaxFallbackDefaultDataTable

2010-06-03 Thread Nelson Segura
Hello,

I am new to Wicket, and I am writing a listing component based on the
phonebook app that uses AjaxFallbackDefaultDataTable and is able to retain
checkbox status across pages.
I searched the forums, and reading around, I was able to get the status
being retained on submits.

What I am missing is to convert my paging and sorting links to
AjaxSubmitLinks, so my checkbox status gets send to the server. I have
searched around and found that this is needed, but how no pointers on how to
do the job. Can someone provide a quick outline / sample code on how this
replacement can be done?

-Nelson


Re: Regression: @Inject'ed objects cannot be passed to Threads

2010-06-03 Thread Igor Vaynberg
this is not a regression in the sense that it is a bug. we have always
maintained that the objects that get injected should only be used
within wicket components.

you need to make sure the Application object is bound to the thread
that is executing the runnable, so you will have to pass the
application along with the dependencies and call application.set/unset
around the runnable.

-igor

On Thu, Jun 3, 2010 at 1:07 AM, Douglas Ferguson
doug...@douglasferguson.us wrote:
 I've posted a similar message the other week, because I was having strange 
 behavior when passing objects that have been injected into my page to child 
 threads.

 So, we recently upgrade from 1.4.5 - 1.4.7

 Prior to the upgrade we had some runnables that would do some asynchronous 
 work for us and we would just @inject the DAO into the page and pass that 
 into constructor of the runnable.
 This worked fine until the upgrade to 1.4.7. Now when the thread calls 
 methods on the object we get the org.apache.wicket.WicketRuntimeException: 
 There is no application attached to current thread pool-13-thread-16' error

 D/



 -
 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: Opening a new modal window when OK is clicked on currently open modal window

2010-06-03 Thread Istvan Jozsa
Yes, by opening the second window *when* the first is closed.
Try something like this:

abstract class Modal1 extends ModalWindow {
   public Modal1(id) {
  // ...
  setWindowClosedCallback(new ModalWindow.CloseButtonCallback() {
 @Override
 public void onClose(AjaxRequestTarget target) {
Modal1.this.onClose(target);
 }
  });
   }
   protected abstract void onClose(AjaxRequestTarget target);
   public Modal1 showMe(target) {
  // ...
  super.show();
  return this;
   }
}

// somewhere in the page:
ModalWindow modal1, modal2;
// ...
add(modal1 = new Modal1(w1) {
   @Override
   void onClose(AjaxRequestTarget target) {
 modal2.show(target);
   }
});
add(modal2 = new Modal2(w2));
// ...
modal1.showMe(target);

The more flexible solution is by
setting the close callback *when* the window is shown:

modal1.showMe(target).setWindowClosedCallback(new
ModalWindow.CloseButtonCallback() {
   @Override
   public void onClose(AjaxRequestTarget target) {
   modal2.show(target);
   }
});


On Thu, Jun 3, 2010 at 3:48 PM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 Is it possible to replace the currently open Modal window with a
 different modal window from within the OK click handler of the currently
 open modal window?


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




validations in a form with listView

2010-06-03 Thread tubin gen
I have a form , this  has a listview  , listview contains a chekbox.Upon
form submit I want atleast one check box to be checked,
In a formvalidator I use form.get(id )  this returns formComponent and
formcomponent has a method getValue()but in case of listView how can I
retrieve the  formComponent and its value?


Re: Can I develop without recompiling/restarting after every change?

2010-06-03 Thread Igor Vaynberg
On Thu, Jun 3, 2010 at 1:57 AM,  b...@actrix.gen.nz wrote:
 Martijn,

 You are making a *lot* of assumptions.

 Not everybody uses Eclipse.

 Nobody in this thread would consider restarts acceptable, still we are
 using this subject.

 HTML files location has to do with performance in the developing
 process depending on how the IDE handles the files.

 Please advise how to configure the NetBeans IDE to redeploy a HTML
 file in a Java package in a J2EE app server with the same speed as
 HTML files in the web directory (milliseconds not seconds).

launch the Start class supplied by quickstart and archetype to launch
the application from netbeans in debug mode. this will get you jvm
hotswapping for changes you make to java code.

for resources add lines like these to your application.init()

getResourceSettings().addResourceFolder(src/main/java);
getResourceSettings().addResourceFolder(src/main/resources);

the lines above are for a project using maven layout, if you use a
different layout adjust the paths.

this will get you reloading of markup and property files.

to adjust the frequency of reloading set it in resource settings,
although i doubt it takes you less then a second to switch from your
ide to the browser and hit refresh after you make a change.

-igor



 Thanks

 Bernard




 On Sun, 30 May 2010 15:23:09 +0200, you wrote:

Huh?

Storing the HTML in the packages has *nothing* to do with requiring
restarts. Only wrongly configured IDEs may cause that.

If your HTML doesn't get reloaded when you change it, then you should
run Wicket in DEVELOPMENT mode. Also make sure you've configured
Eclipse to copy all resources (not just .properties files)

The Wicket Quickstart project and using Maven to generate your eclipse
project files (mvn eclipse:eclipse) will configure everything
correctly.

Martijn

On Sat, May 29, 2010 at 11:18 PM,  b...@actrix.gen.nz wrote:
 Hi,

 For best performance of redeploys in Wicket, consider storing HTML not
 in the Java package structure but in the web directory. So if your IDE
 and app server allow for hot deployment, then HTML changes deploy much
 faster, ie instantly. In your application init(), you add one
 statement

 getResourceSettings().addResourceFolder(wicket);

 where wicket matches the url-pattern in your filter-mapping in
 web.xml.

 PLease see https://issues.apache.org/jira/browse/WICKET-2881 for some
 background on how to take this one step further.

 Additionally, with GlassFish V3, you get session preservation on hot
 deployment of Java classes.

 You can enable deploy on save for convenience.

 If that is not fast enough, you can run your app in debug mode and hot
 swap classes after save while you are debugging it.

 All this comes with the NetBeans IDE. You really don't have to worry
 about this stuff anymore.

 Regards

 Bernard



 On Sat, 29 May 2010 16:12:46 +0100, you wrote:

have you tried JRebel?  I've not used it myself, but there was an
interview on JavaPosse recently, sounds like it'd be an ideal fit for
any Wicket developer.

Dan

On 22/07/28164 20:59, David Chang wrote:
 I am using Tomcat, any tips about how to develop out 
 recompiling/restarting after every change?

 Best.

 --- On Fri, 5/21/10, Jeremy Thomersonjer...@wickettraining.com  wrote:


 From: Jeremy Thomersonjer...@wickettraining.com
 Subject: Re: Can I develop without recompiling/restarting after every 
 change?
 To: users@wicket.apache.org
 Date: Friday, May 21, 2010, 12:17 PM
 the easiest way to do this is to use
 the Start class (Start.java) from the
 quickstart to run an embedded jetty instance in your
 IDE.  then, if you run
 it in debug mode, it will hotswap any possible changes (and
 tell you if you
 must restart if it's an incompatible change)

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Fri, May 21, 2010 at 10:53 AM, ekallevige...@ekallevig.com
 wrote:


 I'm a front-end developer trying to learn Java (total

 n00b) and working on

 a
 wicket application at work.  The whole process

 feels very slow primarily

 because I have to recompile and restart JBoss every

 time I make a change.

 So I'm wondering what the best way is to avoid having

 to do this when

 editing .java/.js/.css/.html files during development?

 I'd like to just

 make
 changes and then refresh the browser to test -- is

 this possible?

 I've seen in the FAQ that you can change the

 application settings to

 auto-reload markup .html files -- where would I insert

 this setting

 (remember I'm a total n00b).

 As to .css/.js/.java files -- do I need jRebel or

 something like that to

 get
 these files to reload automatically?

 Thanks for helping out a super-beginner :)
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-I-develop-without-recompiling-restarting-after-every-change-tp2226360p2226360.html
 Sent from the Wicket - User mailing list archive at

 Nabble.com.



 -

 To 

Unit Test InMethod DataGrid

2010-06-03 Thread Ronan O'Connell

Hi,

Does anybody know how to check the values of individual cells of an 
InMethod DataGrid/Treedrid. in a unit test?


Looking at the output of WicketTester.debugComponentTrees() I can see 
that the grid row is the deepest level with a wicket id:


NFO  - BaseWicketTester   - path
panel:storyGrid:form:bodyContainer:body 
com.inmethod.grid.datagrid.DataGridBody
INFO  - BaseWicketTester   - path
panel:storyGrid:form:bodyContainer:body:row 
com.inmethod.grid.common.AbstractPageableView
INFO  - BaseWicketTester   - path
panel:storyGrid:form:bodyContainer:body:row:1 
org.apache.wicket.markup.repeater.Item
INFO  - BaseWicketTester   - path
panel:storyGrid:form:bodyContainer:body:row:1:item 
com.inmethod.grid.common.AbstractGridRow
INFO  - BaseWicketTester   - path
panel:storyGrid:form:bodyContainer:body:row:2 
org.apache.wicket.markup.repeater.Item
INFO  - BaseWicketTester   - path
panel:storyGrid:form:bodyContainer:body:row:2:item 
com.inmethod.grid.common.AbstractGridRow


I've looked at those component classes and can't see anything helpful in 
them.


Hoping I'm not missing the obvious,
Ronan






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



Re: Dialog involving multiple pages and a VO: some best practices?

2010-06-03 Thread Igor Vaynberg
usually i simply allow pages to take models of whatever it is they
need, just like any other component. in case of a dto being passed
around you can simply use the default model: new ModelDto(new
Dto()); and pass that to any page. that way the page does not need to
worry about where the objects comes from or how to store it.

-igor

On Wed, Jun 2, 2010 at 3:43 PM, Joseph Pachod
josephpac...@thomas-daily.de wrote:
 hi

 I've recently been wondering about the following use case: an instance of Foo 
 class, used as a detached value object, is edited in a FooEditPage. For some 
 reasons, let's say this page then needs to launch dialogs spanning over 
 different pages. Each of these pages could then change some fields of the VO 
 being passed around.

 how would you handle the Foo instance being given through ?

 in fact, I mainly wonder about the pages' serialization... are there some 
 pitfalls to avoid ?

 on a side note, for the return page requirement of the dialog, I would just 
 give the calling page on the next one. Something like setResponsePage(new 
 DialogPageX(this, ...));

 is this ok ?

 thanks in advance
 best regards
 joseph

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



Re: Unit Test InMethod DataGrid

2010-06-03 Thread nino martinez wael
what about grabbing the model behind and checking that instead?

2010/6/3 Ronan O'Connell ronanoconnell1...@gmail.com:
 Hi,

 Does anybody know how to check the values of individual cells of an InMethod
 DataGrid/Treedrid. in a unit test?

 Looking at the output of WicketTester.debugComponentTrees() I can see that
 the grid row is the deepest level with a wicket id:

 NFO  - BaseWicketTester           - path
  panel:storyGrid:form:bodyContainer:body
 com.inmethod.grid.datagrid.DataGridBody
 INFO  - BaseWicketTester           - path
  panel:storyGrid:form:bodyContainer:body:row
 com.inmethod.grid.common.AbstractPageableView
 INFO  - BaseWicketTester           - path
  panel:storyGrid:form:bodyContainer:body:row:1
 org.apache.wicket.markup.repeater.Item
 INFO  - BaseWicketTester           - path
  panel:storyGrid:form:bodyContainer:body:row:1:item
 com.inmethod.grid.common.AbstractGridRow
 INFO  - BaseWicketTester           - path
  panel:storyGrid:form:bodyContainer:body:row:2
 org.apache.wicket.markup.repeater.Item
 INFO  - BaseWicketTester           - path
  panel:storyGrid:form:bodyContainer:body:row:2:item
 com.inmethod.grid.common.AbstractGridRow

 I've looked at those component classes and can't see anything helpful in
 them.

 Hoping I'm not missing the obvious,
 Ronan






 -
 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: Replacing Links with AjaxSubmitLinks in AjaxFallbackDefaultDataTable

2010-06-03 Thread Igor Vaynberg
see how AjaxFallbackDefaultDataTable  replaces the navigator links
with AjaxFallbackLinks...

-igor

On Thu, Jun 3, 2010 at 8:18 AM, Nelson Segura nsegu...@gmail.com wrote:
 Hello,

 I am new to Wicket, and I am writing a listing component based on the
 phonebook app that uses AjaxFallbackDefaultDataTable and is able to retain
 checkbox status across pages.
 I searched the forums, and reading around, I was able to get the status
 being retained on submits.

 What I am missing is to convert my paging and sorting links to
 AjaxSubmitLinks, so my checkbox status gets send to the server. I have
 searched around and found that this is needed, but how no pointers on how to
 do the job. Can someone provide a quick outline / sample code on how this
 replacement can be done?

 -Nelson


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



Re: Javascript string formatting problem with DateTextField and DatePicker

2010-06-03 Thread Igor Vaynberg
i think this is fixed in 1.4.7+, you should upgrade

-igor

On Thu, Jun 3, 2010 at 5:11 AM, Jimi jimi.hulleg...@mogul.com wrote:

 Ok, I managed to find the problem using the javascript debug function of
 Firebug, but I have no idea on how to solve it.

 The problematic code lies in the file wicket-date.js:

 125  /**
 126  * Return the result of interpolating the value (date) argument with the
 date pattern.
 127  * The dateValue has to be an array, where year is in the first, month
 in the second
 128  * and date (day of month) in the third slot.
 129  */
 130  Wicket.DateTime.substituteDate = function(datePattern, date) {
 131  day = date[2];
 132  month = date[1];
 133  year = date[0];
 134  // optionally do some padding to match the pattern
 135  if(datePattern.match(/dd+/)) day =
 Wicket.DateTime.padDateFragment(day);
 136  if(datePattern.match(/MM+/)) month =
 Wicket.DateTime.padDateFragment(month);
 137  if(datePattern.match(/yy+/)) year =
 Wicket.DateTime.padDateFragment(year % 100);
 138  // replace pattern with real values
 139  return datePattern.replace(/d+/, day).replace(/M+/,
 month).replace(/y+/, year);
 140  }

 On the line 137 it truncates the year from 2010 to 10, and simply ignores
 the fact that I want a 4 digit year.

 When I did the same debugging on the example on wicketstuff.org I found that
 this javascript function looked a little bit different:

 80  Wicket.DateTime.substituteDate = function(datePattern, date) {
 71  day = date[2];
 72  month = date[1];
 73  year = date[0];
 74  if(datePattern.match(/dd+/)) day = Wicket.DateTime.padDateFragment(day);
 75  if(datePattern.match(/MM+/)) month =
 Wicket.DateTime.padDateFragment(month);
 76  if(datePattern.match(/byy+/)) year =
 Wicket.DateTime.padDateFragment(year % 100);
 77  return datePattern.replace(/d+/, day).replace(/M+/, month).replace(/y+/,
 year);
 78  }

 Here on line 76 it sees if the datePattern matches byy+, I have no idea
 what that 'b' i supposed to mean, but the result is that it doesn't truncate
 the year from 4 to 2 digits.

 I also noted that these two *different* wicket-date.js files contain the
 exact same versioning information:

 YAHOO.register(wicket-date, Wicket.DateTime, {version: 1.3.0, build:
 rc1});

 So, does anyone know what I can do to get the correct wicket-date.js? Or
 should I report this as a bug somewhere? The way I see it, the javascript
 should check if the datepattern matches  and then leave the year as it
 is.

 /Jimi
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Javascript-string-formatting-problem-with-DateTextField-and-DatePicker-tp2241433p2241559.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



SessionStore life cycle in cluster?

2010-06-03 Thread DmitryM

Hello, guys

I managed to have Tomcat cluster working with memcached-session-manager
(http://groups.google.com/group/memcached-session-manager) from Martin.

Everything works perfectly fine unless tomcats start getting shut down.
I have 2 tomcats running with the session replicated (see above). Then I
shut down one of them.
When on a page with ajax behavior after I click an ajax button the response
to the request gets delayed (about 2-3 seconds extra compared to the case
when all tomcats are live and running).

I tried this with Wicket's SecondLevelCacheSessionStore(+ DiskPageStore, I
assume) and I also tried to use a Hazelcast-based PageStore (ex. from here:
http://wicketbyexample.com/apache-wicket-clustering-with-multiple-options/).
That bizarre delay happens in both cases.

Can anyone please try to come up with some explanation what may be happening
in that case?
I guess, the scenario is as follows:
- tomcat cluster with proper session distribution in place,
- request hits tomcat1 and gets page with ajax button
- tomcat1 is shutdown
- ajax button is clicked
- request hits tomcat2 and gets processed successfully (but with delay)

Thanks in advance,
Dmitry
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SessionStore-life-cycle-in-cluster-tp2242105p2242105.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: SessionStore life cycle in cluster?

2010-06-03 Thread Igor Vaynberg
maybe because tomcat2 needs to retrieve the session from memcached,
are subsequent requests also slow? or just the first request after the
failover?

-igor

On Thu, Jun 3, 2010 at 11:06 AM, DmitryM nsk...@aol.com wrote:

 Hello, guys

 I managed to have Tomcat cluster working with memcached-session-manager
 (http://groups.google.com/group/memcached-session-manager) from Martin.

 Everything works perfectly fine unless tomcats start getting shut down.
 I have 2 tomcats running with the session replicated (see above). Then I
 shut down one of them.
 When on a page with ajax behavior after I click an ajax button the response
 to the request gets delayed (about 2-3 seconds extra compared to the case
 when all tomcats are live and running).

 I tried this with Wicket's SecondLevelCacheSessionStore(+ DiskPageStore, I
 assume) and I also tried to use a Hazelcast-based PageStore (ex. from here:
 http://wicketbyexample.com/apache-wicket-clustering-with-multiple-options/).
 That bizarre delay happens in both cases.

 Can anyone please try to come up with some explanation what may be happening
 in that case?
 I guess, the scenario is as follows:
 - tomcat cluster with proper session distribution in place,
 - request hits tomcat1 and gets page with ajax button
 - tomcat1 is shutdown
 - ajax button is clicked
 - request hits tomcat2 and gets processed successfully (but with delay)

 Thanks in advance,
 Dmitry
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/SessionStore-life-cycle-in-cluster-tp2242105p2242105.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: Replacing Links with AjaxSubmitLinks in AjaxFallbackDefaultDataTable

2010-06-03 Thread Nelson Segura
OK, so this means replacing all the
AjaxFallBackDefaultDataTable/AjaxNavigationToolbar/AjaxPaginNavigator/etc
and the AjaxFallbackHeadersToolbar/etc classes with my own classes that
mimic them? Correct?

-Nelson


On Thu, Jun 3, 2010 at 11:02 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 see how AjaxFallbackDefaultDataTable  replaces the navigator links
 with AjaxFallbackLinks...

 -igor

 On Thu, Jun 3, 2010 at 8:18 AM, Nelson Segura nsegu...@gmail.com wrote:
  Hello,
 
  I am new to Wicket, and I am writing a listing component based on the
  phonebook app that uses AjaxFallbackDefaultDataTable and is able to
 retain
  checkbox status across pages.
  I searched the forums, and reading around, I was able to get the status
  being retained on submits.
 
  What I am missing is to convert my paging and sorting links to
  AjaxSubmitLinks, so my checkbox status gets send to the server. I have
  searched around and found that this is needed, but how no pointers on how
 to
  do the job. Can someone provide a quick outline / sample code on how this
  replacement can be done?
 
  -Nelson
 

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




Re: Replacing Links with AjaxSubmitLinks in AjaxFallbackDefaultDataTable

2010-06-03 Thread Igor Vaynberg
yep

-igor

On Thu, Jun 3, 2010 at 11:14 AM, Nelson Segura nsegu...@gmail.com wrote:
 OK, so this means replacing all the
 AjaxFallBackDefaultDataTable/AjaxNavigationToolbar/AjaxPaginNavigator/etc
 and the AjaxFallbackHeadersToolbar/etc classes with my own classes that
 mimic them? Correct?

 -Nelson


 On Thu, Jun 3, 2010 at 11:02 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 see how AjaxFallbackDefaultDataTable  replaces the navigator links
 with AjaxFallbackLinks...

 -igor

 On Thu, Jun 3, 2010 at 8:18 AM, Nelson Segura nsegu...@gmail.com wrote:
  Hello,
 
  I am new to Wicket, and I am writing a listing component based on the
  phonebook app that uses AjaxFallbackDefaultDataTable and is able to
 retain
  checkbox status across pages.
  I searched the forums, and reading around, I was able to get the status
  being retained on submits.
 
  What I am missing is to convert my paging and sorting links to
  AjaxSubmitLinks, so my checkbox status gets send to the server. I have
  searched around and found that this is needed, but how no pointers on how
 to
  do the job. Can someone provide a quick outline / sample code on how this
  replacement can be done?
 
  -Nelson
 

 -
 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: SessionStore life cycle in cluster?

2010-06-03 Thread DmitryM

Only the very first one.

I'm not 100% sure but the session seems to be always retrieved from
memcached...

That's what I don't quite understand. When all nodes/tomcats in the cluster
are up then request are fast.
And the thing is, if that's not an Ajax action, then the request is
responded at the same speed (like switching between pages in the app).

-Dmitry
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SessionStore-life-cycle-in-cluster-tp2242105p2242134.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: validations in a form with listView

2010-06-03 Thread fachhoch

I tried this code please tell me if this is right  code  to  retrieve to
formcomponent from a list view



ListFormComponent?  formComponents= new 
ArrayListFormComponent?();
for(Iterator?  extends ListItem? listItemIterator= 

((ListView?)form.get(listViewId)).iterator();listItemIterator.hasNext();
){
for(Iterator?  extends Component itemChildrenIterator=
listItemIterator.next().iterator() ;itemChildrenIterator.hasNext(); ){
Component  
component=itemChildrenIterator.next();
if(component  instanceof  FormComponent?  
component.getId().equals(id)   ){

formComponents.add((FormComponent?)component);
}
}
}
return formComponents;

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validations-in-a-form-with-listView-tp2242009p2242137.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: SessionStore life cycle in cluster?

2010-06-03 Thread Igor Vaynberg
are you sure its ajax only? that seems rather strange to me. if its
true then i dont have a clue, you will have to use a profiler to see
where the time goes.

-igor

On Thu, Jun 3, 2010 at 11:26 AM, DmitryM nsk...@aol.com wrote:

 Only the very first one.

 I'm not 100% sure but the session seems to be always retrieved from
 memcached...

 That's what I don't quite understand. When all nodes/tomcats in the cluster
 are up then request are fast.
 And the thing is, if that's not an Ajax action, then the request is
 responded at the same speed (like switching between pages in the app).

 -Dmitry
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/SessionStore-life-cycle-in-cluster-tp2242105p2242134.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: validations in a form with listView

2010-06-03 Thread vineet semwal
you can just add formcomponent to your arraylist in populateitem that will
give you list of formcomponents.
you can then validate them in your custom formvalidator..


On Thu, Jun 3, 2010 at 11:58 PM, fachhoch fachh...@gmail.com wrote:


 I tried this code please tell me if this is right  code  to  retrieve to
 formcomponent from a list view



ListFormComponent?  formComponents= new
 ArrayListFormComponent?();
for(Iterator?  extends ListItem? listItemIterator=

 ((ListView?)form.get(listViewId)).iterator();listItemIterator.hasNext();
 ){
for(Iterator?  extends Component
 itemChildrenIterator=
 listItemIterator.next().iterator() ;itemChildrenIterator.hasNext(); ){
Component
  component=itemChildrenIterator.next();
if(component  instanceof  FormComponent?
 
 component.getId().equals(id)   ){

  formComponents.add((FormComponent?)component);
}
}
}
return formComponents;

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/validations-in-a-form-with-listView-tp2242009p2242137.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




-- 
regards,
Vineet Semwal


FileUpload inside two forms

2010-06-03 Thread Josh Chappelle
Hi,

 

I have a generic FileUploadModal class that allows the user to upload files
as long as it is not being used inside of another form. The FileUploadPanel
that is the content of the FileUploadModal contains a Form. So when the
modal is used inside a panel that already contains a form I get a 400 error
when I click the form submit button.

 

Is there any way to make this work?

 

Thanks,

 

Josh



Re: SessionStore life cycle in cluster?

2010-06-03 Thread DmitryM

Igor,

I was wrong.
When it's a first request hitting a page (after shutting down one of 2
tomcats) then regardless of the type of request (ajax or bookmarkable page
link) there is a delay of 2+ seconds.

-Dmitry
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/SessionStore-life-cycle-in-cluster-tp2242105p2242198.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: SessionStore life cycle in cluster?

2010-06-03 Thread Igor Vaynberg
i would guess that is the time it takes to pull the session from
memcached to the tomcat node.

-igor

On Thu, Jun 3, 2010 at 12:12 PM, DmitryM nsk...@aol.com wrote:

 Igor,

 I was wrong.
 When it's a first request hitting a page (after shutting down one of 2
 tomcats) then regardless of the type of request (ajax or bookmarkable page
 link) there is a delay of 2+ seconds.

 -Dmitry
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/SessionStore-life-cycle-in-cluster-tp2242105p2242198.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: Guice Wicket Guice Proxy

2010-06-03 Thread nino martinez wael
yes, i think so:

?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
version=2.4

display-nameIVR Web frontend/display-name

filter
filter-namewicket.WicketWarp/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name

param-valuecom.netdesign.codan.webadmin.WicketApplication/param-value
/init-param

init-param
param-nameconfiguration/param-name
param-valuedeployment/param-value
/init-param
/filter

filter
filter-namewarpPersistFilter/filter-name

filter-classcom.wideplay.warp.persist.PersistenceFilter/filter-class
/filter

filter-mapping
filter-namewarpPersistFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping




filter-mapping
filter-namewicket.WicketWarp/filter-name
url-pattern/*/url-pattern
/filter-mapping


/web-app


2010/6/2 Igor Vaynberg igor.vaynb...@gmail.com:
 did you install warp's open entity manager in view filter *before*
 wicket's filter?

 -igor

 On Wed, Jun 2, 2010 at 5:46 AM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 Hi I somehow think theres something wrong with the Wicket Guice proxy
 (probably only if you are using guice 2  possibly warp persist)

 Anyhow I have had to change my LDM's to this code, notice the injector
 holder in the getter method really really bad. But if not I get an
 entity manager is closed:

 public class ClassWithDao {

        public ClassWithDao() {
                InjectorHolder.getInjector().inject(this);
        }

       �...@inject
        private transient PhoneDao phoneDao;

        /**
         * This method contains a fix, should ordinary be avoided! There
 should be no need for calling the extra InjectorHolder method!
         * @return
         */
      public PhoneDao getPhoneDao() {
              InjectorHolder.getInjector().inject(this);
              return phoneDao;
      }

        public void setPhoneDao(PhoneDao phoneDao) {
                this.phoneDao = phoneDao;
        }

 Am I doing anything wrong I wonder, however the first requests are
 always working it's after something has been trough the session store
 it goes wrong..

 -regards Nino

 -
 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



[wicketstuff/wicket-contrib-jasperpreports] Is anyone supporting this?

2010-06-03 Thread Charles Deal
Is anyone out there maintaining/using this library?

I am using it and I have a handful of modifications that I'd like to push
back into the source tree.  Should I prepare a patch and JIRA issue or shall
I pursue commit access for this library?

I would also like to get it hooked into the build process.  It seems like I
only need to add the wicketstuff-core reference to this pom and have the
wicketstuff-core pom updated to include this  module.  What else needs to be
done?  Are there specific requirements for a library to be part of the
wicketstuff-core build?


Re: Problem with Crypted URL

2010-06-03 Thread kugaprakash

Thanks for the response, I am trying to implement your recommended solution,
however, It goes into the respond method and I did the following 
  public void respond(RequestCycle requestCycle) {
PageParameters param = new PageParameters();
param.add(error, errorMessage); //$NON-NLS-1$
   try {

((WebResponse)requestCycle.getResponse()).getHttpServletResponse().

sendRedirect(requestCycle.urlFor(pageClass, param).toString());
Session.get().invalidate();
} catch (IOException e) {
log.error(Error while redirecting to global 
error page, e);
//$NON-NLS-1$
} 
} 

Please let me know if the above is correct.
However, I am seeing the following issue:
1. When the session expires, the session expiry page appears, and when click
on Browser back button, it takes me to previous page, but doesnt complete
rendering, as there are decode exceptions, but this time it does not render
the SessionExpiry page.

2. We also have a Global error page, when the application gets an RunTime
exception, we report it to global error page, I tried to use the same
concept there, but for this case, it does not redirect to the Global error
page, rather, just stays in the current page, as though it has consumed the
click.

Please let me know if you have any thoughts.
Thanks in advance
Kuga
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-with-Crypted-URL-tp1875435p2242335.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: Guice Wicket Guice Proxy

2010-06-03 Thread nino martinez wael
Argh, how stupid.. Thanks a lot igor, how can I buy you a beer or Coke?

I spend a tremendous time trying to figure out what was wrong. I even
considered going back to spring..

regards Nino

2010/6/3 Igor Vaynberg igor.vaynb...@gmail.com:
 noep, the filters are processed in the order they are defined in
 web.xml, move the wicket filter decl below the warp persist stuff.

 -igor

 On Thu, Jun 3, 2010 at 1:05 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 yes, i think so:

 ?xml version=1.0 encoding=ISO-8859-1?
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
        xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
        version=2.4

        display-nameIVR Web frontend/display-name

        filter
                filter-namewicket.WicketWarp/filter-name
                
 filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
                init-param
                        param-nameapplicationClassName/param-name
                        
 param-valuecom.netdesign.codan.webadmin.WicketApplication/param-value
                /init-param

                init-param
                        param-nameconfiguration/param-name
                        param-valuedeployment/param-value
                /init-param
        /filter

        filter
                filter-namewarpPersistFilter/filter-name
                
 filter-classcom.wideplay.warp.persist.PersistenceFilter/filter-class
        /filter

        filter-mapping
                filter-namewarpPersistFilter/filter-name
                url-pattern/*/url-pattern
        /filter-mapping




        filter-mapping
                filter-namewicket.WicketWarp/filter-name
                url-pattern/*/url-pattern
        /filter-mapping


 /web-app


 2010/6/2 Igor Vaynberg igor.vaynb...@gmail.com:
 did you install warp's open entity manager in view filter *before*
 wicket's filter?

 -igor

 On Wed, Jun 2, 2010 at 5:46 AM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 Hi I somehow think theres something wrong with the Wicket Guice proxy
 (probably only if you are using guice 2  possibly warp persist)

 Anyhow I have had to change my LDM's to this code, notice the injector
 holder in the getter method really really bad. But if not I get an
 entity manager is closed:

 public class ClassWithDao {

        public ClassWithDao() {
                InjectorHolder.getInjector().inject(this);
        }

       �...@inject
        private transient PhoneDao phoneDao;

        /**
         * This method contains a fix, should ordinary be avoided! There
 should be no need for calling the extra InjectorHolder method!
         * @return
         */
      public PhoneDao getPhoneDao() {
              InjectorHolder.getInjector().inject(this);
              return phoneDao;
      }

        public void setPhoneDao(PhoneDao phoneDao) {
                this.phoneDao = phoneDao;
        }

 Am I doing anything wrong I wonder, however the first requests are
 always working it's after something has been trough the session store
 it goes wrong..

 -regards Nino

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



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



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



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



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



Re: [wicketstuff/wicket-contrib-jasperpreports] Is anyone supporting this?

2010-06-03 Thread nino martinez wael
go for commit rights. And for requirements it would be good to have an
example project other than that it should just be working :)



2010/6/3 Charles Deal chuckdea...@gmail.com:
 Is anyone out there maintaining/using this library?

 I am using it and I have a handful of modifications that I'd like to push
 back into the source tree.  Should I prepare a patch and JIRA issue or shall
 I pursue commit access for this library?

 I would also like to get it hooked into the build process.  It seems like I
 only need to add the wicketstuff-core reference to this pom and have the
 wicketstuff-core pom updated to include this  module.  What else needs to be
 done?  Are there specific requirements for a library to be part of the
 wicketstuff-core build?


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



Re: Guice Wicket Guice Proxy

2010-06-03 Thread James Carman
I thought the filters were executed in the order of their
filter-mappings, not their filter definitions.

On Thu, Jun 3, 2010 at 5:23 PM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 Argh, how stupid.. Thanks a lot igor, how can I buy you a beer or Coke?

 I spend a tremendous time trying to figure out what was wrong. I even
 considered going back to spring..

 regards Nino

 2010/6/3 Igor Vaynberg igor.vaynb...@gmail.com:
 noep, the filters are processed in the order they are defined in
 web.xml, move the wicket filter decl below the warp persist stuff.

 -igor

 On Thu, Jun 3, 2010 at 1:05 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 yes, i think so:

 ?xml version=1.0 encoding=ISO-8859-1?
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
        xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
        version=2.4

        display-nameIVR Web frontend/display-name

        filter
                filter-namewicket.WicketWarp/filter-name
                
 filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
                init-param
                        param-nameapplicationClassName/param-name
                        
 param-valuecom.netdesign.codan.webadmin.WicketApplication/param-value
                /init-param

                init-param
                        param-nameconfiguration/param-name
                        param-valuedeployment/param-value
                /init-param
        /filter

        filter
                filter-namewarpPersistFilter/filter-name
                
 filter-classcom.wideplay.warp.persist.PersistenceFilter/filter-class
        /filter

        filter-mapping
                filter-namewarpPersistFilter/filter-name
                url-pattern/*/url-pattern
        /filter-mapping




        filter-mapping
                filter-namewicket.WicketWarp/filter-name
                url-pattern/*/url-pattern
        /filter-mapping


 /web-app


 2010/6/2 Igor Vaynberg igor.vaynb...@gmail.com:
 did you install warp's open entity manager in view filter *before*
 wicket's filter?

 -igor

 On Wed, Jun 2, 2010 at 5:46 AM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 Hi I somehow think theres something wrong with the Wicket Guice proxy
 (probably only if you are using guice 2  possibly warp persist)

 Anyhow I have had to change my LDM's to this code, notice the injector
 holder in the getter method really really bad. But if not I get an
 entity manager is closed:

 public class ClassWithDao {

        public ClassWithDao() {
                InjectorHolder.getInjector().inject(this);
        }

       �...@inject
        private transient PhoneDao phoneDao;

        /**
         * This method contains a fix, should ordinary be avoided! There
 should be no need for calling the extra InjectorHolder method!
         * @return
         */
      public PhoneDao getPhoneDao() {
              InjectorHolder.getInjector().inject(this);
              return phoneDao;
      }

        public void setPhoneDao(PhoneDao phoneDao) {
                this.phoneDao = phoneDao;
        }

 Am I doing anything wrong I wonder, however the first requests are
 always working it's after something has been trough the session store
 it goes wrong..

 -regards Nino

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



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



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



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



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



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



Re: Guice Wicket Guice Proxy

2010-06-03 Thread nino martinez wael
yeah me too, what Igor said worked so must be true or a bug.. I don't
think it's a bug..

2010/6/3 James Carman ja...@carmanconsulting.com:
 I thought the filters were executed in the order of their
 filter-mappings, not their filter definitions.

 On Thu, Jun 3, 2010 at 5:23 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 Argh, how stupid.. Thanks a lot igor, how can I buy you a beer or Coke?

 I spend a tremendous time trying to figure out what was wrong. I even
 considered going back to spring..

 regards Nino

 2010/6/3 Igor Vaynberg igor.vaynb...@gmail.com:
 noep, the filters are processed in the order they are defined in
 web.xml, move the wicket filter decl below the warp persist stuff.

 -igor

 On Thu, Jun 3, 2010 at 1:05 PM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 yes, i think so:

 ?xml version=1.0 encoding=ISO-8859-1?
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
        xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
        version=2.4

        display-nameIVR Web frontend/display-name

        filter
                filter-namewicket.WicketWarp/filter-name
                
 filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
                init-param
                        param-nameapplicationClassName/param-name
                        
 param-valuecom.netdesign.codan.webadmin.WicketApplication/param-value
                /init-param

                init-param
                        param-nameconfiguration/param-name
                        param-valuedeployment/param-value
                /init-param
        /filter

        filter
                filter-namewarpPersistFilter/filter-name
                
 filter-classcom.wideplay.warp.persist.PersistenceFilter/filter-class
        /filter

        filter-mapping
                filter-namewarpPersistFilter/filter-name
                url-pattern/*/url-pattern
        /filter-mapping




        filter-mapping
                filter-namewicket.WicketWarp/filter-name
                url-pattern/*/url-pattern
        /filter-mapping


 /web-app


 2010/6/2 Igor Vaynberg igor.vaynb...@gmail.com:
 did you install warp's open entity manager in view filter *before*
 wicket's filter?

 -igor

 On Wed, Jun 2, 2010 at 5:46 AM, nino martinez wael
 nino.martinez.w...@gmail.com wrote:
 Hi I somehow think theres something wrong with the Wicket Guice proxy
 (probably only if you are using guice 2  possibly warp persist)

 Anyhow I have had to change my LDM's to this code, notice the injector
 holder in the getter method really really bad. But if not I get an
 entity manager is closed:

 public class ClassWithDao {

        public ClassWithDao() {
                InjectorHolder.getInjector().inject(this);
        }

       �...@inject
        private transient PhoneDao phoneDao;

        /**
         * This method contains a fix, should ordinary be avoided! There
 should be no need for calling the extra InjectorHolder method!
         * @return
         */
      public PhoneDao getPhoneDao() {
              InjectorHolder.getInjector().inject(this);
              return phoneDao;
      }

        public void setPhoneDao(PhoneDao phoneDao) {
                this.phoneDao = phoneDao;
        }

 Am I doing anything wrong I wonder, however the first requests are
 always working it's after something has been trough the session store
 it goes wrong..

 -regards Nino

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



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



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



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



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



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



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



strange ClassCastException in wicketstuff-push

2010-06-03 Thread Ingo Adler
Hi,

I'm trying to use wicketstuff-push in my project. I'm always getting a
ClassCastException in the wicketstuff-push sources, which I can't explain:

java.lang.ClassCastException:
org.mortbay.cometd.continuation.ContinuationBayeux cannot be cast to
org.cometd.Bayeux
 at
org.wicketstuff.push.cometd.CometdService.initBayeux(CometdService.java:172)
 at
org.wicketstuff.push.cometd.CometdService.getBayeux(CometdService.java:161)
 at
org.wicketstuff.push.cometd.CometdService.publish(CometdService.java:155)
 at org.xtoto.ui.comment.CommentPanel$3.onSubmit(CommentPanel.java:140)

My code is very similar to the example:

final ChannelEvent event = new ChannelEvent(chat);
event.addData(message, comment.getMessage());
getChannelService().publish(event); // - Line 140 in CommentPanel

I'm using the trunk of wicketstuff. The org.wicketstuff.push code
compiled perfectly.

I tried different library versions - which didn't help.

Currently I'm using

cometd-api-1.1.1
cometd-client-6.1.22
cometd-server-6.1.22

jetty-6.1.22

wicket-1.4.7

When I change the code in push a little bit, from

_bayeux = (Bayeux) _application
.getServletContext()
.getAttribute(Bayeux.ATTRIBUTE); // - line 172 in CometdService

to

ContinuationBayeux b = (ContinuationBayeux)_application
.getServletContext()
.getAttribute(Bayeux.ATTRIBUTE);

_bayeux = b;

I get a IncompatibleClassChangeError later in line:

serviceClient = _bayeux.newClient(BAYEUX_CLIENT_PREFIX);



Very strange...

Has anyone had this problem before? Any ideas?

Regards
Ingo


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



Re: Unit Test InMethod DataGrid

2010-06-03 Thread Kent Tong

Hi Ronan,

Looking at the output of WicketTester.debugComponentTrees() I can see 
that the grid row is the deepest level with a wicket id:

...
panel:storyGrid:form:bodyContainer:body:row:2:item 
com.inmethod.grid.common.AbstractGridRow


If you use http://wicketpagetest.sourceforge.net, then you can test
it easily like:

   Selenium s = ...;
   assert 
s.getText(wicket=//storyGrid//body//row[2]//item[3]).equals(foo;


In this example you're checking the the 3rd cell in the 2nd row (both
are 0-based).

--
Kent Tong
Useful news for CIO's at http://www2.cpttm.org.mo/cyberlab/cio-news

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



Re: How to test a link in wicket:links

2010-06-03 Thread Kent Tong

Hi Kent,

Thanks for the answer, but that looks like it requires Spring, I'm not using
Spring. I was hoping to use the test framework that is included in Wicket,
not go outside it. 


Well, it doesn't require you to use Spring in your code. However, it is
indeed assumed that you're using a IoC framework (eg, Spring or Guice).
Why? Only when you do, is it possible to really unit test a page,
otherwise your page will be invoking the real business logic and
database access in the tests.


I come across this doing a demo of Wicket and it kind of broke the whole
spiel about Look, you can do unittests of the GUI!! thing.


That's exactly the point. If your tests are touching the database, then
they aren't really unit tests anymore.

--
Kent Tong
Borrow IT books for free at http://www2.cpttm.org.mo/cyberlab/mslib

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