Re: Howto modify css-class prefix of all components on a panel?

2011-05-18 Thread Mike Mander
But if i remove it the problem stays the same. Maybe i should have said 
that the components are added to a border.

Maybe this is relevant.

Thanks
Mike


Hi Mike,

maybe is not related to your problem, but I think you shouldn't recall 
vistiChildren inside visitor because visitChildren already traverse 
the whole hierarchy of children.




Hi,

i use a component twice. Layout of first component has to be 
horizontal of second vertical (MainMenu, Sidebar).
Because the component itself provides the layout (horizontal version) 
i run into trouble with vertical layout.
My solution would be to add a prefix to vertical layout component and 
it's children. So i could modify the layout
by css class overriding. But strangely my solution is not working (= 
no prefix in any component child).


Modifier for css class
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.model.Model;

public class FirstCssClassDecorator extends AttributeModifier {

public FirstCssClassDecorator(String prefix) {
super(class, Model.String of(prefix));
}

@Override
protected String newValue(String currentValue, String 
replacementValue) {

  // Here add sidebar- to current css class
  return replacementValue.concat(currentValue);
}
}

Visitor for appending FirstCssClassDecorator to all children
import org.apache.wicket.Component;
import org.apache.wicket.Component.IVisitor;
import org.apache.wicket.MarkupContainer;

public class FirstCssClassDecorationVisitor implements 
IVisitorComponent {


private final String _prefix;

public FirstCssClassDecorationVisitor(String prefix) {
_prefix = prefix;
}

@Override
public Object component(Component component) {
if (component instanceof MarkupContainer) {
((MarkupContainer) component).visitChildren(new 
FirstCssClassDecorationVisitor(_prefix));

}
component.add(new 
FirstCssClassDecorator(String.valueOf(_prefix)));

return CONTINUE_TRAVERSAL;
}
}

I've added the visitor
visitChildren(new FirstCssClassDecorationVisitor(sidebar-));
+ in sidebar Constructor
+ in sidebar onConfigure
+ in Page Constructor

But all did the same - no sidebar-xyz class in Markup.

What am i missing here?
Thanks
Mike

-
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: Howto modify css-class prefix of all components on a panel?

2011-05-18 Thread Igor Vaynberg
you can use css child selectors to override the layout when they are
inside a specific div.

-igor


On Tue, May 17, 2011 at 4:49 AM, Mike Mander wicket-m...@gmx.de wrote:
 Hi,

 i use a component twice. Layout of first component has to be horizontal of
 second vertical (MainMenu, Sidebar).
 Because the component itself provides the layout (horizontal version) i run
 into trouble with vertical layout.
 My solution would be to add a prefix to vertical layout component and it's
 children. So i could modify the layout
 by css class overriding. But strangely my solution is not working (= no
 prefix in any component child).

 Modifier for css class
 import org.apache.wicket.AttributeModifier;
 import org.apache.wicket.model.Model;

 public class FirstCssClassDecorator extends AttributeModifier {

    public FirstCssClassDecorator(String prefix) {
        super(class, Model.String of(prefix));
    }

    @Override
    protected String newValue(String currentValue, String replacementValue) {
      // Here add sidebar- to current css class
      return replacementValue.concat(currentValue);
    }
 }

 Visitor for appending FirstCssClassDecorator to all children
 import org.apache.wicket.Component;
 import org.apache.wicket.Component.IVisitor;
 import org.apache.wicket.MarkupContainer;

 public class FirstCssClassDecorationVisitor implements IVisitorComponent {

    private final String _prefix;

    public FirstCssClassDecorationVisitor(String prefix) {
        _prefix = prefix;
    }

    @Override
    public Object component(Component component) {
        if (component instanceof MarkupContainer) {
            ((MarkupContainer) component).visitChildren(new
 FirstCssClassDecorationVisitor(_prefix));
        }
        component.add(new FirstCssClassDecorator(String.valueOf(_prefix)));
        return CONTINUE_TRAVERSAL;
    }
 }

 I've added the visitor
    visitChildren(new FirstCssClassDecorationVisitor(sidebar-));
 + in sidebar Constructor
 + in sidebar onConfigure
 + in Page Constructor

 But all did the same - no sidebar-xyz class in Markup.

 What am i missing here?
 Thanks
 Mike

 -
 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: Howto modify css-class prefix of all components on a panel?

2011-05-18 Thread Mike Mander
That was the way brought me to my trouble. In IE the parent selector was 
ignored.

{.sidebar * .facet} definition was nicely rendered in FF but ignored in IE.
The solution for this non-wicket problem was to add the doc-type to my 
page html.

Now i get the results i've expected.

Thanks
Mike


you can use css child selectors to override the layout when they are
inside a specific div.

-igor


On Tue, May 17, 2011 at 4:49 AM, Mike Manderwicket-m...@gmx.de  wrote:

Hi,

i use a component twice. Layout of first component has to be horizontal of
second vertical (MainMenu, Sidebar).
Because the component itself provides the layout (horizontal version) i run
into trouble with vertical layout.
My solution would be to add a prefix to vertical layout component and it's
children. So i could modify the layout
by css class overriding. But strangely my solution is not working (= no
prefix in any component child).

Modifier for css class
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.model.Model;

public class FirstCssClassDecorator extends AttributeModifier {

public FirstCssClassDecorator(String prefix) {
super(class, Model.String  of(prefix));
}

@Override
protected String newValue(String currentValue, String replacementValue) {
  // Here add sidebar- to current css class
  return replacementValue.concat(currentValue);
}
}

Visitor for appending FirstCssClassDecorator to all children
import org.apache.wicket.Component;
import org.apache.wicket.Component.IVisitor;
import org.apache.wicket.MarkupContainer;

public class FirstCssClassDecorationVisitor implements IVisitorComponent  {

private final String _prefix;

public FirstCssClassDecorationVisitor(String prefix) {
_prefix = prefix;
}

@Override
public Object component(Component component) {
if (component instanceof MarkupContainer) {
((MarkupContainer) component).visitChildren(new
FirstCssClassDecorationVisitor(_prefix));
}
component.add(new FirstCssClassDecorator(String.valueOf(_prefix)));
return CONTINUE_TRAVERSAL;
}
}

I've added the visitor
visitChildren(new FirstCssClassDecorationVisitor(sidebar-));
+ in sidebar Constructor
+ in sidebar onConfigure
+ in Page Constructor

But all did the same - no sidebar-xyz class in Markup.

What am i missing here?
Thanks
Mike

-
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: [1.5RC2] impossible to add cookies

2011-05-18 Thread adriclad
Sorry, I didn't work on this bug recently.

But, I finally found the solution !

With the RC3 and RC4, I can now see now errors : (With RC2 they were not
display !!!)

18:29:40.479  WARN (org.apache.wicket.util.lang.WicketObjects) Unable to
determine object size:
nc.ird.cantharella.web.utils.security.AuthSession@6a19905e
java.io.NotSerializableException:
org.apache.wicket.authentication.strategy.DefaultAuthenticationStrategy
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

My error was to declare the DefaultAuthentificationStrategy as a private
property. Being not serializable,  AuthSession wich contains this property
couldn't be serialized.
I did the same error for my other tries with CookieUtils or Cookie.

So now I use correctly the DefaultAuthentificationStrategy and I don't store
it in my Session object.
The best I found is to directly use :
WebApplication.get().getSecuritySettings().getAuthenticationStrategy()
to get the IAuthentificationStrategy initialized with the current
WebApplication (In fact, a DefaultAuthentificationStrategy).



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-5RC2-impossible-to-add-cookies-tp3380554p3531881.html
Sent from the Users forum mailing list archive at Nabble.com.

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



tree

2011-05-18 Thread hubert_hupe
hello,

after hours of researching and trying get a simple tree running iam completely 
frustrated.

i added a tree to the website in this way:

public class Test extends WebPage {

protected TreeModel createTreeModel() {
ListObject l1 = new ArrayListObject();
l1.add(test 1.1);

}

public Test(final PageParameters parameters) {
tree = new LinkTree(tree, createTreeModel()); 
add(tree);
}
markup:

div wicket:id=tree class=my-tree  /div  

now the problem: i am not able to fetch the selected node. iam not able to 
fetch the event...
i tried the following:

add(new LinkTree(tree) {  
public void onClick(AjaxRequestTarget target) { 
System.out.println(Click);
}
});
error: WicketMessage: Can't instantiate page using constructor public 
com.test.Test(org.apache.wicket.PageParameters) and argument 

what works is: to get an event from a link:

add(new AjaxLink(expandAll) {
@Override
public void onClick(AjaxRequestTarget target) {
tree.getTreeState().expandAll();
tree.updateTree(target);
System.out.println(Click);
}
});

the same must be possible with the tree?!

any help is appreciated...

cheers hubert





Re: FormComponent convertInput for children FormComponets

2011-05-18 Thread kamiseq
maybe you need to set type for each control, I had similar issue. look at
the wicket code where the value is set.

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: tree

2011-05-18 Thread Sven Meier

Hi,

 error: WicketMessage: Can't instantiate page using constructor
 public com.test.Test(org.apache.wicket.PageParameters) and argument

an exception stacktrace would give us a clue on what goes wrong here.

Sven

Am 18.05.2011 11:44, schrieb hubert_hupe:

hello,

after hours of researching and trying get a simple tree running iam completely 
frustrated.

i added a tree to the website in this way:

public class Test extends WebPage {

protected TreeModel createTreeModel() {
ListObject  l1 = new ArrayListObject();
l1.add(test 1.1);

}

public Test(final PageParameters parameters) {
tree = new LinkTree(tree, createTreeModel());
add(tree);
}
markup:

 div wicket:id=tree class=my-tree   /div

now the problem: i am not able to fetch the selected node. iam not able to 
fetch the event...
i tried the following:

add(new LinkTree(tree) {
public void onClick(AjaxRequestTarget target) { 
System.out.println(Click);
}
});
error: WicketMessage: Can't instantiate page using constructor public 
com.test.Test(org.apache.wicket.PageParameters) and argument

what works is: to get an event from a link:

add(new AjaxLink(expandAll) {
@Override
public void onClick(AjaxRequestTarget target) {
tree.getTreeState().expandAll();
tree.updateTree(target);
System.out.println(Click);
}
});

the same must be possible with the tree?!

any help is appreciated...

cheers hubert







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



Re: tree

2011-05-18 Thread hubert_hupe
hi sven,

here it is. cheers hubert

WicketMessage: Can't instantiate page using constructor public 
com.reporting.SignIn(org.apache.wicket.PageParameters) and argument 

Root cause:

java.lang.NullPointerException
 at com.reporting.SignIn.init(SignIn.java:217)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at 
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
 at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
 at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
 at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
 at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
 at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
 at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
 at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
 at org.mortbay.jetty.Server.handle(Server.java:295)
 at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
 at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:827)
 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
 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)

Complete stack:

org.apache.wicket.WicketRuntimeException: Can't instantiate page using 
constructor public com.reporting.SignIn(org.apache.wicket.PageParameters) and 
argument 
 at 
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
 at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
 at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)

java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at 
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
 at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
 at 

Re: tree

2011-05-18 Thread Martijn Dashorst
Take a look at line 217 of your SignIn class and see why it throws a NPE.

Martijn

On Wed, May 18, 2011 at 3:24 PM, hubert_hupe hubert_h...@gmx.de wrote:
 hi sven,

 here it is. cheers hubert

 WicketMessage: Can't instantiate page using constructor public 
 com.reporting.SignIn(org.apache.wicket.PageParameters) and argument

 Root cause:

 java.lang.NullPointerException
     at com.reporting.SignIn.init(SignIn.java:217)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at 
 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
     at 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
     at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
     at 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
     at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
     at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
     at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
     at 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
     at 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
     at 
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
     at 
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
     at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
     at 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
     at org.mortbay.jetty.Server.handle(Server.java:295)
     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
     at 
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:827)
     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511)
     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
     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)

 Complete stack:

 org.apache.wicket.WicketRuntimeException: Can't instantiate page using 
 constructor public com.reporting.SignIn(org.apache.wicket.PageParameters) and 
 argument
     at 
 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
     at 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
     at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
     at 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
     at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
     at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)

 java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at 
 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
     at 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
     at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
     at 
 

Re: tree

2011-05-18 Thread hubert_hupe
Oh my goodness, 

ok. there was an object that was null. error is gone. 
BUT still no event is fired when i click on a node in the tree.

as a kind of template i tried to adapt the following for the tree:
add(new AjaxLink(expandAll) {
@Override
public void onClick(AjaxRequestTarget target) {
tree.getTreeState().expandAll();
tree.updateTree(target);
System.out.println(Click);
}
});

here is the current snippet:


add(new LinkTree(tree, createTreeModel()) {
protected void onNodeClicked(AjaxRequestTarget ajaxRequestTarget, TreeNode 
node) {
System.out.println(Click);
}
});

the problem is that the line with system.out is never reached when i click 
the tree node.
an @Override is not possible as in the AjaxLink onClik Method.

has anyone ever used  
org.apache.wicket.markup.html.tree.LinkTree.LinkTree(String id, TreeModel model)
i got the exampe from here: 
http://www.wicket-library.com/wicket-examples/ajax/tree/simple?0
but there is no sample to get the clicked node

cheers 

Am 18.05.2011 um 15:28 schrieb Martijn Dashorst:

 Take a look at line 217 of your SignIn class and see why it throws a NPE.
 
 Martijn
 
 On Wed, May 18, 2011 at 3:24 PM, hubert_hupe hubert_h...@gmx.de wrote:
 hi sven,
 
 here it is. cheers hubert
 
 WicketMessage: Can't instantiate page using constructor public 
 com.reporting.SignIn(org.apache.wicket.PageParameters) and argument
 
 Root cause:
 
 java.lang.NullPointerException
 at com.reporting.SignIn.init(SignIn.java:217)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at 
 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
 at 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
 at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
 at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
 at 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
 at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
 at 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
 at 
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
 at 
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at 
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
 at 
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
 at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
 at 
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
 at org.mortbay.jetty.Server.handle(Server.java:295)
 at 
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
 at 
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:827)
 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
 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)
 
 Complete stack:
 
 org.apache.wicket.WicketRuntimeException: Can't instantiate page using 
 constructor public com.reporting.SignIn(org.apache.wicket.PageParameters) 
 and argument
 at 
 org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
 at 
 org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
 at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
 at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
 at 
 

IStringResourceLoader database implementation

2011-05-18 Thread Wicket

Hi,

Has anyone successfully implemented IStringResourceLoader to get text 
via database without to much load for the database? Any suggestion?


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



Re: HeaderContributors, Ajax and IE8

2011-05-18 Thread Mathias Nilsson
I had problem in IE8 with a previous version of wicket. Used 1.4.12 and it
worked fine in IE8

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/HeaderContributors-Ajax-and-IE8-tp3529468p3533422.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: tree

2011-05-18 Thread Sven Meier

Hi,

the method you want to override is the following:

protected void onNodeLinkClicked(Object node, BaseTree tree, 
AjaxRequestTarget target)

{
}

Sven

On 05/18/2011 05:27 PM, hubert_hupe wrote:

Oh my goodness,

ok. there was an object that was null. error is gone.
BUT still no event is fired when i click on a node in the tree.

as a kind of template i tried to adapt the following for the tree:
add(new AjaxLink(expandAll) {
@Override
public void onClick(AjaxRequestTarget target) {
tree.getTreeState().expandAll();
tree.updateTree(target);
System.out.println(Click);
}
});

here is the current snippet:


add(new LinkTree(tree, createTreeModel()) {
protected void onNodeClicked(AjaxRequestTarget ajaxRequestTarget, TreeNode 
node) {
System.out.println(Click);
}
});

the problem is that the line with system.out is never reached when i click 
the tree node.
an @Override is not possible as in the AjaxLink onClik Method.

has anyone ever used  
org.apache.wicket.markup.html.tree.LinkTree.LinkTree(String id, TreeModel model)
i got the exampe from here: 
http://www.wicket-library.com/wicket-examples/ajax/tree/simple?0
but there is no sample to get the clicked node

cheers

Am 18.05.2011 um 15:28 schrieb Martijn Dashorst:


Take a look at line 217 of your SignIn class and see why it throws a NPE.

Martijn

On Wed, May 18, 2011 at 3:24 PM, hubert_hupehubert_h...@gmx.de  wrote:

hi sven,

here it is. cheers hubert

WicketMessage: Can't instantiate page using constructor public 
com.reporting.SignIn(org.apache.wicket.PageParameters) and argument

Root cause:

java.lang.NullPointerException
 at com.reporting.SignIn.init(SignIn.java:217)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at 
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
 at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
 at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
 at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
 at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
 at 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
 at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
 at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
 at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
 at org.mortbay.jetty.Server.handle(Server.java:295)
 at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503)
 at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:827)
 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210)
 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)

Complete stack:

org.apache.wicket.WicketRuntimeException: Can't instantiate page using 
constructor public com.reporting.SignIn(org.apache.wicket.PageParameters) and 
argument
 at 
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212)
 at 
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
 at 
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
 at 

Re: IStringResourceLoader database implementation

2011-05-18 Thread andrea del bene

Hi,

I've just finished to implement a custom string resource loader which 
checks for existing resource bundle in database. For now i've  used a 
simple HashMap to store loaded entries and to retrieve them without 
reading again from database. I've choose HashMap over HashTable because 
I need to store null values.

Hi,

Has anyone successfully implemented IStringResourceLoader to get text 
via database without to much load for the database? Any suggestion?


-
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: IStringResourceLoader database implementation

2011-05-18 Thread Matthias Gasser
I've used a second level cache, works like a charm.

- matt

--
iPhone Mail


On 18.05.2011, at 20:22, andrea del bene andrea.on@libero.it wrote:

 Hi,
 
 I've just finished to implement a custom string resource loader which checks 
 for existing resource bundle in database. For now i've  used a simple HashMap 
 to store loaded entries and to retrieve them without reading again from 
 database. I've choose HashMap over HashTable because I need to store null 
 values.
 Hi,
 
 Has anyone successfully implemented IStringResourceLoader to get text via 
 database without to much load for the database? Any suggestion?
 
 -
 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



Killing threads in Application's onDestroy method

2011-05-18 Thread Henrique Boregio
Hi, in my Wicket Application class, I create a couple of thread that
sleep most of the time..and come alive every one in a while to do some
maintenance tasks.

I create them in the init() method of the Wicket Application...and
call kill() on them in the onDestroy() method.

When I shutdown tomcat and restart it again (via the default .bat or
.sh), I can see from my log files that some threads from the previuos
deploy are still hanging around in memory.

Am I doing something wrong?

Many thanks.

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



Re: Killing threads in Application's onDestroy method

2011-05-18 Thread Bruno Borges
Don't kill your threads...

You should code them the right way:

public void run() {
   while(running) {
  // do stuff
   }
}

Instead of killing them, change the value of that boolean 'running' to false
through any other method.

Cheers,
*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Wed, May 18, 2011 at 3:51 PM, Henrique Boregio hbore...@gmail.comwrote:

 Hi, in my Wicket Application class, I create a couple of thread that
 sleep most of the time..and come alive every one in a while to do some
 maintenance tasks.

 I create them in the init() method of the Wicket Application...and
 call kill() on them in the onDestroy() method.

 When I shutdown tomcat and restart it again (via the default .bat or
 .sh), I can see from my log files that some threads from the previuos
 deploy are still hanging around in memory.

 Am I doing something wrong?

 Many thanks.

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




Re: Killing threads in Application's onDestroy method

2011-05-18 Thread Henrique Boregio
My bad...that's actually what I am doing.
I have a stop() method insite my threads that change a boolean value
to false inside the while...instead of having while(tru)

On Wed, May 18, 2011 at 3:51 PM, Henrique Boregio hbore...@gmail.com wrote:
 Hi, in my Wicket Application class, I create a couple of thread that
 sleep most of the time..and come alive every one in a while to do some
 maintenance tasks.

 I create them in the init() method of the Wicket Application...and
 call kill() on them in the onDestroy() method.

 When I shutdown tomcat and restart it again (via the default .bat or
 .sh), I can see from my log files that some threads from the previuos
 deploy are still hanging around in memory.

 Am I doing something wrong?

 Many thanks.


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



Re: IStringResourceLoader database implementation

2011-05-18 Thread andrea del bene
Did you implemented this cache using some framework (ehcache, 
terracotta, spring cache, )?

I've used a second level cache, works like a charm.

- matt

--
iPhone Mail


On 18.05.2011, at 20:22, andrea del beneandrea.on@libero.it  wrote:


Hi,

I've just finished to implement a custom string resource loader which checks 
for existing resource bundle in database. For now i've  used a simple HashMap 
to store loaded entries and to retrieve them without reading again from 
database. I've choose HashMap over HashTable because I need to store null 
values.

Hi,

Has anyone successfully implemented IStringResourceLoader to get text via 
database without to much load for the database? Any suggestion?

-
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: IStringResourceLoader database implementation

2011-05-18 Thread Matthias Gasser
Used hibernate+ehcache.

- matt

Am 18.05.2011 um 21:21 schrieb andrea del bene:

 Did you implemented this cache using some framework (ehcache, terracotta, 
 spring cache, )?
 I've used a second level cache, works like a charm.
 
 - matt
 
 --
 iPhone Mail
 
 
 On 18.05.2011, at 20:22, andrea del beneandrea.on@libero.it  wrote:
 
 Hi,
 
 I've just finished to implement a custom string resource loader which 
 checks for existing resource bundle in database. For now i've  used a 
 simple HashMap to store loaded entries and to retrieve them without reading 
 again from database. I've choose HashMap over HashTable because I need to 
 store null values.
 Hi,
 
 Has anyone successfully implemented IStringResourceLoader to get text via 
 database without to much load for the database? Any suggestion?
 
 -
 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: Killing threads in Application's onDestroy method

2011-05-18 Thread Rafał Krupiński

W dniu 18.05.2011 21:16, Henrique Boregio pisze:

My bad...that's actually what I am doing.
I have a stop() method insite my threads that change a boolean value
to false inside the while...instead of having while(tru)


In this case, most probably your threads are running while your 
application is being closed. You can call Thread.join() or use 
CountDownLatch to wait for all the Threads to finish.


Regards

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



JavaScript onClick Handler Stops Form Submit

2011-05-18 Thread eugenebalt
Hi,

My SubmitButton has an onClick JavaScript handler. Let's say the handler is
something simple, like

onclick=alert('Test')

There are no JS errors when I run. But the problem is, the form submit flow
stops. The flow doesn't go into Form.onSubmit() as it should.

I tried returning true and false in the handler, but it doesn't help, the
flow stops. Any ideas?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JavaScript-onClick-Handler-Stops-Form-Submit-tp3533771p3533771.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: JavaScript onClick Handler Stops Form Submit

2011-05-18 Thread Bruno Borges
Please send more code.

Would be great if you could put that on a quickstart project.


*Bruno Borges*
www.brunoborges.com.br
+55 21 76727099



On Wed, May 18, 2011 at 5:04 PM, eugenebalt eugeneb...@yahoo.com wrote:

 Hi,

 My SubmitButton has an onClick JavaScript handler. Let's say the handler is
 something simple, like

 onclick=alert('Test')

 There are no JS errors when I run. But the problem is, the form submit flow
 stops. The flow doesn't go into Form.onSubmit() as it should.

 I tried returning true and false in the handler, but it doesn't help, the
 flow stops. Any ideas?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/JavaScript-onClick-Handler-Stops-Form-Submit-tp3533771p3533771.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Issue with internationalising the MultiFileUploadField component

2011-05-18 Thread Steve Swinsburg
Thanks, I can reproduce it in a quickstart using 1.4.17 as well.Attached tohttps://issues.apache.org/jira/browse/WICKET-3727Reproduced the snippets here:---HomePage.java:add(new Label("message", new ResourceModel("some.label")));Form form = new Form("form");form.setMultiPart(true);form.add(new MultiFileUploadField("multi", 5));add(form);---HomePage.htmlspanwicket:id="message"message will be here/spanformwicket:id="form"spanwicket:id="multi"/span/form---WicketApplication.properties:some.label=this is a message from our properties fileorg.apache.wicket.mfu.caption.unlimited=blah:org.apache.wicket.mfu.caption.limited=test123 (${max}):org.apache.wicket.mfu.delete=BorrarAnd I get the label translated from the properties file, but not the MultiUploadFieldComponent. Screenshot:On 18/05/2011, at 3:51 PM, Martin Grigorov wrote:Please create a quickstart app and attach it to a ticket.Test the quickstart with 1.4.17 too.On Wed, May 18, 2011 at 1:41 AM, Steve Swinsburgsteve.swinsb...@gmail.comwrote:Ok I've done that and when the webapp starts up I get this:INFO: 2011-05-18 09:36:53,246 Loading properties files fromjar:file:/pah/to/my/app/WEB-INF/lib/wicket-1.4.13.jar!/org/apache/wicket/Application.properties[http-8081-Processor24]Accessing pages I see things like:DEBUG: 2011-05-18 09:38:27,823 Property found in cache:'link.my.profile.tooltip'; Component: '[MarkupContainer [Component id =myProfileLink]]'; value: 'Ver y editar tu perfil' [http-8081-Processor19]Which all looks good.Then, when I access the panel that has the MultiFileUploadField component,I see no reference at all to any of the properties.In contrast, when I access a panel that has the phone number validator,which actually works in terms of internationalisation, I get:DEBUG: 2011-05-18 09:40:06,655 Property found in cache:'homephone.PhoneNumberValidator'; Component: '[MarkupContainer [Component id= homephone]]'; value: 'N?mero de tel?fono no v?lido'[http-8081-Processor19]Does that give you an idea of where the issue might be?thanks,SteveOn 17/05/2011, at 10:26 PM, Martin Grigorov wrote:Enable debug level logging for org.apache.wicket.Localizer and see whatisattempted.On Tue, May 17, 2011 at 1:37 PM, Steve Swinsburgsteve.swinsb...@gmail.comwrote:Yeah, that's where I have them and its not working. Its the same spot wehave the ones that do work too.We do use a custom resource loader but I don't understand why it wouldallow us to override some properties from Wicket components, and notothers.Does the property need to be prefixed with the wicket id or something?Any ideas?ThanksSteveSent from my iPhoneOn 17/05/2011, at 17:37, Martin Grigorov mgrigo...@apache.org wrote:Looking at MultiFileUploadField.java these are exactly the keys youhavetouse.Try to put them in MyApp_es.propertiesOn Tue, May 17, 2011 at 9:31 AM, Steve Swinsburgsteve.swinsb...@gmail.comwrote:Hi,We are having an issue setting some properties to override the defaulttextfor the MultiFileUploadField component. As per the docs, we have setthefollowing in our local properties file:org.apache.wicket.mfu.caption.unlimited=Ficheros:org.apache.wicket.mfu.caption.limited=Ficheros (m\u00E1ximo ${max}):org.apache.wicket.mfu.delete=Borrarhowever they are not being overridden. We know our properties file isworking because we can override other properties, like:workphone.PhoneNumberValidator = N\u00FAmero de tel\u00E9fono nov\u00E1lidoand those come up correctly.Is this a bug? If not, what might we be missing?Wicket 1.4.13thanks,steve--Martin GrigorovjWeekendTraining, Consulting, Developmenthttp://jWeekend.com http://jweekend.com/-To unsubscribe, e-mail: users-unsubscr...@wicket.apache.orgFor additional commands, e-mail: users-h...@wicket.apache.org--Martin GrigorovjWeekendTraining, Consulting, Developmenthttp://jWeekend.com http://jweekend.com/-To unsubscribe, e-mail: users-unsubscr...@wicket.apache.orgFor additional commands, e-mail: users-h...@wicket.apache.org-- Martin GrigorovjWeekendTraining, Consulting, Developmenthttp://jWeekend.com http://jweekend.com/

Re: JavaScript onClick Handler Stops Form Submit

2011-05-18 Thread Pedro Santos
Hi, if you are using an AJAX submit button then you can't simple
change the onclick tag attribute that is already changed by the
component. Prepend your alert script in the attribute rather than
modify it.
e.g.
submitComponent.add( new Behavior(){
  onComponentTat(tag){
tag.put(onclick, alert('some alert')+ tag.getAttribute(onclick));
  }
}

On Wed, May 18, 2011 at 5:04 PM, eugenebalt eugeneb...@yahoo.com wrote:
 Hi,

 My SubmitButton has an onClick JavaScript handler. Let's say the handler is
 something simple, like

 onclick=alert('Test')

 There are no JS errors when I run. But the problem is, the form submit flow
 stops. The flow doesn't go into Form.onSubmit() as it should.

 I tried returning true and false in the handler, but it doesn't help, the
 flow stops. Any ideas?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/JavaScript-onClick-Handler-Stops-Form-Submit-tp3533771p3533771.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Pedro Henrique Oliveira dos Santos

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



Re: JavaScript onClick Handler Stops Form Submit

2011-05-18 Thread hariharansrc
when you are using wicket in form that has already onSubmit event so your
javascript onclick event won't work so you have to extend your form and
override the onSubmit in wicket and add your javascript in that onSubmit
function. Here is a sample code i am attaching you make changes in that to
obtain your function

HTML
html
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.5-strict.dtd;

head  
titleWicket form/title
/head

body
   button wicket:id=hello type=submithelloworld/button



/body
/html



JAVA
package org.wick;



import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Form;

public class HomePage extends WebPage {
public HomePage()
{
Form f=new Form(form);
add(f);
f.add(new AjaxButton(hw,f){

/**
 * 
 */
private static final long serialVersionUID = 1L;

protected void onSubmit(AjaxRequestTarget target1, Form form) {

target1.appendJavascript(alert(helloworld));
}
});
}
}




If you get anything new better than this then just post it i also posted
your question and got good replies 
but now also i am searching for better alternatives

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JavaScript-onClick-Handler-Stops-Form-Submit-tp3533771p3534772.html
Sent from the Users forum mailing list archive at Nabble.com.

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