Re: Generate ajax link

2011-07-15 Thread Martin Grigorov
This JavaScript is generated by AbstractDefaultAjaxBehavior.

On Thu, Jul 14, 2011 at 11:26 PM, Lurtz Nazgul lu...@ymail.com wrote:
 Thanks Martin; but it doesn't make sense to me, sorry.

 Wicket generates below code for a simple counter increment example.

  var wcall =
 wicketAjaxGet('?wicket:interface=:2:panel1:okla::IBehaviorListener:0:',
The first parameter is the callback url to the ajax behavior.
This means: find the first behavior in component with id 'okla' which
is in component with id 'panel1' which is in page with id 2.
 function() {
            }.bind(this),
The first function is the onSuccess callback
function() {
            }.bind(this),
The second is the onFailure callback
function() {
                return Wicket.$('okla') != null;
            }.bind(this));
The last is the precondition: execute the Ajax request only if there
is an HTMLElement with id 'okla' in the DOM.
            return !wcall;

Just the callback url is mandatory parameter, all other can be null.

 Any suggestions ?

 Thanks.



 
 From: Martin Grigorov mgrigo...@apache.org
 To: users@wicket.apache.org
 Sent: Thu, July 14, 2011 2:46:04 PM
 Subject: Re: Generate ajax link

 See how AjaxLink generates its markup.

 On Thu, Jul 14, 2011 at 2:31 PM, Lurtz Nazgul lu...@ymail.com wrote:
 I mean; generating ajax link  format

 Instead of

 lia href='?thePanel=com.test.PanelOne'/a/li

 I want to generate ajax link on the fly

 Example :
 a onclick=var
 wcall=wicketAjaxGet('wicket/page?2-1.IBehaviorListener.0-c1--link',function()
 {
 }.bind(this),function() { }.bind(this), function() {return Wicket.$('idc') !=
 null;}.bind(this));return !wcall; id=idc href=#increment/a

 Any suggestions ?

 Thanks.




 
 From: Andrea Del Bene adelb...@ciseonweb.it
 To: users@wicket.apache.org
 Sent: Thu, July 14, 2011 2:00:32 PM
 Subject: Re: Generate ajax link

 Hi,

 you can use Loop component to generate a dynamic number of links. For 
 example:



 HTML code:

 ol title=Menù class=main_menu
 li style=list-style: none; wicket:id=itemList
 a wicket:id=menuItem/a
 /li
 /ol



 Java  code:


 ListAbstractLink linkList = ...
 Loop loop = new Loop(itemList, linkList.size()) {
                @Override
                protected void populateItem(LoopItem item) {
                    AbstractLink curLink = linkList.get(item.getIndex());
                    item.add(curLink);
                }
            };



 Hi all;

 I can generate normal links in to my dynamic menu

 lia href='?thePanel=com.test.PanelOne'/a/li
 ...

 I wonder if i can generate those links in ajax link format ?

 Thanks.


 -
 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



-- 
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: Generate ajax link

2011-07-14 Thread Andrea Del Bene

Hi,

you can use Loop component to generate a dynamic number of links. For 
example:




HTML code:

ol title=Menù class=main_menu
li style=list-style: none; wicket:id=itemList
a wicket:id=menuItem/a
/li
/ol



Java  code:


 ListAbstractLink linkList = ...
Loop loop = new Loop(itemList, linkList.size()) {
@Override
protected void populateItem(LoopItem item) {
AbstractLink curLink = linkList.get(item.getIndex());
item.add(curLink);
}
};




Hi all;

I can generate normal links in to my dynamic menu

lia href='?thePanel=com.test.PanelOne'/a/li
...

I wonder if i can generate those links in ajax link format ?

Thanks.



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



Re: Generate ajax link

2011-07-14 Thread Lurtz Nazgul
I mean; generating ajax link  format

Instead of 

lia href='?thePanel=com.test.PanelOne'/a/li

I want to generate ajax link on the fly 

Example : 
a onclick=var 
wcall=wicketAjaxGet('wicket/page?2-1.IBehaviorListener.0-c1--link',function() { 
}.bind(this),function() { }.bind(this), function() {return Wicket.$('idc') != 
null;}.bind(this));return !wcall; id=idc href=#increment/a

Any suggestions ?

Thanks.





From: Andrea Del Bene adelb...@ciseonweb.it
To: users@wicket.apache.org
Sent: Thu, July 14, 2011 2:00:32 PM
Subject: Re: Generate ajax link

Hi,

you can use Loop component to generate a dynamic number of links. For example:



HTML code:

ol title=Menù class=main_menu
li style=list-style: none; wicket:id=itemList
a wicket:id=menuItem/a
/li
/ol



Java  code:


ListAbstractLink linkList = ...
Loop loop = new Loop(itemList, linkList.size()) {
@Override
protected void populateItem(LoopItem item) {
AbstractLink curLink = linkList.get(item.getIndex());
item.add(curLink);
}
};



 Hi all;
 
 I can generate normal links in to my dynamic menu
 
 lia href='?thePanel=com.test.PanelOne'/a/li
 ...
 
 I wonder if i can generate those links in ajax link format ?
 
 Thanks.


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

Re: Generate ajax link

2011-07-14 Thread Martin Grigorov
See how AjaxLink generates its markup.

On Thu, Jul 14, 2011 at 2:31 PM, Lurtz Nazgul lu...@ymail.com wrote:
 I mean; generating ajax link  format

 Instead of

 lia href='?thePanel=com.test.PanelOne'/a/li

 I want to generate ajax link on the fly

 Example :
 a onclick=var
 wcall=wicketAjaxGet('wicket/page?2-1.IBehaviorListener.0-c1--link',function() 
 {
 }.bind(this),function() { }.bind(this), function() {return Wicket.$('idc') !=
 null;}.bind(this));return !wcall; id=idc href=#increment/a

 Any suggestions ?

 Thanks.




 
 From: Andrea Del Bene adelb...@ciseonweb.it
 To: users@wicket.apache.org
 Sent: Thu, July 14, 2011 2:00:32 PM
 Subject: Re: Generate ajax link

 Hi,

 you can use Loop component to generate a dynamic number of links. For example:



 HTML code:

 ol title=Menù class=main_menu
 li style=list-style: none; wicket:id=itemList
 a wicket:id=menuItem/a
 /li
 /ol



 Java  code:


 ListAbstractLink linkList = ...
 Loop loop = new Loop(itemList, linkList.size()) {
                @Override
                protected void populateItem(LoopItem item) {
                    AbstractLink curLink = linkList.get(item.getIndex());
                    item.add(curLink);
                }
            };



 Hi all;

 I can generate normal links in to my dynamic menu

 lia href='?thePanel=com.test.PanelOne'/a/li
 ...

 I wonder if i can generate those links in ajax link format ?

 Thanks.


 -
 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: Generate ajax link

2011-07-14 Thread Lurtz Nazgul
Thanks Martin; but it doesn't make sense to me, sorry.

Wicket generates below code for a simple counter increment example.

 var wcall = 
wicketAjaxGet('?wicket:interface=:2:panel1:okla::IBehaviorListener:0:', 
function() {
}.bind(this), function() {
}.bind(this), function() {
return Wicket.$('okla') != null;
}.bind(this));
return !wcall;

Any suggestions ? 

Thanks.




From: Martin Grigorov mgrigo...@apache.org
To: users@wicket.apache.org
Sent: Thu, July 14, 2011 2:46:04 PM
Subject: Re: Generate ajax link

See how AjaxLink generates its markup.

On Thu, Jul 14, 2011 at 2:31 PM, Lurtz Nazgul lu...@ymail.com wrote:
 I mean; generating ajax link  format

 Instead of

 lia href='?thePanel=com.test.PanelOne'/a/li

 I want to generate ajax link on the fly

 Example :
 a onclick=var
 wcall=wicketAjaxGet('wicket/page?2-1.IBehaviorListener.0-c1--link',function() 
{
 }.bind(this),function() { }.bind(this), function() {return Wicket.$('idc') !=
 null;}.bind(this));return !wcall; id=idc href=#increment/a

 Any suggestions ?

 Thanks.




 
 From: Andrea Del Bene adelb...@ciseonweb.it
 To: users@wicket.apache.org
 Sent: Thu, July 14, 2011 2:00:32 PM
 Subject: Re: Generate ajax link

 Hi,

 you can use Loop component to generate a dynamic number of links. For example:



 HTML code:

 ol title=Menù class=main_menu
 li style=list-style: none; wicket:id=itemList
 a wicket:id=menuItem/a
 /li
 /ol



 Java  code:


 ListAbstractLink linkList = ...
 Loop loop = new Loop(itemList, linkList.size()) {
@Override
protected void populateItem(LoopItem item) {
AbstractLink curLink = linkList.get(item.getIndex());
item.add(curLink);
}
};



 Hi all;

 I can generate normal links in to my dynamic menu

 lia href='?thePanel=com.test.PanelOne'/a/li
 ...

 I wonder if i can generate those links in ajax link format ?

 Thanks.


 -
 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