Re: wicket-jquery-ui menu item with client handler

2017-07-27 Thread Maxim Solodovnik
Hello Sebastien,

Just was able to check it
It works, unfortunately I was unable to abopt it for my needs ... :(
What I need is
1) some menu items should work via server round-trip
2) couple of menu items should be client-side only
I tried to "return true/false" from handler but it doesn't work

So the whole menu can be client-side or server-side :(

On Wed, Jul 12, 2017 at 6:21 PM, Sebastien <seb...@gmail.com> wrote:

> Hi Maxim,
>
> 8.0.0-SNAPSHOT is deploying; you should now be able to supply your own
> callback as follow:
>
> @Override
> public void onConfigure(JQueryBehavior behavior)
> {
> behavior.setOption("select", "function(...) { ... }");
> }
>
> Please refer to jQuery UI or Kendo UI doc for usage/arguments. Please also
> note that an ajax behavior is still bound to the component (but not used),
> that's ok if you have only one menu. But if you have dozen, you may
> consider having your own menu implementation...
>
> Thanks & best regards,
> Sebastien.
>
>


-- 
WBR
Maxim aka solomax


Re: wicket-jquery-ui menu item with client handler

2017-07-12 Thread Sebastien
Hi Maxim,

8.0.0-SNAPSHOT is deploying; you should now be able to supply your own
callback as follow:

@Override
public void onConfigure(JQueryBehavior behavior)
{
behavior.setOption("select", "function(...) { ... }");
}

Please refer to jQuery UI or Kendo UI doc for usage/arguments. Please also
note that an ajax behavior is still bound to the component (but not used),
that's ok if you have only one menu. But if you have dozen, you may
consider having your own menu implementation...

Thanks & best regards,
Sebastien.


Re: wicket-jquery-ui menu item with client handler

2017-07-12 Thread Sebastien
Hi Maxim,

A simple solution would be to specify your own "select" callback but you
can't do it right now because the API is not designed to let you do that! ;)
I will change this asap...

Thanks & best regards,
Sebastien.


On Wed, Jul 12, 2017 at 2:39 AM, Maxim Solodovnik <solomax...@gmail.com>
wrote:

> Thanks a lot for clarifications
> Finally I was able to find onSelect method :)
>
> What I need is "client only" menu item (with no round trip to server)
> Currently I'm achieving this as follows:
> new MenuItem() {
> @Override
> public void onClick(AjaxRequestTarget target) {
> target.appendJavaScript("alert('test');");
> }
> }
>
>
>
> On Wed, Jul 12, 2017 at 12:38 AM, Sebastien <seb...@gmail.com> wrote:
>
>> Hi Maxim,
>>
>> MenuItem is a pojo, not a component/widget. You can use the
>> Menu#getItemList (jquery-ui) or Menu#getMenuItemsMap (kendo-ui) to add
>> menu-items and then reload the widget with the ART.
>> But I did not understood what you want/need to listen, there is no lazy
>> load (in ajax) for instance. The only available ajax-behavior is "onselect"
>> which triggers both menuItem#onClick(ART) and menu#onclick(ART, menuitem)
>>
>> I don't know if it helps, otherwise please give me more detail about your
>> use-case...
>>
>> Thanks & best regards :)
>> Sebastien
>>
>>
>> On Tue, Jul 11, 2017 at 5:04 PM, Maxim Solodovnik <solomax...@gmail.com>
>> wrote:
>>
>>> Hello Sebastien,
>>>
>>> I'm trying to add MenuItem to wicket-jquery-ui menu with client only JS
>>> handler
>>> As I understand I need to add AjaxCallListener to MenuItem but it
>>> seems I'm unable to find the correct place for it :(
>>> Maybe you can help?
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>
>
> --
> WBR
> Maxim aka solomax
>


Re: wicket-jquery-ui menu item with client handler

2017-07-12 Thread Maxim Solodovnik
Thanks a lot!

On Wed, Jul 12, 2017 at 3:10 PM, Sebastien <seb...@gmail.com> wrote:

> Hi Maxim,
>
> A simple solution would be to specify your own "select" callback but you
> can't do it right now because the API is not designed to let you do that! ;)
> I will change this asap...
>
> Thanks & best regards,
> Sebastien.
>
>
> On Wed, Jul 12, 2017 at 2:39 AM, Maxim Solodovnik <solomax...@gmail.com>
> wrote:
>
>> Thanks a lot for clarifications
>> Finally I was able to find onSelect method :)
>>
>> What I need is "client only" menu item (with no round trip to server)
>> Currently I'm achieving this as follows:
>> new MenuItem() {
>> @Override
>> public void onClick(AjaxRequestTarget target) {
>> target.appendJavaScript("alert('test');");
>> }
>> }
>>
>>
>>
>> On Wed, Jul 12, 2017 at 12:38 AM, Sebastien <seb...@gmail.com> wrote:
>>
>>> Hi Maxim,
>>>
>>> MenuItem is a pojo, not a component/widget. You can use the
>>> Menu#getItemList (jquery-ui) or Menu#getMenuItemsMap (kendo-ui) to add
>>> menu-items and then reload the widget with the ART.
>>> But I did not understood what you want/need to listen, there is no lazy
>>> load (in ajax) for instance. The only available ajax-behavior is "onselect"
>>> which triggers both menuItem#onClick(ART) and menu#onclick(ART, menuitem)
>>>
>>> I don't know if it helps, otherwise please give me more detail about
>>> your use-case...
>>>
>>> Thanks & best regards :)
>>> Sebastien
>>>
>>>
>>> On Tue, Jul 11, 2017 at 5:04 PM, Maxim Solodovnik <solomax...@gmail.com>
>>> wrote:
>>>
>>>> Hello Sebastien,
>>>>
>>>> I'm trying to add MenuItem to wicket-jquery-ui menu with client only JS
>>>> handler
>>>> As I understand I need to add AjaxCallListener to MenuItem but it
>>>> seems I'm unable to find the correct place for it :(
>>>> Maybe you can help?
>>>>
>>>> --
>>>> WBR
>>>> Maxim aka solomax
>>>>
>>>
>>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>


-- 
WBR
Maxim aka solomax


Re: wicket-jquery-ui menu item with client handler

2017-07-12 Thread Maxim Solodovnik
Maybe little example can be added to 7thweb :)))

On Wed, Jul 12, 2017 at 3:16 PM, Maxim Solodovnik <solomax...@gmail.com>
wrote:

> Thanks a lot!
>
> On Wed, Jul 12, 2017 at 3:10 PM, Sebastien <seb...@gmail.com> wrote:
>
>> Hi Maxim,
>>
>> A simple solution would be to specify your own "select" callback but you
>> can't do it right now because the API is not designed to let you do that! ;)
>> I will change this asap...
>>
>> Thanks & best regards,
>> Sebastien.
>>
>>
>> On Wed, Jul 12, 2017 at 2:39 AM, Maxim Solodovnik <solomax...@gmail.com>
>> wrote:
>>
>>> Thanks a lot for clarifications
>>> Finally I was able to find onSelect method :)
>>>
>>> What I need is "client only" menu item (with no round trip to server)
>>> Currently I'm achieving this as follows:
>>> new MenuItem() {
>>> @Override
>>> public void onClick(AjaxRequestTarget target) {
>>> target.appendJavaScript("alert('test');");
>>> }
>>> }
>>>
>>>
>>>
>>> On Wed, Jul 12, 2017 at 12:38 AM, Sebastien <seb...@gmail.com> wrote:
>>>
>>>> Hi Maxim,
>>>>
>>>> MenuItem is a pojo, not a component/widget. You can use the
>>>> Menu#getItemList (jquery-ui) or Menu#getMenuItemsMap (kendo-ui) to add
>>>> menu-items and then reload the widget with the ART.
>>>> But I did not understood what you want/need to listen, there is no lazy
>>>> load (in ajax) for instance. The only available ajax-behavior is "onselect"
>>>> which triggers both menuItem#onClick(ART) and menu#onclick(ART, menuitem)
>>>>
>>>> I don't know if it helps, otherwise please give me more detail about
>>>> your use-case...
>>>>
>>>> Thanks & best regards :)
>>>> Sebastien
>>>>
>>>>
>>>> On Tue, Jul 11, 2017 at 5:04 PM, Maxim Solodovnik <solomax...@gmail.com
>>>> > wrote:
>>>>
>>>>> Hello Sebastien,
>>>>>
>>>>> I'm trying to add MenuItem to wicket-jquery-ui menu with client only
>>>>> JS handler
>>>>> As I understand I need to add AjaxCallListener to MenuItem but it
>>>>> seems I'm unable to find the correct place for it :(
>>>>> Maybe you can help?
>>>>>
>>>>> --
>>>>> WBR
>>>>> Maxim aka solomax
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> WBR
>>> Maxim aka solomax
>>>
>>
>>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax


Re: wicket-jquery-ui menu item with client handler

2017-07-11 Thread Maxim Solodovnik
Thanks a lot for clarifications
Finally I was able to find onSelect method :)

What I need is "client only" menu item (with no round trip to server)
Currently I'm achieving this as follows:
new MenuItem() {
@Override
public void onClick(AjaxRequestTarget target) {
target.appendJavaScript("alert('test');");
}
}



On Wed, Jul 12, 2017 at 12:38 AM, Sebastien <seb...@gmail.com> wrote:

> Hi Maxim,
>
> MenuItem is a pojo, not a component/widget. You can use the
> Menu#getItemList (jquery-ui) or Menu#getMenuItemsMap (kendo-ui) to add
> menu-items and then reload the widget with the ART.
> But I did not understood what you want/need to listen, there is no lazy
> load (in ajax) for instance. The only available ajax-behavior is "onselect"
> which triggers both menuItem#onClick(ART) and menu#onclick(ART, menuitem)
>
> I don't know if it helps, otherwise please give me more detail about your
> use-case...
>
> Thanks & best regards :)
> Sebastien
>
>
> On Tue, Jul 11, 2017 at 5:04 PM, Maxim Solodovnik <solomax...@gmail.com>
> wrote:
>
>> Hello Sebastien,
>>
>> I'm trying to add MenuItem to wicket-jquery-ui menu with client only JS
>> handler
>> As I understand I need to add AjaxCallListener to MenuItem but it
>> seems I'm unable to find the correct place for it :(
>> Maybe you can help?
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>


-- 
WBR
Maxim aka solomax


Re: wicket-jquery-ui menu item with client handler

2017-07-11 Thread Sebastien
Hi Maxim,

MenuItem is a pojo, not a component/widget. You can use the
Menu#getItemList (jquery-ui) or Menu#getMenuItemsMap (kendo-ui) to add
menu-items and then reload the widget with the ART.
But I did not understood what you want/need to listen, there is no lazy
load (in ajax) for instance. The only available ajax-behavior is "onselect"
which triggers both menuItem#onClick(ART) and menu#onclick(ART, menuitem)

I don't know if it helps, otherwise please give me more detail about your
use-case...

Thanks & best regards :)
Sebastien


On Tue, Jul 11, 2017 at 5:04 PM, Maxim Solodovnik <solomax...@gmail.com>
wrote:

> Hello Sebastien,
>
> I'm trying to add MenuItem to wicket-jquery-ui menu with client only JS
> handler
> As I understand I need to add AjaxCallListener to MenuItem but it
> seems I'm unable to find the correct place for it :(
> Maybe you can help?
>
> --
> WBR
> Maxim aka solomax
>


wicket-jquery-ui menu item with client handler

2017-07-11 Thread Maxim Solodovnik
Hello Sebastien,

I'm trying to add MenuItem to wicket-jquery-ui menu with client only JS handler
As I understand I need to add AjaxCallListener to MenuItem but it
seems I'm unable to find the correct place for it :(
Maybe you can help?

-- 
WBR
Maxim aka solomax

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



Question regarding jquery-ui menu

2017-03-08 Thread Maxim Solodovnik
Hello Sebastien,

I would like to create Menu without icons (and without space for icons)
I tried to set icon to be null, and icon to be JQueryIcon.NONE, but
unfortunately it doesn't help
I believe code of Menu.java line 256 need to be changed, to hide icon
block if it wasn't specified
WDYT? do you need PR? :)

And I have to report http://www.7thweb.net/wicket-jquery-ui is down :(


-- 
WBR
Maxim aka solomax

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



Re: java wickets menu on image button

2016-10-13 Thread Martin Grigorov
Hi,

I'd suggest the following:
- produce a normal  with ExternalLink
- add a special CSS class to all links you need to manipulate, e.g.
class="toVerify"
- in renderHead() do:
response.render(OnDomReadyHeaderItem.forScript("$('.toVerify').each(checkLink)"))

This will call checkLink(link) function for each one of those links

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Oct 13, 2016 at 11:13 AM, ASHU_JAVA <ashu@gmail.com> wrote:

> Hi Martin,
>
> I tried adding following Javascript in HTML file like below:-
>
>
> And modify the code in corresponding JAVA file:-
>
>
>
>
> But I'm unable to get Javascript function trigger when the link is clicked.
>
> Can you please propose some suggestions.
> Thanks in advance
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675754.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: java wickets menu on image button

2016-10-13 Thread ASHU_JAVA
Hi Martin,

I tried adding following Javascript in HTML file like below:-


And modify the code in corresponding JAVA file:-




But I'm unable to get Javascript function trigger when the link is clicked.

Can you please propose some suggestions.
Thanks in advance

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675754.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: java wickets menu on image button

2016-10-11 Thread Martin Grigorov
Hi,

For this you will need to use Javascript.
E.g. you can use jQuery#ajax() to make a HEAD request to the url. If it
returns an error, then remove the "target" attribute and apply some JS to
show a popover when the link is clicked.
This is not Wicket related so you will have to use Google for more
information.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Oct 11, 2016 at 7:56 PM, ASHU_JAVA <ashu@gmail.com> wrote:

> Hi Martin,
>
> I've implemented the External Links as shown in below code
>
>
> Can you please suggest how to provide a Pop-up if the External link doesn't
> work i.e. if a link is clicked and the link is an invalid URL, it should
> open a pop-up with error message instead of a new tab?
>
> Thanks in advance.
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675739.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: java wickets menu on image button

2016-10-11 Thread ASHU_JAVA
Hi Martin,

I've implemented the External Links as shown in below code


Can you please suggest how to provide a Pop-up if the External link doesn't
work i.e. if a link is clicked and the link is an invalid URL, it should
open a pop-up with error message instead of a new tab?

Thanks in advance.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675739.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: java wickets menu on image button

2016-10-03 Thread Martin Grigorov
Hi,



Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sun, Oct 2, 2016 at 4:31 PM, ASHU_JAVA <ashu@gmail.com> wrote:

> Hi Martin,
>
> Thanks a lot for your suggestion.
>
> My requirement is nearly complete, the only issue I'm facing right now is
> *how to open the List link in new tab ?*.
> Please find below my current code:
>
> /SamplePage.Java/
> add(new LinkPanel("navBar"));
>
> /SamplePage.html/
> 
>
> /LinkPanel.Java/
>
>
>
> /LinkPanel.html/
>
>
>
> /style.css/
>
>
>
> The output looks like below image:
> <http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_2.png>
>
> So, when I click on link it open in the same window.
>
> I tried to change the *"LinkPanel.java" *code as below:-
>
> The output now looks like below image:
> <http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_1.png>
>
> I'm able to now open the links in different tabs but the appearance is now
> not in the list.
>
> I think if the LinkPanel.Java code can generate an HTML like below it will
> become perfect according to my requirement:-
>
>
> Kindly suggest inputs on how to achieve it in my current code.
> Thanks in advance.
>
>
>
>
> You need to add the dropdown to the  element.
> In the blog article you mentioned in your first email this is:   class="dropdown" wicket:id="itemContainer">
>
> The blog uses:
> 
>  <#>
>  **
>
>
>  
>
>  
>
> You need to remove * and use   instead of .
> In the Java code replace:
>
> itemContainer.add(new Label("label", currentMenuItem.getLabel()));
>
> with
>
> itemContainer.add(new ContextImage("img", ...));
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675620.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: java wickets menu on image button

2016-10-02 Thread ASHU_JAVA
Hi Martin,

Thanks a lot for your suggestion.

My requirement is nearly complete, the only issue I'm facing right now is
*how to open the List link in new tab ?*.
Please find below my current code:

/SamplePage.Java/
add(new LinkPanel("navBar"));

/SamplePage.html/


/LinkPanel.Java/



/LinkPanel.html/



/style.css/



The output looks like below image:
<http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_2.png> 

So, when I click on link it open in the same window. 

I tried to change the *"LinkPanel.java" *code as below:-

The output now looks like below image:
<http://apache-wicket.1842946.n4.nabble.com/file/n4675620/Wicket_1.png> 

I'm able to now open the links in different tabs but the appearance is now
not in the list.

I think if the LinkPanel.Java code can generate an HTML like below it will
become perfect according to my requirement:-


Kindly suggest inputs on how to achieve it in my current code.
Thanks in advance.




You need to add the dropdown to the  element.
In the blog article you mentioned in your first email this is:  

The blog uses:

 <#> 
 **

   
 
   
 

You need to remove * and use   instead of .
In the Java code replace:

itemContainer.add(new Label("label", currentMenuItem.getLabel()));

with

itemContainer.add(new ContextImage("img", ...));

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675620.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: java wickets menu on image button

2016-09-29 Thread Martin Grigorov
You need to add the dropdown to the  element.
In the blog article you mentioned in your first email this is:  

The blog uses:

   
 
 
   
   
 
   
 

You need to remove  and use  instead of .
In the Java code replace:

itemContainer.add(new Label("label", currentMenuItem.getLabel()));

with

itemContainer.add(new ContextImage("img", ...));

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Sep 29, 2016 at 12:00 PM, ASHU_JAVA <ashu@gmail.com> wrote:

> Hi Martin,
>
> Thanks for your response.
> Please find below the JSFiddle URL of what I want to achieve in Java
> Wickets.
> JSFiddle Example <https://jsfiddle.net/ashu_mdu/xeg58nyo/>
>
> Kindly suggest solution to achieve this requirement.
> Thanks in advance.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675607.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: java wickets menu on image button

2016-09-29 Thread ASHU_JAVA
Hi Martin,

Thanks for your response.
Please find below the JSFiddle URL of what I want to achieve in Java
Wickets.
JSFiddle Example <https://jsfiddle.net/ashu_mdu/xeg58nyo/>  

Kindly suggest solution to achieve this requirement.
Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675607.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: java wickets menu on image button

2016-09-29 Thread Martin Grigorov
Hi,

This is an image, not HTML.
Wicket generates HTML, not images.
I cannot help you unless you give me the HTML snippet you need to generate.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Sep 29, 2016 at 10:28 AM, ASHU_JAVA <ashu@gmail.com> wrote:

> Hi Martin,
>
> Thanks for your response. I need to create the following kind of image
> button.
>
> <http://apache-wicket.1842946.n4.nabble.com/file/n4675605/
> Image_Button_DropDown_Menu.png>
>
> On clicking this Image button, a dropdown should appear containing External
> Links to other web applications.
>
> Kindly suggest solutions for this issue.
> Thanks in advance.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675605.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: java wickets menu on image button

2016-09-29 Thread ASHU_JAVA
Hi Martin,

Thanks for your response. I need to create the following kind of image
button.

<http://apache-wicket.1842946.n4.nabble.com/file/n4675605/Image_Button_DropDown_Menu.png>
 

On clicking this Image button, a dropdown should appear containing External
Links to other web applications.

Kindly suggest solutions for this issue.
Thanks in advance. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602p4675605.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: java wickets menu on image button

2016-09-29 Thread Martin Grigorov
Hi,

I guess the problem you face is that ContextImage has no #add() method ?
This is because  cannot have children HTML elements.

What is the HTML output you need to produce?
Please create the plain HTML example at JSFiddle (https://jsfiddle.net/)
and give us a link.

I guess you need to add the dropdown to the link, not to the image.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Sep 29, 2016 at 8:23 AM, ASHU_JAVA <ashu@gmail.com> wrote:

> I'm trying to create a image button. When this button clicked, a drop down
> menu should appear with External Links to other websites.
>
> Till now, I've managed to create drop down menu with External links but on
> navigation bar as provided in example:
> http://tomaszdziurko.pl/2012/03/wicket-and-twitter-bootstrap-navbar/.
>
> HTML:
> 
> Code:
> public Builder withMenuItemAsDropdown(MenuItemEnum menuItem, String
> pageToLink, String label) {
> //BookmarkablePageLink link = new
> BookmarkablePageLink("link", pageToLink);
>ExternalLink linkExternal = new ExternalLink("link", pageToLink,
> label);
>linkExternal.setBody(new Model(label));
>linksMap2.put(menuItem, linkExternal);
>
> return this;
> }
>
> And then in Base JAVA class:
> add(new TwitterBootstrapNavBarPanel.Builder("navBar", HomePage.class,
> "Example Web App", getActiveMenu())
> .withMenuItem(MenuItemEnum.CLIENTS, ClientsPage.class)
>  .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", "Product
> 1")
> .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2,  "Sample_URL",
> "Product 2")
> .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2,  "Sample_URL",
> "Product 3")
>.build());
>
>
> Now to add a Image, I've added the code:-
>
> final ContextImage image=new ContextImage("image","IMAGE.png");
> ExternalLink link = new ExternalLink("link", "SAMPLE_URL");
>  //Image image = new Image("img", new
> SharedResourceReference(BasePage.class,
> "/wicket-bootstrap/img/QuestionMark_2.png"));
>  link.add(image);
>  add(link);
>
> But I'm unable to add the drop down menu to this Image button. Kindly
> suggest some inputs.
>
> Thanks in advance.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/java-wickets-menu-on-image-button-tp4675602.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
>
>


java wickets menu on image button

2016-09-29 Thread ASHU_JAVA
I'm trying to create a image button. When this button clicked, a drop down
menu should appear with External Links to other websites.

Till now, I've managed to create drop down menu with External links but on
navigation bar as provided in example:
http://tomaszdziurko.pl/2012/03/wicket-and-twitter-bootstrap-navbar/. 

HTML: 
 
Code:
public Builder withMenuItemAsDropdown(MenuItemEnum menuItem, String
pageToLink, String label) {
//BookmarkablePageLink link = new
BookmarkablePageLink("link", pageToLink);
   ExternalLink linkExternal = new ExternalLink("link", pageToLink,
label); 
   linkExternal.setBody(new Model(label));
   linksMap2.put(menuItem, linkExternal);

return this;
}

And then in Base JAVA class:
add(new TwitterBootstrapNavBarPanel.Builder("navBar", HomePage.class,
"Example Web App", getActiveMenu())
.withMenuItem(MenuItemEnum.CLIENTS, ClientsPage.class)
 .withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2, "Sample_URL", "Product 1")
.withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2,  "Sample_URL",
"Product 2")
.withMenuItemAsDropdown(MenuItemEnum.PRODUCTS2,  "Sample_URL",
"Product 3")
   .build());


Now to add a Image, I've added the code:-

final ContextImage image=new ContextImage("image","IMAGE.png");
ExternalLink link = new ExternalLink("link", "SAMPLE_URL");
 //Image image = new Image("img", new
SharedResourceReference(BasePage.class,
"/wicket-bootstrap/img/QuestionMark_2.png"));
 link.add(image);
 add(link);

But I'm unable to add the drop down menu to this Image button. Kindly
suggest some inputs.

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/java-wickets-menu-on-image-button-tp4675602.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: wicket-menu and AjaxLink

2015-06-16 Thread lucio

Il 2015-06-14 21:47 Martin Grigorov ha scritto:

Hi,

Consult with the sources and the demo application -
https://github.com/cooldatasoft/wicket-menu ;-)


Thanks, source code is not the most beautiful documentation you can 
think of, but it is better than nothing. The demo app does not use that 
constructor, so I had to resort to wicket-menu source code 
interpretation.
The wicket:id to use is menuLink and you don't need to add it to your 
html, the tag is provided by wicket-menu.


Now there's another problem, the onClick() method of my AjaxFallbackLink 
instance never gets called, but I suppose I have to look at the 
wicket-menu source code again to understand why...




Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sun, Jun 14, 2015 at 5:13 PM, lu...@sulweb.org wrote:


Hello

I'm trying to use the com.cooldatasoft.common.MenuItem constructor 
that
accepts the id string and a LinkVoid ajaxLink argument. Let alone 
the
fact I don't udenrstand why that constructor allows for a normal Link 
if it
expects it to be a AjaxLink. The real problem is that I dont know how 
to
create the AjaxLink, because I should tell the AjaxLink constructor 
which
wicket:id it should bind to, but that wicket:id is unknown to me: it 
is

being generated (I assume) by wicket-menu classes at runtime.

My code is:

new MenuItem(MenuText, new AjaxLinkVoid()
{
  @Override
  public void onClick(AjaxRequestTarget target)
  {
  }
});

and I need to put the correct MenuItem wicket:id in place of the 
question

marks.

Any help appreciated, thanks in advace.

Lucio.

-
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-menu and AjaxLink

2015-06-16 Thread Martin Grigorov
On Tue, Jun 16, 2015 at 12:48 PM, lu...@sulweb.org wrote:

 Il 2015-06-14 21:47 Martin Grigorov ha scritto:

 Hi,

 Consult with the sources and the demo application -
 https://github.com/cooldatasoft/wicket-menu ;-)


 Thanks, source code is not the most beautiful documentation you can think
 of, but it is better than nothing. The demo app does not use that
 constructor, so I had to resort to wicket-menu source code interpretation.
 The wicket:id to use is menuLink and you don't need to add it to your
 html, the tag is provided by wicket-menu.

 Now there's another problem, the onClick() method of my AjaxFallbackLink
 instance never gets called, but I suppose I have to look at the wicket-menu
 source code again to understand why...


Right!
Or create an issue at the project and ask...

Martin Grigorov
Freelancer. Available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov






 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Sun, Jun 14, 2015 at 5:13 PM, lu...@sulweb.org wrote:

  Hello

 I'm trying to use the com.cooldatasoft.common.MenuItem constructor that
 accepts the id string and a LinkVoid ajaxLink argument. Let alone the
 fact I don't udenrstand why that constructor allows for a normal Link if
 it
 expects it to be a AjaxLink. The real problem is that I dont know how to
 create the AjaxLink, because I should tell the AjaxLink constructor which
 wicket:id it should bind to, but that wicket:id is unknown to me: it is
 being generated (I assume) by wicket-menu classes at runtime.

 My code is:

 new MenuItem(MenuText, new AjaxLinkVoid()
 {
   @Override
   public void onClick(AjaxRequestTarget target)
   {
   }
 });

 and I need to put the correct MenuItem wicket:id in place of the question
 marks.

 Any help appreciated, thanks in advace.

 Lucio.

 -
 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-menu and AjaxLink

2015-06-14 Thread lucio

Hello

I'm trying to use the com.cooldatasoft.common.MenuItem constructor that 
accepts the id string and a LinkVoid ajaxLink argument. Let alone 
the fact I don't udenrstand why that constructor allows for a normal 
Link if it expects it to be a AjaxLink. The real problem is that I dont 
know how to create the AjaxLink, because I should tell the AjaxLink 
constructor which wicket:id it should bind to, but that wicket:id is 
unknown to me: it is being generated (I assume) by wicket-menu classes 
at runtime.


My code is:

new MenuItem(MenuText, new AjaxLinkVoid()
{
  @Override
  public void onClick(AjaxRequestTarget target)
  {
  }
});

and I need to put the correct MenuItem wicket:id in place of the 
question marks.


Any help appreciated, thanks in advace.

Lucio.

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



Re: wicket-menu and AjaxLink

2015-06-14 Thread Martin Grigorov
Hi,

Consult with the sources and the demo application -
https://github.com/cooldatasoft/wicket-menu ;-)

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sun, Jun 14, 2015 at 5:13 PM, lu...@sulweb.org wrote:

 Hello

 I'm trying to use the com.cooldatasoft.common.MenuItem constructor that
 accepts the id string and a LinkVoid ajaxLink argument. Let alone the
 fact I don't udenrstand why that constructor allows for a normal Link if it
 expects it to be a AjaxLink. The real problem is that I dont know how to
 create the AjaxLink, because I should tell the AjaxLink constructor which
 wicket:id it should bind to, but that wicket:id is unknown to me: it is
 being generated (I assume) by wicket-menu classes at runtime.

 My code is:

 new MenuItem(MenuText, new AjaxLinkVoid()
 {
   @Override
   public void onClick(AjaxRequestTarget target)
   {
   }
 });

 and I need to put the correct MenuItem wicket:id in place of the question
 marks.

 Any help appreciated, thanks in advace.

 Lucio.

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




Re: Tooltips/Contextual menu with interactive content

2014-02-22 Thread ChambreNoire
Yup,

I found it shortly after my original post. I'm a bit apprehensive about
overriding jQuery styles but other than that it certainly looks promising.
Only problem, I'm running 1.4 on this project (old project no mandate to
upgrade to 6 unfortunately).

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Tooltips-Contextual-menu-with-interactive-content-tp4664619p4664632.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: Tooltips/Contextual menu with interactive content

2014-02-22 Thread Sebastien
Hi Chambre,

Unfortunately wicket-jquery-ui is not compatible with wicket-1.4

Best regards,
Sebastien.



On Sat, Feb 22, 2014 at 5:08 PM, ChambreNoire a...@tentelemed.com wrote:

 Yup,

 I found it shortly after my original post. I'm a bit apprehensive about
 overriding jQuery styles but other than that it certainly looks promising.
 Only problem, I'm running 1.4 on this project (old project no mandate to
 upgrade to 6 unfortunately).

 Chambre

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Tooltips-Contextual-menu-with-interactive-content-tp4664619p4664632.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




Tooltips/Contextual menu with interactive content

2014-02-21 Thread ChambreNoire
Hello folks,

Here's what I'd like to achieve : A user clicks on an image - although this
could be any type of component (I suppose this makes it more of a contextual
menu). A floating panel appears over/below the component. In this panel I
can put anything but in my specific use case I'd like a simple vertical list
of actions (perhaps with icons) which depend on the component that the menu
is attached too. Clicking on an action will perform a state change at the
level of the component. All this ajaxified.

I've been looking around for something htat would permit me to achieve this
without too much hastle (not being much of a JQuery/JS expert) without much
success. Any ideas? 

Many thanks,

Chambre

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Tooltips-Contextual-menu-with-interactive-content-tp4664619.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: Tooltips/Contextual menu with interactive content

2014-02-21 Thread Sebastien
Hi Chambre,

Did you looked at wicket-jquery-ui? It provides the context-menu and
customizable-tooltips features

http://www.7thweb.net/wicket-jquery-ui/menu/ContextMenuPage
http://www.7thweb.net/wicket-jquery-ui/tooltip/CustomTooltipPage

Hope this helps,
Sebastien.

On Fri, Feb 21, 2014 at 11:44 PM, ChambreNoire a...@tentelemed.com wrote:

 Hello folks,

 Here's what I'd like to achieve : A user clicks on an image - although this
 could be any type of component (I suppose this makes it more of a
 contextual
 menu). A floating panel appears over/below the component. In this panel I
 can put anything but in my specific use case I'd like a simple vertical
 list
 of actions (perhaps with icons) which depend on the component that the menu
 is attached too. Clicking on an action will perform a state change at the
 level of the component. All this ajaxified.

 I've been looking around for something htat would permit me to achieve this
 without too much hastle (not being much of a JQuery/JS expert) without much
 success. Any ideas?

 Many thanks,

 Chambre



Re: Wicket context menu component

2013-06-17 Thread bronius
Hi Sebastien,

Thats great news, I prefer to use library version as it has a lot of
advantages over rolling my own solution. I tried yours and it works fine for
me. I think example of how to recognize which link was clicked in demo would
be helpful for others, as context menu will certainly need this for real
world scenario. Here how I did it (let me know if thats how its intended to
use):
final ContextMenu menu = new ContextMenu(menu, Arrays.asList(menuItem1,
menuItem2, menuItem3, menuItem4)) {

private static final long serialVersionUID = 1L;

private AjaxFallbackLinkUser selectedLink = null;

@SuppressWarnings(unchecked)
@Override
protected void onContextMenu(AjaxRequestTarget target, Component
component)
{
selectedLink = ((AjaxFallbackLinkUser)component);
}

@Override
public void onClick(AjaxRequestTarget target, IMenuItem item)
{
switch (item.getTitle().getObject()) {
case Context menu 1:
if (selectedLink != null) {
selectedLink.onClick(target);
}
break;
case Context menu 2:
System.out.println(Clicked  +
item.getTitle().getObject() +  on  +
selectedLink.getModelObject().getNickname());
break;
case Context menu 3:
System.out.println(Clicked  +
item.getTitle().getObject() +  on  +
selectedLink.getModelObject().getNickname());
break;
case Context menu 4:
System.out.println(Clicked  +
item.getTitle().getObject() +  on  +
selectedLink.getModelObject().getNickname());
break;
}
}
};

Big thanks and best regards! :)

bronius



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659541.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: Wicket context menu component

2013-06-17 Thread Sebastien
Hi Bronius,

You're welcome!

Yes, the usage you performed is the intended one. In your case however,
maybe you can optimize it, because when a menu-item is clicked, both
IMenuItem#onClick() and Menu#onClick() are triggered (in that order). So
instead of a 'switch' statement in Menu#onClick(), you can implement the
IMenuItem(s)#onClick().
For instance, if you extend the ContextMenu to a dedicated class (embedding
the selectedLink member, the menu-items and their #onClick), then you'll
have a nicer code IMO...

Thanks  best regards,
Sebastien.


On Mon, Jun 17, 2013 at 1:58 PM, bronius keptavi...@gmail.com wrote:

 Hi Sebastien,

 Thats great news, I prefer to use library version as it has a lot of
 advantages over rolling my own solution. I tried yours and it works fine
 for
 me. I think example of how to recognize which link was clicked in demo
 would
 be helpful for others, as context menu will certainly need this for real
 world scenario. Here how I did it (let me know if thats how its intended to
 use):
 final ContextMenu menu = new ContextMenu(menu, Arrays.asList(menuItem1,
 menuItem2, menuItem3, menuItem4)) {

 private static final long serialVersionUID = 1L;

 private AjaxFallbackLinkUser selectedLink = null;

 @SuppressWarnings(unchecked)
 @Override
 protected void onContextMenu(AjaxRequestTarget target,
 Component
 component)
 {
 selectedLink = ((AjaxFallbackLinkUser)component);
 }

 @Override
 public void onClick(AjaxRequestTarget target, IMenuItem item)
 {
 switch (item.getTitle().getObject()) {
 case Context menu 1:
 if (selectedLink != null) {
 selectedLink.onClick(target);
 }
 break;
 case Context menu 2:
 System.out.println(Clicked  +
 item.getTitle().getObject() +  on  +
 selectedLink.getModelObject().getNickname());
 break;
 case Context menu 3:
 System.out.println(Clicked  +
 item.getTitle().getObject() +  on  +
 selectedLink.getModelObject().getNickname());
 break;
 case Context menu 4:
 System.out.println(Clicked  +
 item.getTitle().getObject() +  on  +
 selectedLink.getModelObject().getNickname());
 break;
 }
 }
 };

 Big thanks and best regards! :)

 bronius



Re: Wicket context menu component

2013-06-17 Thread bronius
Yes I agree, thanks again :)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659544.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: Dynamic Context Menu using wicket-jquery-ui

2013-06-16 Thread Colin Rogers
Sebestien,

I did get the chance to look at your first suggestion... and it was looking 
really good. Apologies for not getting the chance to reply. I really liked the 
change - and the 'issue' didn't seem too much of a problem, but I'm guessing 
you've solved it, from the looks of, below.

Really chuffed you've added it to your stack - the example looks really 
cool...! :)

Will have a proper delve into it tonight or tomorrow - but once again - awesome 
work! :D

Cheers,
Col.

-Original Message-
From: Sebastien [mailto:seb...@gmail.com]
Sent: 16 June 2013 03:32
To: users@wicket.apache.org
Subject: Re: Dynamic Context Menu using wicket-jquery-ui

Hi Colin,

By trying to help you on this topic, I finally end up with a working 
ContextMenu implementation (so, I add it in
wicket-jquery-ui-6.8.2-SNAPSHOT...)
You can either use it or have a look at the code to complete your own if this 
one does not full-fit your needs...

ContextMenu:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/ContextMenu.java

ContextMenuBehavior:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/ContextMenuBehavior.java

The usage is the following:

final ContextMenu menu = new ContextMenu(menu, newMenuItemList()) {

private static final long serialVersionUID = 1L;

@Override
protected void onContextMenu(AjaxRequestTarget target, Component
component)
{
//the menu-item list can be modified here
//this.getItemList().add(new MenuItem(my new item));
}

@Override
public void onClick(AjaxRequestTarget target, IMenuItem item)
{
}
};

this.add(menu);

final Label label = new Label(label, my label); label.add(new 
ContextMenuBehavior(menu)); this.add(label);


There is a demo here:
http://www.7thweb.net/wicket-jquery-ui/menu/ContextMenuPage


Hope you will like it,
Best regards,
Sebastien.
EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.

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



Re: Dynamic Context Menu using wicket-jquery-ui

2013-06-15 Thread Sebastien
Hi Colin,

By trying to help you on this topic, I finally end up with a working
ContextMenu implementation (so, I add it in
wicket-jquery-ui-6.8.2-SNAPSHOT...)
You can either use it or have a look at the code to complete your own if
this one does not full-fit your needs...

ContextMenu:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/ContextMenu.java

ContextMenuBehavior:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/ContextMenuBehavior.java

The usage is the following:

final ContextMenu menu = new ContextMenu(menu, newMenuItemList()) {

private static final long serialVersionUID = 1L;

@Override
protected void onContextMenu(AjaxRequestTarget target, Component
component)
{
//the menu-item list can be modified here
//this.getItemList().add(new MenuItem(my new item));
}

@Override
public void onClick(AjaxRequestTarget target, IMenuItem item)
{
}
};

this.add(menu);

final Label label = new Label(label, my label);
label.add(new ContextMenuBehavior(menu));
this.add(label);


There is a demo here:
http://www.7thweb.net/wicket-jquery-ui/menu/ContextMenuPage


Hope you will like it,
Best regards,
Sebastien.


Re: Wicket context menu component

2013-06-15 Thread Sebastien
Hi Bronius,

As (just) said in another thread, I did implement a ContextMenu in
wicket-jquery-ui.
http://apache-wicket.1842946.n4.nabble.com/Dynamic-Context-Menu-using-wicket-jquery-ui-td4659437.html

But, if you still wish/prefer continue implementing the context-menu
plugin, please post a quick-start of your current work in the
wicket-jquery-ui's group so I can see what's happens with your
implementation...

Thanks  best regards,
Sebastien.



On Thu, Jun 13, 2013 at 12:12 AM, bronius keptavi...@gmail.com wrote:

 Ok thanks again for helping out! :)
 Well I found that 'options.$trigger.attr(id)' from parameters returns id
 of link pressed (did not try yet on wicket side, but I think it should
 work)
 and 'key' returns which context menu was pressed. Now my links represents
 users and context menu some actions to do on users (say view profile). So
 now I kinda can set user id as link id and then retrieve link id from
 'options.$trigger.attr(id)'  and load user and do action from context
 menu
 on it. But for some reason it does not feel right :) Is it ok to implement
 it like that? What do you think? I don't have much wicket experience, but
 wicketish way for me seems that context menu behavior could be added to
 link
 component and then from that behavior I could invoke link's onClick lets
 say. How would you would go forward from here for that kind of use case?



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659436.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: Dynamic Context Menu using wicket-jquery-ui

2013-06-13 Thread Sebastien
Hi Colin,

Nice try :) It's not perfect for now but its interesting!
(actually bronius is also using wicket-jquery-ui, but not the Menu; he's
trying to integrate a context-menu plugin...)

So, for the short time I had today, here is my current feedback:

First, I am not yet convinced about the CloseMenusBahavior, so I did
public class OpenMenuBehaviour extends AjaxEventBehavior (instead of
CloseMenusBehavior)

Closing on-click somewhere (on the document) and on-escape can be easily
done using a jquery statement, so in ContextMenu I did:

@Override
protected void onInitialize() {

super.onInitialize();

this.setVisible( false );
// this.setOutputMarkupId( true ); //not needed, already handled by
setOutputMarkupPlaceholderTag
this.setOutputMarkupPlaceholderTag( true );

this.add(new JQueryAbstractBehavior(contextmenu-commands) {

private static final long serialVersionUID = 1L;

@Override
protected String $() {

String selector =
JQueryWidget.getSelector(ContextMenu.this);

StringBuilder builder = new
StringBuilder(jQuery(function() {);
builder.append($(document).click(function(e) {
$(').append(selector).append(').hide(); });); // hide on click
builder.append($(document).keyup(function(e) { if (e.which
== 27) { $(').append(selector).append(').hide(); } }););  // hide on
escape
builder.append( }););

return builder.toString();
}
});
}

The 'only' issue I have is with the link (the standard one, not the ajax)
because if I open the context menu, its visible flag is set to true (for
the menu to be displayed) but is not set to false on click or/and on
escape., so refreshing the page cause the menu to be displayed inline...
There is probably a nice way to fix this but I do not have yet in mind... ;)

Hope this helps (a little),

Best regards,
Sebastien.



On Thu, Jun 13, 2013 at 4:15 AM, Colin Rogers 
colin.rog...@objectconsulting.com.au wrote:

 Wicketeers,

 I'm attempting to develop a reusable context menu component. I'm nearly
 there, but having a few issues, and thought I might share in the hope I
 might get some help. I realise that another person (bronius) is also having
 a go at this, but his implementation isn't using wicket-jquery-ui, which I
 am using and want to utilise.

 http://www.otbcs.co.uk/wicketmenu.zip

 The link above includes a zip to a quick start that contains the code.
 There isn't a lot to it, that isn't already done by wicket-jquery-ui.

 Requirements;

 * Open Menu on right click - menus to appear near or in relation
 to what was clicked. (done)

 * Menus are dynamically defined - they are not created or rendered
 initially, on page creation, but are defined dynamically on button event
 and returned via Ajax for rendering. (done)

 * Must allow multiple, different, menus on same page. (done)

 * Must clear down intelligently - when another click elsewhere or
 escape etc., is pressed.

 The issue I have at the moment is;

 * Closing the menu only happens on another context-menu,
 successfully. I can have it close on an 'onclick' event, which is added to
 the page, but this in turn disables/ breaks standard links. In the example
 above, this is the case - the menu behaves nicely, but breaks the standard
 link.

 * How would I close the menu on an 'escape' key press?

 * While not that important; you can't reuse a menu and have it
 appear where it's clicked. At the moment, they just appear where they are
 placed. As 'items' can be re-used, this isn't so much of an issue.

 Any help, advice or suggestions welcome!

 Cheers,
 Col.


 EMAIL DISCLAIMER This email message and its attachments are confidential
 and may also contain copyright or privileged material. If you are not the
 intended recipient, you may not forward the email or disclose or use the
 information contained in it. If you have received this email message in
 error, please advise the sender immediately by replying to this email and
 delete the message and any associated attachments. Any views, opinions,
 conclusions, advice or statements expressed in this email message are those
 of the individual sender and should not be relied upon as the considered
 view, opinion, conclusions, advice or statement of this company except
 where the sender expressly, and with authority, states them to be the
 considered view, opinion, conclusions, advice or statement of this company.
 Every care is taken but we recommend that you scan any attachments for
 viruses.



Re: Wicket context menu component

2013-06-12 Thread bronius
Ok thanks again for helping out! :)
Well I found that 'options.$trigger.attr(id)' from parameters returns id
of link pressed (did not try yet on wicket side, but I think it should work)
and 'key' returns which context menu was pressed. Now my links represents
users and context menu some actions to do on users (say view profile). So
now I kinda can set user id as link id and then retrieve link id from
'options.$trigger.attr(id)'  and load user and do action from context menu
on it. But for some reason it does not feel right :) Is it ok to implement
it like that? What do you think? I don't have much wicket experience, but
wicketish way for me seems that context menu behavior could be added to link
component and then from that behavior I could invoke link's onClick lets
say. How would you would go forward from here for that kind of use case?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659436.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



Dynamic Context Menu using wicket-jquery-ui

2013-06-12 Thread Colin Rogers
Wicketeers,

I'm attempting to develop a reusable context menu component. I'm nearly there, 
but having a few issues, and thought I might share in the hope I might get some 
help. I realise that another person (bronius) is also having a go at this, but 
his implementation isn't using wicket-jquery-ui, which I am using and want to 
utilise.

http://www.otbcs.co.uk/wicketmenu.zip

The link above includes a zip to a quick start that contains the code. There 
isn't a lot to it, that isn't already done by wicket-jquery-ui.

Requirements;

* Open Menu on right click - menus to appear near or in relation to 
what was clicked. (done)

* Menus are dynamically defined - they are not created or rendered 
initially, on page creation, but are defined dynamically on button event and 
returned via Ajax for rendering. (done)

* Must allow multiple, different, menus on same page. (done)

* Must clear down intelligently - when another click elsewhere or 
escape etc., is pressed.

The issue I have at the moment is;

* Closing the menu only happens on another context-menu, successfully. 
I can have it close on an 'onclick' event, which is added to the page, but this 
in turn disables/ breaks standard links. In the example above, this is the case 
- the menu behaves nicely, but breaks the standard link.

* How would I close the menu on an 'escape' key press?

* While not that important; you can't reuse a menu and have it appear 
where it's clicked. At the moment, they just appear where they are placed. As 
'items' can be re-used, this isn't so much of an issue.

Any help, advice or suggestions welcome!

Cheers,
Col.


EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.


Re: Wicket context menu component

2013-06-11 Thread bronius
Hi thanks for help! With your explanations and MenuBehavior example I made it
work. Now one last thing is to recognize which link was chosen for context
menu. I see this documentation about callback:
(function) callback
Specifies the default callback to be used in case an item does not
expose its own callback.
The default callback behaves just like item.callback.
Example: {callback: callback: function(key, opt){ alert(Clicked on  +
key +  on element  + opt.$trigger.attr(id)); }}

Is opt.$trigger.attr(id) what I want? How does this work out? I debugged
my select event for RequestCycleUtils.getQueryParameterValue(options) but
it returns nothing.

Here is my current working version of context menu:

public class ContextMenuBehavior extends JQueryBehavior implements
IJQueryAjaxAware {

private static final long serialVersionUID = 1L;

private String selector;

private ListMenuItem menuItems;

private MapString, MenuItem menuItemsMap = new HashMapString,
MenuItem();

private JQueryAjaxBehavior onSelectBehavior;

public ContextMenuBehavior(String selector, ListMenuItem menuItems) {
super(contextMenu);
this.selector = selector;
this.menuItems = menuItems;
for (MenuItem menuItem : menuItems) {
menuItemsMap.put(menuItem.getId(), menuItem);
}

add(new JavaScriptResourceReference(ContextMenuBehavior.class,
jquery.ui.position.js));
add(new JavaScriptResourceReference(ContextMenuBehavior.class,
jquery.contextMenu.js));
add(new CssResourceReference(ContextMenuBehavior.class,
jquery.contextMenu.css));
}

// Methods //
@Override
public void bind(Component component) {
super.bind(component);

component.add(this.onSelectBehavior = this.newOnSelectBehavior());
}

// Events //
@Override
public void onConfigure(Component component) {
super.onConfigure(component);

this.setOption(select,
this.onSelectBehavior.getCallbackFunction());
}

@Override
protected String $() {
// build menu items for jquery
StringBuilder items = new StringBuilder(items: {);
int nbOfMenuItems = menuItems.size();
for (int i = 0; i  nbOfMenuItems; i++) {
MenuItem menuItem = menuItems.get(i);
items.append(').append(menuItem.getId()).append(': {name:
').append(menuItem.getTitle().getObject())
.append(', icon:
').append(menuItem.getIcon()).append('});
if (i  nbOfMenuItems - 1) {
items.append(,);
}
}
items.append(});
return String.format($(function(){$.contextMenu({selector: '%s',
callback: %s, %s});});, selector,
onSelectBehavior.getCallbackFunction(), items.toString());
}

@Override
public void onAjax(AjaxRequestTarget target, JQueryEvent event) {
if (event instanceof SelectEvent) {
IMenuItem item = this.menuItemsMap.get(((SelectEvent)
event).getKey());

if (item != null) {
item.onClick(target);
}
}
}

protected JQueryAjaxBehavior newOnSelectBehavior() {
return new JQueryAjaxBehavior(this) {

private static final long serialVersionUID = 1L;

@Override
protected CallbackParameter[] getCallbackParameters() {
return new CallbackParameter[] {
CallbackParameter.explicit(key), CallbackParameter.context(options) };
}

@Override
protected JQueryEvent newEvent() {
return new SelectEvent();
}
};
}

protected static class SelectEvent extends JQueryEvent {
private final String key;

public SelectEvent() {
super();
this.key =
RequestCycleUtils.getQueryParameterValue(key).toString();
}

public String getKey() {
return this.key;
}
}
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659381.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: Wicket context menu component

2013-06-11 Thread Sebastien
Hi, glad to read it is almost working :)

getQueryParameterValue(options) does return anything because it's not
transmitted server side (due to CallbackParameter.context(options), which
does not pass the parameter to the ajax callback). But even you did
transmit it, you probably got an [object] string.

As per your example, I would think that you are probably interested to the
'key'... But if you want to check what's happening client side, best is to
debug the call to the function using Firefox with Firebug (or Chrome
equivalent for instance) and see what you have in 'key' and 'options'
object. Then you will know what to transmit server side via the ajax
callback. For instance (I did not check the doc):
CallbackParameter.resolved(menuId, options.id)
Hope this helps,
Sebastien.



Re: Wicket context menu component

2013-06-10 Thread Sebastien
Hi,

Did you looked at the Menu implementation? I think it should be close to
what you want to achieve:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/MenuBehavior.java

Here, the way to retrieve the menu-item id is done by:
CallbackParameter.resolved(id, ui.item.context.id)

Pay attention with this sample because the menu rendering is done
component-side, not by the behavior (Menu needs a markup)

You can find a dummy sample of component/behavior implementation here:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-samples/src/test/java/MyJQueryLabel.java

Hope this helps,
Sebastien.


On Mon, Jun 10, 2013 at 1:37 AM, bronius keptavi...@gmail.com wrote:

 Hello,

 I needed context menu component, but surprisingly it does not exit for
 current version, so decided to roll my own, even though i have very little
 Wicket experience and know absolutely nothing about jquery, so im like that
 dog :)
 http://apache-wicket.1842946.n4.nabble.com/file/n4659306/7TjIrsT.jpg

 Anyway I managed to get something working like this (maybe it will be
 helpful for someone or maybe someone smarter will show me my mistakes):
 1. Added https://github.com/sebfz1/wicket-jquery-ui dependency.
 2. Chosen to use this jquery plugin:
 http://medialize.github.io/jQuery-contextMenu/index.html
 3. After spending some time I managed to create Behavior like this:

 public class ContextMenuBehavior extends JQueryAbstractBehavior {

 private static final long serialVersionUID = 1L;

 private String selector;

 private ListMenuItem menuItems;

 public ContextMenuBehavior(String selector, ListMenuItem menuItems) {
 super(contextMenu);
 this.selector = selector;
 this.menuItems = menuItems;

 add(new JavaScriptResourceReference(ContextMenuBehavior.class,
 jquery.ui.position.js));
 add(new JavaScriptResourceReference(ContextMenuBehavior.class,
 jquery.contextMenu.js));
 add(new CssResourceReference(ContextMenuBehavior.class,
 jquery.contextMenu.css));
 }

 @Override
 protected String $() {
 // build menu items for jquery
 StringBuilder items = new StringBuilder(items: {);
 int nbOfMenuItems = menuItems.size();
 for (int i = 0; i  nbOfMenuItems; i++) {
 MenuItem menuItem = menuItems.get(i);
 items.append(').append(menuItem.getId()).append(': {name:
 ').append(menuItem.getTitle().getObject()).append(', icon:
 ').append(menuItem.getIcon()).append('});
 if (i  nbOfMenuItems - 1) {
 items.append(,);
 }
 }
 items.append(});
 return String.format($(function(){$.contextMenu({selector: '%s',
 callback: function(key, options) {var m = 'clicked: ' + key; window.console
  console.log(m) || alert(m); }, %s});});, selector, items.toString());
 }

 }

 4. $() method just prints jquery context menu initialization stuff from
 here: http://medialize.github.io/jQuery-contextMenu/demo.html

 5. Now when add this behavior to Page and add div class=userContextMenu
 to
 html right click on it gives me context menu so its working. Clicking on
 menu also shows me simple alert message as it is in callback parameter.

 6. So far so good, but now Im interested in how to link this to wicket
 component listener. I will put this menu on multiple links, so i would like
 to receive both on which link user clicked for context menu and which menu
 item he have chosen. How would you implement this? Also am I even on the
 right track? Is it good approach? Im sorry if this is stupid question :)



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306.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: Wicket context menu component

2013-06-10 Thread Martin Grigorov
Hi Sebastien,


On Mon, Jun 10, 2013 at 11:04 AM, Sebastien seb...@gmail.com wrote:

 Hi,

 Did you looked at the Menu implementation? I think it should be close to
 what you want to achieve:

 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/MenuBehavior.java

 Here, the way to retrieve the menu-item id is done by:
 CallbackParameter.resolved(id, ui.item.context.id)

 Pay attention with this sample because the menu rendering is done
 component-side, not by the behavior (Menu needs a markup)


I haven't checked how wicket-jquery-ui code related to Menu looks like but
you can check org.apache.wicket.markup.html.border.BorderBehavior for an
example of a behavior with a markup. It uses MarkupStream - i.e. very deep
internals of Wicket rendering machinery.



 You can find a dummy sample of component/behavior implementation here:

 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-samples/src/test/java/MyJQueryLabel.java

 Hope this helps,
 Sebastien.


 On Mon, Jun 10, 2013 at 1:37 AM, bronius keptavi...@gmail.com wrote:

  Hello,
 
  I needed context menu component, but surprisingly it does not exit for
  current version, so decided to roll my own, even though i have very
 little
  Wicket experience and know absolutely nothing about jquery, so im like
 that
  dog :)
  http://apache-wicket.1842946.n4.nabble.com/file/n4659306/7TjIrsT.jpg
 
  Anyway I managed to get something working like this (maybe it will be
  helpful for someone or maybe someone smarter will show me my mistakes):
  1. Added https://github.com/sebfz1/wicket-jquery-ui dependency.
  2. Chosen to use this jquery plugin:
  http://medialize.github.io/jQuery-contextMenu/index.html
  3. After spending some time I managed to create Behavior like this:
 
  public class ContextMenuBehavior extends JQueryAbstractBehavior {
 
  private static final long serialVersionUID = 1L;
 
  private String selector;
 
  private ListMenuItem menuItems;
 
  public ContextMenuBehavior(String selector, ListMenuItem
 menuItems) {
  super(contextMenu);
  this.selector = selector;
  this.menuItems = menuItems;
 
  add(new JavaScriptResourceReference(ContextMenuBehavior.class,
  jquery.ui.position.js));
  add(new JavaScriptResourceReference(ContextMenuBehavior.class,
  jquery.contextMenu.js));
  add(new CssResourceReference(ContextMenuBehavior.class,
  jquery.contextMenu.css));
  }
 
  @Override
  protected String $() {
  // build menu items for jquery
  StringBuilder items = new StringBuilder(items: {);
  int nbOfMenuItems = menuItems.size();
  for (int i = 0; i  nbOfMenuItems; i++) {
  MenuItem menuItem = menuItems.get(i);
  items.append(').append(menuItem.getId()).append(': {name:
  ').append(menuItem.getTitle().getObject()).append(', icon:
  ').append(menuItem.getIcon()).append('});
  if (i  nbOfMenuItems - 1) {
  items.append(,);
  }
  }
  items.append(});
  return String.format($(function(){$.contextMenu({selector: '%s',
  callback: function(key, options) {var m = 'clicked: ' + key;
 window.console
   console.log(m) || alert(m); }, %s});});, selector, items.toString());
  }
 
  }
 
  4. $() method just prints jquery context menu initialization stuff from
  here: http://medialize.github.io/jQuery-contextMenu/demo.html
 
  5. Now when add this behavior to Page and add div class=userContextMenu
  to
  html right click on it gives me context menu so its working. Clicking on
  menu also shows me simple alert message as it is in callback parameter.
 
  6. So far so good, but now Im interested in how to link this to wicket
  component listener. I will put this menu on multiple links, so i would
 like
  to receive both on which link user clicked for context menu and which
 menu
  item he have chosen. How would you implement this? Also am I even on the
  right track? Is it good approach? Im sorry if this is stupid question :)
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306.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: Wicket context menu component

2013-06-10 Thread bronius
Hi,

Yes I checked it. I also was reading this:
http://code.google.com/p/wicket-jquery-ui/wiki/HowToCreatePlugin2. However
context menu plug in was not standard here is jquery example:
$(function(){
$.contextMenu({
selector: '.context-menu-one', 
callback: function(key, options) {
var m = clicked:  + key;
window.console  console.log(m) || alert(m); 
},
items: {
edit: {name: Edit, icon: edit},
cut: {name: Cut, icon: cut},
copy: {name: Copy, icon: copy},
paste: {name: Paste, icon: paste},
delete: {name: Delete, icon: delete},
sep1: -,
quit: {name: Quit, icon: quit}
}
});

$('.context-menu-one').on('click', function(e){
console.log('clicked', this);
})
});
Now the problem is I don't have knowledge about jquery, but from what I
understand it creates context menu instance with parameters: selector,
callback and items.  Differently from menu it does not have any markup
(items are passed as parameters and thats it) and also jquery syntax is
different. Menu jquery example is just like this:
 $(function() {
$( #menu ).menu();
});
 Thats why I extended JQueryAbstractBehavior, as jquery initialization is
quite different. What I implemented shows context menu, and callback
function is invoked(from jquery parameter), but I lack knowledge on how to
convert that callback function to wicket one. Menu example is ok, but its
different and also it seems I understand what separate methods do, but
because of my inexperience I lack bigger picture understanding how
everything works together. Any help is really appreciated :)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659334.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: Wicket context menu component

2013-06-10 Thread Sebastien
Hi Martin,

Thanks for the tips!
Actually, the way how the wicket-jquery-ui Menu works can a little bit be
compared to the Tree implementation in wicket-extensions.
In my case, I think the markup is easier to use, considering there is a
recursive loop for sub-menus...

Thanks again  best regards,
Sebastien.


On Mon, Jun 10, 2013 at 10:17 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi Sebastien,


 On Mon, Jun 10, 2013 at 11:04 AM, Sebastien seb...@gmail.com wrote:

  Hi,
 
  Did you looked at the Menu implementation? I think it should be close to
  what you want to achieve:
 
 
 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/MenuBehavior.java
 
  Here, the way to retrieve the menu-item id is done by:
  CallbackParameter.resolved(id, ui.item.context.id)
 
  Pay attention with this sample because the menu rendering is done
  component-side, not by the behavior (Menu needs a markup)
 

 I haven't checked how wicket-jquery-ui code related to Menu looks like but
 you can check org.apache.wicket.markup.html.border.BorderBehavior for an
 example of a behavior with a markup. It uses MarkupStream - i.e. very deep
 internals of Wicket rendering machinery.


 
  You can find a dummy sample of component/behavior implementation here:
 
 
 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-samples/src/test/java/MyJQueryLabel.java
 
  Hope this helps,
  Sebastien.
 
 
  On Mon, Jun 10, 2013 at 1:37 AM, bronius keptavi...@gmail.com wrote:
 
   Hello,
  
   I needed context menu component, but surprisingly it does not exit for
   current version, so decided to roll my own, even though i have very
  little
   Wicket experience and know absolutely nothing about jquery, so im like
  that
   dog :)
   http://apache-wicket.1842946.n4.nabble.com/file/n4659306/7TjIrsT.jpg
  
   Anyway I managed to get something working like this (maybe it will be
   helpful for someone or maybe someone smarter will show me my mistakes):
   1. Added https://github.com/sebfz1/wicket-jquery-ui dependency.
   2. Chosen to use this jquery plugin:
   http://medialize.github.io/jQuery-contextMenu/index.html
   3. After spending some time I managed to create Behavior like this:
  
   public class ContextMenuBehavior extends JQueryAbstractBehavior {
  
   private static final long serialVersionUID = 1L;
  
   private String selector;
  
   private ListMenuItem menuItems;
  
   public ContextMenuBehavior(String selector, ListMenuItem
  menuItems) {
   super(contextMenu);
   this.selector = selector;
   this.menuItems = menuItems;
  
   add(new JavaScriptResourceReference(ContextMenuBehavior.class,
   jquery.ui.position.js));
   add(new JavaScriptResourceReference(ContextMenuBehavior.class,
   jquery.contextMenu.js));
   add(new CssResourceReference(ContextMenuBehavior.class,
   jquery.contextMenu.css));
   }
  
   @Override
   protected String $() {
   // build menu items for jquery
   StringBuilder items = new StringBuilder(items: {);
   int nbOfMenuItems = menuItems.size();
   for (int i = 0; i  nbOfMenuItems; i++) {
   MenuItem menuItem = menuItems.get(i);
   items.append(').append(menuItem.getId()).append(':
 {name:
   ').append(menuItem.getTitle().getObject()).append(', icon:
   ').append(menuItem.getIcon()).append('});
   if (i  nbOfMenuItems - 1) {
   items.append(,);
   }
   }
   items.append(});
   return String.format($(function(){$.contextMenu({selector:
 '%s',
   callback: function(key, options) {var m = 'clicked: ' + key;
  window.console
console.log(m) || alert(m); }, %s});});, selector,
 items.toString());
   }
  
   }
  
   4. $() method just prints jquery context menu initialization stuff from
   here: http://medialize.github.io/jQuery-contextMenu/demo.html
  
   5. Now when add this behavior to Page and add div
 class=userContextMenu
   to
   html right click on it gives me context menu so its working. Clicking
 on
   menu also shows me simple alert message as it is in callback parameter.
  
   6. So far so good, but now Im interested in how to link this to wicket
   component listener. I will put this menu on multiple links, so i would
  like
   to receive both on which link user clicked for context menu and which
  menu
   item he have chosen. How would you implement this? Also am I even on
 the
   right track? Is it good approach? Im sorry if this is stupid question
 :)
  
  
  
   --
   View this message in context:
  
 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306.html
   Sent from the Users forum mailing list archive at Nabble.com.
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional

Re: Wicket context menu component

2013-06-10 Thread Sebastien
Hi,

I think what is missing you is the AjaxBehavior / Event / jQuery event
binding.

Basically, your ContextMenuBehavior (CMB) should embed an ajax behavior
(JQueryAjaxBehavior, let's say AB). A common Event object (E) should be
shared between CMB  AB. Note that CMB should implement IJQueryAjaxAware
the its instance (this) should be passed to AB's contructor.

Once bound to the CMB (see #bind() ), you can get the
AB#getCallbackFunction() (if using wicket-jquery-ui-6.x) that you will
transmit to the jQuery function 'callback' like this:
{ selector: '.the selector', callback:  + ab.getCallbackFunction() +  }.

At this stage, AB should be invoked when the jQuery event is fired, and you
can do things in CMD#onAjax(AjaxRequestTarget target, JQueryEvent event).
(note the JQueryEvent here)

The question is now how you transmit an additional information to AB (means
wicket side).
First, you need to know what parameter context-menu will give you when the
callback is triggered. If I see that the callback have 2 parameters (key
and options), I will suppose that the key is the menu-id I am interested to
get back, so in AB:

protected CallbackParameter[] getCallbackParameters()
{
return new CallbackParameter[] {
CallbackParameter.explicit(key) //considering key is the
menu-item key, see CallbackParameter javadoc
CallbackParameter.context(option),
};
}

Once invoked AB will create a new E. What you need is a custom event that
have a key property (ie: getKey()) which have the value coming the jquery
callback:
protected static class MyCallbackEvent extends JQueryEvent
{
private final String key;

public MyCallbackEvent()
{
this.key =
RequestCycleUtils.getQueryParameterValue(key).toString(); //the menu key!
}

public String getKey()
{
return this.key;
}
}

Here we are, in the onAjax above, get the key, eventually the menu-item
associated to the key, and fire a custom event (for instance onClick,
onMenuClicked, onWhatYouWant)

if (event instanceof MyCallbackEvent )
{
String key = ((MyCallbackEvent)event).getKey();
MenuItem item = null; // FIXME: get the menu item using the key from
the ListMenuItem

this.onClick(target, item); //the custom event
}


If you encounter other problem(s), you can post a quickstart on the
wicket-jquery-ui googlegroup. (but my home PC is currently under
re-installation so feel free to investigate a little bit on your own
before... ;))

Best regards,
Sebastien.



On Mon, Jun 10, 2013 at 12:14 PM, bronius keptavi...@gmail.com wrote:

 Hi,

 Yes I checked it. I also was reading this:
 http://code.google.com/p/wicket-jquery-ui/wiki/HowToCreatePlugin2. However
 context menu plug in was not standard here is jquery example:
 $(function(){
 $.contextMenu({
 selector: '.context-menu-one',
 callback: function(key, options) {
 var m = clicked:  + key;
 window.console  console.log(m) || alert(m);
 },
 items: {
 edit: {name: Edit, icon: edit},
 cut: {name: Cut, icon: cut},
 copy: {name: Copy, icon: copy},
 paste: {name: Paste, icon: paste},
 delete: {name: Delete, icon: delete},
 sep1: -,
 quit: {name: Quit, icon: quit}
 }
 });

 $('.context-menu-one').on('click', function(e){
 console.log('clicked', this);
 })
 });
 Now the problem is I don't have knowledge about jquery, but from what I
 understand it creates context menu instance with parameters: selector,
 callback and items.  Differently from menu it does not have any markup
 (items are passed as parameters and thats it) and also jquery syntax is
 different. Menu jquery example is just like this:
  $(function() {
 $( #menu ).menu();
 });
  Thats why I extended JQueryAbstractBehavior, as jquery initialization is
 quite different. What I implemented shows context menu, and callback
 function is invoked(from jquery parameter), but I lack knowledge on how to
 convert that callback function to wicket one. Menu example is ok, but its
 different and also it seems I understand what separate methods do, but
 because of my inexperience I lack bigger picture understanding how
 everything works together. Any help is really appreciated :)



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659334.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




Wicket context menu component

2013-06-09 Thread bronius
Hello,

I needed context menu component, but surprisingly it does not exit for
current version, so decided to roll my own, even though i have very little
Wicket experience and know absolutely nothing about jquery, so im like that
dog :) 
http://apache-wicket.1842946.n4.nabble.com/file/n4659306/7TjIrsT.jpg 

Anyway I managed to get something working like this (maybe it will be
helpful for someone or maybe someone smarter will show me my mistakes):
1. Added https://github.com/sebfz1/wicket-jquery-ui dependency.
2. Chosen to use this jquery plugin:
http://medialize.github.io/jQuery-contextMenu/index.html
3. After spending some time I managed to create Behavior like this:

public class ContextMenuBehavior extends JQueryAbstractBehavior {

private static final long serialVersionUID = 1L;

private String selector;

private ListMenuItem menuItems;

public ContextMenuBehavior(String selector, ListMenuItem menuItems) {
super(contextMenu);
this.selector = selector;
this.menuItems = menuItems;

add(new JavaScriptResourceReference(ContextMenuBehavior.class,
jquery.ui.position.js));
add(new JavaScriptResourceReference(ContextMenuBehavior.class,
jquery.contextMenu.js));
add(new CssResourceReference(ContextMenuBehavior.class,
jquery.contextMenu.css));
}

@Override
protected String $() {
// build menu items for jquery
StringBuilder items = new StringBuilder(items: {);
int nbOfMenuItems = menuItems.size();
for (int i = 0; i  nbOfMenuItems; i++) {
MenuItem menuItem = menuItems.get(i);
items.append(').append(menuItem.getId()).append(': {name:
').append(menuItem.getTitle().getObject()).append(', icon:
').append(menuItem.getIcon()).append('});
if (i  nbOfMenuItems - 1) {
items.append(,);
}
}
items.append(});
return String.format($(function(){$.contextMenu({selector: '%s',
callback: function(key, options) {var m = 'clicked: ' + key; window.console
 console.log(m) || alert(m); }, %s});});, selector, items.toString());
}

}

4. $() method just prints jquery context menu initialization stuff from
here: http://medialize.github.io/jQuery-contextMenu/demo.html

5. Now when add this behavior to Page and add div class=userContextMenu to
html right click on it gives me context menu so its working. Clicking on
menu also shows me simple alert message as it is in callback parameter.

6. So far so good, but now Im interested in how to link this to wicket
component listener. I will put this menu on multiple links, so i would like
to receive both on which link user clicked for context menu and which menu
item he have chosen. How would you implement this? Also am I even on the
right track? Is it good approach? Im sorry if this is stupid question :)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306.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: jQuery Treeview Context menu in wicket

2013-03-28 Thread Leningovi
i want menu like in below link

Tree View with context Menu
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/index.htm#demos/jqxtree/treepopup.htm
  

in wicket .. please help me ... this is very urgent 

Thanks in advance



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512p4657601.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: jQuery Treeview Context menu in wicket

2013-03-28 Thread Paul Bors
That's a nice menu.

Since the UI part is already done you can simply follow the examples from
other projects on how to integrate it with Wicket yourself.

It took me half a day to get a simple jQuery date picker ported over to
Wicket 1.5.x (spent more time waiting on Sonatype OSS to setup the nexus
repository https://issues.sonatype.org/browse/OSSRH-5277 which took a day
and to document the project than implement it).

See for example this very simple project:
https://Wicket-Continuous-Calendar.GoogleCode.com
I do recommend sharing your code with the rest of the community so that
others can contribute to your project.
Feel free to let us know via an announcement on this list once you have it
setup.

If you decide not to create this project, I might do it later when we'll
get to refactor our webapp menu :)

~ Thank you,
   Paul Bors

On Thu, Mar 28, 2013 at 2:38 AM, Leningovi g.le...@nic.in wrote:

 i want menu like in below link

 Tree View with context Menu
 
 http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/index.htm#demos/jqxtree/treepopup.htm
 

 in wicket .. please help me ... this is very urgent

 Thanks in advance



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512p4657601.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: jQuery Treeview Context menu in wicket

2013-03-28 Thread Paul Bors
Speaking of which, does anyone know what happen with jQuery UI and latest
version of Wicket 6.x?

I'm getting too many hits on two many different projects, most of which
seem to be old and I through since jQuery is part of Wicket 6.x that there
would be a similar module in Wicket to cover the jQuery UI library.

I've been disconnected since we're not due to upgrade our webapp to Wicket
6 for another few months.

~ Thank you,
   Paul Bors

On Thu, Mar 28, 2013 at 10:50 AM, Paul Bors p...@bors.ws wrote:

 That's a nice menu.

 Since the UI part is already done you can simply follow the examples from
 other projects on how to integrate it with Wicket yourself.

 It took me half a day to get a simple jQuery date picker ported over to
 Wicket 1.5.x (spent more time waiting on Sonatype OSS to setup the nexus
 repository https://issues.sonatype.org/browse/OSSRH-5277 which took a day
 and to document the project than implement it).

 See for example this very simple project:
 https://Wicket-Continuous-Calendar.GoogleCode.com
 I do recommend sharing your code with the rest of the community so that
 others can contribute to your project.
 Feel free to let us know via an announcement on this list once you have it
 setup.

 If you decide not to create this project, I might do it later when we'll
 get to refactor our webapp menu :)

 ~ Thank you,
Paul Bors

 On Thu, Mar 28, 2013 at 2:38 AM, Leningovi g.le...@nic.in wrote:

 i want menu like in below link

 Tree View with context Menu
 
 http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/index.htm#demos/jqxtree/treepopup.htm
 

 in wicket .. please help me ... this is very urgent

 Thanks in advance



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512p4657601.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: jQuery Treeview Context menu in wicket

2013-03-28 Thread Martin Grigorov
https://github.com/WiQuery/wiquery
https://github.com/sebfz1/wicket-jquery-ui

There are no plans to add a module for the same in Apache repos


On Thu, Mar 28, 2013 at 5:09 PM, Paul Bors p...@bors.ws wrote:

 Speaking of which, does anyone know what happen with jQuery UI and latest
 version of Wicket 6.x?

 I'm getting too many hits on two many different projects, most of which
 seem to be old and I through since jQuery is part of Wicket 6.x that there
 would be a similar module in Wicket to cover the jQuery UI library.

 I've been disconnected since we're not due to upgrade our webapp to Wicket
 6 for another few months.

 ~ Thank you,
Paul Bors

 On Thu, Mar 28, 2013 at 10:50 AM, Paul Bors p...@bors.ws wrote:

  That's a nice menu.
 
  Since the UI part is already done you can simply follow the examples from
  other projects on how to integrate it with Wicket yourself.
 
  It took me half a day to get a simple jQuery date picker ported over to
  Wicket 1.5.x (spent more time waiting on Sonatype OSS to setup the nexus
  repository https://issues.sonatype.org/browse/OSSRH-5277 which took a
 day
  and to document the project than implement it).
 
  See for example this very simple project:
  https://Wicket-Continuous-Calendar.GoogleCode.com
  I do recommend sharing your code with the rest of the community so that
  others can contribute to your project.
  Feel free to let us know via an announcement on this list once you have
 it
  setup.
 
  If you decide not to create this project, I might do it later when we'll
  get to refactor our webapp menu :)
 
  ~ Thank you,
 Paul Bors
 
  On Thu, Mar 28, 2013 at 2:38 AM, Leningovi g.le...@nic.in wrote:
 
  i want menu like in below link
 
  Tree View with context Menu
  
 
 http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/index.htm#demos/jqxtree/treepopup.htm
  
 
  in wicket .. please help me ... this is very urgent
 
  Thanks in advance
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512p4657601.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
 
 
 




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com http://jweekend.com/


Re: jQuery Treeview Context menu in wicket

2013-03-28 Thread Paul Bors
Cool, maybe we can suggest adding http://www.jqwidgets.com as a module to
either wiquery or wicket-jquery-ui or create a new project depending on
either on :)

~ Thank you,
   Paul Bors

On Thu, Mar 28, 2013 at 11:16 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 https://github.com/WiQuery/wiquery
 https://github.com/sebfz1/wicket-jquery-ui

 There are no plans to add a module for the same in Apache repos


 On Thu, Mar 28, 2013 at 5:09 PM, Paul Bors p...@bors.ws wrote:

  Speaking of which, does anyone know what happen with jQuery UI and latest
  version of Wicket 6.x?
 
  I'm getting too many hits on two many different projects, most of which
  seem to be old and I through since jQuery is part of Wicket 6.x that
 there
  would be a similar module in Wicket to cover the jQuery UI library.
 
  I've been disconnected since we're not due to upgrade our webapp to
 Wicket
  6 for another few months.
 
  ~ Thank you,
 Paul Bors
 
  On Thu, Mar 28, 2013 at 10:50 AM, Paul Bors p...@bors.ws wrote:
 
   That's a nice menu.
  
   Since the UI part is already done you can simply follow the examples
 from
   other projects on how to integrate it with Wicket yourself.
  
   It took me half a day to get a simple jQuery date picker ported over to
   Wicket 1.5.x (spent more time waiting on Sonatype OSS to setup the
 nexus
   repository https://issues.sonatype.org/browse/OSSRH-5277 which took a
  day
   and to document the project than implement it).
  
   See for example this very simple project:
   https://Wicket-Continuous-Calendar.GoogleCode.com
   I do recommend sharing your code with the rest of the community so that
   others can contribute to your project.
   Feel free to let us know via an announcement on this list once you have
  it
   setup.
  
   If you decide not to create this project, I might do it later when
 we'll
   get to refactor our webapp menu :)
  
   ~ Thank you,
  Paul Bors
  
   On Thu, Mar 28, 2013 at 2:38 AM, Leningovi g.le...@nic.in wrote:
  
   i want menu like in below link
  
   Tree View with context Menu
   
  
 
 http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/index.htm#demos/jqxtree/treepopup.htm
   
  
   in wicket .. please help me ... this is very urgent
  
   Thanks in advance
  
  
  
   --
   View this message in context:
  
 
 http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512p4657601.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
  
  
  
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/



Re: jQuery Treeview Context menu in wicket

2013-03-28 Thread Ernesto Reinaldo Barreiro
contributions are welcome:-)

On Thu, Mar 28, 2013 at 4:32 PM, Paul Bors p...@bors.ws wrote:

 Cool, maybe we can suggest adding http://www.jqwidgets.com as a module to
 either wiquery or wicket-jquery-ui or create a new project depending on
 either on :)

 ~ Thank you,
Paul Bors

 On Thu, Mar 28, 2013 at 11:16 AM, Martin Grigorov mgrigo...@apache.org
 wrote:

  https://github.com/WiQuery/wiquery
  https://github.com/sebfz1/wicket-jquery-ui
 
  There are no plans to add a module for the same in Apache repos
 
 
  On Thu, Mar 28, 2013 at 5:09 PM, Paul Bors p...@bors.ws wrote:
 
   Speaking of which, does anyone know what happen with jQuery UI and
 latest
   version of Wicket 6.x?
  
   I'm getting too many hits on two many different projects, most of which
   seem to be old and I through since jQuery is part of Wicket 6.x that
  there
   would be a similar module in Wicket to cover the jQuery UI library.
  
   I've been disconnected since we're not due to upgrade our webapp to
  Wicket
   6 for another few months.
  
   ~ Thank you,
  Paul Bors
  
   On Thu, Mar 28, 2013 at 10:50 AM, Paul Bors p...@bors.ws wrote:
  
That's a nice menu.
   
Since the UI part is already done you can simply follow the examples
  from
other projects on how to integrate it with Wicket yourself.
   
It took me half a day to get a simple jQuery date picker ported over
 to
Wicket 1.5.x (spent more time waiting on Sonatype OSS to setup the
  nexus
repository https://issues.sonatype.org/browse/OSSRH-5277 which took
 a
   day
and to document the project than implement it).
   
See for example this very simple project:
https://Wicket-Continuous-Calendar.GoogleCode.com
I do recommend sharing your code with the rest of the community so
 that
others can contribute to your project.
Feel free to let us know via an announcement on this list once you
 have
   it
setup.
   
If you decide not to create this project, I might do it later when
  we'll
get to refactor our webapp menu :)
   
~ Thank you,
   Paul Bors
   
On Thu, Mar 28, 2013 at 2:38 AM, Leningovi g.le...@nic.in wrote:
   
i want menu like in below link
   
Tree View with context Menu

   
  
 
 http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/index.htm#demos/jqxtree/treepopup.htm

   
in wicket .. please help me ... this is very urgent
   
Thanks in advance
   
   
   
--
View this message in context:
   
  
 
 http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512p4657601.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
   
   
   
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/
 




-- 
Regards - Ernesto Reinaldo Barreiro


Re: jQuery Treeview Context menu in wicket

2013-03-27 Thread Andrea Del Bene

Hi,

I didn't clearly understand what you want to build. Dou you want a 
treeview like this http://jquery.bassistance.de/treeview/demo/?

Hi,

How to implement jQuery Tree View with Context Menu in wicket.
Please provide a sample code or example


Thanks in advance


Regards
G.Lenin



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512.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




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



jQuery Treeview Context menu in wicket

2013-03-26 Thread Leningovi
Hi,

How to implement jQuery Tree View with Context Menu in wicket.
Please provide a sample code or example 


Thanks in advance


Regards
G.Lenin



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/jQuery-Treeview-Context-menu-in-wicket-tp4657512.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: OnMouseOver and OnMouseOut menu

2012-10-06 Thread vineet semwal
you are welcome,as i have said before there are already existing
tooltips projects done in wicket ,the most popular/used one is i think
mootip,it's in minis project  in wickestuff but i have not used
tooltips in long time so there might have come  new ones so either use
that or create a new thread that asks for the existing
tooltips/ajaxtooltips in wicket and people will recommend the tooltips
they like/use.



On Sat, Oct 6, 2012 at 6:05 AM, theivorykitty
chantal.da...@frontier.com wrote:
 Thanks very much! Unfortunately while this does set a wait time, I didn't
 really think it through. ... After the wait time the mouseout behavior
 always occurs - even if your mouse is back in at the time (obviously - I
 didn't think this through). That means that the mouse-in behavior also
 occurs (making the popup appear again). To the user it looks like the menu
 is flickering horribly. :( I'm just not sure what the answer is! However, I
 did get the throttle setting working properly, so thank you very much :).



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/OnMouseOver-and-OnMouseOut-menu-tp4652538p4652714.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




-- 
regards,

Vineet Semwal

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



OnMouseOver and OnMouseOut menu

2012-09-29 Thread theivorykitty
Hey guys!

So, basically I have a panel which, underneath some other items, has a
WebMarkupContainer which contains:
(1) A text link
(2) The label that goes inside the link (the text for the link above)
(3) A panel with clickable options in it. This panel is hidden with
setOutputMarkupPlaceholderTag set to true.

The WebMarkupContainer which contains all of these items has an
AjaxEventBehavior(onmouseover), and an AjaxEventBehavior(onmouseout)
which make the #3 panel with clickable options in it visible or not visible.

The visible/invisible bit works wonderfully - however, the onmouseout
behavior happens too quickly - I can't get the mouse the tiny hair-line
distance between the #1 text link and the #3 panels with the options in
them.

Is there a way to add some sort of wait time or something to the onmouseout
behavior to give the user enough time to get into the selection panel?
And/or is this a totally hokey way to do this and should I try a different
way?

Any help is GREATLY appreciated!!! 

Example Code:

   WebMarkupContainer webcontainer = new
WebMarkupContainer(container);

Panel panel = new Panel (panel);
webcontainer.add(panel);
panel.setOutputMarkupPlaceholderTag(true);
panel.setVisible(false);

AjaxLink link = new AjaxLink (link);
webcontainer.add(link.setOutputMarkupId(true));

Label labelText = new Label(labelText, Hover Over Me!);
link.add(labelText);
labelText.setOutputMarkupId(true);
labelText.setOutputMarkupPlaceholderTag(true);
labelText.setVisible(true);

webcontainer.add(new AjaxEventBehavior(onmouseover) {

@Override
protected void onEvent(AjaxRequestTarget target) {
panel.setVisible(true);
target.add(panel, panel.getMarkupId());
}
});
webcontainer.add(new AjaxEventBehavior(onmouseout) {

@Override
protected void onEvent(AjaxRequestTarget target) {
panel.setVisible(false);
target.add(panel, panel.getMarkupId());
}
});

add(webcontainer);
webcontainer.setOutputMarkupId(true);

Thanks,



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/OnMouseOver-and-OnMouseOut-menu-tp4652538.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: dynamic vertical menu

2012-04-30 Thread Dan Retzlaff
Hi, Lenin. Have you looked into these two examples? They might help you get
started.

http://www.wicket-library.com/wicket-examples/nested/
http://www.wicket-library.com/wicket-examples/navomatic/

Dan

On Mon, Apr 30, 2012 at 12:30 AM, lenin lening...@gmail.com wrote:

 Dear,

 i am new in the wicket1.5.5 framework , how to create dynamic vertical
 menu(with sub menu) 
 i want to display the page within the menu page.
 i am trying this past one month but till not able to find out the solution
 can any one help to resolve the problem...

 thanks in advance

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/dynamic-vertical-menu-tp4597577.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: dynamic vertical menu creating-reg

2012-04-16 Thread Martin Grigorov
Hi,

Wicket just generates the markup of the page.
So find a menu implementation in the internet that fits your needs and
see what html and css it uses, then use some Wicket repeater to
generate such html for your page.

On Mon, Apr 16, 2012 at 12:58 PM, lenin lening...@gmail.com wrote:
 Dear,

 i am new in the wicket1.5.5 framework , how to create dynamic vertical
 menu(with sub menu) 
 i want to display the page within the menu page.
 i am trying past one week but till not able to find the solution
 can any one help to resolve the problem...
 thanks in advance

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/dynamic-vertical-menu-creating-reg-tp4561036p4561036.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




-- 
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



Re: Wicket and Menu support

2012-04-10 Thread Martin Grigorov
On Sun, Apr 8, 2012 at 8:04 PM, Tom Eugelink t...@tbee.org wrote:

 Is there any documentation on this jquery support in wicket 6? I'm setting
 up a new project ARM and instead of including all kinds of side kick
 projects, core support is preferable.

https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+6.0#MigrationtoWicket6.0-Ajax


 Tom





 On 2012-04-08 19:55, msalman wrote:

 Thanks to every one for all of your comments and suggestions.

 Great to know that wicket core will include jquery.

 Alle, I would appreciate very much if you can please share your code for
 using jquery tree.  It would give me a good start.

 Thanks.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Menu-support-tp4540516p4541287.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





 -
 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



Re: Wicket and Menu support

2012-04-08 Thread Daniel Neugebauer
Depending on how your menus are supposed to be defined, you could
statically put them into your markup or dynamically create them by using
a ListView or similar.

A nested HTML list structure, as already suggested, usually works best.
There are a lot of ready-to-use CSS examples and JavaScript libraries to
handle such menus, if you don't want to write it yourself.

On 04/08/2012 07:52 AM, msalman wrote:
 I thought that the idea behind Wicket is to take care of these things for
 Java programmers.  I would appreciate if some basic form of menu is made
 part of wicket core.

Wicket is one of the few frameworks that leave you in full control of
your markup, which means that it does not provide a lot of
ready-to-include components that include markup and a full style.
Instead it works more like casting your markup to Java components, so
your HTML code becomes accessible from Java.

There are of course some ready-to-use components in wicket-stuff etc.
but less in Wicket core. This way, you are not forced to follow an HTML
structure or CSS classes someone else wrote that may clash with the
design you had in mind (modal dialogs are one exception, apart from that
and trees I can't think of many standard components that use a
noticeable amount of their own HTML/CSS).

If you want to avoid HTML/CSS as far as possible, other frameworks may
fit better. For example, you can avoid HTML/CSS almost completely with
Vaadin or GWT if you don't need any custom layout (if you do, it can be
a lot of work to style it). And then there are a lot of frameworks that
are easier to style but require you to write some HTML/CSS yourself.

If you want to stay with Wicket, you should get more comfortable with
HTML and CSS (which will take a lot of exercise to get it right) or
leave writing templates up to a web designer, which (due to a good
separation of templates and code) is far easier in Wicket than with
other frameworks. In most cases, you can simply take a design, add
Wicket XML tags/attributes to it and start using that template from your
code.

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



Re: Wicket and Menu support

2012-04-08 Thread Paolo
Alle domenica 08 aprile 2012, Daniel Neugebauer ha scritto:
 Depending on how your menus are supposed to be defined, you could
 statically put them into your markup or dynamically create them by using
 a ListView or similar.
 

 If you want to avoid HTML/CSS as far as possible, other frameworks may
 fit better. For example, you can avoid HTML/CSS almost completely with
 Vaadin or GWT if you don't need any custom layout (if you do, it can be
 a lot of work to style it). And then there are a lot of frameworks that
 are easier to style but require you to write some HTML/CSS yourself.
 
 If you want to stay with Wicket, you should get more comfortable with
 HTML and CSS (which will take a lot of exercise to get it right) or
 leave writing templates up to a web designer, which (due to a good
 separation of templates and code) is far easier in Wicket than with
 other frameworks. In most cases, you can simply take a design, add
 Wicket XML tags/attributes to it and start using that template from your
 code.

I suggest jquery menu, they are very simple to use. You could find a lot of 
those on google search.
I used with satisfaction jquery.treeview.js with 3 level menu and wicket:link 
statically
http://docs.jquery.com/Plugins/Treeview

P.S.
Jquery now, with wicket 6, is internally supported by wicket core.



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



Re: Wicket and Menu support

2012-04-08 Thread msalman
Thanks to every one for all of your comments and suggestions.

Great to know that wicket core will include jquery.

Alle, I would appreciate very much if you can please share your code for
using jquery tree.  It would give me a good start.  

Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Menu-support-tp4540516p4541287.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: Wicket and Menu support

2012-04-08 Thread Tom Eugelink


Is there any documentation on this jquery support in wicket 6? I'm setting up a 
new project ARM and instead of including all kinds of side kick projects, core 
support is preferable.

Tom




On 2012-04-08 19:55, msalman wrote:

Thanks to every one for all of your comments and suggestions.

Great to know that wicket core will include jquery.

Alle, I would appreciate very much if you can please share your code for
using jquery tree.  It would give me a good start.

Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Menu-support-tp4540516p4541287.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






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



Wicket and Menu support

2012-04-07 Thread msalman
Wicket is a great product and I really hope that I do not offend any one by
my question.  Indeed this may be due to my lack of information.  What I want
to know is why does not Wicket 'core' supports menu and other items
necessary to develop a website?  I have to search  for YUI wicket,
wicket-stuff, and wicket-extensions, which are some what phantom like
websites.  After some research I find that the code I am looking for is not
even supported any more.  The kind developer has moved on to other stuff.  

So what is the qualification for you to include a control(?) into the Wicket
'core'?  What is the suggested way to handle stuff like this?

Thanks. 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Menu-support-tp4540516p4540516.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: Wicket and Menu support

2012-04-07 Thread Josh Kamau
IMHO, Wicket as the largest number of out of the box components of all the
frameworks that i know.
For such things as menus, are they not 'ulli' that have been styled the
way you want..

I think the key thing is ... if you are not familiar with HTML and CSS, you
may not like wicket. Because if leaves writting html and styling the
elements to you.

Josh.

On Sun, Apr 8, 2012 at 8:19 AM, msalman mohammad_sal...@yahoo.com wrote:

 Wicket is a great product and I really hope that I do not offend any one by
 my question.  Indeed this may be due to my lack of information.  What I
 want
 to know is why does not Wicket 'core' supports menu and other items
 necessary to develop a website?  I have to search  for YUI wicket,
 wicket-stuff, and wicket-extensions, which are some what phantom like
 websites.  After some research I find that the code I am looking for is not
 even supported any more.  The kind developer has moved on to other stuff.

 So what is the qualification for you to include a control(?) into the
 Wicket
 'core'?  What is the suggested way to handle stuff like this?

 Thanks.


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Menu-support-tp4540516p4540516.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: Wicket and Menu support

2012-04-07 Thread msalman
Well you are right that I am not good with html and css.  As I say I have
been forced to do GUI work - kicking and screaming.  Well, I think I am OK
with html but this CSS thing leaves me very frustrated. 

I thought that the idea behind Wicket is to take care of these things for
Java programmers.  I would appreciate if some basic form of menu is made
part of wicket core.

BTW, thanks for the ULli hint.  

Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Menu-support-tp4540516p4540539.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



How to open BreadCrumbPanel from a context menu item instead of link

2012-02-21 Thread michen
Hi there,
   In my application, I would like to navigate through several breadcrumb
panels through clicking context menu item. For example, in panel1, I have a
result table, right click a context menu of a row in the table, I would like
to open another panel2 in a breadcrumb fashion. Is there a way to do that? I
have looked at Wicket breadcrumb examples, but they are all using a link or
button of sort to navigate from one panel to another.  Thanks for your
suggestions.

   -min


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-open-BreadCrumbPanel-from-a-context-menu-item-instead-of-link-tp4408530p4408530.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: right click popup context menu

2012-01-31 Thread suryaraju
I have a similar requirement for my project .could you share the
implementation or guide me to the example which can help to implement
context menu on right of a grid cell in Wicket.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/right-click-popup-context-menu-tp1872802p4343078.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



YUI sub menu not showing until refresh

2011-12-14 Thread jchappelle
Hi,

We have been using the wicket-yui menu for some time now and I recently
updated our jar file to the 1.4.15 version because of a problem we were
hitting with the 1.4.2 version. Well it seems that we have traded one
problem for another. The 1.4.15 version will not show the drop down icons
for the sub menu unless you ctrl-F5 the browser to force a refresh.

Has anyone had this problem. By the way I have setStripWicketTags(true) set
to true in our application.

Thanks,

Josh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/YUI-sub-menu-not-showing-until-refresh-tp4195883p4195883.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: YUI menu and development mode

2011-09-18 Thread jchappelle
I am having the same issue. Has anyone found a solution to this? I am using
wicket version 1.4.15. 

Thanks,

Josh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/YUI-menu-and-development-mode-tp1882092p3822359.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: YUI menu and development mode

2011-09-18 Thread Ernesto Reinaldo Barreiro
I´m not  using this menu but I have seen similar problems with other
components because of  wicket:panel and other development info
wikcet generates (by default) on development mode.

Best,

Ernesto


On Sun, Sep 18, 2011 at 8:10 PM, jchappelle jchappe...@4redi.com wrote:
 I am having the same issue. Has anyone found a solution to this? I am using
 wicket version 1.4.15.

 Thanks,

 Josh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/YUI-menu-and-development-mode-tp1882092p3822359.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



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



Re: YUI menu and development mode

2011-09-18 Thread jchappelle
Thanks a lot Ernesto! That pointed me in the right direction and I found the
specific setting that was causing the problem. The following code is in my
Application subclass's init method and it seems to fix the problem for me.

getMarkupSettings().setStripWicketTags(true);

Thanks,

Josh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/YUI-menu-and-development-mode-tp1882092p3822415.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: YUI menu and development mode

2011-09-18 Thread Ernesto Reinaldo Barreiro
Glad to be of some help:-) Yes, that is the setting I had to use as well.

Best,

Ernesto

On Sun, Sep 18, 2011 at 9:03 PM, jchappelle jchappe...@4redi.com wrote:
 Thanks a lot Ernesto! That pointed me in the right direction and I found the
 specific setting that was causing the problem. The following code is in my
 Application subclass's init method and it seems to fix the problem for me.

 getMarkupSettings().setStripWicketTags(true);

 Thanks,

 Josh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/YUI-menu-and-development-mode-tp1882092p3822415.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



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



Different menu path in a MenuPanel

2011-06-22 Thread César Alberto Barrera
Hello!

I have a special menu to build, my HomePage has many links example and I can
go to distinct Page

HomePage link to Page1, Page 5

In Page 1 has link to Page 2, Page3
Page2 - links to Page 3, Page 4
Page3 - links to Page 2, Page 4

In Page 5 has link to Page 6, Page 7
Page7 - links to Page 8
Page6 - links to Page 9

And the combinations going on.

So, I need to build a MenuPanel to take track from the user selection of
page to permit the user return easy to whatever page.
Example of navigation:
The user starts in HomePage, then Click Page1, the menu is (HomePage | Page1
-- disabled but showed in the menu to show the position)
latter the user clicks Page2 now the menu change to (HomePage | Page1 |
Page2 -- disabled )
I have solved this with a Session and a Menu List saving the PageParameters to
reproduce the same page, my user can go to HomePage, Page1 or clic the link
Page3 or Page4, so the menu change
to (HomePage | Page1 | Page2 | Page3 )
My problem is that if my user open a new browser tab, the menu in session is
the same so I need to take track of the new tab.
How can I take track of the browser tab, window etc, to get better listMenu.

I can't do a map of menu because Page4 may be can render page N accord to
user properties

May be I need to get the window# or tab and save it with the listMenu.

My test code
public class SiSession extends WebSession
{
private static final long serialVersionUID = 6953907625762546748L;
private ArrayListMenu listMenu = new ArrayListMenu();

public ArrayListMenu getListMenu() {
return listMenu;
}

public void setListMenu(ArrayListMenu lista) {
this.listMenu = lista;
}
}

LayoutPage
public abstract class LayoutPage extends WebPage {
public LayoutPage(Class clase, String nombre, PageParameters parametros){
MenuPanel mp = new MenuPanel(menu, clase, nombre, parametros);
add(mp);
}
}

public class MenuPanel extends Panel {
public MenuPanel(String id, Class? extends Page paginaActual, String
nombre, PageParameters parametros){
super(id);
SiSession sesion = (SiSession) getSession();
ArrayListMenu lista = sesion.getListMenu();
int index = lista.lastIndexOf(new Menu(paginaActual));
if(index = 0){
lista = new ArrayList(lista.subList(0, index));
}
ista.add(new Menu(nombre, paginaActual, parametros));
 ListViewMenu listaMenu = new ListViewMenu(listaMenu, lista) {
 @Override
protected void populateItem(ListItemMenu item) {
 BookmarkablePageLink link = new BookmarkablePageLinkVoid(url,
item.getModelObject().getClase());
link.add(new Label(etiqueta, item.getModelObject().getNombre()));
item.add(link);
}
};
add(listaMenu);
}
}

public class Menu implements IClusterable {
private String nombre;
private Class? extends Page clase;
private PageParameters parameters;
private Image imagen;
 public Menu(Class clase){
setClase(clase);
}
public Menu(String nombre, Class clase){
setNombre(nombre);
setClase(clase);
}
public Menu(String nombre, Class clase, PageParameters parameters){
setNombre(nombre);
setClase(clase);
setParameters(parameters);
}

...getters  setters
}


all my Pages  are like this
public class UnoPage extends LayoutPage {
public UnoPage(){
super(UnoPage.class, Uno, null);
Link link = new Link(dosPageLink){
@Override
public void onClick() {
setResponsePage(DosPage.class);
}
};
add(link);
}
}


Thank you!

-- 
César Alberto Barrera  abarrera at gmail dot com


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 ListMenuItem 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 hubert_h...@gmx.de 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,

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);
ListMenuItem primaryMenuList = new ArrayListMenuItem();
primaryMenuList.add(primaryMenu1);

add(new SunriseGlossDropDownMenu(sunriseGlossMenu, primaryMenuList));

markup:
div wicket:id=sunriseGlossMenu/div


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 hubert_h...@gmx.de 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 Fatih Mehmet UCAR
Well at the beginning of my email I stated that it is not complete. I don't 
there is a way to do it directly, but you may wanna change the code or use 
some pieces to make it the way you want it, better than starting from 
scratch. Take a look at the source of both components and then you can 
create your own.


cheers,
fatih

-Original Message- 
From: hubert_hupe

Sent: Thursday, June 09, 2011 15:31 PM
To: users@wicket.apache.org
Subject: Re: navigation menu

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);
ListMenuItem primaryMenuList = new ArrayListMenuItem();
primaryMenuList.add(primaryMenu1);

add(new SunriseGlossDropDownMenu(sunriseGlossMenu, primaryMenuList));

markup:
div wicket:id=sunriseGlossMenu/div


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 hubert_h...@gmx.de 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




-
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: navigation menu

2011-06-08 Thread 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 hubert_h...@gmx.de 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-08 Thread Peter Karich
 Hi,

why not use the 'tutsplus' code which you like and bind the links to
bookmarkable pages?
You could also inject some variables (e.g. the urls) into javascript
from wicket:

private HeaderContributor contrib = new HeaderContributor(
new IHeaderContributor() {

@Override
public void renderHead(IHeaderResponse response) {
PageParameters params = new PageParameters();
params.add(myparam, true);
String url = RequestUtils.toAbsolutePath(urlFor(MyPage1.class,
params).toString());
response.renderJavascript(var myurl1 = ' + url + ';,
myjsinjection);
}
});

of course this should be injected before the external code:

public void init(final PageParameters parameters) {
add(contrib);
add(new HeaderContributor(
new IHeaderContributor() {
public void renderHead(IHeaderResponse response) {
response.renderJavascriptReference(js/external.js);
}
}));}

Would this help?

Regards,
Peter.

 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 hubert_h...@gmx.de 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

-- 
http://jetwick.com open twitter search


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



Re: Adding attribute to selected menu item

2011-01-30 Thread msj121

Well there are a couple ways of doing this I recently dealt with this
same problem. You can in fact use some Javascript on the onClick of your
item (or onHover) to add to the affect, but either way you will want to have
your default menu item selected from the get go when they are on that page
(ie: they clicked on the blog section, that link in the menu should be
highlighted now without clicking). So unless its all one page and your using
ajax(I'll stop droning) The following should help:

Link link = new Link(menuLink) { 
@Override
protected void onComponentTag(ComponentTag tag) {
if()
 tag.put(id,curent_menu);
}
}

In Theory you can simply add the AttributeAppender from the get go depending
on which page you are on, so when it reloads, it will be reloaded with a
component.

Now I take it you are using onclick to keep track of your page. Either you
have to store a local variable that will record the page onClick, you have
to have a method that each page overrides telling you the current page, or
what I do is simply look at the PageParameters of my page.

So as follows: params.getString(key); //the key depends on how you build
your urls.
This only works if every time a link is clicked it actually goes to another
page with a different url.

So as of now, in your onclick record the name of the menu clicked, then in
the building section automaticlally add the appender This is what I mean
(notice the unqouted changes):


String selected = ;

 ListView lv = new ListView(mainMenu, menuList) {
@Override
protected void populateItem(final ListItem item) {
Menu menuItem = (Menu) item.getModelObject();
Link link = new Link(menuLink) {
@Override
public void onClick() {
  selected = item.getPath();
System.out.println(item was clicked  +
 item.getPath());
}

};
  if(item.getPath().equals(selected))
   item.add(new AttributeAppender(id, new
Model(current_menu), ;));
link.add(new Label(menuCaption,
 menuItem.getMenuNameDe()));
item.add(link);
}
};
add(lv);
 

Try the above. Notice the selected variable is now global and the if
statement can be used to whatever will stay constant. I have never used
getPath() before not sure what it returns, you might need the name of the
menu which doesn't change etc no idea.

Good Luck, 
   Matthew
 Hello to all,

 i am trying to build a dynamic menu based on data from a database. So i
 thought i could build it like my code shows it. To highlight the selected
 menu i try to dynamically add an attribute to the li tag in the onClick
 method. I would also want to load and repaint other panels (for example
 loading sub menus ), when the user clicks a menu link. But it is not
 working. What am i doing wrong?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-attribute-to-selected-menu-item-tp3244327p3247201.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



Adding attribute to selected menu item

2011-01-28 Thread Haman Abel

Hello to all,

i am trying to build a dynamic menu based on data from a database. So i 
thought i could build it like my code shows it. To highlight the 
selected menu i try to dynamically add an attribute to the li tag in the 
onClick method. I would also want to load and repaint other panels (for 
example loading sub menus ), when the user clicks a menu link. But it is 
not working. What am i doing wrong?


pre
ListViewMenu lv = new ListViewMenu(mainMenu, menuList) {
@Override
protected void populateItem(final ListItemMenu item) {
Menu menuItem = (Menu) item.getModelObject();
LinkMenu link = new LinkMenu(menuLink) {
@Override
public void onClick() {
item.add(new AttributeAppender(id, new 
Model(current_menu), ;));
System.out.println(item was clicked  + 
item.getPath());

}

};
link.add(new Label(menuCaption, 
menuItem.getMenuNameDe()));

item.add(link);
}
};
add(lv);
/pre

and this is my panel markup:

pre
body
wicket:panel
ul
li wicket:id=mainMenu
a href=# wicket:id=menuLinkspan wicket:id=menuCaption/span/a
/li
/ul
/wicket:panel
/body
/pre
My goal:

pre
body
wicket:panel
ul
li wicket:id=mainMenu id=current_menu
a href=# wicket:id=menuLinkspan wicket:id=menuCaption/span/a
/li
/ul
/wicket:panel
/body
/pre

Thank you for any help!


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



Re: Adding attribute to selected menu item

2011-01-28 Thread Pedro Santos
Hi Haman, ListView items are recreated by default (see RepeatingView or
ListView#setReuseItems). So your code is adding an AttributeAppender to an
component that will be discarded in benefit of a new one for the next
render.

On Fri, Jan 28, 2011 at 10:28 AM, Haman Abel fha...@online.de wrote:

 Hello to all,

 i am trying to build a dynamic menu based on data from a database. So i
 thought i could build it like my code shows it. To highlight the selected
 menu i try to dynamically add an attribute to the li tag in the onClick
 method. I would also want to load and repaint other panels (for example
 loading sub menus ), when the user clicks a menu link. But it is not
 working. What am i doing wrong?

 pre
 ListViewMenu lv = new ListViewMenu(mainMenu, menuList) {
@Override
protected void populateItem(final ListItemMenu item) {
Menu menuItem = (Menu) item.getModelObject();
LinkMenu link = new LinkMenu(menuLink) {
@Override
public void onClick() {
item.add(new AttributeAppender(id, new
 Model(current_menu), ;));
System.out.println(item was clicked  +
 item.getPath());
}

};
link.add(new Label(menuCaption,
 menuItem.getMenuNameDe()));
item.add(link);
}
};
add(lv);
 /pre

 and this is my panel markup:

 pre
 body
 wicket:panel
 ul
 li wicket:id=mainMenu
 a href=# wicket:id=menuLinkspan wicket:id=menuCaption/span/a
 /li
 /ul
 /wicket:panel
 /body
 /pre
 My goal:

 pre
 body
 wicket:panel
 ul
 li wicket:id=mainMenu id=current_menu
 a href=# wicket:id=menuLinkspan wicket:id=menuCaption/span/a
 /li
 /ul
 /wicket:panel
 /body
 /pre

 Thank you for any help!


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




-- 
Pedro Henrique Oliveira dos Santos


Re: onmouseover menu

2010-09-27 Thread Johan Haleby

Thanks for your suggestion. I can't seem to use Wiquery because when I add
the tooltip behavior I cannot drag and drop the component anymore.

The other approach fails with an exception 
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = 1]] when executing
this.getCallbackScript(). Why is this happening?

/Johan
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onmouseover-menu-tp2553581p2715019.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: onmouseover menu

2010-09-27 Thread Johan Haleby

I've managed to avoid the exceptionchanging the onBind method's
AttributeModifier from a standard Model to a LoadableDetachableModel, e.g. 
getComponent().add(new AttributeModifier(onmouseover, true, new
LoadableDetachableModelCharSequence() {
@Override
protected CharSequence load() {
return MyBehavior.this.getCallbackScript();
}
}));

Thank
/Johan
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onmouseover-menu-tp2553581p2715045.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: onmouseover menu

2010-09-27 Thread Ernesto Reinaldo Barreiro
I'm not following you on the drag-drop part? What is stopping to work?
If you can't use wiQuery you can simply copy and paste the code remove
the wiQuery dependency and include the needed JavaScript and CSS using
standard wicket machinery .

Ernesto

On Mon, Sep 27, 2010 at 9:40 AM, Johan Haleby johan.hal...@gmail.com wrote:

 Thanks for your suggestion. I can't seem to use Wiquery because when I add
 the tooltip behavior I cannot drag and drop the component anymore.

 The other approach fails with an exception
 java.lang.IllegalStateException: No Page found for component
 [MarkupContainer [Component id = 1]] when executing
 this.getCallbackScript(). Why is this happening?

 /Johan
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/onmouseover-menu-tp2553581p2715019.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



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



Re: onmouseover menu

2010-09-27 Thread Johan Haleby

I'm using wicket-dnd to allow for drag and drop of the rows in the datatable.
When I'm adding the TooltipBehavior to my component I can no longer drag and
drop the rows. If I remove it, I can dnd again. 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onmouseover-menu-tp2553581p2715216.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



onmouseover menu

2010-09-24 Thread Johan Haleby

Hi, 

I have a datatable with a couple of rows. I'd like a menu to popup when the
mouse is located over a row and I'd like it to disappear on onmouseout.
The menu must be aware of the row model that the mouse cursor is currently
over since I'd like to make changes to the model from the menu.

I'd like to do something similar to the google maps satellite button. I.e.
when you move the mouse over it a menu appears allowing you to show or hide
labels on the map.

/Johan
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/onmouseover-menu-tp2553581p2553581.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: onmouseover menu

2010-09-24 Thread Ernesto Reinaldo Barreiro
Maybe you can use a tool-tip component bound to the roww  and use an
AJAX call back to update tooltip contents with your menu. There
several tooltip implementations out there, e.g. [1].

Ernesto

1-http://wiquery-plugins-demo.appspot.com/demo/?wicket:bookmarkablePage=:com.wiquery.plugins.demo.ToolTipPage

On Fri, Sep 24, 2010 at 4:42 PM, Johan Haleby johan.hal...@gmail.com wrote:

 Hi,

 I have a datatable with a couple of rows. I'd like a menu to popup when the
 mouse is located over a row and I'd like it to disappear on onmouseout.
 The menu must be aware of the row model that the mouse cursor is currently
 over since I'd like to make changes to the model from the menu.

 I'd like to do something similar to the google maps satellite button. I.e.
 when you move the mouse over it a menu appears allowing you to show or hide
 labels on the map.

 /Johan
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/onmouseover-menu-tp2553581p2553581.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



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



Re: onmouseover menu

2010-09-24 Thread Michael O'Cleirigh

 Hello,

Look into overriding dataTable.newRowItem (..) like this:

protected ItemT newRowItem(final String id, int index, final IModelT 
model)

{
ItemTitem  = new ItemT(id, index, model);

item.add (new MyBehaviour(index, model));

}

Then create a behaviour to implement the action.  It could use ajax or 
javascript that was written out in the page header when it was rendered.


public class MyBehaviour extends AbstractDefaultAjaxBehavior {

private IModelTrowModel;
private boolean popupVisible = false;

public MyBehaviour (int index, IModelTrowModel) {
this.rowModel = rowModel;

}
 // assume you passed trough the model
protected void onBind() {
getComponent().add(new AttributeModifier (onmouseover, true, 
this.getCallbackScript()));
getComponent().add(new AttributeModifier (onmouseout, true, 
this.getCallbackScript()));


}

protected void respond(AjaxRequestTarget target) {

if (popupVisible) {
T value = this.rowModel.getObject();
// show the popup contextualized with T
}
else {
// hide the popup.
}

}


}

Depending on what your menu will allow you might not need standard form 
processing.  You could use an AjaxLink to handle the action which would 
make changes to the IModelTrowModel backing object.


Regards,

Mike

Hi,

I have a datatable with a couple of rows. I'd like a menu to popup when the
mouse is located over a row and I'd like it to disappear on onmouseout.
The menu must be aware of the row model that the mouse cursor is currently
over since I'd like to make changes to the model from the menu.

I'd like to do something similar to the google maps satellite button. I.e.
when you move the mouse over it a menu appears allowing you to show or hide
labels on the map.

/Johan



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



selected links in a menu

2010-06-08 Thread Fernando Wermus
Hi all,
I have a menu that it structure is the following:


1. for the link selected

ul id=someId
 li
em selected item /em
/li



2. for the link not selected

ul id=someId
  li
  em
 a item not selected/a
  em
  /li
...


I programmed this with a border that renders the em, but I need make
invisible the border, but not the anchor to get the first case.

I tried:

border.setVisible(false);
border.getBodyContainer().setVisible(true);

and I got an error:

at java.util.AbstractList$Itr.remove(
AbstractList.java:356)
at org.apache.wicket.Page.checkRendering(Page.java:1139)
at org.apache.wicket.Page.renderPage(Page.java:921)
at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:240)


Which is the best way to achieve this?

I supposed that if a decorator didn't render it would mean the body would
still be rendered - it is a decorator, not a classic container.

thanks in advance


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: selected links in a menu

2010-06-08 Thread Igor Vaynberg
simply disabling the link, calling setenabled(false), will get you
there. also see link#setbefore/afterdisabledlink(string markup) which
looks like you may want to set to 

-igor

On Tue, Jun 8, 2010 at 12:37 PM, Fernando Wermus
fernando.wer...@gmail.com wrote:
 Hi all,
    I have a menu that it structure is the following:


 1. for the link selected

 ul id=someId
     li
        em selected item /em
    /li
 


 2. for the link not selected

 ul id=someId
      li
          em
             a item not selected/a
          em
      /li
 ...


 I programmed this with a border that renders the em, but I need make
 invisible the border, but not the anchor to get the first case.

 I tried:

 border.setVisible(false);
 border.getBodyContainer().setVisible(true);

 and I got an error:

 at java.util.AbstractList$Itr.remove(
 AbstractList.java:356)
 at org.apache.wicket.Page.checkRendering(Page.java:1139)
 at org.apache.wicket.Page.renderPage(Page.java:921)
 at
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:240)


 Which is the best way to achieve this?

 I supposed that if a decorator didn't render it would mean the body would
 still be rendered - it is a decorator, not a classic container.

 thanks in advance


 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus


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



Re: Caching menu

2010-05-14 Thread Altuğ Bilgin Altıntaş
Hi;

For distributed caching i can advice hazelcast.com, take a look.

Cheers

Altug.

2010/5/7 nino martinez wael nino.martinez.w...@gmail.com

 Id go for at pojo dao provider which then can cache the menu, and
 just use that from your wicket menu components.. You could then use
 something like ehcache, for caching..

 2010/5/5 Wolfgang wolfgang.bue...@exedio.com:
 
  I'm working on a web site that has a menu bar with sub-items, and
  sub-sub-items. The configuration of this menu is computed from
 hilariously
  complex SQL queries and needs quite some time to be established. The menu
  looks different for each user (session) but stays the same for the
 lifetime
  of the session. So it's time for caching as this menu shows up on most of
  the pages.
 
  From other posts on this site I've taken that it's not a good idea to
 share
  the components that represent the menu among different pages. Now I
 wonder
  on which level I can cache and re-use objects.
 
  Is it advisable to share models (in the Wicket sense), i.e. store the
 menu
  models on the session and construct the menu components according to
 their
  information for every page?
 
  Or do I have to create separate, Wicket-independent data structures that
  hold the menu structure information and store it on the session or in the
  database?
 
  Or am I on a complete wrong track and should look for caching of the
  rendered HTML code on a component basis?
 
  Thanks in advance for sharing your knowledge/experience.
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Caching-menu-tp2130813p2130813.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: Caching menu

2010-05-06 Thread nino martinez wael
Id go for at pojo dao provider which then can cache the menu, and
just use that from your wicket menu components.. You could then use
something like ehcache, for caching..

2010/5/5 Wolfgang wolfgang.bue...@exedio.com:

 I'm working on a web site that has a menu bar with sub-items, and
 sub-sub-items. The configuration of this menu is computed from hilariously
 complex SQL queries and needs quite some time to be established. The menu
 looks different for each user (session) but stays the same for the lifetime
 of the session. So it's time for caching as this menu shows up on most of
 the pages.

 From other posts on this site I've taken that it's not a good idea to share
 the components that represent the menu among different pages. Now I wonder
 on which level I can cache and re-use objects.

 Is it advisable to share models (in the Wicket sense), i.e. store the menu
 models on the session and construct the menu components according to their
 information for every page?

 Or do I have to create separate, Wicket-independent data structures that
 hold the menu structure information and store it on the session or in the
 database?

 Or am I on a complete wrong track and should look for caching of the
 rendered HTML code on a component basis?

 Thanks in advance for sharing your knowledge/experience.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Caching-menu-tp2130813p2130813.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



Cache menu

2010-05-05 Thread Wolfgang

I'm working on a web site that has a menu bar with sub-items, and
sub-sub-items. The configuration of this menu is computed from hilariously
complex SQL queries and needs quite some time to be established. The menu
looks different for each user (session) but stays the same for the lifetime
of the session. So it's time for caching as this menu shows up on most of
the pages.

From other posts on this site I've taken that it's not a good idea to share
the components that represent the menu among different pages. Now I wonder
on which level I can cache and re-use objects.

Is it advisable to share models (in the Wicket sense), i.e. store the menu
models on the session and construct the menu components according to their
information for every page?

Or do I have to create separate, Wicket-independent data structures that
hold the menu structure information and store it on the session or in the
database?

Or am I on a complete wrong track and should look for caching of the
rendered HTML code on a component basis?

Thanks in advance for sharing your knowledge/experience. 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cache-menu-tp2130976p2130976.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: Cache menu

2010-05-05 Thread Ernesto Reinaldo Barreiro
I would opt for creating very simple Java beans containing the cached
information and store them on the session and later on use that
information to build the menu bar. If several users share the
information (e/g/ based on roles) maybe you can devise some mechanism
to store them by role so that several session share the information.
If this menu bar information does not vary over time, or you have a
good criteria to know it is stale, and if is costly to compute I would
also consider (as you suggest) storing it on a temporary database for
later use (and recompute it just if it is stale).

Best,

Ernesto

On Wed, May 5, 2010 at 3:55 PM, Wolfgang wolfgang.bue...@exedio.com wrote:

 I'm working on a web site that has a menu bar with sub-items, and
 sub-sub-items. The configuration of this menu is computed from hilariously
 complex SQL queries and needs quite some time to be established. The menu
 looks different for each user (session) but stays the same for the lifetime
 of the session. So it's time for caching as this menu shows up on most of
 the pages.

 From other posts on this site I've taken that it's not a good idea to share
 the components that represent the menu among different pages. Now I wonder
 on which level I can cache and re-use objects.

 Is it advisable to share models (in the Wicket sense), i.e. store the menu
 models on the session and construct the menu components according to their
 information for every page?

 Or do I have to create separate, Wicket-independent data structures that
 hold the menu structure information and store it on the session or in the
 database?

 Or am I on a complete wrong track and should look for caching of the
 rendered HTML code on a component basis?

 Thanks in advance for sharing your knowledge/experience.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Cache-menu-tp2130976p2130976.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: Cache menu

2010-05-05 Thread Igor Vaynberg
cache whatever holds the actual data. for example in our code we have
a menu and that takes IModelMenuRoot, and using menu root object it
can render the entire menu by traversing it. store the MenuRoot in
session.

-igor

On Wed, May 5, 2010 at 6:55 AM, Wolfgang wolfgang.bue...@exedio.com wrote:

 I'm working on a web site that has a menu bar with sub-items, and
 sub-sub-items. The configuration of this menu is computed from hilariously
 complex SQL queries and needs quite some time to be established. The menu
 looks different for each user (session) but stays the same for the lifetime
 of the session. So it's time for caching as this menu shows up on most of
 the pages.

 From other posts on this site I've taken that it's not a good idea to share
 the components that represent the menu among different pages. Now I wonder
 on which level I can cache and re-use objects.

 Is it advisable to share models (in the Wicket sense), i.e. store the menu
 models on the session and construct the menu components according to their
 information for every page?

 Or do I have to create separate, Wicket-independent data structures that
 hold the menu structure information and store it on the session or in the
 database?

 Or am I on a complete wrong track and should look for caching of the
 rendered HTML code on a component basis?

 Thanks in advance for sharing your knowledge/experience.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Cache-menu-tp2130976p2130976.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



Caching menu

2010-05-05 Thread Wolfgang

I'm working on a web site that has a menu bar with sub-items, and
sub-sub-items. The configuration of this menu is computed from hilariously
complex SQL queries and needs quite some time to be established. The menu
looks different for each user (session) but stays the same for the lifetime
of the session. So it's time for caching as this menu shows up on most of
the pages.

From other posts on this site I've taken that it's not a good idea to share
the components that represent the menu among different pages. Now I wonder
on which level I can cache and re-use objects.

Is it advisable to share models (in the Wicket sense), i.e. store the menu
models on the session and construct the menu components according to their
information for every page?

Or do I have to create separate, Wicket-independent data structures that
hold the menu structure information and store it on the session or in the
database?

Or am I on a complete wrong track and should look for caching of the
rendered HTML code on a component basis?

Thanks in advance for sharing your knowledge/experience.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Caching-menu-tp2130813p2130813.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



Menu other than YUI

2010-03-15 Thread Josh Chappelle
Hi,

 

I'm unable to get wicket-datetime DatePicker to work with the YUI menu for
wicket 1.4.7. So it's either not upgrade to 1.4.7 or use a menu other than
YUI. I noticed that the javascript for YUI in 1.4 was pretty bulky and a
significant increase from 1.3 so I'm kind of ok with replacing it.

 

Is anyone using a menu component that allows for submenus other than YUI
that works for wicket 1.4?

 

Thanks,

 

Josh



best practice for a simple menu

2010-02-07 Thread Andreas Lüdtke
I'm relatively new to wicket and I want to build a menu in my webapp that
looks similar to the menu of xing (start search messages...).
My existing webapp has an abstract base page with a header panel and a footer
panel. Inbetween is the body for the real pages. This works so far, but I
have problems with the realization of the menu that should reside in a
separate navigation panel.
First I tried the TabPanel example (which worked) but that is only switching
between Panels instead of switching between Pages, which I need to make these
pages bookmarkable. 

So if someone would be so kind and share his/her expertise, I would be really
glad. All the examples I found didn't helped me.

Thanks in advance

Andreas


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



  1   2   3   >