Re: jazzy spell cheker

2010-01-19 Thread Dane Laverty
I tried to use Jazzy with TinyMCE on Wicket and also couldn't get it to
work. If it helps, i got a different error when I put the english.0
dictionary file in the same package as the JazzySpellChecker class, so I
think that signifies a step in the right direction. You can see what I did
by searching the mailing list archives for a post titled TinyMCE 
Spellcheck. Good luck, and let us know if you get this figured out.

Dane


On Tue, Jan 19, 2010 at 7:22 AM, tubin gen fachh...@gmail.com wrote:

 I am trying to   use jazzy spell cheker for my app.

 I end up with this error message

 Jan 18, 2010 1:11:13 AM org.tinymce.spellchecker.TinyMCESpellCheckerServlet
 doPost
 WARNING: There is no dictionaries for the language=en
 org.tinymce.spellchecker.SpellCheckException: There is no dictionaries for
 the language=en
 inside my   i have
 web-inf/dictionary/jazzy/en-us/en-us.0
 web-inf/dictionary/jazzy/global/global.0
 what more do I need ?



Finding output from WicketTester

2010-01-15 Thread Dane Laverty
A while back I added basic WicketTester rendering tests for each of my
pages. They have been great for discovering problems, but not so great for
telling me what those problems are. My tests are of the most basic kind:



tester.startPage(MyPage.*class*);

tester.assertRenderedPage(MyPage.*class*);


When a test fails, though, the only feedback I get is:


junit.framework.AssertionFailedError: expected:MyPage but was:ErrorPage
[stack trace follows]

I understand that MyPage threw an exception, resulting in ErrorPage at the
assert step. What I don't know is how I can get the error that was thrown. I
tried removing my RequestCycle's onRuntimeException(), but then I just get
an equally useless stack trace that tells me:


...at
edu.chemeketa.foodhandler.webapp.TestMyPage.testRenderMyPage(TestMyPage.java:58)


I know that WicketTester is great, so I'm assuming that the problem is on my
end. Is there a simple way of printing out the exceptions that occur during
a WicketTester test run?


thanks,


Dane


Re: page without class

2009-11-13 Thread Dane Laverty
I believe you can do this if you change the Wicket filter mapping in your
web.xml to something other than /*. Then Tomcat will serve the page and
bypass Wicket entirely.

Dane


On Fri, Nov 13, 2009 at 8:36 AM, fachhoch fachh...@gmail.com wrote:


 Ok I have to tell that page to my IApplicationSettings

IApplicationSettings settings=
 super.getApplicationSettings();
settings.setAccessDeniedPage(accessDeniedPage)
 here accessDeniedPage page is a static html page and I dont need java .
  I am talking about a wicket page without a class  just html  is it
 possible
 ?



 Pedro H. O. dos Santos wrote:
 
  Only put then on top-level directory of a web module.
  http://java.sun.com/javaee/5/docs/tutorial/doc/bnadx.html#bnadz
 
  On Fri, Nov 13, 2009 at 1:21 PM, tubin gen fachh...@gmail.com wrote:
 
  can I create a page just with html  and not write class ? I need some
  static
  html pages and writing java for those will be of no use .
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 
 

 --
 View this message in context:
 http://old.nabble.com/page-without-class-tp26338268p26339453.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: AjaxFallbackLink problem on Internet Explorer 6

2009-10-23 Thread Dane Laverty
Yeah, now that I look at it again, that would throw an error. Instead of
showAllLink.setOutputMarkupId(true), it needs
showAllSpan.setOutputMarkupId(true) and
showMineSpan.setOutputMarkupId(true).

When you make display changes in an Ajax method, Wicket updates the Java
objects' attributes, but the HTML on the page doesn't know that it needs to
change. In order to tell the HTML components to change, they need to be
added to the target (as you've done here). However, Wicket can only identify
the correct HTML components if their ID attributes are set, which we
accomplish through setOutputMarkupId(true).

For those same reasons, I doubt that calling
replacement.setOutputMarkupId(true) will do anything for you inside of the
Ajax call, since the Wicket can't set its ID value unless it already knows
its ID value (kind of a circular problem). That's why you need to call
setOutputMarkupId(true) for any Ajax-updatable objects in the initial page
rendering (say, in the constructor).

Dane

On Thu, Oct 22, 2009 at 10:03 PM, Swarnim Ranjitkar swarn...@hotmail.comwrote:


 Thank you for you suggestion. It didn't really work. Looks like the
 setvisible inside  onclick doesn't work . Here is the code that I have
  //this.replaceWith(replacement);
replacement.setOutputMarkupId(true);
datatable.replaceWith(replacement);
showMineSpan.setVisible(true);
showAllSpan.setVisible(false);
 showMineSpan.setOutputMarkupId(true);
showAllSpan.setOutputMarkupId(true);
 target.addComponent(showMineSpan);
target.addComponent(showAllSpan);
 target.addComponent(replacement);

}
};
showAllLink.setOutputMarkupId(true);



  Date: Thu, 22 Oct 2009 18:05:46 -0700
  Subject: Re: AjaxFallbackLink problem on Internet Explorer 6
  From: danelave...@gmail.com
  To: users@wicket.apache.org
 
  You need to add the spans to the target in onClick, and the links need to
  have their outputMarkupId set to true, as follows (I've added the ***
  lines):
 
  final Link showMineLink =new AjaxFallbackLink(trafficreportlistmine) {
public void onClick(AjaxRequestTarget target) {
   AjaxFallbackDefaultDataTable replacement = new
  AjaxFallbackDefaultDataTable(trafficreportlistdatatable, columns, new
  ReportListProvider(Traffic, mine), 8);
  //this.replaceWith(replacement);
  replacement.setOutputMarkupId(true);
  datatable.replaceWith(replacement);
  showMineSpan.setVisible(true);
  showAllSpan.setVisible(false);
  target.addComponent(replacement);
  ***target.addComponent(showMineSpan);
  ***target.addComponent(showAllSpan);
}
  };
  *** showMineLink.setOutputMarkupId(true);
 
  Then do the same with the other link.
 
  Dane
 
 
  On Thu, Oct 22, 2009 at 4:42 PM, wicketnewuser swarn...@hotmail.com
 wrote:
 
  
   It's suppose to hide Show All and show Show Mine when I click on Show
 All
   but
   that doesn't happen. on the onclick of showmine it is supposed to be
  showMineSpan.setVisible(false);
  showAllSpan.setVisible(true);
   instead of  what I listed earlier as
   showMineSpan.setVisible(true);
  showAllSpan.setVisible(false);
  
  
   wicketnewuser wrote:
   
Hi tried to follow this and having problem with it . Could someone
 please
let me know what I'm doing wrong
Here is the code
package com.swishmark.tugboat;
   
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
   
import org.apache.wicket.PageParameters;
import org.apache.wicket.Session;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
import
   
  
 org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import
   
  
 org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import
   
  
 org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
   
import com.swishmark.tugboat.util.DateTimePropertyColumn;
import com.swishmark.tugboat.util.LinkPropertyColumn;
import com.swishmark.tugboat.util.ReportListProvider;
import com.swishmark.tugboat.util.TugboatReport;
   
//
 

Re: AjaxFallbackLink problem on Internet Explorer 6

2009-10-22 Thread Dane Laverty
You need to add the spans to the target in onClick, and the links need to
have their outputMarkupId set to true, as follows (I've added the ***
lines):

final Link showMineLink =new AjaxFallbackLink(trafficreportlistmine) {
  public void onClick(AjaxRequestTarget target) {
 AjaxFallbackDefaultDataTable replacement = new
AjaxFallbackDefaultDataTable(trafficreportlistdatatable, columns, new
ReportListProvider(Traffic, mine), 8);
//this.replaceWith(replacement);
replacement.setOutputMarkupId(true);
datatable.replaceWith(replacement);
showMineSpan.setVisible(true);
showAllSpan.setVisible(false);
target.addComponent(replacement);
***target.addComponent(showMineSpan);
***target.addComponent(showAllSpan);
  }
};
*** showMineLink.setOutputMarkupId(true);

Then do the same with the other link.

Dane


On Thu, Oct 22, 2009 at 4:42 PM, wicketnewuser swarn...@hotmail.com wrote:


 It's suppose to hide Show All and show Show Mine when I click on Show All
 but
 that doesn't happen. on the onclick of showmine it is supposed to be
showMineSpan.setVisible(false);
showAllSpan.setVisible(true);
 instead of  what I listed earlier as
 showMineSpan.setVisible(true);
showAllSpan.setVisible(false);


 wicketnewuser wrote:
 
  Hi tried to follow this and having problem with it . Could someone please
  let me know what I'm doing wrong
  Here is the code
  package com.swishmark.tugboat;
 
  import java.util.ArrayList;
  import java.util.HashMap;
  import java.util.List;
 
  import org.apache.wicket.PageParameters;
  import org.apache.wicket.Session;
  import org.apache.wicket.markup.html.WebMarkupContainer;
  import org.apache.wicket.markup.html.basic.Label;
  import org.apache.wicket.markup.html.link.Link;
  import org.apache.wicket.markup.html.panel.Panel;
  import org.apache.wicket.markup.repeater.Item;
  import org.apache.wicket.ajax.AjaxRequestTarget;
  import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
  import
 
 org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
  import
 
 org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
  import
  org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
  import
 
 org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
  import org.apache.wicket.model.IModel;
  import org.apache.wicket.model.Model;
 
  import com.swishmark.tugboat.util.DateTimePropertyColumn;
  import com.swishmark.tugboat.util.LinkPropertyColumn;
  import com.swishmark.tugboat.util.ReportListProvider;
  import com.swishmark.tugboat.util.TugboatReport;
 
  // http://cwiki.apache.org/WICKET/simple-sortable-datatable-example.html
  // AJAX:
 
 http://www.wicket-library.com/wicket-examples/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.AjaxDataTablePage
 
  public class TrafficReportListPanel extends Panel {
 
Integer contactId;
 
public TrafficReportListPanel(String id, final String include) {
super(id);
 
final ListIColumn? columns = new
 ArrayListIColumn?();
 
columns.add(new PropertyColumn(new Model(Report ID),
 reportId,
  reportId));
columns.add(new PropertyColumn(new Model(Contact Name),
 contactName,
  contactName));
 
  //
 http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg16575.html
if (include != null  include.equals(running)){
columns.add(new PropertyColumn(new Model(Report
 Name), reportName,
  reportName));
} else {
columns.add(new LinkPropertyColumn(new Model(Report
 Name),
  reportName, reportName) {
 
@Override
public void onClick(Item item, String componentId,
 IModel model) {
 HashMapString, Integer params = new
 HashMapString, Integer();
 TugboatReport selectedReport =
 (TugboatReport) model.getObject();
 params.put(reportId,
 selectedReport.getReportId());
 
 
 setResponsePage( ReportResultsPage.class,
 new
  PageParameters(params));
 
}
 
  });
}
columns.add(new DateTimePropertyColumn(new Model(Start
 Time),
  startTime, startTime));
columns.add(new DateTimePropertyColumn(new Model(End
 Time), endTime,
  endTime));
columns.add(new PropertyColumn(new Model(Duration),
 duration,
  duration));
 
 
final AjaxFallbackDefaultDataTable datatable = new
  AjaxFallbackDefaultDataTable(trafficreportlistdatatable, columns, new
  ReportListProvider(Traffic, include), 8);
add(datatable);
final WebMarkupContainer 

Ongoing Erractic Form Submit Issue

2009-10-14 Thread Dane Laverty
I've built several Wicket apps for the college where I work. 95% of the time
they work great, but I get frequent complaints about form submits not
functioning correctly. In those cases the form processing code in onSubmit
doesn't appear to be running.

I can't reproduce the error, but the reports are consistent enough that I
believe something isn't right. I've combed through the code up and down, but
can't find any issues. Has anyone else experienced this, and if so, how have
you solved it?

thanks,

Dane


Re: Ongoing Erractic Form Submit Issue

2009-10-14 Thread Dane Laverty
I hadn't implemented onError. Thanks for pointing that out. Now that I added
onError, I discovered that ModalWindow doesn't automatically scroll to the
top to display messages on an error. I also discovered that placing a
FeedbackPanel into the ModalWindow directly won't display messages --
instead I had to wrap the FeedbackPanel in a WebMarkupContainer.

In case anyone else needs to get their Modal Window to scroll up, here is
the solution I used:

  IndicatingAjaxButton submitLink = new
IndicatingAjaxButton(submitLink, MyForm.this) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form?
form) {
...
}

@Override
protected void onError(AjaxRequestTarget target, Form?
form) {
...
}

@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence
decorateOnSuccessScript(CharSequence script) {
return  $('# +
MyModalWindowPanel.this.getMarkupId() + ').parent().attr('scrollTop', '0');
 + script;
}
};
}
};
add(submitLink);


On Wed, Oct 14, 2009 at 11:40 AM, Pedro Santos pedros...@gmail.com wrote:

 Did you implement the onError method too? Maybe you has an form without an
 feedback panel, and some form component don't pass by validations. On that
 case the onSubmit method don't get called, for example.

 On Wed, Oct 14, 2009 at 3:34 PM, Dane Laverty danelave...@gmail.com
 wrote:

  I've built several Wicket apps for the college where I work. 95% of the
  time
  they work great, but I get frequent complaints about form submits not
  functioning correctly. In those cases the form processing code in
 onSubmit
  doesn't appear to be running.
 
  I can't reproduce the error, but the reports are consistent enough that I
  believe something isn't right. I've combed through the code up and down,
  but
  can't find any issues. Has anyone else experienced this, and if so, how
  have
  you solved it?
 
  thanks,
 
  Dane
 



 --
 Pedro Henrique Oliveira dos Santos



Re: [tinymce] problem adding/removing TinyMceBehavior dinamically

2009-10-09 Thread Dane Laverty
Did you get the
response.renderJavascriptReference(TinyMCESettings.javaScriptReference()); ?

In my code it goes like this (as per
http://wicketbyexample.com/wicket-tinymce-some-advanced-tips/):

add(new HeaderContributor(new IHeaderContributor() {
 public void renderHead(IHeaderResponse response) {

response.renderJavascriptReference(TinyMCESettings.javaScriptReference());
 }
}));

Dane

On Fri, Oct 9, 2009 at 10:17 AM, Daniele Dellafiore ilde...@gmail.comwrote:

 I start from the end: I need fine control over the order javascript is
 executed. What is the javascript to call a refresh on a component like
 is done when I use target.addComponent()?


 From the start.
 I make that work with bgooren suggestion, using the javascript to
 remove the editor. No need to remove the behavior on java side. That
 works for the checkbox that dynamically adds and removes the Rich
 Editor.

 Now, the problem on refreshing a list of fields.
 What happens: to add a new field, click on ADD and I add my ListView
 is added to be refreshed via a target.addComponent(). In doing this,
 the markupId of the component changes, so tinyMce lose reference to
 it's existing editors.

 My solution: on the ADD callback, I remove the editors and let them be
 re-added during repainting. Works? NO!
 Why? because the listView is repainted before the mceControlRemove is
 executed, even if they are added to the same AjaxRequestTarget in the
 ADD callback. So happens that:
 1.  the remove fails because the old component is found no more
 2. after, the submit fails because tinyMCE still have the old editor
 reference.

 -- ;(

 On Mon, Oct 5, 2009 at 11:44 AM, Daniele Dellafiore ilde...@gmail.com
 wrote:
  Hey Bas, thanks for answering.
 
  Unfortunately it does not work.
  Even if I run:
 
String removeEditor =
 tinyMCE.execCommand('mceRemoveControl',
  false, '
   + propertyPanel.getValueMarkupId() + ');;
 target.appendJavascript(removeEditor);
 
  or simply remove the TinyMceBehavior from my TextField, the result is the
  same: mce editor disappear correclty, but remains in tinyMCE.editors list
 so
  Tiny tries to process it in a successive iteration.
 
  I try to find help on tinyMCE forum
 
 
  On Mon, Oct 5, 2009 at 10:59 AM, bgooren b...@iswd.nl wrote:
 
  I'll show you some parts of my code so you get an idea of how I do
 things.
 
  First of all, I have used AjaxEditableLabel from wicket-extensions as a
  starting point.
  TinyMCE's javascripts should always be loaded:
 
  // Preload TinyMCE
 add( new AbstractBehavior()
 {
 
 @Override
 public void renderHead( IHeaderResponse response )
 {
 if( !tinyMCELoaded )
 {
 response.renderJavascriptReference(
  TinyMCESettings.javaScriptReference() );
 
 settings = buildTinyMCESettings();
 
 tinyMCELoaded = true;
 }
 }
 
 } );
 
  In my case TinyMCE is loaded through an AJAX call:
 
  @SuppressWarnings(unchecked)
 @Override
 protected void onEdit( AjaxRequestTarget target )
 {
 super.onEdit( target );
 
 final String id = editor.getMarkupId( true );
 final StringBuilder buf = new StringBuilder();
 
 // Load plugins
 buf.append( settings.getLoadPluginJavaScript() ).append( ;\n );
 
 // Initialize tinyMCE
 buf.append( tinyMCE.init({ ).append( settings.toJavaScript(
  Mode.none, Collections.EMPTY_LIST ) ).append(  });\n );
 buf.append( settings.getAdditionalPluginJavaScript() ).append(
  ;\n
  );
 
 // Setup editor
 buf.append( tinyMCE.execCommand('mceAddControl',true,'
 ).append(
  id ).append( '); );
 
 // Request focus on editor
 buf.append( setTimeout( function()
  {tinyMCE.execCommand('mceFocus',true,' ).append( id ).append( ');},
 500
  ); );
 
 target.appendJavascript( buf.toString() );
 }
 
  As you can see I initialize TinyMCE, and then perform an mceAddControl
  command on the textarea I want to convert to a TinyMCE editor.
 
  Finally, I need to switch back to a textarea before unloading, so the
  correct contents are POSTed. To do so, I have added an AjaxCallDecorator
  to
  the close request, and allow implementations to override it:
 
  @Override
 protected IAjaxCallDecorator getCloseDecorator()
 {
 return new AjaxCallDecorator()
 {
 
 @Override
 public CharSequence decorateScript( CharSequence script )
 {
 return tinyMCE.execCommand('mceRemoveControl', false, '
 +
  editor.getMarkupId() + '); 
 + super.decorateOnSuccessScript( script );
 
 // Call to save contents back to textarea
 // return tinyMCE.get(' + editor.getMarkupId() +
  ').save();  +
 // 

Re: TinyMCE Spellcheck

2009-10-09 Thread Dane Laverty
I've made a little progress toward getting the spell checker working. In my
TinyMCESettings I've added:

tinyMCESettings.addCustomSetting(spellchecker_rpc_url : \someURL\);

That takes care of the alert, but now I need to know what URL I'm supposed
to put there. The SpellCheckPlugin class has the following code:

private static final String resourceKey =
tiny_mce/plugins/spellchecker/tinyspell.php;
...
Application.get().getSharedResources().add(TinyMceBehavior.class,
resourceKey, null, null,
new JazzySpellChecker());

So my guess is that I need to have spellchecker_rpc_url hit the URL of the
SharedResource added above. When I debug the app, the line

WicketApplication.get().getSharedResources().get(TinyMceBehavior.class,
tiny_mce/plugins/spellchecker/tinyspell.php, null, null, true)

does return the JazzySpellChecker, so I hoped that the following crazy line
would get me the URL:

WicketRequestCycle.get().urlFor(new
ResourceStreamRequestTarget(WicketApplication.get().getSharedResources().get(TinyMceBehavior.class,
tiny_mce/plugins/spellchecker/tinyspell.php, null, null,
true).getResourceStream()))

However, that just gives me null.

I feel like I must be making this more difficult than it should be. Nothing
I've seen anywhere mentions setting the spellchecker_rpc_url. Is there an
easier way to do this?

thanks,

Dane

On Thu, Oct 8, 2009 at 6:24 PM, Dane Laverty danelave...@gmail.com wrote:

 I've added TinyMCE to my application, but I can't get the spellchecker to
 work. When I click the button, I get a JavaScript alert that says, Please
 specify: spellchecker_rpc_url. I checked it out in the example application,
 but I get the same error there. I've installed the Jazzy spell checker, but
 apparently I need something else as well. Has anyone gotten this to work?



TinyMCE Spellcheck

2009-10-08 Thread Dane Laverty
I've added TinyMCE to my application, but I can't get the spellchecker to
work. When I click the button, I get a JavaScript alert that says, Please
specify: spellchecker_rpc_url. I checked it out in the example application,
but I get the same error there. I've installed the Jazzy spell checker, but
apparently I need something else as well. Has anyone gotten this to work?


Re: How do you achieve persistency

2009-10-06 Thread Dane Laverty
I've just finished up my first Wicket + ORM project. I knew nothing
about ORM when I started, so I decided to go with Hibernate since it
seems to be the most commonly used. It was both painful and
educational.

My only suggestion is to suck it up and put in the effort it will take
to learn it. I'm by no means an expert at it (and trying to figure out
the complicated bits still makes me want to scream), but it works and
I can see that learning it well would save me a lot of time and effort
in larger projects in the future.

Dane


On Tue, Oct 6, 2009 at 9:47 AM, James Perry
james.austin.pe...@gmail.com wrote:
 There are many ways to skin a cat. Personally I like to use machine code to
 give it a slow, painful death.
 Best,
 James.

 On Tue, Oct 6, 2009 at 4:42 PM, James Carman
 jcar...@carmanconsulting.comwrote:

 On Tue, Oct 6, 2009 at 11:05 AM, James Perry
 james.austin.pe...@gmail.com wrote:
  On a more serious note then perhaps just using raw JDBC if you are unsure
 of
  ORM concepts.
 

 Isn't that kind of like saying I suggest you walk everywhere you want
 to go if you're unfamiliar with how to drive a car?

 -
 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: Complicated workflows

2009-09-29 Thread Dane Laverty
If you're using Spring, the dependency injection issue for
non-component items can be solved by adding the following line to the
object's constructor:

InjectorHolder.getInjector().inject(this);

where InjectorHolder is org.apache.wicket.injection.web.InjectorHolder
. I'm afraid I don't have any advice to offer you on the rest of it,
except that it sounds like a good work and I hope you can get it doing
what you need :)

Dane

On Tue, Sep 29, 2009 at 2:11 PM, Phil Housley undeconstruc...@gmail.com wrote:
 Hello list,

 I'm currently working on some ideas for building apps with fairly
 complex workflows.  My aim is to find a nice pattern/framework for
 building apps where each unit of work involves many panels, several
 forms, lots of decisions and so on.  In particular I'm aiming at apps
 where you need to be very confident about exactly what is happening,
 so very strict control of actions, being careful of multiple
 renderings of a page each trying to change the server data, and so on.
  Also, I'm wondering about some options for declarative building of
 workflows out of existing tasks.

 My current design involves running from a special page, which
 maintains a stack of tasks.  One type of task is a Workflow, which can
 be configured to automatically spawn subtasks as required, based on
 the result of previous tasks.  Another type of task is based on a
 panel, and is able to cause itself to be rendered.  The stack
 processor makes sure that each task is invoked at the right time, that
 a task can render if it is at the top of the stack, that only the top
 of the stack can be invoked from a form and so on.

 This is working ok for some silly demo cases, but there are various
 issues.  For example, any task that is not also a component cannot
 access dependency injection, or set error messages and so on.  I'm not
 sure how to get around this at the moment, as I don't want to force
 every task to be a component, when many will likely have no cause to
 ever be rendered.

 So, the reason I'm posting is to ask mainly two things:

 1) Is this of interest to anyone else?  All the code is my own, so
 I'll open source it if there seems to be some future in it.

 2) If so, does anyone have any comments on my current design?  Clearly
 there are problems with it, but should I carry on trying to find ways
 to work around them, or does the whole thing sounds like so much
 crack?

 Thanks,

 --
 Phil Housley

 -
 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: Maven eclipse plugin

2009-09-23 Thread Dane Laverty
What do you mean after created the pom? If you're following the guide
here,
http://cwiki.apache.org/WICKET/windows-guide-to-installing-wicket-on-eclipse-with-maven.html,
you shouldn't have to create the pom manually. The mvn
archetype:create
command will do that for you.

Dane

On Wed, Sep 23, 2009 at 8:00 AM, Anantha Kumaran
ananthakuma...@gmail.comwrote:

 hi i am new to eclipse and maven
 i followed the wicket wiki  to create a new wicket project

 after created the pom i try to create the project using the eclipse plugin
 (mvn eclipse:eclipse)
 i got the following error

 [INFO] Scanning for projects...
 [INFO]
 
 [INFO] Building quickstart
 [INFO]task-segment: [eclipse:eclipse]
 [INFO]
 
 [INFO] Preparing eclipse:eclipse
 [INFO] No goals needed for project - skipping
 [INFO] [eclipse:eclipse {execution: default-cli}]
 [FATAL ERROR] org.apache.maven.plugin.eclipse.EclipsePlugin#execute()
 caused
 a l
 inkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check
 the
 realms:
 [FATAL ERROR] Plugin realm =
 app0.child-container[org.apache.maven.plugins:maven
 -eclipse-plugin:2.5.1]
 urls[0] =
 file:/C:/Users/Ananth/.m2/repository/org/apache/maven/plugins/maven-ec
 lipse-plugin/2.5.1/maven-eclipse-plugin-2.5.1.jar
 urls[1] =
 file:/C:/Users/Ananth/.m2/repository/org/codehaus/plexus/plexus-archiv
 er/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
 urls[2] =
 file:/C:/Users/Ananth/.m2/repository/org/codehaus/plexus/plexus-utils/
 1.4.5/plexus-utils-1.4.5.jar
 urls[3] =
 file:/C:/Users/Ananth/.m2/repository/org/codehaus/plexus/plexus-intera
 ctivity-jline/1.0-alpha-5/plexus-interactivity-jline-1.0-alpha-5.jar
 urls[4] =
 file:/C:/Users/Ananth/.m2/repository/jline/jline/0.9.1/jline-0.9.1.jar

 urls[5] =
 file:/C:/Users/Ananth/.m2/repository/org/apache/maven/maven-archiver/2
 .2/maven-archiver-2.2.jar
 urls[6] =
 file:/C:/Users/Ananth/.m2/repository/org/codehaus/plexus/plexus-resour
 ces/1.0-alpha-4/plexus-resources-1.0-alpha-4.jar
 urls[7] =
 file:/C:/Users/Ananth/.m2/repository/biz/aQute/bndlib/0.0.145/bndlib-0
 .0.145.jar
 urls[8] =
 file:/C:/Users/Ananth/.m2/repository/org/apache/maven/shared/maven-osg
 i/0.2.0/maven-osgi-0.2.0.jar
 urls[9] =
 file:/C:/Users/Ananth/.m2/repository/org/eclipse/core/resources/3.3.0-
 v20070604/resources-3.3.0-v20070604.jar
 [FATAL ERROR] Container realm = plexus.core
 urls[0] = file:/D:/Program Files/Apache Software
 Foundation/apache-maven-2.2.0/l
 ib/maven-2.2.0-uber.jar
 [INFO]
 
 [ERROR] FATAL ERROR
 [INFO]
 
 [INFO] org/eclipse/core/internal/localstore/SafeChunkyInputStream
 org.eclipse.core.internal.localstore.SafeChunkyInputStream
 [INFO]
 
 [INFO] Trace
 java.lang.NoClassDefFoundError:
 org/eclipse/core/internal/localstore/SafeChunkyI
 nputStream
at
 org.apache.maven.plugin.eclipse.EclipsePlugin.getWorkspaceConfigurati
 on(EclipsePlugin.java:1473)
at
 org.apache.maven.plugin.eclipse.EclipsePlugin.fillDefaultClasspathCon
 tainers(EclipsePlugin.java:1222)
at
 org.apache.maven.plugin.eclipse.EclipsePlugin.setup(EclipsePlugin.jav
 a:753)
at
 org.apache.maven.plugin.ide.AbstractIdeSupportMojo.execute(AbstractId
 eSupportMojo.java:483)
at
 org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
 nManager.java:483)
at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
 ultLifecycleExecutor.java:678)
at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
 Goal(DefaultLifecycleExecutor.java:553)
at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
 ltLifecycleExecutor.java:523)
at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
 dleFailures(DefaultLifecycleExecutor.java:371)
at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
 ts(DefaultLifecycleExecutor.java:332)
at
 org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
 fecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
 org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
 1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
 java:39)
at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
 sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
 

Re: Wicket integration with jQuery

2009-09-14 Thread Dane Laverty
+1 for WiQuery, although I haven't tried jWicket.


On Sat, Sep 12, 2009 at 4:12 AM, jWeekend jweekend_for...@cabouge.comwrote:


 I may not be totally unbiased as we're involved in the project but jWeekend
 uses WiQuery, including on client applications, and can recommend it.

 Regards - Cemal
 jWeekend
 OO  Java Technologies, Wicket Training and Development
 http://jWeekend.com


 danisevsky danisevsky wrote:
 
  Hello folks. I would like to use some Wicket integration with jQuery. But
  I
  found several implementations (WickeXt, wiquery and in wicket-stuff
  jwicket
  and jquery) and I do not know which one is the best. Could someone give
 me
  an advise?
 
  Thanks
 
 

 --
 View this message in context:
 http://www.nabble.com/Wicket-integration-with-jQuery-tp25408781p25413545.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




FeedbackPanel not displaying in IE6

2009-09-01 Thread Dane Laverty
The FeedbackPanel on my site is not displaying in IE6, unless the user
minimizes and restores the browser window. I would imagine other Wicket
developers have run into this, but I don't see anything about in in the
archives. Does anyone have a solution?

Dane


Re: FeedbackPanel not displaying in IE6

2009-09-01 Thread Dane Laverty
Good call. Looks like it's a Peek-a-boo bug (
http://www.positioniseverything.net/explorer/peekaboo.html ). Sometimes I
get so excited about my Java work that I forget my basic HTML and CSS
pitfalls.

Dane


On Tue, Sep 1, 2009 at 11:57 AM, Matej Knopp matej.kn...@gmail.com wrote:

 This is most likely related to your styling. Wicket only generates
 simple ul/li markup that shouldn't trigger any IE6 bugs.

 -Matej

 On Tue, Sep 1, 2009 at 8:51 PM, Dane Lavertydanelave...@gmail.com wrote:
  The FeedbackPanel on my site is not displaying in IE6, unless the user
  minimizes and restores the browser window. I would imagine other Wicket
  developers have run into this, but I don't see anything about in in the
  archives. Does anyone have a solution?
 
  Dane
 

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




Re: Quick model/user/session question

2009-08-31 Thread Dane Laverty
Thanks James and Igor for looking it over. Switching the order of the filter
definitions didn't make a difference. If it helps, here's what I'm doing:

1 - This is the UserInfo class. As far as this test case is concerned, it
has an ID and a SetString to check lazy loading. I've commented out the
FetchType.EAGER to test the OSIV. When it is uncommented, the UserPage (#2,
below) renders correctly, otherwise I get a lazy load exception.

@Entity
@Table(name = zjp_user_accounts)
public class UserInfo extends PersonInfo {
@Id
Long id;

@OneToMany(mappedBy=employerInfo /*, fetch=FetchType.EAGER*/)
SetString postedJobs;
...
}


2 - UserPage is the page I'm using to test lazy loading.

public class UserPage extends WebPage {
@SpringBean(name = personInfoDao)
private PersonInfoDao personInfoDao;

public UserPage() {

EntityModelPersonInfo personInfoModel = new
EntityModelPersonInfo(UserInfo.class, new Long(1));

EmployerInfo personInfo = (EmployerInfo)personInfoModel.getObject();
SetString jobs = personInfo.getPostedJobs();
IteratorString itr = jobs.iterator();
while (itr.hasNext()) {
System.out.println(itr.next());
}
}
}


3 - And this is the EntityModel, based on the Smart EntityModel article -
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/

public class EntityModelT extends Identifiable? extends
AbstractEntityModelT {

@SpringBean(name = entityDao)
private EntityDao dao;

public EntityModel(Class clazz, Serializable id) {
super(clazz, id);
// This makes the class Spring-aware, so we can inject the DAOs, as
above
InjectorHolder.getInjector().inject(this);
}

@Override
protected T load(Class clazz, Serializable id) {
return (T)dao.get(clazz, (Long)id);
};
}


I'd be happy to supply more code (xml files, etc.) if it would be useful. I
feel that this is about as simple a use case as I can create for the issue.
Thanks again for all your help!

Dane



On Sat, Aug 29, 2009 at 7:41 AM, James Carman ja...@carmanconsulting.comwrote:

 Aren't they chained based on the order of the filter mapping definitions,
 not the order of the filter definitions?

 On Aug 29, 2009 12:40 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:

 filters are executed in the order they are defined, so put the osiv
 filter declaration before wicket.

 -igor

 On Thu, Aug 27, 2009 at 8:08 AM, Dane Lavertydanelave...@gmail.com
 wrote:
  Thanks for the sugges...



Re: Quick model/user/session question

2009-08-31 Thread Dane Laverty
Here's the output on startup. The OSIV is being loaded before the
WicketFilter, and when I set breakpoints I can see that the
OpenSessionInViewFilter is being hit first on each request. I'm turning the
project into a QuickStart and will attach it to a JIRA issue.

DEBUG main org.mortbay.log - loaded class
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter from
sun.misc.launcher$appclassloa...@1a7bf11
DEBUG main org.mortbay.log - Holding class
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
DEBUG main
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter -
Initializing filter 'open.hibernate.session.in.view'
DEBUG main
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter - Filter
'open.hibernate.session.in.view' configured successfully
DEBUG main org.mortbay.log - started open.hibernate.session.in.view
DEBUG main org.mortbay.log - loaded class
org.apache.wicket.protocol.http.WicketFilter from
sun.misc.launcher$appclassloa...@1a7bf11
DEBUG main org.mortbay.log - Holding class
org.apache.wicket.protocol.http.WicketFilter
DEBUG main org.mortbay.log - loaded class
org.apache.wicket.spring.SpringWebApplicationFactory from
sun.misc.launcher$appclassloa...@1a7bf11
DEBUG main
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Returning cached instance of singleton bean 'wicketApplication'


Dane


On Mon, Aug 31, 2009 at 9:14 AM, James Carman
jcar...@carmanconsulting.comwrote:

 Or, you can turn on spring logging to see it opening the session.

 On Mon, Aug 31, 2009 at 10:56 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:

  doesnt look like your osiv is working. you can create a wicket
  quickstart project and attach it to a jira issue if you want someone
  to take a look at it. other then that you can use the debugger to see
  if osiv is actually being hit *before* the wicket filter.
 
  -igor
 
  On Mon, Aug 31, 2009 at 7:50 AM, Dane Lavertydanelave...@gmail.com
  wrote:
   Thanks James and Igor for looking it over. Switching the order of the
  filter
   definitions didn't make a difference. If it helps, here's what I'm
 doing:
  
   1 - This is the UserInfo class. As far as this test case is concerned,
 it
   has an ID and a SetString to check lazy loading. I've commented out
 the
   FetchType.EAGER to test the OSIV. When it is uncommented, the UserPage
  (#2,
   below) renders correctly, otherwise I get a lazy load exception.
  
   @Entity
   @Table(name = zjp_user_accounts)
   public class UserInfo extends PersonInfo {
  @Id
  Long id;
  
  @OneToMany(mappedBy=employerInfo /*, fetch=FetchType.EAGER*/)
  SetString postedJobs;
  ...
   }
  
  
   2 - UserPage is the page I'm using to test lazy loading.
  
   public class UserPage extends WebPage {
  @SpringBean(name = personInfoDao)
  private PersonInfoDao personInfoDao;
  
  public UserPage() {
  
  EntityModelPersonInfo personInfoModel = new
   EntityModelPersonInfo(UserInfo.class, new Long(1));
  
  EmployerInfo personInfo =
  (EmployerInfo)personInfoModel.getObject();
  SetString jobs = personInfo.getPostedJobs();
  IteratorString itr = jobs.iterator();
  while (itr.hasNext()) {
  System.out.println(itr.next());
  }
  }
   }
  
  
   3 - And this is the EntityModel, based on the Smart EntityModel article
 -
   http://wicketinaction.com/2008/09/building-a-smart-entitymodel/
  
   public class EntityModelT extends Identifiable? extends
   AbstractEntityModelT {
  
  @SpringBean(name = entityDao)
  private EntityDao dao;
  
  public EntityModel(Class clazz, Serializable id) {
  super(clazz, id);
  // This makes the class Spring-aware, so we can inject the DAOs,
  as
   above
  InjectorHolder.getInjector().inject(this);
  }
  
  @Override
  protected T load(Class clazz, Serializable id) {
  return (T)dao.get(clazz, (Long)id);
  };
   }
  
  
   I'd be happy to supply more code (xml files, etc.) if it would be
 useful.
  I
   feel that this is about as simple a use case as I can create for the
  issue.
   Thanks again for all your help!
  
   Dane
  
  
  
   On Sat, Aug 29, 2009 at 7:41 AM, James Carman 
  ja...@carmanconsulting.comwrote:
  
   Aren't they chained based on the order of the filter mapping
  definitions,
   not the order of the filter definitions?
  
   On Aug 29, 2009 12:40 AM, Igor Vaynberg igor.vaynb...@gmail.com
  wrote:
  
   filters are executed in the order they are defined, so put the osiv
   filter declaration before wicket.
  
   -igor
  
   On Thu, Aug 27, 2009 at 8:08 AM, Dane Lavertydanelave...@gmail.com
   wrote:
Thanks for the sugges...
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: Quick model/user/session question

2009-08-31 Thread Dane Laverty
: [edu.chemeketa.careerconnect.model.EmployerInfo#250]
TRACE btpool0-4 - /view-jobs
org.hibernate.persister.entity.AbstractEntityPersister - Fetching entity:
[edu.chemeketa.careerconnect.model.EmployerInfo#250]
DEBUG btpool0-4 - /view-jobs org.hibernate.loader.Loader - loading entity:
[edu.chemeketa.careerconnect.model.EmployerInfo#250]
DEBUG btpool0-4 - /view-jobs org.hibernate.jdbc.AbstractBatcher - about to
open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG btpool0-4 - /view-jobs org.hibernate.jdbc.ConnectionManager - opening
JDBC connection
DEBUG btpool0-4 - /view-jobs org.hibernate.SQL - select
employerin0_.employer_account_id... // Rest of query here
...


On Mon, Aug 31, 2009 at 9:43 AM, James Carman
jcar...@carmanconsulting.comwrote:

 You need the output from Spring classes during a request, not during
 application startup.

 On Mon, Aug 31, 2009 at 12:39 PM, Dane Laverty danelave...@gmail.com
 wrote:

  Here's the output on startup. The OSIV is being loaded before the
  WicketFilter, and when I set breakpoints I can see that the
  OpenSessionInViewFilter is being hit first on each request. I'm turning
 the
  project into a QuickStart and will attach it to a JIRA issue.
 
  DEBUG main org.mortbay.log - loaded class
  org.springframework.orm.hibernate3.support.OpenSessionInViewFilter from
  sun.misc.launcher$appclassloa...@1a7bf11
  DEBUG main org.mortbay.log - Holding class
  org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
  DEBUG main
  org.springframework.orm.hibernate3.support.OpenSessionInViewFilter -
  Initializing filter 'open.hibernate.session.in.view'
  DEBUG main
  org.springframework.orm.hibernate3.support.OpenSessionInViewFilter -
 Filter
  'open.hibernate.session.in.view' configured successfully
  DEBUG main org.mortbay.log - started open.hibernate.session.in.view
  DEBUG main org.mortbay.log - loaded class
  org.apache.wicket.protocol.http.WicketFilter from
  sun.misc.launcher$appclassloa...@1a7bf11
  DEBUG main org.mortbay.log - Holding class
  org.apache.wicket.protocol.http.WicketFilter
  DEBUG main org.mortbay.log - loaded class
  org.apache.wicket.spring.SpringWebApplicationFactory from
  sun.misc.launcher$appclassloa...@1a7bf11
  DEBUG main
  org.springframework.beans.factory.support.DefaultListableBeanFactory -
  Returning cached instance of singleton bean 'wicketApplication'
 
 
  Dane
 
 
  On Mon, Aug 31, 2009 at 9:14 AM, James Carman
  jcar...@carmanconsulting.comwrote:
 
   Or, you can turn on spring logging to see it opening the session.
  
   On Mon, Aug 31, 2009 at 10:56 AM, Igor Vaynberg 
 igor.vaynb...@gmail.com
   wrote:
  
doesnt look like your osiv is working. you can create a wicket
quickstart project and attach it to a jira issue if you want someone
to take a look at it. other then that you can use the debugger to see
if osiv is actually being hit *before* the wicket filter.
   
-igor
   
On Mon, Aug 31, 2009 at 7:50 AM, Dane Lavertydanelave...@gmail.com
wrote:
 Thanks James and Igor for looking it over. Switching the order of
 the
filter
 definitions didn't make a difference. If it helps, here's what I'm
   doing:

 1 - This is the UserInfo class. As far as this test case is
  concerned,
   it
 has an ID and a SetString to check lazy loading. I've commented
 out
   the
 FetchType.EAGER to test the OSIV. When it is uncommented, the
  UserPage
(#2,
 below) renders correctly, otherwise I get a lazy load exception.

 @Entity
 @Table(name = zjp_user_accounts)
 public class UserInfo extends PersonInfo {
@Id
Long id;

@OneToMany(mappedBy=employerInfo /*, fetch=FetchType.EAGER*/)
SetString postedJobs;
...
 }


 2 - UserPage is the page I'm using to test lazy loading.

 public class UserPage extends WebPage {
@SpringBean(name = personInfoDao)
private PersonInfoDao personInfoDao;

public UserPage() {

EntityModelPersonInfo personInfoModel = new
 EntityModelPersonInfo(UserInfo.class, new Long(1));

EmployerInfo personInfo =
(EmployerInfo)personInfoModel.getObject();
SetString jobs = personInfo.getPostedJobs();
IteratorString itr = jobs.iterator();
while (itr.hasNext()) {
System.out.println(itr.next());
}
}
 }


 3 - And this is the EntityModel, based on the Smart EntityModel
  article
   -
 http://wicketinaction.com/2008/09/building-a-smart-entitymodel/

 public class EntityModelT extends Identifiable? extends
 AbstractEntityModelT {

@SpringBean(name = entityDao)
private EntityDao dao;

public EntityModel(Class clazz, Serializable id) {
super(clazz, id);
// This makes the class Spring-aware, so we can inject the
  DAOs,
as
 above
InjectorHolder.getInjector().inject

Re: Quick model/user/session question

2009-08-27 Thread Dane Laverty
Thanks for the suggestion. I've actually already got OpenSessionInViewFilter
in my web.xml, like so:

filter
filter-namewicket.filter/filter-name

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

param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
/filter

filter
   filter-nameopen.hibernate.session.in.view/filter-name

filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class
/filter

!-- Important! This filter mapping must come before Wickets! --
filter-mapping
   filter-nameopen.hibernate.session.in.view/filter-name
   url-pattern/*/url-pattern
/filter-mapping

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

Is there anything else I need to do in order to make OSIV work? Everything
I've read says it just needs to be placed in the web.xml.

Thanks,

Dane



On Wed, Aug 26, 2009 at 7:58 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Wed, Aug 26, 2009 at 6:30 PM, Dane Lavertydanelave...@gmail.com
 wrote:
  As I understand it, the LazyInitializationException is thrown because the
  Hibernate session closes after I call EntityDao.load(). But if that's the
  problem, then why should an LDM help? Won't the Hibernate session close
  again as soon as the LDM's load() is called?

 google OpenSessionInViewFilter, it keeps the hibernate session open
 for the entire request.

 -igor

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




Re: Quick model/user/session question

2009-08-26 Thread Dane Laverty
More progress and another brick wall. After spending too many hours
researching connection pools, it looks like the problem was actually a lack
of @Transactional on the DAO method used by the EntityModel. Now I've added
@Transactional, but that puts me back to getting the
LazyInitializationException when I access one of PersonInfo's lazily loaded
properties. Ugh...

So now my question goes back to the smart EntityModel approach (as per
http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ ). When I
search the mailing list, I see LDM/EntityModel given as the solution for
LazyInitializationException. I don't understand why wrapping the object in a
model should help (and in my case it doesn't help, probably because I'm
implementing it wrong).

As I understand it, the LazyInitializationException is thrown because the
Hibernate session closes after I call EntityDao.load(). But if that's the
problem, then why should an LDM help? Won't the Hibernate session close
again as soon as the LDM's load() is called?

well, regardless, let me echo Nino's tagline and say, Wicket for love! As
frustrating as this is, I know it would be ten times more frustrating back
in Struts-land, where I'm from.


Dane



On Tue, Aug 25, 2009 at 3:53 PM, Dane Laverty danelave...@gmail.com wrote:

 Good point. Now that I've switched to c3p0, I'm getting more debug info,
 i.e.:

 DEBUG - BasicResourcePool - [managed: 3, unused: 1, excluded: 0]
 DEBUG - BasicResourcePool - [managed: 3, unused: 0, excluded: 0]
 DEBUG - BasicResourcePool - [managed: 4, unused: 1, excluded: 0]
 DEBUG - BasicResourcePool - [managed: 4, unused: 0, excluded: 0]
 ...
 DEBUG - BasicResourcePool - [managed: 15, unused: 0, excluded: 0]
 DEBUG - BasicResourcePool - acquire test -- pool is already maxed out.
 [managed: 15; max: 15]

 It turns out that the problem has nothing to do with clicking really fast.
 After 15 clicks on any of the links in the app, it will freeze. I'm using
 wicket-auth for security, so the EntityModelUserInfo is inflating the
 UserInfo object on every page to check for permissions, and the connections
 are not being released. This was not an issue before I moved my UserInfo
 into the detachable EntityModel. I'll do some more research.

 Dane




 On Tue, Aug 25, 2009 at 3:34 PM, Edward Zarecor 
 edw...@indeterminate.orgwrote:

 There's no connection pool size defined.  Is the default pool size for
 dbcp
 1?

 Ed.

 On Aug 25, 2009 5:29 PM, Dane Laverty danelave...@gmail.com wrote:

 I'm using dbcp, as per below. I'll try switching over to c3p0 and see if
 that helps.

   bean id=dataSourceOracle
 class=org.apache.commons.dbcp.BasicDataSource destroy-method=close
   property name=driverClassName value=${jdbc.oracle.driver}/
   property name=url value=${jdbc.oracle.url}/
   property name=username value=${jdbc.oracle.username}/
   property name=password value=${jdbc.oracle.password}/
   /bean


 On Tue, Aug 25, 2009 at 2:25 PM, Martijn Dashorst 

 martijn.dasho...@gmail.com wrote:  Do you use a connection pool? e.g.
 datasource definition in yo...





Re: Quick model/user/session question

2009-08-25 Thread Dane Laverty
(HttpParser.java:279)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:204)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
DEBUG - log- EOF


On Mon, Aug 24, 2009 at 6:06 PM, Dane Laverty danelave...@gmail.com wrote:

 I took your advice and added a UserInfo variable to the RequestCycle [1].
 Now my pages look for the UserInfo in the RequestCycle. If it's null, the
 RequestCycle loads it from the ID in Session [2]. However, I still get the
 LazyInitializationException when a page wants to access a collection from
 userInfo [3], presumably because the Hibernate session was closed after the
 Session loads the UserInfo. I thought that the OpenSessionInViewFilter was
 supposed to keep the session open during the entire request, but apparently
 I'm using it wrong.

 [1] - public class WicketRequestCycle extends WebRequestCycle implements
 Serializable {

 UserInfo userInfo;
 ...
 public UserInfo getUserInfo() {
 if (userInfo != null) return userInfo;
 userInfo = WicketSession.get().generateUserInfo();
 return userInfo;
 }
 }


 [2] - public class WicketSession extends AuthenticatedWebSession {

 @SpringBean(name = userInfoDao)
 private UserInfoDao userInfoDao;

 private Long userInfoID;
 ...
 public UserInfo generateUserInfo() {
 if (userInfoID == null) return null;
 return personInfoDao.load(personInfoId, personInfoClass);
 }
 }

 [3] - public class UserRolesAuthorizer implements IRoleCheckingStrategy
 {
 public boolean hasAnyRole(Roles roles)
 {
 PersonInfo personInfo = WicketRequestCycle.get().getPersonInfo();
 // THIS NEXT LINE THROWS THE ERROR, since it's trying to load
 BasicUser
 return userInfo.getBasicUser().hasAnyRole(roles);
 }

 }


 On Mon, Aug 24, 2009 at 2:12 PM, Martijn Dashorst 
 martijn.dasho...@gmail.com wrote:

 Don't put the models in your session! Session access is not guaranteed
 to be confined to a single thread - multi window support, resources
 and such all attach the session to their own threads, making the
 session non-thread safe.

 Best option is to put the ID of your entities in your session object,
 and store the entities in your request cycle for request processing.

 Martijn

 On Mon, Aug 24, 2009 at 9:21 PM, Dane Lavertydanelave...@gmail.com
 wrote:
  I understand that a Hibernate-generated object needs to be kept in a
  LoadableDetachableModel in order to avoid errors across requests. I also
  understand that a LDM has to belong to a component in order for its
 detach
  to be called at the end of a request. So what should I do with
  Hibernate-generated objects that live in the session, specifically a
  UserInfo object? Since the session doesn't have a model, how do I inform
  Wicket to detach these models after each request?
 
  thanks,
 
  Dane
 



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

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





Re: Quick model/user/session question

2009-08-25 Thread Dane Laverty
I'm using dbcp, as per below. I'll try switching over to c3p0 and see if
that helps.

bean id=dataSourceOracle
class=org.apache.commons.dbcp.BasicDataSource destroy-method=close
property name=driverClassName value=${jdbc.oracle.driver}/
property name=url value=${jdbc.oracle.url}/
property name=username value=${jdbc.oracle.username}/
property name=password value=${jdbc.oracle.password}/
/bean


On Tue, Aug 25, 2009 at 2:25 PM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Do you use a connection pool? e.g. datasource definition in your
 container, dbcp or c3p0? If not, use one.

 Martijn

 On Tue, Aug 25, 2009 at 11:10 PM, Dane Lavertydanelave...@gmail.com
 wrote:
  I think I've discovered the source of the problem, but not the solution.
 On
  a normal page request, the console output says:
 
DEBUG - log- REQUEST /post-job on
  org.mortbay.jetty.httpconnect...@1b9db06 ...
DEBUG - ConnectionManager  - opening JDBC connection
DEBUG - SQL- select
  jobcategor0_.job_category_id...
 
  And everything goes normally from there. But on double-clicking the link,
  the console says:
 
DEBUG - log- REQUEST /post-job on
  org.mortbay.jetty.httpconnect...@1b9db06 ...
DEBUG - ConnectionManager  - opening JDBC connection
DEBUG - log- REQUEST /post-job on
  org.mortbay.jetty.httpconnect...@a78af0 ...
DEBUG - ConnectionManager  - opening JDBC connection
 
  And then the application freezes. Apparently it is trying to open a
 second
  JDBC connection before the first one closed, and something doesn't like
  that. I'm not sure where to start looking to solve this -- any
 suggestions?
 
  thanks again,
 
  Dane
 
 
 
  On Tue, Aug 25, 2009 at 1:22 PM, Dane Laverty danelave...@gmail.com
 wrote:
 
  Progress is being made. Thanks again for your suggestion, Martijn. I
  discovered this thread (
 
 http://www.nabble.com/Storing-user-entity-in-session--td22113666.html#a22113666)
 where you discussed putting the user in the RequestCycle in some more
  detail. That helped me rebuild my RequestCycle [1].
 
  The new RequestCycle solved the LazyInitializationException, but created
 a
  new problem. The application runs fine, but if I click a link twice in
 rapid
  succession, the application hangs for all users until I restart the
 server.
  This is kind of a major problem :) I've pasted the server output below
 [2].
  The console stops on the line DEBUG - ConnectionManager - opening JDBC
  connection for a couple minutes, then throws the
 java.net.SocketException:
  Connection reset stack trace.
 
  Googling java.net.SocketException: Connection reset shows that the
 error
  is connected to a wide array of issues. Has anyone here run into the
 problem
  before? And if so, how did you solve it?
 
  thanks,
 
  Dane
 
  ---
 
  [1] - public class WicketRequestCycle extends WebRequestCycle implements
  Serializable {
 
  EntityModelUserInfo userInfoModel;
  ...
  public UserInfo getUserInfo() {
  if (userInfoModel != null) return userInfoModel.getObject();
  UserInfo userInfo = WicketSession.get().generateUserInfo();
  if (userInfo == null) return null;
  userInfoModel = new EntityModelUserInfo(userInfo);
  return userInfoModel.getObject();
  }
 
  @Override
  public void detach() {
  super.detach();
  if (userInfoModel != null)
  userInfoModel.detach();
  }
  }
 
 
  [2] - TRACE - SessionImpl- closing session
  TRACE - ConnectionManager  - connection already null in cleanup
 :
  no action
  DEBUG - log- RESPONSE /images/lotus.png  200
  DEBUG - log- REQUEST /login on
  org.mortbay.jetty.httpconnect...@7d0f44
  DEBUG - log- Got Session ID 1haooq2s24av1 from
  cookie
  DEBUG - log-
  sessionmanager=org.mortbay.jetty.servlet.hashsessionmana...@3411a
  DEBUG - log-
 
 session=org.mortbay.jetty.servlet.HashSessionManager$Session:1haooq2s24...@18296160
  DEBUG - log- servlet=default
  DEBUG - log-
  chain=open.hibernate.session.in.view-wicket.careerconnect-default
  DEBUG - log- servelet holder=default
  DEBUG - log- call filter
  open.hibernate.session.in.view
  DEBUG - OpenSessionInViewFilter- Using SessionFactory
 'sessionFactory'
  for OpenSessionInViewFilter
  DEBUG - DefaultListableBeanFactory - Returning cached instance of
 singleton
  bean 'sessionFactory'
  DEBUG - OpenSessionInViewFilter- Opening single Hibernate Session in
  OpenSessionInViewFilter
  DEBUG - SessionFactoryUtils- Opening Hibernate Session
  DEBUG - SessionImpl- opened session at timestamp:
  5125043523203072

Re: Quick model/user/session question

2009-08-25 Thread Dane Laverty
Good point. Now that I've switched to c3p0, I'm getting more debug info,
i.e.:

DEBUG - BasicResourcePool - [managed: 3, unused: 1, excluded: 0]
DEBUG - BasicResourcePool - [managed: 3, unused: 0, excluded: 0]
DEBUG - BasicResourcePool - [managed: 4, unused: 1, excluded: 0]
DEBUG - BasicResourcePool - [managed: 4, unused: 0, excluded: 0]
...
DEBUG - BasicResourcePool - [managed: 15, unused: 0, excluded: 0]
DEBUG - BasicResourcePool - acquire test -- pool is already maxed out.
[managed: 15; max: 15]

It turns out that the problem has nothing to do with clicking really fast.
After 15 clicks on any of the links in the app, it will freeze. I'm using
wicket-auth for security, so the EntityModelUserInfo is inflating the
UserInfo object on every page to check for permissions, and the connections
are not being released. This was not an issue before I moved my UserInfo
into the detachable EntityModel. I'll do some more research.

Dane



On Tue, Aug 25, 2009 at 3:34 PM, Edward Zarecor edw...@indeterminate.orgwrote:

 There's no connection pool size defined.  Is the default pool size for dbcp
 1?

 Ed.

 On Aug 25, 2009 5:29 PM, Dane Laverty danelave...@gmail.com wrote:

 I'm using dbcp, as per below. I'll try switching over to c3p0 and see if
 that helps.

   bean id=dataSourceOracle
 class=org.apache.commons.dbcp.BasicDataSource destroy-method=close
   property name=driverClassName value=${jdbc.oracle.driver}/
   property name=url value=${jdbc.oracle.url}/
   property name=username value=${jdbc.oracle.username}/
   property name=password value=${jdbc.oracle.password}/
   /bean


 On Tue, Aug 25, 2009 at 2:25 PM, Martijn Dashorst 

 martijn.dasho...@gmail.com wrote:  Do you use a connection pool? e.g.
 datasource definition in yo...



Re: Quick model/user/session question

2009-08-24 Thread Dane Laverty
Do you mean that the database should be queried for every persistent session
object on every request?

On Mon, Aug 24, 2009 at 2:12 PM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Don't put the models in your session! Session access is not guaranteed
 to be confined to a single thread - multi window support, resources
 and such all attach the session to their own threads, making the
 session non-thread safe.

 Best option is to put the ID of your entities in your session object,
 and store the entities in your request cycle for request processing.

 Martijn

 On Mon, Aug 24, 2009 at 9:21 PM, Dane Lavertydanelave...@gmail.com
 wrote:
  I understand that a Hibernate-generated object needs to be kept in a
  LoadableDetachableModel in order to avoid errors across requests. I also
  understand that a LDM has to belong to a component in order for its
 detach
  to be called at the end of a request. So what should I do with
  Hibernate-generated objects that live in the session, specifically a
  UserInfo object? Since the session doesn't have a model, how do I inform
  Wicket to detach these models after each request?
 
  thanks,
 
  Dane
 



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

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




Re: Quick model/user/session question

2009-08-24 Thread Dane Laverty
I took your advice and added a UserInfo variable to the RequestCycle [1].
Now my pages look for the UserInfo in the RequestCycle. If it's null, the
RequestCycle loads it from the ID in Session [2]. However, I still get the
LazyInitializationException when a page wants to access a collection from
userInfo [3], presumably because the Hibernate session was closed after the
Session loads the UserInfo. I thought that the OpenSessionInViewFilter was
supposed to keep the session open during the entire request, but apparently
I'm using it wrong.

[1] - public class WicketRequestCycle extends WebRequestCycle implements
Serializable {

UserInfo userInfo;
...
public UserInfo getUserInfo() {
if (userInfo != null) return userInfo;
userInfo = WicketSession.get().generateUserInfo();
return userInfo;
}
}


[2] - public class WicketSession extends AuthenticatedWebSession {

@SpringBean(name = userInfoDao)
private UserInfoDao userInfoDao;

private Long userInfoID;
...
public UserInfo generateUserInfo() {
if (userInfoID == null) return null;
return personInfoDao.load(personInfoId, personInfoClass);
}
}

[3] - public class UserRolesAuthorizer implements IRoleCheckingStrategy
{
public boolean hasAnyRole(Roles roles)
{
PersonInfo personInfo = WicketRequestCycle.get().getPersonInfo();
// THIS NEXT LINE THROWS THE ERROR, since it's trying to load
BasicUser
return userInfo.getBasicUser().hasAnyRole(roles);
}

}


On Mon, Aug 24, 2009 at 2:12 PM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Don't put the models in your session! Session access is not guaranteed
 to be confined to a single thread - multi window support, resources
 and such all attach the session to their own threads, making the
 session non-thread safe.

 Best option is to put the ID of your entities in your session object,
 and store the entities in your request cycle for request processing.

 Martijn

 On Mon, Aug 24, 2009 at 9:21 PM, Dane Lavertydanelave...@gmail.com
 wrote:
  I understand that a Hibernate-generated object needs to be kept in a
  LoadableDetachableModel in order to avoid errors across requests. I also
  understand that a LDM has to belong to a component in order for its
 detach
  to be called at the end of a request. So what should I do with
  Hibernate-generated objects that live in the session, specifically a
  UserInfo object? Since the session doesn't have a model, how do I inform
  Wicket to detach these models after each request?
 
  thanks,
 
  Dane
 



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

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




Re: Wicketstuff releases?

2009-08-13 Thread Dane Laverty
I followed your instructions. When I ran the mvn release:prepare, I was
asked several dozen times about versions, to which I responded with whatever
Maven's default choice was. Then there was a lot more output, and finally it
failed with an OutOfMemoryError: PermGen space. I know that's not very
helpful to you -- do you know what I can do to increase the memory available
to Maven?

On Thu, Aug 13, 2009 at 6:21 AM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 To those who have written me volunteering to help: thank you.  I will
 try to do the release this weekend.  Here's what you can do to help
 before then.

 1 - check out wicketstuff-core trunk
 2 - change the wicket dependencies from snapshot to 1.4.0 (note: only
 do this locally - don't commit that change - since trunk should run on
 trunk)
 3 - build it to make sure it all works
 4 - test the release process by doing following:

 mvn release:prepare -DdryRun=true

 If all of that is working fine (no build errors, etc), then let the
 list know.  That will make it much easier to do the release.  And I'll
 try to document the process so that someone else can perform the next
 one easier.

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




 On Wed, Aug 12, 2009 at 7:27 PM, Jeremy
 Thomersonjer...@wickettraining.com wrote:
  The idea behind the matching release numbers was so that Wicket newbs
  could more easily adopt the most commonly used and supported
  wicketstuff projects into their projects.  I would like to be able to
  still have that.  No compatibility matrix needed - if you are using
  Wicket 1.4.1 - use WS 1.4.1.  That being said, I think that the best
  solution is that we have 1.4.1.X where X is our release number.
 
  The biggest problem is still what a hassle it is to build a release.
  When I built rc8, it took a couple days because people had broken junk
  in trunk, not followed pom conventions, etc.  Plus, syncing the build
  artifacts to the repo was a pain because it's not documented, and I'm
  no maven guru.
 
  I haven't even had time to build 1.4.0 to match Wicket yet, and that
  is arguably the most important one since we started WS Core.
 
  If someone would like to help by building 1.4.0 and documenting a
  streamlined process, I would love it.  I have been running a Continuum
  server that was doing continuous builds as well.  I think that we
  could see about using the release process on Continuum to run mvn
  release:deploy and automating releases.  I just don't have time this
  week, and probably won't next week.
 
  So - anyone volunteering?
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
 
  On Wed, Aug 12, 2009 at 1:01 PM, nino martinez
  waelnino.martinez.w...@gmail.com wrote:
  Hmm I believe with may way it should be possible todo both..
 
  However I don't much care what the releases are named its the quality
  that matters to me. No matter what the customer will blame me if
  something does not work, they don't care if its a 1.4,  1.4.1.1
  release snapshot or snafu:)
 
  Jeremy are doing a fine job. However feedback are always nice, I like
  to get that too from my wicketstuffings.
 
  -my two cents..
 
  2009/8/12 Martijn Dashorst martijn.dasho...@gmail.com:
  Given the lackluster release history of Wicket Stuff, I'd suggest
  going with whatever the only person able *AND* willing to cut releases
  wants. In this case, that is Jeremy. If you don't want to follow the
  general Wicket Stuff release processes, you're welcome to maintain
  your own projects and release them at your own schedule.
 
  It doesn't make sense to me to go back on a decision that was made,
  just because 2 folks think it is better. IMO having a release
  following Wicket's releases is better than not having a release.
 
  The problem with Wicket Stuff is not that they follow the Wicket
  release cycle, it is that nobody gives a damn to cut releases. Jeremy
  fixed that. If you think you can do better, don't put your project in
  the Wicket Stuff parent group, but release the software on your own.
 
  Martijn
 
 
  On Wed, Aug 12, 2009 at 3:36 PM, Reinhard
  Nägelereinhard.naeg...@mgm-tp.com wrote:
  I'd like to second Maartens point. Identical releases to Wicket itself
 would
  mean that it always depends on Wicket. Independent releases would not
 be
  possible. Bugs could not be fixed and new features could not be added
  without a new Wicket release. This doesn't really make sense to me.
 
  Reinhard
 
 
  Jeremy Thomerson schrieb:
 
  Now that Wicket 1.4.0 is out, I wonder which wicketstuff core
 version is
  compatible. There is no 1.4.0 version of wicketstuff core (yet?).
 Should
  I
  use 1.4-rc8-SNAPSHOT?
 
 
  It should be just 1.4-SNAPSHOT.  1.4-rc8-SNAPSHOT was an accidental
  relic of after I built rc8
 
 
 
  Side note:  I don't see the version of wicket-stuff has to match
 exactly
  with version of wicket ?
  Suppose someone releases wicketstuff-core-1.4.0 today, and tomorrow
 some
  bugs are fixed in 

IndexOutOfBoundsException on ListView model add()

2009-08-13 Thread Dane Laverty
I'm going crazy over what should be a simple procedure. I want to add an
element to a ListView's model, but when I try, it throws an
IndexOutOfBoundsException.

I have a form [1] which contains a ListView and an AjaxSubmitLink which adds
items to the ListView. The only funny thing you might notice with the form
is that ListView's model is employerInfoModel.contactPoints, while the
AjaxSubmitLink is adding items to employerInfoModel.contactPointsSet. This
is because employerInfo's collection of contactPoints is actually a set, but
ListView needs them as a list. In order to get around this, I have two
getters and setters, one that gets the set directly, and one that converts
to and from a list [2].

[1] - public class ContactInfoForm extends FormEmployerInfo {

WebMarkupContainer contactPointsContainer;

public ContactInfoForm(String id,
CompoundPropertyModelEmployerInfo model) {
super(id, model);

contactPointsContainer = new
WebMarkupContainer(contactPointsContainer);

ListViewContactPoint contactPointsListView = new
ListViewContactPoint(contactPoints, new
PropertyModelListContactPoint(employerInfoModel, contactPoints)) {
@Override
protected void populateItem(ListItemContactPoint item) {
final ContactPoint cp = item.getModelObject();

item.add(new TextFieldString(contactInfo, new
PropertyModelString(item.getModel(), contactInfo)));
item.add(new
ContactPointTypesDropDownChoice(contactPointTypeImpl, new
PropertyModelContactPointType(item.getModel(), contactPointTypeImpl)));
item.add(new
IndicatingAjaxLinkContactPoint(deleteLink, new ModelContactPoint(cp))
{
@Override
public void onClick(AjaxRequestTarget target) {

employerInfoModel.getObject().getContactPoints().remove(cp);
target.addComponent(ContactInfoForm.this);
}
});
}
};
contactPointsContainer.add(contactPointsListView);
contactPointsContainer.setOutputMarkupId(true);
add(contactPointsContainer);

add(new AjaxSubmitLink(addContactPointLink, this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form? form)
{
getModelObject().getContactPointsSet().add(new
ContactPointImpl());
target.addComponent(contactPointsContainer);
}
});
}
}



[2] - public class EmployerInfo extends PersonInfoImpl {
...
SetContactPoint contactPointsSet;

public ListContactPoint getContactPoints() {
ListContactPoint list = new
ArrayListContactPoint(contactPointsSet);
Collections.sort(list);
return list;
}

public void setContactPoints(ListContactPoint contactPoints) {
this.contactPointsSet = new HashSetContactPoint(contactPoints);
}

public SetContactPoint getContactPointsSet() {
return contactPointsSet;
}

public void setContactPointsSet(SetContactPoint contactPointsSet) {
this.contactPointsSet = contactPointsSet;
}

}


Re: IndexOutOfBoundsException on ListView model add()

2009-08-13 Thread Dane Laverty
In case anyone else ends up with a similar error, here's the solution I
ended up using. (Yes, I'm sure it's an awful hack, but right now it works
for me.)

First, I swapped the Set/List implementation I was using in Employer Info
[1], since I realized that the items affected in my previously generated
List weren't getting passed back to the Set. Then I passed my ListView the
list directly, rather than wrapped in a model [2]. The AjaxSubmitLink adds
to that list, by way of the ListView's model [3]. Then, when the user wanted
to save the updated List, I had to explicitly re-set it in the Form model
[4].

That resolved my IndexOutOfBoundsException issue. However, when I tried to
persist the list, I got an org.hibernate.NonUniqueObjectException. This is
my first Hibernate/Wicket project, so I'm pretty clueless about that one.
Searching the list, I found a post by Eelco [5] that mentioned using
Hibernate's Session.evict(), so I implemented that in the persist function
of the DAO [6]. Now it appears to be working!

--

[1] - public class EmployerInfo extends PersonInfoImpl {
...
ListContactPoint contactPointsList;

public ListContactPoint getContactPoints() {
return contactPointsList;
}

public void setContactPoints(ListContactPoint contactPointsList) {
this.contactPointsList = contactPointsList;
}

public SetContactPoint getContactPointsSet() {
return new HashSetContactPoint(contactPointsList);
}

public void setContactPointsSet(SetContactPoint contactPointsSet) {
ListContactPoint list = new
ArrayListContactPoint(contactPointsSet);
Collections.sort(list);
contactPointsList = list;
}
}



[2] - final ListViewContactPoint contactPointsListView = new
ListViewContactPoint(contactPoints,
employerInfoModel.getObject().getContactPoints()) {...};


[3] - new AjaxSubmitLink(addContactLink, this) {
@Override
public void onSubmit(AjaxRequestTarget target, Form? form)
{
contactPointsListView.getModelObject().add(new
ContactPointImpl());
target.addComponent(contactPointsContainer);
}


[4] - new SubmitLink(saveContactPoints) {
@Override
public void onSubmit() {
super.onSubmit();

employerInfoModel.getObject().setContactPoints(contactPointsListView.getModelObject());

personInfoDao.persistOrMerge(employerInfoModel.getObject());
info(Your account has been updated.);
}

[5] - http://www.nabble.com/delete-onSubmit-td22839614.html#a22839614

[6] - public void persistOrMerge(PersonInfo personInfo) {
getHibernateTemplate().evict(personInfo);
try {
getHibernateTemplate().saveOrUpdate(personInfo);
} catch (Exception e) {
getHibernateTemplate().merge(personInfo);
}
}


Looking for Web Application Architecture Book

2009-08-04 Thread Dane Laverty
A few months ago I asked for ideas on project management, and you all gave
me some great suggestions of tools and books to check out. Now I'd like to
hear if anyone has recommendations for a resource that explains how to tie
the web application together -- what I would call architecture.

I'm running into questions like
- Where should I put my DAOs? In the session or in the pages? And what's a
reasonable relationship between DAOs and domain objects?
- What are some examples of reasonable package hierarchies?
- What kind of objects should live in the application and what should live
in the session?
- Should I put constants in a Constants.java or in an xml file?
- Spring wants to use interfaces and Hibernate wants to use concrete classes
-- how do I reconcile these?

Effective Java and Design Patterns have been great resources for learning
how to solve specific programming problems. Now I'd like to find information
on how to build the layout of the application in a way that is effective,
simple, and maintainable. Any suggestions?


Re: Looking for Web Application Architecture Book

2009-08-04 Thread Dane Laverty
Thanks for the well-expressed responses. I'll look into the books. Most of
my knowledge about web application programming theory comes from reading
lists like this. There are certain terms that pop up over and over again, so
eventually I think, That must be important, I guess it's time for me to
learn about that.

I appreciate the Wicket example apps that are available -- phonebook and
James Carman's wicket-advanced have both been very helpful. The app I'm
building now is based on the phonebook app. I trust that these are fine
examples, and I want to understand the theory behind them.

So let me give you a couple more questions based on your answers:
- In package hierarchies, what do you mean by module based hierarchies? Is
module a technical term, or does it just refer to some conceptual area of
work for the application?
- In app v. session, one thing I've read in several places is never put
your DAOs in your application. I'm sure that's great advice, but I don't
know why. From my perspective, a DAO is exactly the kind of thing I would
put in the application -- it's the same for all users, and it would be
really handy to have there. The phonebook app, OTOH, puts DAOs directly in
the pages, so that's the model I'm following for my current application.

thanks again!

Dane

On Tue, Aug 4, 2009 at 12:25 PM, Scott Swank scott.sw...@gmail.com wrote:

 I like Martin Fowler's Patterns of Enterprise Architecture.  I also
 like Eric Evans' Domain Driven Design.

 As for your specific questions:

 dao -- Outside of a reasonably simple crud application I wouldn't have
 Wicket even aware of daos.  I like to have wicket (or other clients)
 talk to the proverbial business layer, with persistance, jms, ws,
 and so forth on the other side of said business layer

 package hierarchies -- I like to have module based hierarchies:
 com.you.customer, com.you.order, com.you.ui.  Within each you would
 then have parallel strucures (i.e. if you have a com.you.customer.dao
 package for daos, then you would want to have com.you.order.dao).
 Just try to make thing predictable.

 app v. session -- If an entity is global, such as access to the
 business layer, it should go in the app.  Conversely, things like a
 cart that vary by session should go in the session.  Or maybe you were
 asking something a little meatier?

 constants -- I like to have things in the db.  This does not, however
 work well for db credentials.  Property or xml files are a fine option
 for things that vary by instance (dev v. test v. prod).  I only have
 constants in code when multiple classes (or at least methods) need to
 agree on a value.  I do not like to have constants that drive business
 logic in code.

 spring  wicket -- use the google.

 Scott

 On Tue, Aug 4, 2009 at 11:16 AM, Dane Lavertydanelave...@gmail.com
 wrote:
  A few months ago I asked for ideas on project management, and you all
 gave
  me some great suggestions of tools and books to check out. Now I'd like
 to
  hear if anyone has recommendations for a resource that explains how to
 tie
  the web application together -- what I would call architecture.
 
  I'm running into questions like
  - Where should I put my DAOs? In the session or in the pages? And what's
 a
  reasonable relationship between DAOs and domain objects?
  - What are some examples of reasonable package hierarchies?
  - What kind of objects should live in the application and what should
 live
  in the session?
  - Should I put constants in a Constants.java or in an xml file?
  - Spring wants to use interfaces and Hibernate wants to use concrete
 classes
  -- how do I reconcile these?
 
  Effective Java and Design Patterns have been great resources for learning
  how to solve specific programming problems. Now I'd like to find
 information
  on how to build the layout of the application in a way that is effective,
  simple, and maintainable. Any suggestions?
 

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




Re: Thanks Wicket-Team!

2009-07-29 Thread Dane Laverty
Erik, I'd certainly be happy for you to do that :)

On Wed, Jul 29, 2009 at 3:38 PM, Erik Post eriksen...@gmail.com wrote:

 Hi Jeremy,

 Just to weigh in on this, I personally think that working with JPA
 entity managers/Hibernate sessions could do with some clarification
 beyond just use Spring. There are a number of quickstart type
 projects out there, but they all seem to revolve around using Spring,
 whereas I would have liked to see some of the more low level concepts
 cast light on, as they apply to Wicket:

 - Why might one want to use OSIV or other patterns?
 - EntityManagers/Sessions: how to obtain/close
 - Where in the app/request lifecycle do you do stuff?
 - Potential lazy loading issues
 - Using thread-local storage
 - How/where does this tie into servlets?
 - Why you might not want to bother with all of this too much and just
 use Spring/EJB instead.
 - etc.

 Most of this is not specific to Wicket per se, and I've seen a couple
 of posts on this in the mailing list/various blogs floating around,
 but it's quite a lot of stuff to piece together. I think a
 comprehensive treatment of these issues would be useful.

 Having typed all of that, maybe I should just write a tutorial
 myself... Oh well, my 2c.

 Cheers,
 Erik


 On Wed, Jul 29, 2009 at 11:55 PM, Jeremy
 Thomersonjer...@wickettraining.com wrote:
  I'd be interested in knowing from your viewpoint what parts had a high
  learning curve?  And what background are you coming from (that may
  effect your individual curve)?  In my experience, Wicket has a MUCH
  lower learning curve than Spring Web Flow and Tapestry (any
  incarnation).  So, as someone who teaches Wicket, I'd be interested in
  seeing what parts stumped you.

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




Re: Bypassing form validation

2009-07-23 Thread Dane Laverty
This is sounding like a Chuck Norris joke -- Wicket doesn't create invalid
code -- it roundhouse kicks the rules until they submit!

On Thu, Jul 23, 2009 at 12:48 PM, Jeremy Thomerson 
jer...@wickettraining.com wrote:

 Wicket takes care of that for you - you can do it in Wicket.

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




 2009/7/23 carlson weber filho - Master CIM Informática
 cwe...@mastercim.com.br:
  Isn't invalid to nest forms inside forms?
 
  Igor Vaynberg escreveu:
 
  you should use embedded forms.
 
  make a form for M1
 
  inside it add another form D1
 
  a button in D1 form will only process D1 form, a button in M1 form
  will process both.
 
  -igor
 
  2009/7/23 carlson weber filho - Master CIM Informática
  cwe...@mastercim.com.br:
 
 
  I already tried using setDefaultFormProcessing, but I want to actually
  process the form without validating it, on one of these buttons but
 using
  this method, I can't update my data, . Let me explain better. I have a
  master-detail form, supose I have fields M1, M2 and M3 on master-side
 and
  D1, D2 on details side. Fields M1 and D1 are required. I have a submit
  button that will submit all data and another submit button that will
  submit
  only detail data (I know it submits all the data, but then I will store
  the
  data on memory). When I click the button that submits my detail, I
 don't
  want it to do any validation on M1 field, but I want it to validate D1.
  Currently I am looking for 2 solutions:
  1. Validate D1 but not M1
  2. Do not validate at all.
 
 
  tx
 
  carlson
 
  Craig McIlwee escreveu:
 
 
  See
 
 
 http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing(boolean)http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/Button.html#setDefaultFormProcessing%28boolean%29
 
  -Original Message-
  From: carlson weber filho - Master CIM Informática
  [mailto:cwe...@mastercim.com.br] Sent: Thursday, July 23, 2009 3:31
 PM
  To: users@wicket.apache.org
  Subject: Bypassing form validation
 
  I have a form with two submit buttons. Is there any way to
 selectivelly
  bypass some validation on one of these buttons? I want to validate
 just
  two
  fields if I click on the button1 and I want to validate all fields
 when
  I
  click on button2
 
  tx,
 
  carlson
 
  -
  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: Spring and Wicket - is it worth it?

2009-07-23 Thread Dane Laverty
There we go, that's the kind of information I was looking for! Thanks John.
What got me started with Spring initially was its JDBC templates, but then
everything I read basically said, Yeah, Spring has JDBC templates, but you
won't really need them since you should be using ORM instead. However, when
I went to find some Hibernate/Wicket examples, all the ones I found were
based in a Spring DI framework. So here I am. I'm sure it will be worth it
in the end, but at the moment it's a lot of reading and testing without
feeling like I'm being especially awesome.

Dane

On Thu, Jul 23, 2009 at 1:32 PM, John Krasnay j...@krasnay.ca wrote:

 Wow, this post generated a short burst of heat but not much light!

 I think the problem is your question conflates dependency injection,
 XML-based configuration, and the Spring framework. IMHO you have to
 consider these separately to understand their relative merits.

 Dependency injection is simply that if object A requires object B, it
 can assume that it will be given an instance of object B rather than
 having to look up an instance of object B. This has some very important
 advantages:

 - it makes for cleaner code, since you don't have to code the lookup.

 - it makes your code independent of any particular lookup approach. You
  can change how your business layer is wired together without changing
  all of your code. This is particularly important when trying to create
  libraries to be re-used in different applications.

 - it makes your code easier to test, since your test code can manually
  inject stub objects and mocks.

 So for me, DI is a big win, regardless of how you do it (Spring, Guice,
 or even code in your app startup that instantiates the objects and wires
 them together).

 I don't find the Spring XML configuration to be that much of a problem,
 since most of the apps I work on have no more than a few dozen object
 configured there. One thing I like about it, as opposed to some
 annotation-based approaches, is that it's external to the objects
 themselves, making the objects more flexible. For example, suppose you
 had a WidgetDAO that worked with a DataSource. With the Spring XML you
 could easily create two different WidgetDAO instances each pointing to a
 different datasource. This would not be so easy with an annotation-based
 approach.

 As for the Spring framework itself, I find it contains a whole bunch of
 functionality that I normally need in a business app, such as
 declarative transaction management, AOP (e.g. for logging), and sane
 wrappers around JDBC, JavaMail, and other difficult APIs. If you're not
 using Spring, you usually have to figure out other ways to do these
 things.

 Hope this helps.

 jk

 On Wed, Jul 22, 2009 at 06:40:19PM -0700, Dane Laverty wrote:
  Due to the fact that nearly every substantial sample Wicket app is
  Spring-based, I imagine that there's something awesome about using
 Spring.
  In fact, Wicket is what has finally gotten me to start learning Spring.
 
  I think I understand the basics of dependency injection -- configure your
  objects in xml files and then inject them into your classes -- but I'm
 still
  not clear on the advantage of it. I've read quite a ways into Spring in
  Action, and the author seems to assume that the reader will
 automatically
  see why xml-based dependency injection is great thing. I must just be
  missing something here. What I love about Wicket is being free from xml
  files. Can anyone give me a concise explanation of how the advantages of
  Spring are worth introducing a new layer into my applications?
 
  Dane

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




Re: https flips to http

2009-07-22 Thread Dane Laverty
The problem did eventually get solved, though I couldn't tell you how. It
was a server issue, so our server people finally figured it out. I'm sorry I
can be of any help to you here :(

Dane

On Wed, Jul 22, 2009 at 1:19 PM, TahitianGabriel glan...@piti.pf wrote:


 Hi,

 Did you ever solve this problem?
 I'm having the exact same problme with apache 2, tomcat 6 and wicket 1.3.6.
 Some of the Https URLs are redirect to Http. It seems to happen when I use
 the setResponsePage(Page) fonction.

 Any help would be appreciate...



 insom wrote:
 
  Thanks to everyone who has suggested solutions. It turns out that the
  issue is stranger than I thought, and it's not Wicket-specific. I'll
 share
  what we've got, in case it helps anyone else (not that we have a solution
  yet.)
 
  We have a load balancer, Apache, and Tomcat handling requests. When any
  servlet application is called, for example,
  https://jprod01.chemeketa.edu/docs/ (which is one of the sample apps
 that
  installs with Tomcat), it display perfectly fine if it has the / after
  docs. But if the URL is https://jprod01.chemeketa.edu/docs (without the
  /) then browser automatically gets redirected to
  http://jprod01.chemeketa.edu/docs/ (with the / but without the s in
  https). Why? Who knows.
 

 --
 View this message in context:
 http://www.nabble.com/https-flips-to-http-tp19403303p24613851.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




Spring and Wicket - is it worth it?

2009-07-22 Thread Dane Laverty
Due to the fact that nearly every substantial sample Wicket app is
Spring-based, I imagine that there's something awesome about using Spring.
In fact, Wicket is what has finally gotten me to start learning Spring.

I think I understand the basics of dependency injection -- configure your
objects in xml files and then inject them into your classes -- but I'm still
not clear on the advantage of it. I've read quite a ways into Spring in
Action, and the author seems to assume that the reader will automatically
see why xml-based dependency injection is great thing. I must just be
missing something here. What I love about Wicket is being free from xml
files. Can anyone give me a concise explanation of how the advantages of
Spring are worth introducing a new layer into my applications?

Dane


Re: Dropdownchoice missing (only when the page with Tinymce component) while scrolling the vertical scroll bar

2009-07-16 Thread Dane Laverty
When you called us wicket poles, I had just assumed that you were referring
to the stumps that hold up the bails on a cricket wicket. However, I'm glad
to see that we're also pals and not just poles ;)

On Thu, Jul 16, 2009 at 6:42 PM, rolandpeng rolandp...@cht.com.tw wrote:


 hi wicket poles,

 Does anyone know who still works around the maintenance of the
 wicket-tinymce in wicketstuff?
 I'd like to pass my problem to the group.

 thank you.

 Roland.


 rolandpeng wrote:
 
  thanks for your teach,igor.
 
  I've find the way to build the quickstart with tinymce included.
  The quickstart project is attached,and can be run with 'mvn jetty:run' .
  the url: http://localhost:8080/quickstart
 
  my quickstart brief:
  there are two webpages,one with ajaxlink and the other with non-ajaxlink.
  You can find that when scrolling the vertical bar in the page with
  ajaxlink.The dropdownchoice is dispeared(or blured).But non-ajaxlink page
  won't.
 
  I don't know how to issue this problem in the right way,so I just post
  this quickstart here.
  I would be very obliged if Igor or someone can help to resolve this
  problem.thank you.
 
 

 --
 View this message in context:
 http://www.nabble.com/Dropdownchoice-missing-%28only-when-the-page-with-Tinymce-component%29-while-scrolling-the-vertical-scroll-bar-tp24455751p24527355.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: How to Make a Multiselect Drop Down or Check Box List Collapsible?

2009-06-22 Thread Dane Laverty
I haven't tried it, but I imagine you could create a JavaScript onclick
event that changes the SIZE attribute on the SELECT.

On Mon, Jun 22, 2009 at 9:02 AM, Keith Bennett kbennet...@fedcsc.comwrote:

 We would like to have a multiselect component that only takes up a
 single line on the page when not active.  For example, something that
 looks and behaves like the DropDownChoice, but that allows multiple
 selection when activated, would be nice.

 Is there such a thing in Wicket?

 Thanks,
 Keith


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




Re: JDeveloper - Can I get a show of hands?

2009-06-19 Thread Dane Laverty
I've really enjoyed getting to use Maven on my recent projects. I'm no
Maven expert, but I'm finding that I don't have to be -- it really
just does a great job. Getting Maven working with JDeveloper has not
been going well so far, so that's been one hangup.

There are a few reasons for the department-wide IDE mandate. Our
manager has just discovered UML (I don't know anything about it, to be
honest), and JDeveloper provides UML functionality out of the box,
while any of the free Eclipse UML plugins I could find required a
mountain of dependencies and don't appear to work as smoothly as the
JDev one. Also, we're trying to replace TOAD as our database tool, and
JDev looks like it can do that. The third reason is that most of our
applications are Oracle ApEx, and JDev has stuff for that too.

I'm trying to port my existing apps to JDeveloper, but without much
success. The main problems so far are:
- How do I import a Wicket project using the Maven standard directory
layout? (I am aware of the Maven JDev plugin for JDev 10, but it has
issues with JDev 11)
- How do I run a Wicket app in JDeveloper using the internal WebLogic server?
- Does JDeveloper have some sort of Maven-like functionality for
project lifecycle management?

I imagine (hope) that most of these questions have easy answers, but
I'm just not finding a lot of relevant online
documentation/discussion. Most of the JDeveloper web app documentation
is focused on EJBs or basic Servlet/JSP-based apps.


On Fri, Jun 19, 2009 at 3:53 AM, James
Carmanjcar...@carmanconsulting.com wrote:
 +1 on using Maven.  Most folks at our job site use eclipse, but I'm an
 IntelliJ junkie (they got me hooked many years ago and I can't break
 free).  For the most part, we don't have issues between environments,
 provided folks have their plugins set up correctly.

 On Fri, Jun 19, 2009 at 6:39 AM, Martijn Reuvers
 martijn.reuv...@gmail.com wrote:

 When you use ADF, then stick to JDeveloper you'll get a lot of
 integration for your application and can really build applications
 fast.

 However if you use open-source frameworks like wicket, you're better
 off using one of the other IDE's (Netbeans, Eclipse, IntelliJ). Just
 use maven or so, then your management has nothing to say, as it does
 not really matter what IDE you use. I always say: Use whatever gets
 the job done. =)

 On Fri, Jun 19, 2009 at 1:00 AM, Dane Lavertydanelave...@gmail.com wrote:
  Our management has chosen to make JDeveloper 11g the required IDE for
  the department. Searching the Wicket mailing list archives, I find
  that there is very little discussion about JDev. I'd be interested to
  know, are any of you currently using JDeveloper as your main Wicket
  IDE?
 
  -
  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: JDeveloper - Can I get a show of hands?

2009-06-19 Thread Dane Laverty
James  Igor, It sounds like your experiences with UML are about what
I am expecting it to be like.

Scott, the move to drop other programs in favor of JDeveloper is
partly about cost-cutting, but more so about standardization. As I've
mentioned, I'm the only Java programmer on staff, and I think
JDeveloper and its out-of-the-box-ness will be a little less
intimidating to the rest of the staff as we move towards Java than
Eclipse with its many, many plugins.

Martijn, Apex is Apex is a good way of putting it. I'm hoping that
this will be a move away from Apex and toward application coding that
is more maintainable.

For the most part, I'm keeping a positive attitude about the change. I
love Eclipse, and I expect that I'll find JDeveloper frustrating, but
I'm looking forward to it as a chance to get some experience with
something new. Same with UML. Whether or not it sticks, at least it
will be a learning experience.

On Fri, Jun 19, 2009 at 8:44 AM, Martijn
Reuversmartijn.reuv...@gmail.com wrote:
 You might want to try Netbeans for UML (there is a single plugin,
 install it and it works fine). I have not had any problems with it, it
 has quite some features (similar to the ones in JDeveloper).

 Use SQLDeveloper (of Oracle as well) if you need to replace Toad,
 however keep in mind it does not have all the dba features Toad
 provides, no free tool has these in fact.

 Well Apex is Apex, it cannot be replaced easily as its tied so closely
 to the oracle database and its pl/sql.

 As soon as you use Maven there is no need anymore for JDeveloper, at
 least not for running/building the project. If you really require
 specific features for instance for Apex you can still create a single
 workspace next to the normal maven one and use that separately.

 As for weblogic, just deploy a war manually through its console if you
 need to test it. However for faster testing I'd use Jetty with mvn
 jetty:run (you can always add a weblogic*.xml to the final war to
 override some libraries or so).


 On Fri, Jun 19, 2009 at 5:26 PM, Dane Lavertydanelave...@gmail.com wrote:
 I've really enjoyed getting to use Maven on my recent projects. I'm no
 Maven expert, but I'm finding that I don't have to be -- it really
 just does a great job. Getting Maven working with JDeveloper has not
 been going well so far, so that's been one hangup.

 There are a few reasons for the department-wide IDE mandate. Our
 manager has just discovered UML (I don't know anything about it, to be
 honest), and JDeveloper provides UML functionality out of the box,
 while any of the free Eclipse UML plugins I could find required a
 mountain of dependencies and don't appear to work as smoothly as the
 JDev one. Also, we're trying to replace TOAD as our database tool, and
 JDev looks like it can do that. The third reason is that most of our
 applications are Oracle ApEx, and JDev has stuff for that too.

 I'm trying to port my existing apps to JDeveloper, but without much
 success. The main problems so far are:
 - How do I import a Wicket project using the Maven standard directory
 layout? (I am aware of the Maven JDev plugin for JDev 10, but it has
 issues with JDev 11)
 - How do I run a Wicket app in JDeveloper using the internal WebLogic server?
 - Does JDeveloper have some sort of Maven-like functionality for
 project lifecycle management?

 I imagine (hope) that most of these questions have easy answers, but
 I'm just not finding a lot of relevant online
 documentation/discussion. Most of the JDeveloper web app documentation
 is focused on EJBs or basic Servlet/JSP-based apps.


 On Fri, Jun 19, 2009 at 3:53 AM, James
 Carmanjcar...@carmanconsulting.com wrote:
 +1 on using Maven.  Most folks at our job site use eclipse, but I'm an
 IntelliJ junkie (they got me hooked many years ago and I can't break
 free).  For the most part, we don't have issues between environments,
 provided folks have their plugins set up correctly.

 On Fri, Jun 19, 2009 at 6:39 AM, Martijn Reuvers
 martijn.reuv...@gmail.com wrote:

 When you use ADF, then stick to JDeveloper you'll get a lot of
 integration for your application and can really build applications
 fast.

 However if you use open-source frameworks like wicket, you're better
 off using one of the other IDE's (Netbeans, Eclipse, IntelliJ). Just
 use maven or so, then your management has nothing to say, as it does
 not really matter what IDE you use. I always say: Use whatever gets
 the job done. =)

 On Fri, Jun 19, 2009 at 1:00 AM, Dane Lavertydanelave...@gmail.com wrote:
  Our management has chosen to make JDeveloper 11g the required IDE for
  the department. Searching the Wicket mailing list archives, I find
  that there is very little discussion about JDev. I'd be interested to
  know, are any of you currently using JDeveloper as your main Wicket
  IDE?
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional 

JDeveloper - Can I get a show of hands?

2009-06-18 Thread Dane Laverty
Our management has chosen to make JDeveloper 11g the required IDE for
the department. Searching the Wicket mailing list archives, I find
that there is very little discussion about JDev. I'd be interested to
know, are any of you currently using JDeveloper as your main Wicket
IDE?

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



Re: Wicket-like JavaScript Components

2009-06-16 Thread Dane Laverty
I'm currently the only Java programmer on staff, and I'm already maintaining
two Wicket applications, so my boss is concerned that if I start a third
project in Java that no one else will be able to maintain it. It's a
reasonable concern, but kind of too bad nonetheless. I'm using JQuery as my
main JS resource for the application. All of the business logic is managed
through Ajax calls.

On Tue, Jun 16, 2009 at 12:05 PM, Jeremy Thomerson 
jer...@wickettraining.com wrote:

 Yeah - but I would guess that it wouldn't fit where I'm limited to
 using only JavaScript

 Out of curiosity - what do you mean where I'm limited to using only
 JavaScript?  I mean, can you use HTML?  What does this app do -
 obviously not much if it's only JS.  What does it tie in with to do
 business logic, etc?  Were these requirements written by a PHB?

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




 On Tue, Jun 16, 2009 at 11:56 AM, Nicolas
 Melendeznmelen...@getsense.com.ar wrote:
  GWT is a good framework.You can code in java and then it is translated to
  javascript.
  NM
 
  On Tue, Jun 16, 2009 at 4:05 PM, nino martinez wael 
  nino.martinez.w...@gmail.com wrote:
 
  You can also have a look at wicketstuff and see what integrations
  already exists :)
 
  2009/6/15 Dane Laverty danelave...@gmail.com:
   I'm working on a small project where I'm limited to using only
  JavaScript. I
   love the Wicket programming model, especially reusable components. Is
  anyone
   aware of a JavaScript framework or JavaScript techniques that would
 allow
  me
   to approximate Wicket components?
  
 
  -
  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




Wicket-like JavaScript Components

2009-06-15 Thread Dane Laverty
I'm working on a small project where I'm limited to using only JavaScript. I
love the Wicket programming model, especially reusable components. Is anyone
aware of a JavaScript framework or JavaScript techniques that would allow me
to approximate Wicket components?


Apache Logs, Session IDs, and PageExpiredException

2009-06-11 Thread Dane Laverty
I'm trying to track down the source of frequent PageExpiredExceptions that
we're getting on our deployment server. One of the errors occured at
01:28:06 this morning. In the Apache logs, I discovered that the user's
session ID spontaneously changed at that time, (see the change between lines
4  5 below, and then again between lines 11  12). Is that just a
coincidence, or would a changing session ID cause the PageExpiredException?
And if so, what causes the session ID to change? (I'm using Wicket 1.3.6. I
can't replicate the errors in development, which sounds common according to
the several PageExpiredException threads. I'm not seeing any sort of
serialization errors either.) Thanks for your help!

XXX.XXX.29.22 - - [11/Jun/2009:01:28:03 -0700] GET
/resources/comp.Comp/Oregon2.jpg HTTP/1.1 200 22145 
https://www.foodhandler.org/login%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:03 -0700] GET
/resources/comp.Comp/newVGrad.png HTTP/1.1 200 48736 
https://www.foodhandler.org/login%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:03 -0700] GET
/resources/comp.Comp/navBoxBottom.jpg HTTP/1.1 200 14140 
https://www.foodhandler.org/login%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:05 -0700] GET
/pay%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3 HTTP/1.1 302 - -...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:05 -0700] GET
/foodhandler/login;jsessionid=271042707F280E26F7A08E6FFF108C22 HTTP/1.1 302
263 -...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:05 -0700] GET
/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22 HTTP/1.1 200 8056
-...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
/resources/comp.Comp/main.css HTTP/1.1 200 9904 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
/resources/comp.Comp/print.css HTTP/1.1 200 459 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js;jsessionid=271042707F280E26F7A08E6FFF108C22
HTTP/1.1 200 8939 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=271042707F280E26F7A08E6FFF108C22
HTTP/1.1 200 1184 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
/resources/comp.Comp/prototype.js HTTP/1.1 200 47603 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
/%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3?wicket:interface=:12
HTTP/1.1 200 4623 
https://www.foodhandler.org/take-the-test%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3
...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:07 -0700] GET
/resources/comp.Comp/main.css HTTP/1.1 200 9904 
https://www.foodhandler.org/%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3?wicket:interface=:12:::
:...
XXX.XXX.29.22 - - [11/Jun/2009:01:28:07 -0700] GET
/resources/comp.Comp/print.css HTTP/1.1 200 459 
https://www.foodhandler.org/%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3?wicket:interface=:12:::
:...


Re: Apache Logs, Session IDs, and PageExpiredException

2009-06-11 Thread Dane Laverty
Thanks for pointing that out. I've tried some other changes, so I'll wait
and see how they work out. However, if the problem persists I'll look into
the possibility of it being an HTTPS-related issue. That line of reasoning
hadn't ever occurred to me.

Dane

On Thu, Jun 11, 2009 at 1:09 PM, Igor Vaynberg igor.vaynb...@gmail.com
wrote:

 good catch Jason.

 We have also ran into this when implementing wicket's @RequireHttps
 annotation, there is a javadoc section in HttpsRequestCycleProtocol
 that talks about this cookie pain.

 -igor

 On Thu, Jun 11, 2009 at 1:03 PM, Jason Leaja...@kumachan.net.nz wrote:
  I notice there are some secure requests there (https)... so I will now
  blindly assume you are having the same problem I had in the past...
 
  I had a problem with session ids changing when trying to swtich between
  secure/insecure pages.
  If your first request to a tomcat server is secure, and a session is
  created, tomcat will create a secure session id cookie that will only be
  sent in https requests.  If you request a non-secure (http) page request
it
  will not send the cookie, and a new insecure session cookie is created.
 
  One way to fix* this is to use a http request filter that checks for new
  session id cookie creation, and writing a new insecure cookie if a
secure
  one has been created.  Something like this:
   http://forum.springsource.org/archive/index.php/t-65651.html
 
  *when I say fix, I mean make the system less secure :)
 
  Igor Vaynberg wrote:
 
  yes, a changing sessionid will cause a page expired error because the
  client all of a sudden gets a new blank session.
 
  changing session ids can be caused by either session expiration or a
  manual session invalidation - like during a logout procedure.
 
  you have to figure out what causes the session to get dumped and a new
  one to be created in your application/servlet container.
 
  -igor
 
  On Thu, Jun 11, 2009 at 9:56 AM, Dane Lavertydanelave...@gmail.com
  wrote:
 
 
  I'm trying to track down the source of frequent PageExpiredExceptions
  that
  we're getting on our deployment server. One of the errors occured at
  01:28:06 this morning. In the Apache logs, I discovered that the
user's
  session ID spontaneously changed at that time, (see the change between
  lines
  4  5 below, and then again between lines 11  12). Is that just a
  coincidence, or would a changing session ID cause the
  PageExpiredException?
  And if so, what causes the session ID to change? (I'm using Wicket
1.3.6.
  I
  can't replicate the errors in development, which sounds common
according
  to
  the several PageExpiredException threads. I'm not seeing any sort of
  serialization errors either.) Thanks for your help!
 
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:03 -0700] GET
  /resources/comp.Comp/Oregon2.jpg HTTP/1.1 200 22145 
 
 
https://www.foodhandler.org/login%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:03 -0700] GET
  /resources/comp.Comp/newVGrad.png HTTP/1.1 200 48736 
 
 
https://www.foodhandler.org/login%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:03 -0700] GET
  /resources/comp.Comp/navBoxBottom.jpg HTTP/1.1 200 14140 
 
 
https://www.foodhandler.org/login%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:05 -0700] GET
  /pay%3bjsessionid=E0381EA98B6C107CD1D4DF8FDE5D88C3 HTTP/1.1 302 -
-...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:05 -0700] GET
  /foodhandler/login;jsessionid=271042707F280E26F7A08E6FFF108C22
HTTP/1.1
  302
  263 -...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:05 -0700] GET
  /login%3bjsessionid=271042707F280E26F7A08E6FFF108C22 HTTP/1.1 200
8056
  -...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
  /resources/comp.Comp/main.css HTTP/1.1 200 9904 
 
 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
  /resources/comp.Comp/print.css HTTP/1.1 200 459 
 
 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
 
 
/resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js;jsessionid=271042707F280E26F7A08E6FFF108C22
  HTTP/1.1 200 8939 
 
 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
 
 
/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js;jsessionid=271042707F280E26F7A08E6FFF108C22
  HTTP/1.1 200 1184 
 
 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
  /resources/comp.Comp/prototype.js HTTP/1.1 200 47603 
 
 
https://www.foodhandler.org/login%3bjsessionid=271042707F280E26F7A08E6FFF108C22
  ...
  XXX.XXX.29.22 - - [11/Jun/2009:01:28:06 -0700] GET
 

DropDownChoice with Id Value

2009-05-27 Thread Dane Laverty
I'm using a DropDownChoice that looks like this:

DropDownChoice component = new DropDownChoice(component,
new PropertyModel(task,
componentId),
new PropertyModel(task,
project.components),
new ChoiceRenderer(name, id));

The problem is that task.project.components is a ListComponent and
task.componentId is an int, so I get an error that says:

No get method defined for class: class java.lang.Integer expression: id

I know that I can fix the problem by making the DropDownChoice's model a
Component instead of an int. However, I would like to avoid that, since that
would require reworking the Task class. Is there a way to make this work?


Re: Separating Development and Deployment

2009-05-20 Thread Dane Laverty
Awesome, that's exactly what I was looking for. Thanks!

On Wed, May 20, 2009 at 9:59 AM, Clint Popetz cl...@42lines.net wrote:

 I recommend using ${} variables in web.xml and resource filtering, as
 you mentioned, but  the way to avoid changing them all the time in
 pom.xml is to have different maven profiles that set them differently
 in your pom.  It is true that you'll have to do things like
 -PtomcatDeployment when running maven to activate them, but then all
 your random variables are controlled by a uniform set of profiles, and
 you aren't trying to remember which options to set for which target
 deployment.  You can also set up the profiles to be active based on
 certain environments, or automate setting them in build scripts or in
 settings.xml.

 Maven profiles are da bomb, IMHO.  Especially when building for lots
 of target environments
 (qa/mirroring/local-dev/load-testing/continuous-integration) and on
 different platforms.

 -Clint

 On Wed, May 20, 2009 at 11:40 AM, Dane Laverty danelave...@gmail.com
 wrote:
  I've got my project set up to deploy with Maven's Tomcat plugin now. My
 next
  step is getting the web.xml to use the correct Wicket configuration
  (development/deployment) value. Is there a way to run two separate
 web.xml
  files for the application, and then somehow have Maven pick up the
 correct
  one when I run mvn tomcat:deploy? Or am I going about this the wrong
 way
  entirely? I've done some reading and it sounds like people are using web
  resource filtering to address the issue, however to me it seems that it
  just moves the parameters from the web.xml to the pom.xml, and that I
 would
  have to manually change them in the pom.xml when I want to change from
  deployment to development.
 



 --
 Clint Popetz
 http://42lines.net
 Scalable Web Application Development

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




Re: Separating Development and Deployment

2009-05-20 Thread Dane Laverty
Clint - I've run into one (hopefully minor) hitch with the process. The
filtering works, but only after I've used Maven to deploy the project. When
I'm developing, however, I just run the project on the Jetty server that
comes with the Quickstart. Of course, that means that the ${} variables are
treated as literal values. Is there a way to filter the project locally
without having to run a Maven build every time I make a change?

James - Spring and Hibernate are next on my things-to-learn list, after I
get Maven (and perhaps Continuum) figured out.

Thanks to both of you for the input!


On Wed, May 20, 2009 at 10:48 AM, James Carman jcar...@carmanconsulting.com
 wrote:

 Check out the way I did it in my wicket-advanced example application:

 http://svn.carmanconsulting.com/public/wicket-advanced/trunk

 I did a combination of maven profiles and Spring's
 PropertyPlaceholderConfigurer.  If you're not using Spring, it won't
 help, but if you are, it might be interesting to you.

 On Wed, May 20, 2009 at 12:59 PM, Clint Popetz cl...@42lines.net wrote:
  I recommend using ${} variables in web.xml and resource filtering, as
  you mentioned, but  the way to avoid changing them all the time in
  pom.xml is to have different maven profiles that set them differently
  in your pom.  It is true that you'll have to do things like
  -PtomcatDeployment when running maven to activate them, but then all
  your random variables are controlled by a uniform set of profiles, and
  you aren't trying to remember which options to set for which target
  deployment.  You can also set up the profiles to be active based on
  certain environments, or automate setting them in build scripts or in
  settings.xml.
 
  Maven profiles are da bomb, IMHO.  Especially when building for lots
  of target environments
  (qa/mirroring/local-dev/load-testing/continuous-integration) and on
  different platforms.
 
  -Clint
 
  On Wed, May 20, 2009 at 11:40 AM, Dane Laverty danelave...@gmail.com
 wrote:
  I've got my project set up to deploy with Maven's Tomcat plugin now. My
 next
  step is getting the web.xml to use the correct Wicket configuration
  (development/deployment) value. Is there a way to run two separate
 web.xml
  files for the application, and then somehow have Maven pick up the
 correct
  one when I run mvn tomcat:deploy? Or am I going about this the wrong
 way
  entirely? I've done some reading and it sounds like people are using
 web
  resource filtering to address the issue, however to me it seems that it
  just moves the parameters from the web.xml to the pom.xml, and that I
 would
  have to manually change them in the pom.xml when I want to change from
  deployment to development.
 
 
 
 
  --
  Clint Popetz
  http://42lines.net
  Scalable Web Application Development
 
  -
  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




Separating Development and Deployment

2009-05-20 Thread Dane Laverty
I've got my project set up to deploy with Maven's Tomcat plugin now. My next
step is getting the web.xml to use the correct Wicket configuration
(development/deployment) value. Is there a way to run two separate web.xml
files for the application, and then somehow have Maven pick up the correct
one when I run mvn tomcat:deploy? Or am I going about this the wrong way
entirely? I've done some reading and it sounds like people are using web
resource filtering to address the issue, however to me it seems that it
just moves the parameters from the web.xml to the pom.xml, and that I would
have to manually change them in the pom.xml when I want to change from
deployment to development.


Re: Separating Development and Deployment

2009-05-20 Thread Dane Laverty
Thanks for piping in, Martijn. I should have clarified, my deployment and
development environments use different databases. I'm storing the database
connection information inside of the web.xml also, so I need to be able to
switch those as well as the Wicket configuration depending on the
environment. I suppose I could store the connection information for both,
and then select one based on the Wicket configuration, though that sounds a
little hack-ish.

On Wed, May 20, 2009 at 11:51 AM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 Set a system property in your server config or startup script that
 tells wicket it's running in deployment mode.
 -Dwicket.configuration=deployment is all there's to it.

 Martijn

 On Wed, May 20, 2009 at 6:40 PM, Dane Laverty danelave...@gmail.com
 wrote:
  I've got my project set up to deploy with Maven's Tomcat plugin now. My
 next
  step is getting the web.xml to use the correct Wicket configuration
  (development/deployment) value. Is there a way to run two separate
 web.xml
  files for the application, and then somehow have Maven pick up the
 correct
  one when I run mvn tomcat:deploy? Or am I going about this the wrong
 way
  entirely? I've done some reading and it sounds like people are using web
  resource filtering to address the issue, however to me it seems that it
  just moves the parameters from the web.xml to the pom.xml, and that I
 would
  have to manually change them in the pom.xml when I want to change from
  deployment to development.
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.5 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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




Re: Tools for Managing a Wicket Project

2009-05-18 Thread Dane Laverty
I just wanted to thank Jeremy, Scott, and Linda for recommending Effective
Java. I read through the book this week. It's wonderful -- accessible and
useful. Now I'm in the process of refactoring my project to start applying
the concepts.

On Fri, May 1, 2009 at 8:53 AM, Carlo Camerino cmcamer...@gmail.com wrote:

 we used to be bugzilla, mediawiki, continuum statck.we moved to Trac. It
 was
 simply amazing with all those plugins.

 Code Review WIth Trac Is Good.
 Review Board is also good software but it doesn't suit our programming
 needs.

 On Fri, May 1, 2009 at 11:38 PM, Matt Welch matt...@welchkin.net wrote:

 
  Tools that our team is using (after some trial and error):
 
  IDE - Eclipse/IDEA
  Source Control - SVN
  Build - Maven
  Local Network Maven Repo - Nexus (after a year trying different ones)
  Build Server  - TeamCity, which absolutely rocks (We actually purchased
 and
  used Bamboo for 9 months. I can't believe it comes from the same company
 as
  JIRA. Bamboo was terrible.)
  Story Mgmt/Defects - Rally (hosted commercial app for agile projects; not
  bad, but not fantastic either)
  Code Review - Code Collaborator (again not bad and I'd rather have it
 than
  nothing at all, but could be better)
 
 
  Our QA team has used various testing tools from expensive commercial
 tools
  like Mercury (now HP) Quality Center to Selenium. They use Rally for
 defect
  management.
 
  My highest recommendations are for TeamCity, Nexus, and SVN.
 
  -Matt
 
 
  --
  View this message in context:
 
 http://www.nabble.com/Tools-for-Managing-a-Wicket-Project-tp23299396p23334970.html
  Sent from the Wicket - User mailing list archive at Nabble.com.
 



Re: Maven setup

2009-05-06 Thread Dane Laverty
There's a basic installation guide for Maven, Eclipse, and Wicket on the
wiki:
http://cwiki.apache.org/WICKET/windows-guide-to-installing-wicket-on-eclipse-with-maven.html

Dane

On Wed, May 6, 2009 at 11:36 AM, David Brown
dbr...@sexingtechnologies.comwrote:

 Hello Frank, I can't answer all the questions but...

 * I'm a 10+ year nearly Java only developer. I was initially very impressed
 with databinder but the only real support for databinder I could find is @:
 http://code.google.com/p/wicket-web-beans/
 * I have 1.3.5 running in Eclipse (Ganymede) with Maven OK and I plan to
 upgrade to 1.3.6 as my new gig requires this framework.
 * Hibernate is a great ORM gadget but it is not 100% Java so PermGen space
 can be an issue. So, as an alternative you could investigate iBatis and I
 think Wicket also does well in the DAO arena. I'm only 100 pp into the WIA
 book so obviously you will need more folks chipping in with better
 experience.

 There are 10 kinds of people in this world: those who understand binary and
 those who don’t (Valid only for 2's complement).

 - Original Message -
 From: Frank Tegtmeyer frank.tegtme...@online-systemhaus.com
 To: users@wicket.apache.org
 Sent: Wednesday, May 6, 2009 5:47:25 AM GMT -06:00 US/Canada Central
 Subject: Maven setup

 Hi,

 does anybody have a Wicket quickstart project updated
 to the latest versions?

 I am new to Java, to Maven and to Wicket of course too.
 I have a background in web developing with Zope and
 Django (all implemented in Python) but am forced to use
 Java now. I know that the learning curve will be steep
 and I got some showstoppers already :)

 After reading much about many Java frameworks and some
 frustrating tests with JSF I've chosen Wicket because
 it fits my requirements best. I've done some tests
 with databinder which promoted Maven heavily, so I
 want to use Maven too.

 I'm still struggling with the whole setup - the following
 issues are still not clear to me:

 - Maven setup - Wicket dependency doesn't work for 1.3.5
  nor for 1.3.6 although the website says so
  (data at the end of this message)
  Possibly another repository required?
 - integration with Eclipse - Maven goal or Eclipse plugin
  or both?
 - I want to use embedded Jetty also for production
  (running the application behind lighttpd).
  How to do deployment in an elegant way?
  There is only SSH access to my server.
 - Hibernate integration - does databinder help much
  or is it better to learn Hibernate directly? I saw
  that databinder always is somewhat behind the
  current versions, so that may be an issue.

 I hope these are not too stupid questions and someone will
 find the time to answer them.

 With kind regards,
 Frank

 The Maven dependency for wicket:

 dependency
  groupIdwicket/groupId
  artifactIdwicket/artifactId
  version1.3.5/version
 /dependency

 The error:

 [INFO]task-segment: [compile]
 [INFO]
 
 [INFO] [resources:resources]
 [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
 resources, i.e. build is platform dependent!
 [INFO] Copying 1 resource
 Downloading:
 http://mirrors.sunsite.dk/maven2/wicket/wicket/1.3.5/wicket-1.3.5.pom
 [INFO] Unable to find resource 'wicket:wicket:pom:1.3.5' in repository
 central (http://repo1.maven.org/maven2)
 [INFO] artifact wicket:wicket-extensions: checking for updates from
 central
 [INFO] artifact mysql:mysql-connector-java: checking for updates from
 central
 [INFO] artifact org.mortbay.jetty:jetty: checking for updates from central
 Downloading:
 http://mirrors.sunsite.dk/maven2/wicket/wicket/1.3.5/wicket-1.3.5.jar
 [INFO] Unable to find resource 'wicket:wicket:jar:1.3.5' in repository
 central (http://repo1.maven.org/maven2)
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] Failed to resolve artifact.


 -
 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




Tools for Managing a Wicket Project

2009-04-29 Thread Dane Laverty
My boss has asked me to manage development for a Java project. I'm going to
be working with two other programmers and one designer.

This is the first time that our organization has tried to formally
coordinate several programmers on a project together, and it is also the
first Java project we've done here (I'm the only programmer with extensive
Java experience). I chose to use Wicket for this project because it seemed
to be the most intuitive framework, and because I hope it will make it easy
for the designer and programmers to work together without stepping on each
others toes.

At my previous job, we used CVS for managing code contribution and Ant for
deployment. Is that still a good solution, or should I be looking at other
tools? Also, how do you coordinate the designer's work with the programmers'
work?

My goal is to find a few tools that
- work well with Wicket
- make it easy for programmers to check code in and out
- manage project dependencies
- are easy to set up
- are easy to use
- are free

I appreciate any and all suggestions. Thanks for your help!


Re: Tools for Managing a Wicket Project

2009-04-29 Thread Dane Laverty
Thanks for the suggestions of Continuum, Hudson, and Archiva. I'm not
familiar with any of them, so that at least gives me some direction. Also,
is there a book or website you would recommend that explains some best
practices for Java project management?

I would love to get a team training course in here. That's what we really
need, but recent budget cuts have forced the college to cut way back on its
training budget. As soon as the funding is back, I'm planning to give you
guys a call :)

On Wed, Apr 29, 2009 at 8:39 AM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 I'd definitely suggest SVN over CVS and Maven over Ant.  Maven truly
 manages dependencies.  Ant does not.

 I'd suggest Continuum rather than Hudson simply because it is quick
 and easy to set up and it is built to build Maven projects - so it
 will be easier for your inexperienced team to do so.

 And of course, a team training course is never a bad idea :)

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




 On Wed, Apr 29, 2009 at 10:19 AM, Florian Sperber f...@sperber.info
 wrote:
  Hi Dane,
 
  Dane Laverty schrieb:
 
  My goal is to find a few tools that
  - work well with Wicket
  - make it easy for programmers to check code in and out
  - manage project dependencies
  - are easy to set up
  - are easy to use
  - are free
 
  I appreciate any and all suggestions. Thanks for your help!
 
 
  what about:
 
  - svn (instead of cvs)
  - maven (check the quickstart project on the wicket page)
  - archiva (your own maven repository)
  - hudson (continous integration build system)
 
 
  Kind regards
  Florian Sperber
 
  -
  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: Tools for Managing a Wicket Project

2009-04-29 Thread Dane Laverty
Thanks again to everyone for all the feedback. I'm reading through Design
Patterns and Wicket in Action, but I've never heard of Effective Java. The
Amazon reviews for that book are also amazing. I've got it ordered now and
am excited to see what it will bring.

On Wed, Apr 29, 2009 at 12:37 PM, Scott Swank scott.sw...@gmail.com wrote:

 I agree with Jeremy, that tech books are probably far more important
 than project management books for a first Java project.

 Basics
 -Effective Java, Joshua Block
 -Wicket in Action, Dashorst  Hillenius
 -one more on jdbc or hibernate or ibatis -- your persistence api

 Design (language agnostic)
 -Design Patterns, gang of four
 -Domain Driven Design, Eric Evans

 Advanced (as needed)
 -Java Concurrency in Practice, Goetz
 -NIO from O'Reilly
 -whatever...

 Scott


 On Wed, Apr 29, 2009 at 12:19 PM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
  I would HIGHLY recommend that each of you get a copy of Joshua Bloch's
  Effective Java, now in it's second edition.  It's not really project
  management, but since your team as a whole is not mature with Java, it
  will offer some good advice.  Of course, make sure everyone is
  familiar with Wicket in Action and has gone through the exercises -
  that will give them a good foundation.
 
  As far as books on Java project management, I don't have any
  recommendations.  I've perused some but never been fascinated.  Maybe
  someone else will have a good recommendation.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com

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




Adding a model to a custom panel

2009-04-24 Thread Dane Laverty
I’m building a Panel called TaskPanel that will display the contents of my
Task class. This simple Panel has a single constructor and a method, that
looks like this:

public class TaskPanel extends Panel {

Task task;

public TaskPanel(String id, final Task task) {
super(id);
add(new Label(name, task.getName()));
add(new Label(description, task.getDescription()));
add(new Label(assignedTo, task.getAssignedTo()));

this.task = task;
}

@Override
protected void onComponentTag(ComponentTag tag) {
if (task.isSelected()) {
// Do something
}
}
}


It seems like I should make Task the model for the Panel, but I'm having
trouble finding information on how to connect them. I imagine it should look
something like this:

public class TaskPanel extends Panel {

public TaskPanel(String id, IModel task) {
super(id, task);
add(new Label(name, ???));
add(new Label(description, ???));
add(new Label(assignedTo, ???));
}

@Override
protected void onComponentTag(ComponentTag tag) {
if (getModel().???.isSelected()) {
// Do something
}
}
}

Am I even heading in the right direction? Is this the right place to be
using a Model, or should I just stick with keeping the Task as an instance
variable in the class?


Re: Adding a model to a custom panel

2009-04-24 Thread Dane Laverty
Thanks, that seems pretty straightforward. However, it makes me
wonder, what is the advantage of using a model instead of just using
the Task as a class variable? The model adds an extra layer of
complexity, and I don't see the benefit.


-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Friday, April 24, 2009 10:12 AM
To: users@wicket.apache.org
Subject: Re: Adding a model to a custom panel

public TaskPanel(String id, IModelTask task) {
   super(id, task);
   add(new Label(name,new propertymodel(task, name));


 protected void onComponentTag(ComponentTag tag) {
    if (getModel().getObject().isSelected()) {
    // Do something
    }
    }

-igor


On Fri, Apr 24, 2009 at 7:57 AM, Dane Laverty danelave...@gmail.com wrote:

 I’m building a Panel called TaskPanel that will display the contents of my
 Task class. This simple Panel has a single constructor and a method, that
 looks like this:

 public class TaskPanel extends Panel {

    Task task;

    public TaskPanel(String id, final Task task) {
        super(id);
        add(new Label(name, task.getName()));
        add(new Label(description, task.getDescription()));
        add(new Label(assignedTo, task.getAssignedTo()));

        this.task = task;
    }

       �...@override
    protected void onComponentTag(ComponentTag tag) {
        if (task.isSelected()) {
            // Do something
        }
    }
 }


 It seems like I should make Task the model for the Panel, but I'm having
 trouble finding information on how to connect them. I imagine it should look
 something like this:

 public class TaskPanel extends Panel {

    public TaskPanel(String id, IModel task) {
        super(id, task);
        add(new Label(name, ???));
        add(new Label(description, ???));
        add(new Label(assignedTo, ???));
    }

       �...@override
    protected void onComponentTag(ComponentTag tag) {
        if (getModel().???.isSelected()) {
            // Do something
        }
    }
 }

 Am I even heading in the right direction? Is this the right place to be
 using a Model, or should I just stick with keeping the Task as an instance
 variable in the class?

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



Clickably Selectable DIVs

2009-04-22 Thread Dane Laverty
I'm working on a project management application that lists all of a
project's tasks. Each task is displayed as a DIV. I want the user to be
able to select a specific task by clicking on its DIV, which would then
highlight that DIV by adding a CSS class and display some information
about the task in a separate panel.

 

I can use an AjaxFallbackLink to get the information to display, but how
can I add a CSS class when the DIV is clicked, and then remove the CSS
class when another DIV is clicked?



RE: Clickably Selectable DIVs

2009-04-22 Thread Dane Laverty
Fabulous. Thank you for the quick response!

-Original Message-
From: Jeremy Thomerson [mailto:jer...@wickettraining.com] 
Sent: Wednesday, April 22, 2009 10:58 AM
To: users@wicket.apache.org
Subject: Re: Clickably Selectable DIVs

Try something like this in the onClick(AjaxRequestTarget):

this.add(new SimpleAttributeModifier(class, foobar));
target.add(this);

previouslyClicked.add(new SimpleAttributeModifier(class,
otherclass));
target.add(previouslyClicked);

previouslyClicked = this;

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



On Wed, Apr 22, 2009 at 12:52 PM, Dane Laverty
danelave...@chemeketa.eduwrote:

 I'm working on a project management application that lists all of a
 project's tasks. Each task is displayed as a DIV. I want the user to
be
 able to select a specific task by clicking on its DIV, which would
then
 highlight that DIV by adding a CSS class and display some information
 about the task in a separate panel.



 I can use an AjaxFallbackLink to get the information to display, but
how
 can I add a CSS class when the DIV is clicked, and then remove the CSS
 class when another DIV is clicked?



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



RE: Wicket Quickstart Installation Guide for Beginners

2009-03-04 Thread Dane Laverty
Alright, I just created a JIRA account. I've browsed to the Wicket project, but 
I don't see any way to create a new issue. At the top of the screen I have 
HOME, BROWSE PROJECT and FIND ISSUES, and under that I see Open Issues, 
Road Map, Change Log, Popular Issues, Subversion Commits, Releases, 
Versions, Components, and FishEye. Where should I go to create an issue?

-Original Message-
From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] 
Sent: Tuesday, March 03, 2009 11:14 PM
To: users@wicket.apache.org
Subject: Re: Wicket Quickstart Installation Guide for Beginners

I think the admins disabled attachments for non-committers. Can you
attach them through a JIRA issue? then someone with the correct
permissions can upload them. Just make sure to give them identifiable
names, and don't forget to check the Intended for inclusion in Apache
products check box :)

Martijn

On Wed, Mar 4, 2009 at 1:45 AM, Dane Laverty danelave...@chemeketa.edu wrote:
 Thanks, it looks good. I checked the Confluence website about adding
 images to a page and it says:

 To attach a file to a page,

   1. Go to the page and click on the 'Attachments' tab.

   2. Browse through your files and select the file you'd like to
 attach.

   3. Enter a description for the attachment in the 'Comment' text
 field (optional).

   4. Click 'Attach more files' if required.

   5. Click 'Attach File'.

 I'm not seeing any 'Attachments' tab. Do I need different permissions?
 Or do I have to link to an image hosted elsewhere?


 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Tuesday, March 03, 2009 4:23 PM
 To: users@wicket.apache.org
 Subject: Re: Wicket Quickstart Installation Guide for Beginners

 i got you most of the way there, you just need to upload images and
 put them in the right place

 when you hit edit page, switch to the first tab which says rich
 format that should give you a nice wysiwig editor to work with.

 -igor

 On Tue, Mar 3, 2009 at 4:08 PM, Dane Laverty danelave...@chemeketa.edu
 wrote:
 I attempted to do that, but without any luck. I'm not at all familiar
 with wikis, but I'd be happy to do it if someone will point me in the
 right direction.

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Tuesday, March 03, 2009 3:44 PM
 To: users@wicket.apache.org
 Subject: Re: Wicket Quickstart Installation Guide for Beginners

 you can add a link to it off our wiki. or possibly upload it to the
 wiki, not sure how attachments there work.

 -igor

 -
 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





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

-
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: Wicket Quickstart Installation Guide for Beginners

2009-03-04 Thread Dane Laverty
Alright Igor, that's all of them. Thanks for everyone's help with this.


RE: Wicket Quickstart Installation Guide for Beginners

2009-03-04 Thread Dane Laverty
Great. I've finished putting the pictures into the document. Is there a
place on the wiki where I should locate the page?

Dane

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Wednesday, March 04, 2009 10:55 AM
To: users@wicket.apache.org
Subject: Re: Wicket Quickstart Installation Guide for Beginners

they are attached

-igor

On Wed, Mar 4, 2009 at 10:48 AM, Dane Laverty
danelave...@chemeketa.edu wrote:
 Alright Igor, that's all of them. Thanks for everyone's help with
this.


-
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



Wicket Quickstart Installation Guide for Beginners

2009-03-03 Thread Dane Laverty
I've just finished a Wicket Quickstart Guide for some of my coworkers
who are interested in using Wicket. It steps through installation of
Maven, Eclipse, M2Eclipse, WTP, and a Quickstart. I thought I'd pass it
along here in case it's of value to anyone else. 

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

RE: Wicket Quickstart Installation Guide for Beginners

2009-03-03 Thread Dane Laverty
I tried attaching it, but I guess that doesn't work. You can check it
out here:

https://www.foodhandler.org/wicketGuide/WicketQuickstartGuide.pdf

or here

https://www.foodhandler.org/wicketGuide/WicketQuickstartGuide.doc 

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Tuesday, March 03, 2009 3:27 PM
To: users@wicket.apache.org
Subject: Re: Wicket Quickstart Installation Guide for Beginners

you forgot the link :)

-igor

On Tue, Mar 3, 2009 at 3:21 PM, Dane Laverty danelave...@chemeketa.edu
wrote:
 I've just finished a Wicket Quickstart Guide for some of my coworkers
who
 are interested in using Wicket. It steps through installation of
Maven,
 Eclipse, M2Eclipse, WTP, and a Quickstart. I thought I'd pass it along
here
 in case it's of value to anyone else.

 -
 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: Wicket Quickstart Installation Guide for Beginners

2009-03-03 Thread Dane Laverty
I attempted to do that, but without any luck. I'm not at all familiar
with wikis, but I'd be happy to do it if someone will point me in the
right direction.

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Tuesday, March 03, 2009 3:44 PM
To: users@wicket.apache.org
Subject: Re: Wicket Quickstart Installation Guide for Beginners

you can add a link to it off our wiki. or possibly upload it to the
wiki, not sure how attachments there work.

-igor

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



RE: Wicket Quickstart Installation Guide for Beginners

2009-03-03 Thread Dane Laverty
Thanks, it looks good. I checked the Confluence website about adding
images to a page and it says:

 To attach a file to a page,

   1. Go to the page and click on the 'Attachments' tab.

   2. Browse through your files and select the file you'd like to
attach.

   3. Enter a description for the attachment in the 'Comment' text
field (optional).

   4. Click 'Attach more files' if required.

   5. Click 'Attach File'.

I'm not seeing any 'Attachments' tab. Do I need different permissions?
Or do I have to link to an image hosted elsewhere?


-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Tuesday, March 03, 2009 4:23 PM
To: users@wicket.apache.org
Subject: Re: Wicket Quickstart Installation Guide for Beginners

i got you most of the way there, you just need to upload images and
put them in the right place

when you hit edit page, switch to the first tab which says rich
format that should give you a nice wysiwig editor to work with.

-igor

On Tue, Mar 3, 2009 at 4:08 PM, Dane Laverty danelave...@chemeketa.edu
wrote:
 I attempted to do that, but without any luck. I'm not at all familiar
 with wikis, but I'd be happy to do it if someone will point me in the
 right direction.

 -Original Message-
 From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
 Sent: Tuesday, March 03, 2009 3:44 PM
 To: users@wicket.apache.org
 Subject: Re: Wicket Quickstart Installation Guide for Beginners

 you can add a link to it off our wiki. or possibly upload it to the
 wiki, not sure how attachments there work.

 -igor

 -
 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: Inconsistent Model Binding on Form Submit

2009-02-17 Thread Dane Laverty
In order to see what's going on here, I added this line to my TestPage
class:

System.out.println(*** Form Test:  + user.getTest().toString());
add(new TestForm(testForm, new
CompoundPropertyModel(user.getTest(;

and then I went into FormComponent.java and added a similar line to
updateModel():

public void updateModel()
{
if (getConvertedInput() instanceof Answer) {
System.out.println(*** Updated Test:  +
this.getParent().getParent().getParent().getModelObject().toString());
}

setModelObject(getConvertedInput());
}

I've found that most of the time, the toString() values are the same,
like this:

*** Form Test: edu.chemeketa.foodhandler.objects.t...@daa75c
*** Updated Test: edu.chemeketa.foodhandler.objects.t...@daa75c

But on the instances when the Form's onSubmit() gives null for its
object models, the Test addresses are different:

*** Form Test: edu.chemeketa.foodhandler.objects.t...@12979a1
*** Updated Test: edu.chemeketa.foodhandler.objects.t...@1ec9fdc

I'll keep working on it, but if anyone has any idea why the ModelObject
would change, please let me know.

-Original Message-
From: Dane Laverty [mailto:danelave...@chemeketa.edu] 
Sent: Tuesday, February 10, 2009 4:56 PM
To: users@wicket.apache.org
Subject: Inconsistent Model Binding on Form Submit

I have a test form based on a CompoundPropertyModel. Usually it works
great, but for some users, their answers are lost when they submit the
form. The problem is user-dependent, i.e. it always breaks for certain
users and it never breaks for the other users. If a user calls us with
this problem, we haven't been able to find anyway to get around it. I
haven't been able to replicate the problem on my computer. I posted
about this a few months ago, thinking it was a session problem, but now
I see that the problem happens right when the test is submitted. This is
with Wicket 1.3.4. Any ideas what would cause the model to lose the
information for certain users?

 

public class TestPage

{

 

public TestPage() {

add(new TestForm(testForm, new
CompoundPropertyModel(getSession().getUser().getTest(;

}

  

public TestForm(final String id, CompoundPropertyModel testModel) {

super(id, testModel);

  

add(new ListView(questions) {



  @Override

  public boolean getReuseItems() {

return true;

  }

 

  protected void populateItem(ListItem item) {

 

final Question question = (Question)
item.getModelObject();

  

FoodHandlerRadioChoice answersRadioChoice = new
FoodHandlerRadioChoice(answers, 

  new
PropertyModel(question, markedAnswer), 

 
question.getAnswers());

answersRadioChoice.setRequired(true);


item.add(answersRadioChoice);   

   

}   

});

  }



  protected void onSubmit() {

// The following should return an object. Usually it does,
but sometimes

// it just returns null. Oh why, oh why? 

 
getSession().getUser().getTest().getQuestions().get(0).getMarkedAnswer()
;

setResponsePage(TestResultsPage.class);

  }

} 




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



RE: Inconsistent Model Binding on Form Submit

2009-02-11 Thread Dane Laverty
That's a good consideration. However, the error logs show that the error
does not appear to be browser dependent. It occurs with Firefox, Safari,
and IE. I just checked it by hitting Enter rather than clicking the
Submit button, but that doesn't appear to change anything.


-Original Message-
From: Timo Rantalaiho [mailto:timo.rantala...@ri.fi] 


Could it be that they are submitting the form with Enter on 
a certain browser?

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



Inconsistent Model Binding on Form Submit

2009-02-10 Thread Dane Laverty
I have a test form based on a CompoundPropertyModel. Usually it works
great, but for some users, their answers are lost when they submit the
form. The problem is user-dependent, i.e. it always breaks for certain
users and it never breaks for the other users. If a user calls us with
this problem, we haven't been able to find anyway to get around it. I
haven't been able to replicate the problem on my computer. I posted
about this a few months ago, thinking it was a session problem, but now
I see that the problem happens right when the test is submitted. This is
with Wicket 1.3.4. Any ideas what would cause the model to lose the
information for certain users?

 

public class TestPage

{

 

public TestPage() {

add(new TestForm(testForm, new
CompoundPropertyModel(getSession().getUser().getTest(;

}

  

public TestForm(final String id, CompoundPropertyModel testModel) {

super(id, testModel);

  

add(new ListView(questions) {



  @Override

  public boolean getReuseItems() {

return true;

  }

 

  protected void populateItem(ListItem item) {

 

final Question question = (Question)
item.getModelObject();

  

FoodHandlerRadioChoice answersRadioChoice = new
FoodHandlerRadioChoice(answers, 

  new
PropertyModel(question, markedAnswer), 

 
question.getAnswers());

answersRadioChoice.setRequired(true);


item.add(answersRadioChoice);   

   

}   

});

  }



  protected void onSubmit() {

// The following should return an object. Usually it does,
but sometimes

// it just returns null. Oh why, oh why? 

 
getSession().getUser().getTest().getQuestions().get(0).getMarkedAnswer()
;

setResponsePage(TestResultsPage.class);

  }

} 





RE: Inconsistent Model Binding on Form Submit

2009-02-10 Thread Dane Laverty
I apologize for the awful code formatting. Is there a way to maintain
readable formatting when I post code to this mail list?

-Original Message-
From: Dane Laverty [mailto:danelave...@chemeketa.edu] 
Sent: Tuesday, February 10, 2009 4:56 PM
To: users@wicket.apache.org
Subject: Inconsistent Model Binding on Form Submit

I have a test form based on a CompoundPropertyModel. Usually it works
great, but for some users, their answers are lost when they submit the
form. The problem is user-dependent, i.e. it always breaks for certain
users and it never breaks for the other users. If a user calls us with
this problem, we haven't been able to find anyway to get around it. I
haven't been able to replicate the problem on my computer. I posted
about this a few months ago, thinking it was a session problem, but now
I see that the problem happens right when the test is submitted. This is
with Wicket 1.3.4. Any ideas what would cause the model to lose the
information for certain users?

 

public class TestPage

{

 

public TestPage() {

add(new TestForm(testForm, new
CompoundPropertyModel(getSession().getUser().getTest(;

}

  

public TestForm(final String id, CompoundPropertyModel testModel) {

super(id, testModel);

  

add(new ListView(questions) {



  @Override

  public boolean getReuseItems() {

return true;

  }

 

  protected void populateItem(ListItem item) {

 

final Question question = (Question)
item.getModelObject();

  

FoodHandlerRadioChoice answersRadioChoice = new
FoodHandlerRadioChoice(answers, 

  new
PropertyModel(question, markedAnswer), 

 
question.getAnswers());

answersRadioChoice.setRequired(true);


item.add(answersRadioChoice);   

   

}   

});

  }



  protected void onSubmit() {

// The following should return an object. Usually it does,
but sometimes

// it just returns null. Oh why, oh why? 

 
getSession().getUser().getTest().getQuestions().get(0).getMarkedAnswer()
;

setResponsePage(TestResultsPage.class);

  }

} 




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



QuickStart not finding Wicket classes

2009-01-26 Thread Dane Laverty
I've stepped through the Wicket QuickStart process as outlined at
http://wicket.apache.org/quickstart.html . However, when I try to run
the Start class, I get java.lang.ClassNotFoundException:
org.apache.wicket.protocol.http.WicketFilter. I'm not familiar with
Maven, but I can see that the POM has a dependency for
org.apache.wicket, which I had hoped would install the jar. I can
resolve the problem manually by adding the Wicket source files to my
project source, but that leaves me feeling like I'm taking the long way
around what should be a short and simple process. Any suggestions?



RE: QuickStart not finding Wicket classes

2009-01-26 Thread Dane Laverty
First, Martijn, thank you for your video. I had used your video to get
as far as I did. Second, Igor and Cemal, thank you for your quick
responses. However, I tried running the Maven goals you suggested
(eclipse:eclipse, etc.), but I just end up getting additional errors. To
clarify, I was using the QuickStart with 1.4-SNAPSHOT. Ultimately, I
changed the version to 1.3.5 and it worked. So I guess I'll stick with
that for now.

-Original Message-
From: jWeekend [mailto:jweekend_for...@cabouge.com] 
Sent: Monday, January 26, 2009 9:30 AM
To: users@wicket.apache.org
Subject: Re: QuickStart not finding Wicket classes


Running the artefact creates your project folder structure (including
some
useful and illustrative classes/templates/tests) and the POM.
You need to run some Maven goal (eg eclipse:eclipse, or compile etc) to
retrieve all the required jars into your local repository. See the Use
section (Change into the project directory, then create a WAR file via
mvn
package or build the project and run it under Jetty via mvn jetty:run
...)
on the  http://wicket.apache.org/quickstart.html QuickStart page .

Regards - Cemal
http://www.jWeekend.co.uk jWeekend 


danelav wrote:
 
 I've stepped through the Wicket QuickStart process as outlined at
 http://wicket.apache.org/quickstart.html . However, when I try to run
 the Start class, I get java.lang.ClassNotFoundException:
 org.apache.wicket.protocol.http.WicketFilter. I'm not familiar with
 Maven, but I can see that the POM has a dependency for
 org.apache.wicket, which I had hoped would install the jar. I can
 resolve the problem manually by adding the Wicket source files to my
 project source, but that leaves me feeling like I'm taking the long
way
 around what should be a short and simple process. Any suggestions?
 
 
 

-- 
View this message in context:
http://www.nabble.com/QuickStart-not-finding-Wicket-classes-tp21669263p2
1669684.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: example application for spring wicket hibernate

2009-01-22 Thread Dane Laverty
I'd like to check out the phonebook app as well, but I can't find it.
The link at
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook
says the SVN repository is at
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wick
et-phonebook/ . That doesn't work, but if I replace the https with http,
then I get to a directory tree. However, I don't see any phonebook app
under trunk in there. Am I missing something obvious?

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



Very Simple Security

2009-01-14 Thread Dane Laverty
I'm currently using Swarm to secure my web application, but I think it
provides a lot more functionality than I really need. Would simply
checking for a User object the session on each page load work as well,
or am I overlooking some major security hole? This way, when the user
logs in successfully, the session would get a User object, but otherwise
it would be null and the application would kick back to the login page.



Trying to update a tabbed panel

2009-01-12 Thread Dane Laverty
I have a tabbed panel that displays a person's information. Outside that
panel are several links, which can be clicked to change the person whose
information is being displayed in the tabbed panel.

 

My problem is that it only works the first time the user clicks a link.
Any subsequent clicks do nothing-the panel continues to show the
original person's information. Here's my code. Any suggestions what I'm
doing wrong?

 

IndividualViewArea viewArea = new WebMarkupContainer(viewArea) {

  List tabs = new ArrayList();

  tabs.add(new AbstractTab(new Model(Information)) {

@Override

public Panel getPanel(String panelId) {

  return new Panel(panelId);

}

  });

  

  AjaxTabbedPanel tabbedPanel = new AjaxTabbedPanel(individualTabs,
tabs);

  add(tabbedPanel);

};

 

AjaxFallbackLink personInfoLink1 = new
AjaxFallbackLink(personInfoLink) {

  @Override

  public void onClick(AjaxRequestTarget target) {

viewArea.tabs.set(0, new AbstractTab(new Model(Information)) {

  @Override

  public Panel getPanel(String panelId) {

return new IndividualInformationPanel(panelId,
getPerson(some_id););

  }

});

target.addComponent(viewArea);  

  }

};

 

AjaxFallbackLink personInfoLink2... // Just like personInfoLink1 above,
but with a different person

 

AjaxFallbackLink personInfoLink3... // etc.

 



Extending to all components

2009-01-06 Thread Dane Laverty
Is there an easy way to add/override a function to all my Wicket classes
(panels, pages, forms, etc.)? For example, I have a custom session.
Rather than having to cast (MySession)getSession() , I just want
getSession() to return a MySession. Two solutions come to mind, but
neither seems optimal.

 

First, I could create a MyPanel for all my panels to extend, a MyPage
for all my pages to extend, etc. and have MyPanel and MyPage override
getSession(). However, that means a lot of duplicated code.

 

Second, I could update the Wicket source code, which would be quick and
easy, but then make upgrading Wicket difficult.

 

Is there a simple Java solution that allows me to change/add function
definitions into existing inheritance hierarchies?



DataView vs ListView

2009-01-06 Thread Dane Laverty
I've been trying to understand when DataView would come in handy. I have
a SQL database table with about 1,000,000 rows. The user can enter a
search string, and my application returns a list of all the rows that
match the search string. This list might be over 10,000 rows.

 

At first I thought this would be a perfect situation for a DataView,
since it involves large numbers of rows, and I don't necessarily want to
get all 10,000 rows if the user only needs to look at the first 20.
However, I'm finding that, since DataView re-queries the database with
each page view of the results list, any time advantage I might have
gotten initially is quickly lost. It seems that using a
PageableListView, I just query the database once and I'm good.

 

So my question is, am I misunderstanding the purpose of the DataView?
All of the online examples I find for DataView use Java databases rather
than SQL relational databases. Is the DataView only useful if you
already have some kind of a Java database to back it up? Or is there
some way that I can take advantage of DataView in this situation without
having to re-query the database whenever the user clicks to a different
page of the result list?



RE: Twenty Six Wicket Tricks

2008-12-30 Thread Dane Laverty
I think that sounds like a wonderful idea. I've enjoyed WIA (as much as I've 
read so far) and would certainly purchase a follow-up book of Wicket tricks.

Dane

-Original Message-
From: Jonathan Locke [mailto:jonathan.lo...@gmail.com] 
Sent: Tuesday, December 30, 2008 8:56 AM
To: users@wicket.apache.org
Subject: Re: Twenty Six Wicket Tricks



i like those too. and i hope people keep blogging about 
wicket like that. it's nice to get the gist of how to do
something that way and boost WIA in the process.

however, the quality bar of chapters in twenty-six tricks
will be higher and my goals for each trick are (i hope) 
considerably more rigorous and educational than a blog 
entry. they are:

(1) to present a fully reusable, high-quality component 
suitable for including in your application directly and with 
no changes (i'm generally designing these tricks for 
reuse and extension)

(2) to cohesively demonstrate and detail through discussion
a range of design choices and patterns in the process 
(probably the more valuable part, as you will (hopefully) 
understand not only what it is that i've done, but why it's
been done that way and not some other way). 

(3) to reuse tricks in building new tricks

if it's mainly cost you are worried about, i haven't chosen 
a price yet, but it will obviously be less than WIA. 

and if you want to give feedback, i will need some reviewers 
and you're welcome to be one, although be warned that i'm 
not looking for casual feedback since this is a book project
and not a blog. i'd want thorough and detailed comments 
on the code and text for several (say 5) chapters (which will 
take you hours, not minutes). in return for their work, 
each reviewer gets a free copy of the book.

  jon


martin-g wrote:
 
 Does it have to be a book ?
 
 I do really like Igor's series at wicketinaction.com.
 
 Pros: the community feedback as comments.
 Cons: it is not profitable.
 
 
 El mar, 30-12-2008 a las 00:32 -0800, Jonathan Locke escribió:
 Well, over the break here I've started something I swore I would never do
 again (well, two things, if you include the JavaOne talk I'm working on).
 I'm writing a (hopefully relatively short) book. It's called Twenty-Six
 Wicket Tricks. Each trick in the book (lettered from A-Z) demonstrates
 something that people typically want to do and in the process builds a
 reusable and educational component. I've got 13 tricks coded up now and
 ideas for a handful more, but if there are any requests out there, please
 let me know. I'd also be interested in getting some idea how many people
 would be interested in this book (would provide some fuel for me to get
 it
 done). It does not cover any of the same ground as Wicket in Action
 (which
 you should buy if you have not already!), BTW. It's more of a companion
 to
 that book.
 
 Happy Holidays!
 
 Best,
 
Jonathan
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Twenty-Six-Wicket-Tricks-tp21214357p21219849.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



Maintain radio values on submit validation

2008-12-03 Thread Dane Laverty
I have a form with a list of RadioGroups, which are all required. If the
user submits the form with one or more of the RadioGroups left blank,
the validator correctly returns to form. However, when that happens, any
RadioGroups the user filled also become blank. Is there a way to
maintain the values in the correctly filled RadioGroups when the form is
submitted? The relevant code is below. 

 

add(new ListView(questions, new PropertyModel(user, test.questions))
{



  protected void populateItem(ListItem item) {

final Question question = (Question) item.getModelObject();



// answersRadioGroup will be a group of radio buttons -- one for
each possible answer (4, currently)

RadioGroup answersRadioGroup = new RadioGroup(answers, new
PropertyModel(question, markedAnswerLetter));



// This loop will generate a radio button for letters A, B, C, and D


for (char letter = 'A'; letter = 'D'; letter++) {

  final String letterAsString = letter + ;

  Radio radio = new Radio(letterAsString, new
Model(letterAsString));

  radio.setLabel(new
Model(question.getAnswers().get(letterAsString).toString()));



  answersRadioGroup.add(radio); 

}



// Ensure that each question must be answered.

answersRadioGroup.setRequired(true);   



// Put the whole shebang (radio buttons + answer texts) into the
test.

item.add(answersRadioGroup);  

  }

}

 



RE: Maintain radio values on submit validation

2008-12-03 Thread Dane Laverty
That solved the problem. Thank you very much!

-Original Message-
From: Jeremy Thomerson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2008 12:26 PM
To: users@wicket.apache.org
Subject: Re: Maintain radio values on submit validation

Have you tried ListView.setReuseItems(true) - I didn't look at your code
in
depth, but at a glance I think the problem is that your radios are
getting
recreated.

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

On Wed, Dec 3, 2008 at 12:50 PM, Dane Laverty
[EMAIL PROTECTED]wrote:

 I have a form with a list of RadioGroups, which are all required. If
the
 user submits the form with one or more of the RadioGroups left blank,
 the validator correctly returns to form. However, when that happens,
any
 RadioGroups the user filled also become blank. Is there a way to
 maintain the values in the correctly filled RadioGroups when the form
is
 submitted? The relevant code is below.



 add(new ListView(questions, new PropertyModel(user,
test.questions))
 {



  protected void populateItem(ListItem item) {

final Question question = (Question) item.getModelObject();



// answersRadioGroup will be a group of radio buttons -- one for
 each possible answer (4, currently)

RadioGroup answersRadioGroup = new RadioGroup(answers, new
 PropertyModel(question, markedAnswerLetter));



// This loop will generate a radio button for letters A, B, C, and
D


for (char letter = 'A'; letter = 'D'; letter++) {

  final String letterAsString = letter + ;

  Radio radio = new Radio(letterAsString, new
 Model(letterAsString));

  radio.setLabel(new
 Model(question.getAnswers().get(letterAsString).toString()));



  answersRadioGroup.add(radio);

}



// Ensure that each question must be answered.

answersRadioGroup.setRequired(true);



// Put the whole shebang (radio buttons + answer texts) into the
 test.

item.add(answersRadioGroup);

  }

 }





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



RE: Updating Form TextField Value

2008-12-03 Thread Dane Laverty
I think you'll want to use the button tag rather than the input
type=submit for the changeName button.

-Original Message-
From: tim532 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2008 4:27 PM
To: users@wicket.apache.org
Subject: Updating Form TextField Value


Hopefully this is a simple question with a simple answer... For reasons
I
can't quite grasp yet, the button to changeName doesn't change the
textfield
value when I click it.  However, the submit button does work to change
the
value of the textfield, and setting the initial default value of the
textfield works too.  

Can someone enlighten this new Wicket developer?  I've tried to search
for a
similar question but it seems too basic.. 

The form:

form wicket:id=editForm

  input type=text id=name wicket:id=name /
  input type=submit wicket:id=changeName value=changeName /
  input type=submit wicket:id=saveButton value=save /

/form

With code as such:

public class SimpleExample extends BasePage{

private String name = defaultName;

public String getName() {return name;}
public void setName(String name) {  this.name = name;}

public SimpleExample() {
Form editForm = new Form(editForm, new
CompoundPropertyModel(this)) {
public void onSubmit()
{
name = afterSubmit;
}
};

Button b = new Button(changeName) { 
public void onSubmit() {
SimpleExample.this.name = testName;
}
}.setDefaultFormProcessing(false);

TextField txtCode = new TextField(name);
editForm.add(b);
editForm.add(txtCode);
editForm.add(new Button(saveButton));
add(editForm);
}
}

Thanks,
Tim

-- 
View this message in context:
http://www.nabble.com/Updating-Form-TextField-Value-tp20824843p20824843.
html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


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



RE: Losing session information

2008-11-04 Thread Dane Laverty
Great, I'll check that out. I didn't realize that the mail list would
chop up my code formatting so horribly -- thanks for taking the time to
slog through it anyway.

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 03, 2008 12:02 PM
To: users@wicket.apache.org
Subject: Re: Losing session information

a couple of things to look into:

access to Session is not synchronized, so make sure you sync
everything yourself.

if you have a stateless page it will not store the session in
httpsession, you might have to do that manually by calling
session.bind()

-igor


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



Losing session information

2008-11-03 Thread Dane Laverty
My site has a form-based test on TestPage. Each question in the test has
a Question object as its model. The Questions all sit in an ArrayList in
a Test object. Each Question has a markedAnswer String, which stores
the value of the selected answer. The problem is that, for some users,
the markedAnswer fields are become null on the TestResultsPage after
the test is submitted. This behavior is not consistent (I haven't been
able to replicate it) but it happens dozens of times daily, so I know
that it's a real problem.

 

My question is, does anyone have any ideas why
session.user.test.questions[i].markedAnswer becomes null for some users
after they submit the test? 

 

Here's the relevant code. Important lines include:

- TestPage, line 37. This inserts the test results into the database.
Because this is happening correctly, I know that user.test.questions is
still populated at this point.

- TestResultsPage, line 12. This is where question.getMarkedAnswer()is
null (and throws a NullPointerException).

 

1  public class TestPage extends...

2  {  

3private User user;

4 

5public TestPage()

6{

7 user = getSession().getUser();

8add(new TestForm(testForm));  

9}

10

11final class TestForm extends ApplicationForm

12{   

13  public TestForm(final String id) {

14super(id);

15

16add(new ListView(questions, new PropertyModel(user,
test.questions)) {

17  

18  protected void populateItem(ListItem item) {

19final Question question = (Question)
item.getModelObject();

20

21// answersRadioGroup will be a group of radio
buttons -- one for each possible answer (4, currently)

22RadioGroup answersRadioGroup = new
RadioGroup(answers, new PropertyModel(question,
markedAnswerLetter));

23

24// This loop will generate a radio button for
letters A, B, C, and D. Those letter are hard-coded

25// into the database as answer selections, so
we can't change them.

26for (char letter = 'A'; letter = 'D';
letter++) {

27Radio radio = new Radio(letter + , new
Model(letter + ));

28answersRadioGroup.add(radio); 

29}

30

31item.add(answersRadioGroup);

32}

33});

34  }

35  

36  protected void onSubmit() {

37fhBD.uploadUserTestResults(user); 

38setResponsePage(TestResultsPage.class);   

39  }

40}

41 }

 

 

 

1  public class TestResultsPage extends...

2  {

3 private User user = getSession().getUser();

4 

5  public TestResultsPage()

6  {

7   add(new ListView(resultsListView,
user.getTest().getQuestions()) {

8 

9 protected void populateItem(ListItem item) {

10  final Question question = (Question)
item.getModelObject();

11  

12  Label answerText = new Label(answerText, new
Model(question.getMarkedAnswer().toString()));

13  answerText.setEscapeModelStrings(false);

14  item.add(answerText);

15  

16  }

17  });

18 }

19 }



Changing WicketRuntimeException output

2008-10-29 Thread Dane Laverty
I would like to make it so that whenever Wicket throws a
WicketRuntimeException, it also prints out getSession().getUser(). I'm
not especially clear on the flow for RuntimeExceptions, so any
suggestions on where I would add the code to do this will be greatly
appreciated.

 

Dane Laverty

Information Technology

503-365-4687

[EMAIL PROTECTED]

 



RE: Feedback panel message

2008-10-20 Thread Dane Laverty
Like so:

DropDownChoice myDropDownChoice = new DropDownChoice(...); 
myDropDownChoice.setLabel(new Model(Description));
add(myDropDownChoice);

Hope that helps.

-Original Message-
From: Steve Thompson [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 20, 2008 12:49 PM
To: users@wicket.apache.org
Subject: Feedback panel message

I've got a panel for which I am building a number of DropDownChoices.
Each must be selected, and if any one of them is not, a message must
be displayed in the corresponding feedback panel.  The problem however
is that, with my HTML as such:

table
   tr wicket:id=reasons
  tdspan wicket:id=description//td
  tdselect wicket:id=options name=options//td
   /tr
/table

the ${label} is always 'options' of course.  How could I associate
different DropDownChoice components in this scenario with a little bit
more legible name (like 'description')

Let me know and best regards,


Steve

--

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


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



RE: Trouble printing image

2008-10-15 Thread Dane Laverty
This ended up working for Firefox, but not for IE. The image served in
Firefox will Save As x.png, but the image in IE still shows as
untitled.bmp. Thanks for the suggestion though, it at least taught me
a lot about resources and setting headers :)

Dane

-Original Message-
From: Serkan Camurcuoglu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 14, 2008 12:25 PM
To: users@wicket.apache.org
Subject: Re: Trouble printing image


while serving the image resource, setting the Content-Disposition http
header
to

inline; filename=x.png

might help, but this is just a guess..


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



Trouble printing image

2008-10-14 Thread Dane Laverty
I'm adding an image to my page with the following code. It works
correctly, and the image displays fine. However, we are getting reports
from some IE users that the image will not print. It prints fine for
most IE users, but there are a handful who can't get it to print. 

 

While I don't know the reason, I did notice that when you right-click
the image and Save As..., it doesn't have a name. In IE, the Save As
dialog calls it untitled.bmp (in spite of it being a png) and in
Firefox it's print.png. Perhaps this is the source of the issue? If
so, how do you give an image a name when you're adding it as a Resource?

 

(For anyone who's interested in looking, you can find the offending
image at http://foodhandler.org. Log in with username/password
guest/guest. Then click the Print Your Card button on the navigation
bar. When you print the page, the only two images that should print are
the Thawte 100% Secure image at the top of the page and the card image
in the center of the page - the rest are turned off in a print
stylesheet.)

 

PrintPage.java:

 

public class PrintPage extends NavigationTemplate

{

  public PrintPage()

  {

Resource cardImage = getBothCardImageResource();

add(new NonCachingImage(bothCardImage, cardImage));   



  }

 

  public Resource getBothCardImageResource()

{

final BufferedDynamicImageResource resource = new
BufferedDynamicImageResource();

BufferedImage image;



try {

image = ImageIO.read(((WebApplication)
Application.get()).getServletContext().getResourceAsStream(/path/to/MyI
mage.png));

  

Graphics graphics = image.getGraphics();

... Do some stuff with the graphics ...

}



resource.setImage(image);

return resource;  

}

}



RE: Trouble printing image

2008-10-14 Thread Dane Laverty
Thanks for the hint. I tried your class with some minor modifications
(see below -- I commented out two lines and used the Apache FileUtils,
since I'm not sure which FileUtils class your referenced) but without
any success. However, while playing with that, I did notice that
untitled.bmp that IE returns is 4+ MB, as compared to 200 KB for the
print.png that FireFox returns. I'm not sure what that means, but it
seems odd to me that the file returned would be browser-specific.

Thanks again,

Dane

Modified FileImageResource class:

public class FileImageResource extends DynamicImageResource
{
private static final long serialVersionUID = 1L;
private final String path;

public FileImageResource( File file, String format )
{
super(format);
this.path = file.getAbsolutePath();
//setCacheable(true);

//setLastModifiedTime(Time.valueOf(file.lastModified()));
}

protected byte[] getImageData()
{
try {
return FileUtils.readFileToByteArray(new
File(path));
} catch (IOException ioe) {
logger.error(Trouble reading the image file.,
ioe);
return null;
}
}
}

-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 14, 2008 12:16 PM
To: users@wicket.apache.org
Subject: Re: Trouble printing image

Try the FileImageResource class mentioned here (by me :):

http://www.nabble.com/Mount-files-outside-container-td19232069.html


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



RE: Trouble printing image

2008-10-14 Thread Dane Laverty
I should have said that your class worked great for displaying the
image; it just didn't keep the image name. Well, time to study up on
Serkan's suggestion on Content-Disposition and see what that does.

-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 14, 2008 2:31 PM
To: users@wicket.apache.org
Subject: Re: Trouble printing image

Yeah, sorry about that.  I think the FileUtils class is one of my own,
actually (from work or I'd just give it to you).  I leave it up to the
reader to write the file copy method. :)


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



Downloading a BLOB

2008-10-10 Thread Dane Laverty
The title basically says it all. I've got a BLOB in a database, and I
want the user to be able to click a link and download it. Any wicket
solutions to do this? Thanks much.

 



RE: Downloading a BLOB

2008-10-10 Thread Dane Laverty
DownloadLink appears to accept only a file pathname. If I understand it
correctly, the only way I could use that would be to read the BLOB into
a file on the server, and then have the DownloadLink point to that file.
I believe that would require me to have the file created when the page
is generated, rather than when the link is clicked. Since there are
going to be many links on this page, I would rather be able to wait
until the user clicks the link to stream the BLOB to them. 

-Original Message-
From: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 10, 2008 3:26 PM
To: users@wicket.apache.org
Subject: Re: Downloading a BLOB

see how downloadlink works

-igor

On Fri, Oct 10, 2008 at 3:21 PM, Dane Laverty
[EMAIL PROTECTED] wrote:
 The title basically says it all. I've got a BLOB in a database, and I
 want the user to be able to click a link and download it. Any wicket
 solutions to do this? Thanks much.





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


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



RE: Downloading a BLOB

2008-10-10 Thread Dane Laverty
Thank you for the advice. Here's the solution I came up with, in case
it's useful to anyone else.

First I used the DownloadLink as a template for my blobDownloadLink.
Then I created an InputStreamResourceStream, which is essentially a
barely modified version of Wicket's FileResourceStream, taking an
InputStream as the constructor parameter instead of a File. The code for
both of those is below.

While this solution works, the two issues still hanging in my mind are:
1. I'm sure there's an easier way to get the InputStream into an
IResourceStream than to create an InputStreamResourceStream class...I
just couldn't figure out what it is.
2. When I get the Blob from the database like this, 

rs.getBinaryStream(1);

the returned BinaryStream doesn't work. Doing this,

java.sql.Blob blob = rs.getBlob(1);
return blob.getBinaryStream();

doesn't work either. So I ended up doing,

java.sql.Blob blob = rs.getBlob(1);
byte[] bytes = new byte[(int)blob.length()];
try {
blob.getBinaryStream().read(bytes);
} catch (IOException ioe) {
// handle it
}
return new ByteArrayInputStream(bytes);

Not pretty, but it works.

***
// Relevant code for blobDownloadLink

Link blobDownloadLink = new Link(blobDownloadLink) {
@Override
public void onClick() {
InputStream inputStream =
//getBlobAsInputStreamFromDatabase();

IResourceStream resourceStream =
new InputStreamResourceStream(inputStream);
 
getRequestCycle().setRequestTarget(new
ResourceStreamRequestTarget(resourceStream)
{
public String
getFileName()
{
return
//theFileNameYouWantAssociatedWithThisDownload;
}

public void
respond(RequestCycle requestCycle)
{
 
super.respond(requestCycle);

}
});

try {
inputStream.close();
} catch (IOException ioe) {
logger.error(Error
attempting to close inputStream in blobDownloadLink., ioe);
}
};
};


// Relevant code for InputStreamResourceStream

import java.io.IOException;
import java.io.InputStream;
import org.apache.wicket.util.resource.AbstractResourceStream;
import org.apache.wicket.util.resource.ResourceStreamNotFoundException;

/**
 * An InputStreamResourceStream is an IResource implementation for
files.
 * 
 * @see org.apache.wicket.util.resource.IResourceStream
 * @see org.apache.wicket.util.watch.IModifiable
 * @author Dane Laverty
 */
public class InputStreamResourceStream extends AbstractResourceStream
{
private static final long serialVersionUID = 1L;

/** Resource stream */
private transient InputStream inputStream;

/**
 * Constructor.
 * 
 * @param inputStream
 *[EMAIL PROTECTED] InputStream} containing resource
 */
public InputStreamResourceStream(InputStream inputStream)
{
this.inputStream = inputStream;
}

/**
 * Closes this resource.
 * 
 * @throws IOException
 */
public void close() throws IOException
{
if (inputStream != null)
{
inputStream.close();
inputStream = null;
}
}

/**
 * @see IResourceStream#getContentType()
 */
public String getContentType()
{
// Let ResourceStreamRequestTarget handle content-type
automatically
return null;
}

/**
 * @return A readable input stream for this resource. The same
input stream is returned until
 * ttInputStreamResourceStream.close()/tt is
invoked.
 * 
 * @throws ResourceStreamNotFoundException
 */
public InputStream getInputStream() throws
ResourceStreamNotFoundException
{
if (inputStream == null)
throw new
ResourceStreamNotFoundException(InputStream could not be found);

return inputStream;
}

}


-Original Message-
From: Igor Vaynberg [mailto:[EMAIL