Re: navigation menu

2011-06-09 Thread hubert_hupe
hi,

the wicket menu works fairly ( 
http://www.cooldatasoft.com/wicket-menu-demo/wicket/bookmarkable/com.cooldatasoft.page.SunriseGlossDropDownMenuDemo?1
 )
the problem at the moment is that the target page (p1) replaces the current 
page where the menu is inside.
is there a way to define a target container/DIV where the target page should be 
shown? for example like this: http://wicketstuff.org/wicket/navomatic/

regards hubert

i used the component in this way:

final testMenu p1 = new testMenu();

//Define Primary Menu items (menuText,destinationWebPage)   
MenuItem primaryMenu1 = new MenuItem("MENU 1",p1);
List primaryMenuList = new ArrayList();
primaryMenuList.add(primaryMenu1);

add(new SunriseGlossDropDownMenu("sunriseGlossMenu", primaryMenuList));

markup:



Am 08.06.2011 um 21:33 schrieb Peter Karich:
Am 08.06.2011 um 17:51 schrieb Fatih Mehmet Ucar:

> http://code.google.com/p/wicket-menu/
> 
> Not complete but if you see the source code, it will give you an idea.
> 
> cheers,
> -fatih
> 
> On 8 June 2011 16:28, hubert_hupe  wrote:
>> hi guys,
>> 
>> i have no clue how to create a simple navigation bar like this: 
>> http://net.tutsplus.com/tutorials/javascript-ajax/a-different-top-navigation/
>> if possible i need images for the headlines.
>> when you move the mouse over the menu it drops down - there are millions of 
>> website with this functionality.
>> the problem is: i have to ceate the menu dynamically. the informations which 
>> menuitem should be in the menu comes from the database. so i cannot use a 
>> static javascript code in the html file.
>> is anybody there who can give me a hint or even an example?
>> 
>> best regards
>> 
>> hubert
>> -
>> 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: navigation menu

2011-06-09 Thread hubert_hupe
hi,

thanks for the hint thats the thing iam looking for. unfortunately i cannot run 
the example. i get the following error message: "Index cannot be resolved to a 
type"
there is no method or class names Index...

regards
hubert

private List buildMenu() {
//Create one seperator menu item
MenuItem seperatorMenuItem = new MenuItem(true);
//Define Primary Menu items (menuText,destinationWebPage)   
//MenuItem primaryMenu1 = new MenuItem("MENU 1", new Index());
   
  MenuItem primaryMenu1 = new MenuItem("MENU 1", new Index()); << ERROR Index 
cannot be resolved to a type


Am 08.06.2011 um 17:51 schrieb Fatih Mehmet Ucar:

> http://code.google.com/p/wicket-menu/
> 
> Not complete but if you see the source code, it will give you an idea.
> 
> cheers,
> -fatih
> 
> On 8 June 2011 16:28, hubert_hupe  wrote:
>> hi guys,
>> 
>> i have no clue how to create a simple navigation bar like this: 
>> http://net.tutsplus.com/tutorials/javascript-ajax/a-different-top-navigation/
>> if possible i need images for the headlines.
>> when you move the mouse over the menu it drops down - there are millions of 
>> website with this functionality.
>> the problem is: i have to ceate the menu dynamically. the informations which 
>> menuitem should be in the menu comes from the database. so i cannot use a 
>> static javascript code in the html file.
>> is anybody there who can give me a hint or even an example?
>> 
>> best regards
>> 
>> hubert
>> -
>> 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
> 



navigation menu

2011-06-08 Thread hubert_hupe
hi guys,

i have no clue how to create a simple navigation bar like this: 
http://net.tutsplus.com/tutorials/javascript-ajax/a-different-top-navigation/ 
if possible i need images for the headlines.
when you move the mouse over the menu it drops down - there are millions of 
website with this functionality.
the problem is: i have to ceate the menu dynamically. the informations which 
menuitem should be in the menu comes from the database. so i cannot use a 
static javascript code in the html file.
is anybody there who can give me a hint or even an example?

best regards

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



Re: tree do not stay open tree collapsed after setResponsePage

2011-05-26 Thread hubert_hupe
i used the following example as a template: 
http://wicket.apache.org/learn/examples/markupinheritance.html

> With code like:
>  Page1 p1 = new Page1(node.toString());
> setResponsePage(p1); <--
is there an alternative to show Page1 without using setResponsePage?

Am 26.05.2011 um 10:23 schrieb Martin Grigorov:

> With code like:
>  Page1 p1 = new Page1(node.toString());
> setResponsePage(p1); <--
> 
> it is you who reloads the page.
> 
> Load a page in a div ? How do you do that ? The only possible way is
> to put an iframe in the div.
> I guess you need a Panel instead of a Page and re-render it with :
> target.addComponent(panel)
> 
> On Thu, May 26, 2011 at 11:19 AM, hubert_hupe  wrote:
>> 
>> hi,
>> 
>> i do not reload the page - or rather the page reloads itself. the page has 
>> two div areas in the markup and i load the target page into one div and the 
>> tree in the other.
>> 
>> regards
>> hubert
>> 
>> Am 25.05.2011 um 20:51 schrieb James Carman:
>> 
>>> How are you getting back to the original page?
>>> 
>>> On Wed, May 25, 2011 at 11:09 AM, hubert_hupe  wrote:
>>>> hi folks,
>>>> 
>>>> i get wicket with the wicket...
>>>> what do i have is a simple tree in page X. after click a node i do a 
>>>> redirect to pageY. so far so good. but the tree
>>>> collapsed after the redirect. it seems the tree is rebuild after the 
>>>> click. its a kind of postback behavior.
>>>> my question is: what can i do to prevent collapsing the tree? if this is 
>>>> not possible, how can i open the old node? or how can i prevent the 
>>>> "reloading/postbacking"?
>>>> 
>>>> best regards
>>>> hubert
>>>> 
>>>> add(new LinkTree("tree", createTreeModel()) {
>>>> @Override
>>>> protected void onNodeLinkClicked(Object node, BaseTree tree, 
>>>> AjaxRequestTarget target) {
>>>>   System.out.println("test");
>>>>   System.out.println("node: " + node.toString());
>>>>   Page1 p1 = new Page1(node.toString());
>>>> 
>>>>   setResponsePage(p1); <--
>>>> 
>>>>  }
>>>> });
>>>> 
>>>> protected TreeModel createTreeModel() {
>>>>DefaultMutableTreeNode root = new DefaultMutableTreeNode(new 
>>>> ModelBean("ROOT"));
>>>> ...
>>>> }
>>>> 
>>>> i created a simple layout with div in the markup to ensure that the tree 
>>>> is on the left site and the navigated page on the right...
>>>> 
>>>> 
>>>> ... wicket:id="tree"...
>>>> 
>>>> 
>>>>
>>>> 
>>> 
>>> -
>>> 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
>> 
> 
> 
> 
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.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: tree do not stay open tree collapsed after setResponsePage

2011-05-26 Thread hubert_hupe
hi,

i do not reload the page - or rather the page reloads itself. the page has two 
div areas in the markup and i load the target page into one div and the tree in 
the other.

regards
hubert

Am 25.05.2011 um 20:51 schrieb James Carman:

> How are you getting back to the original page?
> 
> On Wed, May 25, 2011 at 11:09 AM, hubert_hupe  wrote:
>> hi folks,
>> 
>> i get wicket with the wicket...
>> what do i have is a simple tree in page X. after click a node i do a 
>> redirect to pageY. so far so good. but the tree
>> collapsed after the redirect. it seems the tree is rebuild after the click. 
>> its a kind of postback behavior.
>> my question is: what can i do to prevent collapsing the tree? if this is not 
>> possible, how can i open the old node? or how can i prevent the 
>> "reloading/postbacking"?
>> 
>> best regards
>> hubert
>> 
>> add(new LinkTree("tree", createTreeModel()) {
>> @Override
>> protected void onNodeLinkClicked(Object node, BaseTree tree, 
>> AjaxRequestTarget target) {
>>   System.out.println("test");
>>   System.out.println("node: " + node.toString());
>>   Page1 p1 = new Page1(node.toString());
>> 
>>   setResponsePage(p1); <--
>> 
>>  }
>> });
>> 
>> protected TreeModel createTreeModel() {
>>DefaultMutableTreeNode root = new DefaultMutableTreeNode(new 
>> ModelBean("ROOT"));
>> ...
>> }
>> 
>> i created a simple layout with div in the markup to ensure that the tree is 
>> on the left site and the navigated page on the right...
>> 
>> 
>> ... wicket:id="tree"...
>> 
>> 
>>
>> 
> 
> -
> 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



tree do not stay open tree collapsed after setResponsePage

2011-05-25 Thread hubert_hupe
hi folks,

i get wicket with the wicket... 
what do i have is a simple tree in page X. after click a node i do a redirect 
to pageY. so far so good. but the tree
collapsed after the redirect. it seems the tree is rebuild after the click. its 
a kind of postback behavior. 
my question is: what can i do to prevent collapsing the tree? if this is not 
possible, how can i open the old node? or how can i prevent the 
"reloading/postbacking"?

best regards
hubert

add(new LinkTree("tree", createTreeModel()) {
@Override
protected void onNodeLinkClicked(Object node, BaseTree tree, AjaxRequestTarget 
target) {
   System.out.println("test");
   System.out.println("node: " + node.toString());
   Page1 p1 = new Page1(node.toString());

   setResponsePage(p1); <--

 }
});

protected TreeModel createTreeModel() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new 
ModelBean("ROOT"));
...
}

i created a simple layout with div in the markup to ensure that the tree is on 
the left site and the navigated page on the right...


... wicket:id="tree"...





Re: tree

2011-05-19 Thread hubert_hupe
Unbelievable how easy a solution can be...

sven, you are my hero. thanks. please stay the way you are - helpful!

hubert
Am 18.05.2011 um 20:06 schrieb 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_hupe  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.(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(WebAppC

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  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.(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.w

Re: tree

2011-05-18 Thread hubert_hupe
cessEvents(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)


Am 18.05.2011 um 14:59 schrieb 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() {
>>  List  l1 = new ArrayList();
>>  l1.add("test 1.1");
>> 
>> }
>> 
>> public Test(final PageParameters parameters) {
>>  tree = new LinkTree("tree", createTreeModel());
>>  add(tree);
>> }
>> markup:
>> 
>>
>> 
>> 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
> 



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() {
List l1 = new ArrayList();
l1.add("test 1.1");

}

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



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