Re: will there be a performance gain to use singleton to remove references to the service object in models?

2009-07-28 Thread Wilko Hische

Hi Jason,

You could have a look at http://code.google.com/p/salve/
By making use of some byte code instrumentation it will replace your
dependency injections by static lookups, i.e. the best of both worlds. I
wouldn't know about the performance of each approach however.

Regards,

Wilko


Jason Wang-2 wrote:
 
 Hi all,
 
 Although I am using spring-wicket to prevent the whole spring being 
 serialized, It still brothers me to  see the  references in the model 
 object, for example:
 
 Instead of using this:
 
 public class MyViewObjectProvider extends SortableDataProvider{

@SpringBean(daoService)
  private  DAOServices daoService;
 
  private String objectID;
 
  public Iterator iterator(final int first, final int count){
   .
return daoService.load(objectId).subList(first, 
 first+count).iterator();
 }
 
 }
 
 
 
 I always write a singleton helper class for the service to be used, so I 
 can have the model this way:
 
 public class MyViewObjectProvider extends SortableDataProvider{

//so no reference to the dao service object
 
  private String objectID;

 public Iterator iterator(final int first, final int count){
   .
 //here the DAOServiceHelper.get() returns a instance that managed by 
 spring(with the actual service object injected.)
return DAOServiceHelper.get().load(objectId).subList(first, 
 first+count).iterator();
 }
 

 }
 
 So my question is, will there be a noticeable  performance gain to do it 
 the 2nd way?
 The reason to ask is that the static kind of singleton usage is indeed 
 anti-spring, and makes
 my eyes bleed
 
 If no one has done a performance comparison, I might have to do one 
 myself. Just being lazy...
 
 
 Thanks,
 
 Jason Wang
 
 
 
 
 -
 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/will-there-be-a-performance-gain-to-use-singleton-to-remove-references-to-the-service-object-in-models--tp24690276p24694064.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: AutoCompleteTextField and IE8, javascript error thrown

2009-07-21 Thread Wilko Hische

Hi Christian,

Did you ever figure out what was wrong? I encountered the same problem.

Best regards,

Wilko Hische

christian.fichera wrote:
 
 Dear all,
 
 I have a problem using AutoCompleteTextField: when I type something into
 it,
 the choices list is not shown, and the following javascript error is
 thrown:
   
 
 Webpage error details
 
 User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
 Trident/4.0;
 .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR
 3.0.04506.648)
 Timestamp: Thu, 28 May 2009 08:19:40 UTC
 
 
 Message: Invalid argument.
 Line: 253
 Char: 1
 Code: 0
 URI:
 http://localhost:8080/TADinfo/analysis/resources/org.apache.wicket.extension
 s.ajax.markup.html.autocomplete.AutoCompleteBehavior/wicket-autocomplete.js
 
 
 
 
 This problem occurs only with IE8 (with IE7, IE6 and Firefox works), and
 Wicket 1.3.6 (with version 1.3.4 works).
 
 Can anybody help me?
 
 Thank you in advance!
 
 Here is the code: 
 
 .. snip ..
 

-- 
View this message in context: 
http://www.nabble.com/AutoCompleteTextField-and-IE8%2C-javascript-error-thrown-tp23757807p24585462.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: Hello World Program is not working

2008-01-30 Thread Wilko Hische

Hi Gurvinder,


Caused by: java.lang.ClassNotFoundException:
org.apache.wicket.examples.helloworld.HelloWorldApplication

I would suggest to play with http://wicket.apache.org/quickstart.html first

Success,

Wilko




Gurvinder Pal Singh wrote:
 
 Hi, i created a project as mentioned in
 http://wicket.apache.org/examplehelloworld.html, and tried to run it on
 tomcat server. But it is giving me errors. Error Log from tomcat is shown
 below:
 
 
 2008-01-29 11:33:54 StandardContext[/HelloWorld]: Exception starting
 filter HelloWorldApplication
 org.apache.wicket.WicketRuntimeException: Unable to create application of
 class org.apache.wicket.examples.helloworld.HelloWorldApplication
 .
 Caused by: java.lang.ClassNotFoundException:
 org.apache.wicket.examples.helloworld.HelloWorldApplication
   at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1428)
   at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274)
   at
 org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createApplication(ContextParamWebApplicationFactory.java:68)
   ... 45 more 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Hello-World-Program-is-not-working-tp15153342p15193213.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]



Re: wicket-datetime-rc2 javascript error in generated event.js

2007-12-21 Thread Wilko Hische

Answering myself. The problem does not occur anymore in yesterday's snapshot.

Thanks to whoever fixed it,

Wilko Hische
-- 
View this message in context: 
http://www.nabble.com/wicket-datetime-rc2-javascript-error-in-generated-event.js-tp14438031p14457168.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]



wicket-datetime-rc2 javascript error in generated event.js

2007-12-20 Thread Wilko Hische

Hello,

When in a wicket-rc2 Quickstart I try to use
org.apache.wicket.extensions.yui.calendar.DateField from wicket-datetime-rc2
I get an error messsage in FF and IE7 concerning event.js.

If I open the page for the first time:

nl is not defined

looking at the contents of event.js with firebug i only see

nl

(with nl being the only package at root level).


--
HomePage.java:
--
package nl.feeddex;

import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.yui.calendar.DateField;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.model.IModel;

public class HomePage extends WebPage {
private Date date;
public HomePage(final PageParameters parameters) {

Form form = new Form(form);
form.add( new DateField( testDate, new IModel(){
public Object getObject() {
return date;
}
public void setObject(Object object) {
date = (Date)object;
}
public void detach() {
}   
}));
add( form );
add( new MyDummyPanel( panel ));
}
}

--
HomePage.html:
--

html
head
titleWicket Quickstart Archetype Homepage/title
/head
body
br/br/
form wicket:id=form
Date: 
input type=submit value=Submit!/
/form
div wicket:id=panel/div
/body
/html
--


The panel i include because otherwise i get an exception(?):

WicketMessage: Unknown tag name with Wicket namespace: 'panel'. Might be you
haven't installed the appropriate resolver?


This is a blocker for us, should I make a bug report? I am afraid the
JavaScript is a bit too involved for me to be able to patch this myself on
short notice.

Best regards,

Wilko Hische

-- 
View this message in context: 
http://www.nabble.com/wicket-datetime-rc2-javascript-error-in-generated-event.js-tp14438031p14438031.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]



Proper way to mount a shared resource

2007-11-21 Thread Wilko Hische

Hi,

This probably is a stupid question, but thusfar i couldn't figure it out.

I would like to mount a shared resource, but I don't know how to get/create
the correct resourceKey.

In a Quickstart for Wicket 1.3.0-rc1 i put the following init method in
WicketApplication:

@Override
protected void init() {
final String resourceName = myResource;

getSharedResources().add( resourceName, new Resource() {

@Override
public IResourceStream getResourceStream() {
return new StringResourceStream( Found! );
}

});

mountSharedResource(/resource, resourceName);
}

When requesting
  http://localhost:8080/resource
in my browser the message
  ERROR - haredResourceRequestTarget - shared resource myResource not found
appears in my log.

When i mount like this:
  mountSharedResource(/resource, org.apache.wicket.Application/ +
resourceName);
the resource is correctly shown in the browser.

My question is, what is the proper way to get the resourcekey for this
resource?

Regards,

Wilko Hische
-- 
View this message in context: 
http://www.nabble.com/Proper-way-to-mount-a-shared-resource-tf4850639.html#a13878724
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Dynamically created popup window, IE7 wicket 1.3

2007-08-26 Thread Wilko Hische

Hi,

For a chat application I would like to display a list of chat requests that
have come in.
This list is updated by making use of an AbstractAjaxTimerBehavior.

When the user clicks a chat request in the list, a popup window will open
containing that particular chat conversation. In FF all works fine.

The unfortunate thing is that whatever I try, in IE7, the window containing
the list will become the active window whenever the timer fires, thus hiding
the popup window.

Even more strange:

- If the popup was started from a static (ie non dynamically updated)
element the popup doesn't lose focus.

- In wicket 1.2.6 it works fine.

I have been trying various approaches, for instance my own little Java
script creating the popup links, but for some reason I just can't get it to
work. I am willing to accept that is another IE7 feature , but that
doesn't help me much.

I am not really comfortable with Javascript, so before I dive into the
Javascript differences between Wicket version 1.2.6 and 1.3.x I would like
to ask whether somebody on this list might have some suggestions.

I have attached the Index.html and Index.java for the current 1.3 snapshot.
In 1.2.6 it works (mutatis mutandis).

Regards,

Wilko Hische



- org.apache.wicket.quickstart.Index.java


package org.apache.wicket.quickstart;

import java.util.Date;

import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.util.time.Duration;

/**
 * Basic bookmarkable index page.
 * 
 * NOTE: You can get session properties from QuickStartSession via
 * getQuickStartSession()
 */
public class Index extends QuickStartPage {

/**
 * Constructor that is invoked when page is invoked without a session.
 * 
 * @param parameters
 *Page parameters
 */
public Index(final PageParameters parameters)
{
WebMarkupContainer timer = new WebMarkupContainer(timer);
timer.setOutputMarkupId(true);

final Label timeLabel = new Label( time, new 
AbstractReadOnlyModel(){
public Object getObject() {
return new Date().toString();
}
});
timeLabel.setOutputMarkupId(true);
timer.add(timeLabel );
timer.add(
new 
AbstractAjaxTimerBehavior(Duration.seconds(2)) {
protected void 
onTimer(AjaxRequestTarget target) {
target.addComponent(timeLabel);
target.appendJavascript( 
addPopupLinkIfNotExists());
}   
}   
);
add( timer );
}
}


- org.apache.wicket.quickstart.Index.html


html
head
titleQuickStart/title
script type=text/javascript 
function openPopup(e) {
window.open( 'http://wicket.apache.org' );
}

function addPopupLinkIfNotExists() {
var e = document.getElementById( 'popup' );
if (e != null) {
return;
}
var parent = document.getElementById( 'links' );
var link = document.createElement('a');
link.setAttribute( 'id', 'popup' );
link.setAttribute( 'href', '#' );
if (link.addEventListener){
link.addEventListener('click', openPopup, false);
}
else {
link.attachEvent('onclick', openPopup );
}
link.appendChild(document.createTextNode(Dynamic popup));
parent.appendChild( link ); 

}

/script
/head
body
h1QuickStart/h1
p wicket:id=timerLast refresh: /p
p
 # A stable link 
/p
p id=links

/p
/body
/html




-- 
View this message in context: 
http://www.nabble.com/Dynamically-created-popup-window%2C-IE7---wicket-1.3-tf4331823.html#a12337162
Sent from the Wicket - User mailing list archive at Nabble.com.


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