Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune

Sooo...getAjaxCallDecorator() is in AjaxPagingNavigationBehavior, which is
constructed in AjaxPagingNavigationLink, which is constructed in
AjaxPagingNavigator.newPagingNavigatorLink(), which my  subclass overrides.
Is there a way to add this decorator without having to pass an object up the
whole chain or duplicate all the constructor code in
AjaxPagingNavigator.newPagingNavigatorLink()?




James McLaughlin-3 wrote:
 
 If you mean getAjaxCallDecorator(), it is surely there. Just override
 it to return your implementation of AjaxCallDecorator. To add to the
 onclick, you will need to override the decorateScript method of
 AjaxCallDecorator.
 
 best,
 jim
 
 On 5/30/07, Tremelune [EMAIL PROTECTED] wrote:

 I'm looking to add an additional script to the onclick of a (paging) ajax
 link. I stumbled on this thread:

 http://www.nabble.com/Appending-to-AJAX-Submit-Button-onclick-tf1695285.html#a4600751

 I can't seem to find the additional code in 1.3. The thread is a year
 old,
 perhaps the code was discarded. Is there a new and better way to add
 additional onclick scripting somewhere else?
 --
 View this message in context:
 http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10883013
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10896587
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
Is this not possible for you:

protected Link newPagingNavigationLink(String id, IPageable pageable,
int pageNumber)
{
return new AjaxPagingNavigationLink(id, pageable, pageNumber) {

  @Override
  protected IAjaxCallDecorator getAjaxCallDecorator() {
return new MyBrilliantAjaxPagingCallDecorator();
  }
   };
}

best,
jim

On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:

 Sooo...getAjaxCallDecorator() is in AjaxPagingNavigationBehavior, which is
 constructed in AjaxPagingNavigationLink, which is constructed in
 AjaxPagingNavigator.newPagingNavigatorLink(), which my  subclass overrides.
 Is there a way to add this decorator without having to pass an object up the
 whole chain or duplicate all the constructor code in
 AjaxPagingNavigator.newPagingNavigatorLink()?




 James McLaughlin-3 wrote:
 
  If you mean getAjaxCallDecorator(), it is surely there. Just override
  it to return your implementation of AjaxCallDecorator. To add to the
  onclick, you will need to override the decorateScript method of
  AjaxCallDecorator.
 
  best,
  jim
 
  On 5/30/07, Tremelune [EMAIL PROTECTED] wrote:
 
  I'm looking to add an additional script to the onclick of a (paging) ajax
  link. I stumbled on this thread:
 
  http://www.nabble.com/Appending-to-AJAX-Submit-Button-onclick-tf1695285.html#a4600751
 
  I can't seem to find the additional code in 1.3. The thread is a year
  old,
  perhaps the code was discarded. Is there a new and better way to add
  additional onclick scripting somewhere else?
  --
  View this message in context:
  http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10883013
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

 --
 View this message in context: 
 http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10896587
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune

I misspoke a earlier, the method I need to override is
newPagingNavigationIncrementLink(). Looks like this:

public AjaxPagingNavigationIncrementLink(final String id, final 
IPageable
pageable, final int increment)
{
super(id, pageable, increment);
add(new AjaxPagingNavigationBehavior(this, pageable, 
onclick));

setOutputMarkupId(true);
}

Because the behavior is plugged into the constructor, there isn't anything I
can override to change that, unless I duplicate the code in this constructor
elsewhere. I may try using mouseup or onblur or something...My end goal is
to use Scriptaculous to fade from one page to the next.




James McLaughlin-3 wrote:
 
 Is this not possible for you:
 
   protected Link newPagingNavigationLink(String id, IPageable pageable,
 int pageNumber)
   {
   return new AjaxPagingNavigationLink(id, pageable, pageNumber) {
 
   @Override
   protected IAjaxCallDecorator
 getAjaxCallDecorator() {
 return new
 MyBrilliantAjaxPagingCallDecorator();
   }
};
   }
 
 best,
 jim
 
 On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:

 Sooo...getAjaxCallDecorator() is in AjaxPagingNavigationBehavior, which
 is
 constructed in AjaxPagingNavigationLink, which is constructed in
 AjaxPagingNavigator.newPagingNavigatorLink(), which my  subclass
 overrides.
 Is there a way to add this decorator without having to pass an object up
 the
 whole chain or duplicate all the constructor code in
 AjaxPagingNavigator.newPagingNavigatorLink()?




 James McLaughlin-3 wrote:
 
  If you mean getAjaxCallDecorator(), it is surely there. Just override
  it to return your implementation of AjaxCallDecorator. To add to the
  onclick, you will need to override the decorateScript method of
  AjaxCallDecorator.
 
  best,
  jim
 
  On 5/30/07, Tremelune [EMAIL PROTECTED] wrote:
 
  I'm looking to add an additional script to the onclick of a (paging)
 ajax
  link. I stumbled on this thread:
 
 
 http://www.nabble.com/Appending-to-AJAX-Submit-Button-onclick-tf1695285.html#a4600751
 
  I can't seem to find the additional code in 1.3. The thread is a year
  old,
  perhaps the code was discarded. Is there a new and better way to add
  additional onclick scripting somewhere else?
  --
  View this message in context:
 
 http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10883013
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 
 -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
 -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

 --
 View this message in context:
 http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10896587
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10897476
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
Yeah, I see what you mean. The AjaxPagingNavigationIncrementLink is
not really an AjaxLink, but has had an AjaxBehavior grafted in. I
think your best bet would be to build a PagingNavigationIncrementLink
and add a behavior similar to AjaxPagingNavigationBehavior to it, but
with the scriptaculous stuff added in as well.

hth,
jim


On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:

 I misspoke a earlier, the method I need to override is
 newPagingNavigationIncrementLink(). Looks like this:

 public AjaxPagingNavigationIncrementLink(final String id, final 
 IPageable
 pageable, final int increment)
 {
 super(id, pageable, increment);
 add(new AjaxPagingNavigationBehavior(this, pageable, 
 onclick));

 setOutputMarkupId(true);
 }

 Because the behavior is plugged into the constructor, there isn't anything I
 can override to change that, unless I duplicate the code in this constructor
 elsewhere. I may try using mouseup or onblur or something...My end goal is
 to use Scriptaculous to fade from one page to the next.




 James McLaughlin-3 wrote:
 
  Is this not possible for you:
 
protected Link newPagingNavigationLink(String id, IPageable pageable,
  int pageNumber)
{
return new AjaxPagingNavigationLink(id, pageable, pageNumber) 
  {
 
@Override
protected IAjaxCallDecorator
  getAjaxCallDecorator() {
  return new
  MyBrilliantAjaxPagingCallDecorator();
}
 };
}
 
  best,
  jim
 
  On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:
 
  Sooo...getAjaxCallDecorator() is in AjaxPagingNavigationBehavior, which
  is
  constructed in AjaxPagingNavigationLink, which is constructed in
  AjaxPagingNavigator.newPagingNavigatorLink(), which my  subclass
  overrides.
  Is there a way to add this decorator without having to pass an object up
  the
  whole chain or duplicate all the constructor code in
  AjaxPagingNavigator.newPagingNavigatorLink()?
 
 
 
 
  James McLaughlin-3 wrote:
  
   If you mean getAjaxCallDecorator(), it is surely there. Just override
   it to return your implementation of AjaxCallDecorator. To add to the
   onclick, you will need to override the decorateScript method of
   AjaxCallDecorator.
  
   best,
   jim
  
   On 5/30/07, Tremelune [EMAIL PROTECTED] wrote:
  
   I'm looking to add an additional script to the onclick of a (paging)
  ajax
   link. I stumbled on this thread:
  
  
  http://www.nabble.com/Appending-to-AJAX-Submit-Button-onclick-tf1695285.html#a4600751
  
   I can't seem to find the additional code in 1.3. The thread is a year
   old,
   perhaps the code was discarded. Is there a new and better way to add
   additional onclick scripting somewhere else?
   --
   View this message in context:
  
  http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10883013
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
  
  -
   This SF.net email is sponsored by DB2 Express
   Download DB2 Express C - the FREE version of DB2 express and take
   control of your XML. No limits. Just data. Click to get it now.
   http://sourceforge.net/powerbar/db2/
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
  
  -
   This SF.net email is sponsored by DB2 Express
   Download DB2 Express C - the FREE version of DB2 express and take
   control of your XML. No limits. Just data. Click to get it now.
   http://sourceforge.net/powerbar/db2/
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
 
  --
  View this message in context:
  http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10896587
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  

Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune

Well, that works...I think this would be made easier if there were a
getAjaxBehavior() method in AjaxPagingNavigationIncrementLink. As it stands,
there are a few methods in my class that were copied/pasted directly from
AjaxPagingNavigationLink:

public class DecoratableAjaxPagingNavigationIncrementLink extends
PagingNavigationIncrementLink
implements IAjaxLink {

  public DecoratableAjaxPagingNavigationIncrementLink(final String id, final
IPageable pageable,
  final int increment) {
super(id, pageable, increment);

//Adds more text to onclick attribute
final AjaxCallDecorator decorator = new AjaxCallDecorator() {
  public CharSequence decorateScript(final CharSequence charSequence) {
CharSequence ajaxCall = super.decorateScript(charSequence);
return ajaxCall + more onclick stuff;
  }
};

//Adds onclick attribute
final AjaxPagingNavigationBehavior behavior =
new AjaxPagingNavigationBehavior(this, pageable, onclick) {
  protected IAjaxCallDecorator getAjaxCallDecorator() {
return decorator;
  }
};

//The rest of this class is direct from AjaxPagingNavigatorLink

add(behavior);
setOutputMarkupId(true);
  }


  protected String getEventHandler(String defaultHandler) {
return defaultHandler;
  }

  public void onClick() {
onClick(null);
setRedirect(false);
setResponsePage(getPage());
  }

  public void onClick(AjaxRequestTarget target) {
pageable.setCurrentPage(getPageNumber());
  }
}




James McLaughlin-3 wrote:
 
 Yeah, I see what you mean. The AjaxPagingNavigationIncrementLink is
 not really an AjaxLink, but has had an AjaxBehavior grafted in. I
 think your best bet would be to build a PagingNavigationIncrementLink
 and add a behavior similar to AjaxPagingNavigationBehavior to it, but
 with the scriptaculous stuff added in as well.
 
 hth,
 jim
 


On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:

 I misspoke a earlier, the method I need to override is
 newPagingNavigationIncrementLink(). Looks like this:

 public AjaxPagingNavigationIncrementLink(final String id, final
 IPageable
 pageable, final int increment)
 {
 super(id, pageable, increment);
 add(new AjaxPagingNavigationBehavior(this, pageable,
 onclick));

 setOutputMarkupId(true);
 }

 Because the behavior is plugged into the constructor, there isn't anything
 I
 can override to change that, unless I duplicate the code in this
 constructor
 elsewhere. I may try using mouseup or onblur or something...My end goal is
 to use Scriptaculous to fade from one page to the next.

-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10899846
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune

Scratch that, the solution below causes a page refresh...
getAjaxCallDecorator() returns new CancelEventIfNoAjaxDecorator() it works
fine, but if it returns the defined decorator, the page refreshes after the
ajax call is complete. Why would that be? Should decorator extend
CancelEventIfNoAjaxDecorator??




Tremelune wrote:
 
 Well, that works...I think this would be made easier if there were a
 getAjaxBehavior() method in AjaxPagingNavigationIncrementLink. As it
 stands, there are a few methods in my class that were copied/pasted
 directly from AjaxPagingNavigationLink:
 
 public class DecoratableAjaxPagingNavigationIncrementLink extends
 PagingNavigationIncrementLink
 implements IAjaxLink {
 
   public DecoratableAjaxPagingNavigationIncrementLink(final String id,
 final IPageable pageable,
   final int increment)
 {
 super(id, pageable, increment);
 
 //Adds more text to onclick attribute
 final AjaxCallDecorator decorator = new AjaxCallDecorator() {
   public CharSequence decorateScript(final CharSequence charSequence)
 {
 CharSequence ajaxCall = super.decorateScript(charSequence);
 return ajaxCall + more onclick stuff;
   }
 };
 
 //Adds onclick attribute
 final AjaxPagingNavigationBehavior behavior =
 new AjaxPagingNavigationBehavior(this, pageable, onclick) {
   protected IAjaxCallDecorator getAjaxCallDecorator() {
 return decorator;
   }
 };
 
 //The rest of this class is direct from AjaxPagingNavigatorLink
 
 add(behavior);
 setOutputMarkupId(true);
   }
 
 
   protected String getEventHandler(String defaultHandler) {
 return defaultHandler;
   }
 
   public void onClick() {
 onClick(null);
 setRedirect(false);
 setResponsePage(getPage());
   }
 
   public void onClick(AjaxRequestTarget target) {
 pageable.setCurrentPage(getPageNumber());
   }
 }
 
-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901080
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
From what I can tell, since it is not really an ajax link but rather a
regular link with an ajax behavior, the ajax behavior needs to prevent
the onclick from bubbling to the anchors clickhandler. Your
ajaxcalldecorator will need to do that as well. It would be great if
once you are done you could create an rfe in jira with the
enhancements that will make this process easier.

jim

On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:

 Scratch that, the solution below causes a page refresh...
 getAjaxCallDecorator() returns new CancelEventIfNoAjaxDecorator() it works
 fine, but if it returns the defined decorator, the page refreshes after the
 ajax call is complete. Why would that be? Should decorator extend
 CancelEventIfNoAjaxDecorator??




 Tremelune wrote:
 
  Well, that works...I think this would be made easier if there were a
  getAjaxBehavior() method in AjaxPagingNavigationIncrementLink. As it
  stands, there are a few methods in my class that were copied/pasted
  directly from AjaxPagingNavigationLink:
 
  public class DecoratableAjaxPagingNavigationIncrementLink extends
  PagingNavigationIncrementLink
  implements IAjaxLink {
 
public DecoratableAjaxPagingNavigationIncrementLink(final String id,
  final IPageable pageable,
final int increment)
  {
  super(id, pageable, increment);
 
  //Adds more text to onclick attribute
  final AjaxCallDecorator decorator = new AjaxCallDecorator() {
public CharSequence decorateScript(final CharSequence charSequence)
  {
  CharSequence ajaxCall = super.decorateScript(charSequence);
  return ajaxCall + more onclick stuff;
}
  };
 
  //Adds onclick attribute
  final AjaxPagingNavigationBehavior behavior =
  new AjaxPagingNavigationBehavior(this, pageable, onclick) {
protected IAjaxCallDecorator getAjaxCallDecorator() {
  return decorator;
}
  };
 
  //The rest of this class is direct from AjaxPagingNavigatorLink
 
  add(behavior);
  setOutputMarkupId(true);
}
 
 
protected String getEventHandler(String defaultHandler) {
  return defaultHandler;
}
 
public void onClick() {
  onClick(null);
  setRedirect(false);
  setResponsePage(getPage());
}
 
public void onClick(AjaxRequestTarget target) {
  pageable.setCurrentPage(getPageNumber());
}
  }
 
 --
 View this message in context: 
 http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901080
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune

Fixed this last bit by wrapping the return call decorator in a CancelEvent
one (it chains):

final AjaxPagingNavigationBehavior behavior =
new AjaxPagingNavigationBehavior(this, pageable, onclick) {
  protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelEventIfNoAjaxDecorator(decorator);
  }
};




James McLaughlin-3 wrote:
 
From what I can tell, since it is not really an ajax link but rather a
 regular link with an ajax behavior, the ajax behavior needs to prevent
 the onclick from bubbling to the anchors clickhandler. Your
 ajaxcalldecorator will need to do that as well. It would be great if
 once you are done you could create an rfe in jira with the
 enhancements that will make this process easier.
 
 jim
 
 

-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901678
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread Tremelune

I doubt I've enhanced anything. This is a rather roundabout solution at
best...You mean edit the Wicket source and post it somewhere?




James McLaughlin-3 wrote:
 
From what I can tell, since it is not really an ajax link but rather a
 regular link with an ajax behavior, the ajax behavior needs to prevent
 the onclick from bubbling to the anchors clickhandler. Your
 ajaxcalldecorator will need to do that as well. It would be great if
 once you are done you could create an rfe in jira with the
 enhancements that will make this process easier.
 
 jim
 
 On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:

 Scratch that, the solution below causes a page refresh...
 getAjaxCallDecorator() returns new CancelEventIfNoAjaxDecorator() it
 works
 fine, but if it returns the defined decorator, the page refreshes after
 the
 ajax call is complete. Why would that be? Should decorator extend
 CancelEventIfNoAjaxDecorator??




 Tremelune wrote:
 
  Well, that works...I think this would be made easier if there were a
  getAjaxBehavior() method in AjaxPagingNavigationIncrementLink. As it
  stands, there are a few methods in my class that were copied/pasted
  directly from AjaxPagingNavigationLink:
 
  public class DecoratableAjaxPagingNavigationIncrementLink extends
  PagingNavigationIncrementLink
  implements IAjaxLink {
 
public DecoratableAjaxPagingNavigationIncrementLink(final String id,
  final IPageable pageable,
final int
 increment)
  {
  super(id, pageable, increment);
 
  //Adds more text to onclick attribute
  final AjaxCallDecorator decorator = new AjaxCallDecorator() {
public CharSequence decorateScript(final CharSequence
 charSequence)
  {
  CharSequence ajaxCall = super.decorateScript(charSequence);
  return ajaxCall + more onclick stuff;
}
  };
 
  //Adds onclick attribute
  final AjaxPagingNavigationBehavior behavior =
  new AjaxPagingNavigationBehavior(this, pageable, onclick) {
protected IAjaxCallDecorator getAjaxCallDecorator() {
  return decorator;
}
  };
 
  //The rest of this class is direct from AjaxPagingNavigatorLink
 
  add(behavior);
  setOutputMarkupId(true);
}
 
 
protected String getEventHandler(String defaultHandler) {
  return defaultHandler;
}
 
public void onClick() {
  onClick(null);
  setRedirect(false);
  setResponsePage(getPage());
}
 
public void onClick(AjaxRequestTarget target) {
  pageable.setCurrentPage(getPageNumber());
}
  }
 
 --
 View this message in context:
 http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901080
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901775
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Adding more onclick script to ajax link?

2007-05-31 Thread James McLaughlin
Well, it should be much easier to get the AjaxBehavior that is making
the PagingNavigatorLink act like an ajax link, so you can decorate the
onclick in the manner you suggested. You can create a jira issue here
http://issues.apache.org/jira/browse/WICKET

Describe your problem, what would make an elegant solution, and mark
it as an enhancement.

best,
jim

On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:

 I doubt I've enhanced anything. This is a rather roundabout solution at
 best...You mean edit the Wicket source and post it somewhere?




 James McLaughlin-3 wrote:
 
 From what I can tell, since it is not really an ajax link but rather a
  regular link with an ajax behavior, the ajax behavior needs to prevent
  the onclick from bubbling to the anchors clickhandler. Your
  ajaxcalldecorator will need to do that as well. It would be great if
  once you are done you could create an rfe in jira with the
  enhancements that will make this process easier.
 
  jim
 
  On 5/31/07, Tremelune [EMAIL PROTECTED] wrote:
 
  Scratch that, the solution below causes a page refresh...
  getAjaxCallDecorator() returns new CancelEventIfNoAjaxDecorator() it
  works
  fine, but if it returns the defined decorator, the page refreshes after
  the
  ajax call is complete. Why would that be? Should decorator extend
  CancelEventIfNoAjaxDecorator??
 
 
 
 
  Tremelune wrote:
  
   Well, that works...I think this would be made easier if there were a
   getAjaxBehavior() method in AjaxPagingNavigationIncrementLink. As it
   stands, there are a few methods in my class that were copied/pasted
   directly from AjaxPagingNavigationLink:
  
   public class DecoratableAjaxPagingNavigationIncrementLink extends
   PagingNavigationIncrementLink
   implements IAjaxLink {
  
 public DecoratableAjaxPagingNavigationIncrementLink(final String id,
   final IPageable pageable,
 final int
  increment)
   {
   super(id, pageable, increment);
  
   //Adds more text to onclick attribute
   final AjaxCallDecorator decorator = new AjaxCallDecorator() {
 public CharSequence decorateScript(final CharSequence
  charSequence)
   {
   CharSequence ajaxCall = super.decorateScript(charSequence);
   return ajaxCall + more onclick stuff;
 }
   };
  
   //Adds onclick attribute
   final AjaxPagingNavigationBehavior behavior =
   new AjaxPagingNavigationBehavior(this, pageable, onclick) {
 protected IAjaxCallDecorator getAjaxCallDecorator() {
   return decorator;
 }
   };
  
   //The rest of this class is direct from AjaxPagingNavigatorLink
  
   add(behavior);
   setOutputMarkupId(true);
 }
  
  
 protected String getEventHandler(String defaultHandler) {
   return defaultHandler;
 }
  
 public void onClick() {
   onClick(null);
   setRedirect(false);
   setResponsePage(getPage());
 }
  
 public void onClick(AjaxRequestTarget target) {
   pageable.setCurrentPage(getPageNumber());
 }
   }
  
  --
  View this message in context:
  http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901080
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 

 --
 View this message in context: 
 http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10901775
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This 

[Wicket-user] Adding more onclick script to ajax link?

2007-05-30 Thread Tremelune

I'm looking to add an additional script to the onclick of a (paging) ajax
link. I stumbled on this thread:

http://www.nabble.com/Appending-to-AJAX-Submit-Button-onclick-tf1695285.html#a4600751

I can't seem to find the additional code in 1.3. The thread is a year old,
perhaps the code was discarded. Is there a new and better way to add
additional onclick scripting somewhere else?
-- 
View this message in context: 
http://www.nabble.com/Adding-more-onclick-script-to-ajax-link--tf3843103.html#a10883013
Sent from the Wicket - User mailing list archive at Nabble.com.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user