adding ajaxindicator to dropdownchoice

2009-09-24 Thread Jason Novotny


Hi,

   I have a DropDownChoice that triggers an ajax event to occur using 
the  AjaxFormComponentUpdatingBehavior. Since the event takes a little 
while to complete, I'd like to display  an ajaxindicator similar to an 
IndicatingAjaxButton next to it... how can this be done?


   Thanks, Jason

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



Re: adding ajaxindicator to dropdownchoice

2009-09-24 Thread Peter Thomas
On Thu, Sep 24, 2009 at 11:40 AM, Jason Novotny jason.novo...@gmail.comwrote:


 Hi,

   I have a DropDownChoice that triggers an ajax event to occur using the
  AjaxFormComponentUpdatingBehavior. Since the event takes a little while to
 complete, I'd like to display  an ajaxindicator similar to an
 IndicatingAjaxButton next to it... how can this be done?


Have a look at this code, line #137 and #159

http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/MainPage.java#137

In the HTML, use something like:

img id=spinner src=img/spinner.gif style=display:none/

You can also use an Image component and get the markupId generated by wicket
instead of hardcoding spinner etc.  Hope this helps.

- Peter.




   Thanks, Jason

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




Re: adding ajaxindicator to dropdownchoice

2009-09-24 Thread Jason Novotny


   Thanks! That got me in the right direction-- I basically copied 
IndicatingAjaxLink and made a IndicatingDropDownChoice below... seems 
like it would be good to have as part of the default widget set...


public class IndicatingDropDownChoiceT extends DropDownChoiceT 
implements IAjaxIndicatorAware {


   private final AjaxIndicatorAppender indicatorAppender = new 
AjaxIndicatorAppender();
  
   public IndicatingDropDownChoice(final String id) {

   super(id);
   add(indicatorAppender);
   }

   /**
* @see 
org.apache.wicket.markup.html.form.AbstractChoice#AbstractChoice(String, 
java.util.List)

*/
   public IndicatingDropDownChoice(final String id, final List? 
extends T choices)

   {
   super(id, choices);
   add(indicatorAppender);
   }

   /**
* @see 
org.apache.wicket.ajax.IAjaxIndicatorAware#getAjaxIndicatorMarkupId()

*/
   public String getAjaxIndicatorMarkupId()
   {
   return indicatorAppender.getMarkupId();
   }
}


Peter Thomas wrote:

On Thu, Sep 24, 2009 at 11:40 AM, Jason Novotny jason.novo...@gmail.comwrote:

  

Hi,

  I have a DropDownChoice that triggers an ajax event to occur using the
 AjaxFormComponentUpdatingBehavior. Since the event takes a little while to
complete, I'd like to display  an ajaxindicator similar to an
IndicatingAjaxButton next to it... how can this be done?




Have a look at this code, line #137 and #159

http://code.google.com/p/perfbench/source/browse/trunk/perfbench/wicket-jpa/src/main/java/wicketjpa/wicket/MainPage.java#137

In the HTML, use something like:

img id=spinner src=img/spinner.gif style=display:none/

You can also use an Image component and get the markupId generated by wicket
instead of hardcoding spinner etc.  Hope this helps.

- Peter.



  

  Thanks, Jason

-
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