Re: Resource JS

2010-01-26 Thread nino martinez wael
Should be the same thing..

2010/1/26 Douglas Ferguson doug...@douglasferguson.us

 I'm using modjk.


 On Jan 25, 2010, at 4:05 PM, Jeremy Thomerson wrote:

  How are you frontending Tomcat with Apache?  If it's by proxying, you may
  just be able to configure it to do the gzip for you on anything in the
  resources directory.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Sun, Jan 24, 2010 at 10:30 PM, Douglas Ferguson 
  doug...@douglasferguson.us wrote:
 
  Hmm... Actually, I'm wanting to gzip them are they gziped?
 
  Another thought was to do something like this:
 
  Alias /resources/com.package/
  /user/local/tomcat5.5/webapps/resources/path/to/package
 
  So that apache can serve up the static content..
 
  D/
 
  On Jan 24, 2010, at 9:18 AM, Martin Grigorov wrote:
 
  On Sun, 2010-01-24 at 03:19 -0800, Douglas Ferguson wrote:
  I recently configured apache to gzip my js files instead of going
  through tomcat.
 
  Can this be done for the js files that are loaded as resources?
  see
  Application.get().getResourceSettings().getJavascriptCompressor()
 
  if this returns null then any JavascriptPackageResource will be not
  compressed
 
  D/
  -
  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
 
 


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




Wicket, Spring 3 and UnitTesting

2010-01-26 Thread Jochen Mader
Just figured out how to do UnitTesting with Spring 3 and Wicket.
Spring 3 introduced a check to see if a given context was a
WebApplicationContext. That means ApplicationContextMock is not suitable for
testing (giving the infamous  No WebApplicationContext found: no
ContextLoaderListener registered? message).
I simply extended the class and added WebApplicationContext interface.

The following example shows how to get it going (I hope the code doesn't get
messed up):


public class TestHomePage extends TestCase {

private WicketTester tester;


 @Override

public void setUp() {

final WebApplicationContextMock appctx = new WebApplicationContextMock();


 final ServiceOfDoom mock = createMock(ServiceOfDoom.class);

expect(mock.getIt()).andReturn(whups).anyTimes();

replay(mock);

 tester = new WicketTester(new WicketApplication()) {

@Override

public ServletContext newServletContext(String path) {

MockServletContext servletContext = (MockServletContext) super

.newServletContext(path);

appctx.setServletContext(servletContext);

appctx.putBean(scratchy, mock);

servletContext

.setAttribute(

WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,

appctx);

return servletContext;

}

};

tester.getApplication().addComponentInstantiationListener(

new SpringComponentInjector(tester.getApplication(), appctx,

false));

}


 public void testRenderMyPage() {

// start and render the test page

tester.startPage(HomePage.class);


 // assert rendered page class

tester.assertRenderedPage(HomePage.class);


 // assert rendered label component

tester

.assertLabel(message,

whups);

}


 private class WebApplicationContextMock extends ApplicationContextMock

implements WebApplicationContext {

private ServletContext servletContext;


 public T T getBean(ClassT requiredType) throws BeansException {

// TODO Auto-generated method stub

return null;

}


 public A extends Annotation A findAnnotationOnBean(String beanName,

ClassA annotationType) {

// TODO Auto-generated method stub

return null;

}


 public MapString, Object getBeansWithAnnotation(

Class? extends Annotation annotationType)

throws BeansException {

// TODO Auto-generated method stub

return null;

}


 public void setServletContext(ServletContext servletContext) {

this.servletContext = servletContext;

}


 public ServletContext getServletContext() {

return null;

}


 }

}


AjaxSelfUpdatingTimerBehavior

2010-01-26 Thread Sam Barrow
Is there any way to make the AjaxSelfUpdatingTimerBehavior execute X
number of times and then stop until a page refresh/reload?



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



Re: AjaxSelfUpdatingTimerBehavior

2010-01-26 Thread Pedro Santos
You can override getPreconditionScript method to test an counter value on
document object. When you refresh the page, you got a new document.

On Tue, Jan 26, 2010 at 10:05 AM, Sam Barrow s...@sambarrow.com wrote:

 Is there any way to make the AjaxSelfUpdatingTimerBehavior execute X
 number of times and then stop until a page refresh/reload?



 -
 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: Wicket, Spring 3 and UnitTesting

2010-01-26 Thread Martin Grigorov
Please add this to http://cwiki.apache.org/WICKET/spring.html

On Tue, 2010-01-26 at 11:48 +0100, Jochen Mader wrote:
 Just figured out how to do UnitTesting with Spring 3 and Wicket.
 Spring 3 introduced a check to see if a given context was a
 WebApplicationContext. That means ApplicationContextMock is not suitable for
 testing (giving the infamous  No WebApplicationContext found: no
 ContextLoaderListener registered? message).
 I simply extended the class and added WebApplicationContext interface.
 
 The following example shows how to get it going (I hope the code doesn't get
 messed up):
 
 
 public class TestHomePage extends TestCase {
 
 private WicketTester tester;
 
 
  @Override
 
 public void setUp() {
 
 final WebApplicationContextMock appctx = new WebApplicationContextMock();
 
 
  final ServiceOfDoom mock = createMock(ServiceOfDoom.class);
 
 expect(mock.getIt()).andReturn(whups).anyTimes();
 
 replay(mock);
 
  tester = new WicketTester(new WicketApplication()) {
 
 @Override
 
 public ServletContext newServletContext(String path) {
 
 MockServletContext servletContext = (MockServletContext) super
 
 .newServletContext(path);
 
 appctx.setServletContext(servletContext);
 
 appctx.putBean(scratchy, mock);
 
 servletContext
 
 .setAttribute(
 
 WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
 
 appctx);
 
 return servletContext;
 
 }
 
 };
 
 tester.getApplication().addComponentInstantiationListener(
 
 new SpringComponentInjector(tester.getApplication(), appctx,
 
 false));
 
 }
 
 
  public void testRenderMyPage() {
 
 // start and render the test page
 
 tester.startPage(HomePage.class);
 
 
  // assert rendered page class
 
 tester.assertRenderedPage(HomePage.class);
 
 
  // assert rendered label component
 
 tester
 
 .assertLabel(message,
 
 whups);
 
 }
 
 
  private class WebApplicationContextMock extends ApplicationContextMock
 
 implements WebApplicationContext {
 
 private ServletContext servletContext;
 
 
  public T T getBean(ClassT requiredType) throws BeansException {
 
 // TODO Auto-generated method stub
 
 return null;
 
 }
 
 
  public A extends Annotation A findAnnotationOnBean(String beanName,
 
 ClassA annotationType) {
 
 // TODO Auto-generated method stub
 
 return null;
 
 }
 
 
  public MapString, Object getBeansWithAnnotation(
 
 Class? extends Annotation annotationType)
 
 throws BeansException {
 
 // TODO Auto-generated method stub
 
 return null;
 
 }
 
 
  public void setServletContext(ServletContext servletContext) {
 
 this.servletContext = servletContext;
 
 }
 
 
  public ServletContext getServletContext() {
 
 return null;
 
 }
 
 
  }
 
 }



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



Re: dynamically adding components to a ListView

2010-01-26 Thread Bert
looks as it has been solved here:

http://stackoverflow.com/questions/2114351/dynamically-add-components-to-listview-in-wicket/

bert

On Sun, Jan 24, 2010 at 13:04, Sven Meier s...@meiers.net wrote:
 Hi,

 you'll have to tell the request target which components to redraw:
 Put your list inside a markupcontainer and use addComponent().

 Sven

 zdmytriv wrote:

 Could anyone tell me why it doesn't work? Thanks

 InteractivePanelPage.html

 table
    tr
        td # Add Panel /td
    /tr
    tr wicket:id=interactiveListView
        td
                /td
    /tr
 /table

 InteractivePanelPage.java

 // ... imports
 public class InteractivePanelPage extends WebPage {
    public LinkedListInteractivePanel interactivePanels = new
 LinkedListInteractivePanel();

    private ListViewInteractivePanel interactiveList;

    public InteractivePanelPage() {
        add(new AjaxLinkString(addPanelLink) {
            private static final long serialVersionUID = 1L;

           �...@override
            public void onClick(AjaxRequestTarget target) {
                try {
                    System.out.println(link clicked);

                    InteractivePanel newInteractivePanel = new
 InteractivePanel(
                            interactiveItemPanel);
                    newInteractivePanel.setOutputMarkupId(true);


 interactiveList.getModelObject().add(newInteractivePanel);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });

        interactivePanels.add(new
 InteractivePanel(interactiveItemPanel));

        interactiveList = new
 ListViewInteractivePanel(interactiveListView,
                new PropertyModelListInteractivePanel(this,
 interactivePanels)) {
            private static final long serialVersionUID = 1L;

           �...@override
            protected void populateItem(ListItemInteractivePanel item) {
                item.add(item.getModelObject());
            }
        };

        interactiveList.setOutputMarkupId(true);

        add(interactiveList);
    }

    public ListInteractivePanel getInteractivePanels() {
        return interactivePanels;
    }
 }

 InteractivePanel.html

 html xmlns:wicket
 wicket:panel
 input type=button value=BLAAA wicket:id=simpleButton/
 /wicket:panel
 /html

 InteractivePanel.java

 // ... imports
 public class InteractivePanel extends Panel {
    private static final long serialVersionUID = 1L;

    public InteractivePanel(String id) {
        super(id);

        add(new Button(simpleButton));
    }
 }








 zkn wrote:


 On 22.01.2010, at 03:18, vasil.pup...@gmail.com wrote:




 http://old.nabble.com/dynamically-adding-components-to-a-ListView-td26626657.html

 In this post you said You found it. Could you please post how did you
 do it?

 Zinovii


 in addPanel()

 replaced
 panels.add(panel);

 with

 panels.getModelObject().add(panel);





 On 04.12.2009, at 00:17, zkn wrote:



 found it.

 On 03.12.2009, at 16:19, zkn wrote:



 Hi,

 I'm trying to dynamically add components to an existing ListView but I
 can't figure out how to do that. Here is my case:

 MyPanelContainer  class with markup

 wicket:panel
        wicket:container wicket:id=panels
                wicket:container wicket:id=panel /
        /wicket:container
         # add panel /wicket:panel

 and here is how I create the container in the constructor of my page

 ..
 MyPanelContainer container = new MyPanelContainer(panels_list_1);
 ListMyPanel panels = new ArrayListMyPanel();

 for (int j = 0; j  5; j++) {
        MyPanel panel = new MyPanel(panel);

        .

        panels.add(panel);
 .


 container.add(new ListViewMyPanel(panels, panels) {
        protected void populateItem(ListItemMyPanel item) {
                item.add( item.getModelObject());
        }
 });
 add(Container);
 ..

 This works fine and I can see all  MyPanel inside the container.

 Now I'm trying to add another MyPanel inside the container on user
 click. Here is the constructor of MyPanelContainer

 public MyPanelContainer(String id) {
                super(id);
                
                add(new Link(addPanel) {
                               �...@override
                                public void onClick() {
                                        addPanel();
                                }

                        });
 .

 ..
 public void addPanel() {

                ListView MyPanel  panels = (ListView MyPanel )
 get(panels);

                MyPanel panel = new MyPanel(panel);
                ...
                panels.add(panel);
        }

 Basically addPanel() does the same thing as in page constructor to add
 panels to the list but nothing shows up.

 Thanks in advance for your help

 Ozkan








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




RE: modal window contained and displayed by another modal window

2010-01-26 Thread Martin Asenov
Yes, in this example when it comes to closing the second modal from the 'x' 
button the callback returns false obviously. When it does not, everything gets 
messed up and middle modal gets 'page expired'. How can I close the second 
modal and get back to middle modal with no obstacles like these?

Thanks,
Martin

-Original Message-
From: Martin Grigorov [mailto:mcgreg...@e-card.bg] 
Sent: Monday, January 25, 2010 12:06 PM
To: users@wicket.apache.org
Subject: Re: modal window contained and displayed by another modal window

On Mon, 2010-01-25 at 11:26 +0200, Martin Asenov wrote:
 Hello guys!
 
 I was trying to trigger a modal window from another modal window, but on top 
 modal window closing seems like the bottom page gets refreshed, or something 
 like this, because when I click on something on the middle frame (first 
 modal) that is active after the closing of the top modal, I get something 
 like 'component not found [modal]' and get redirected to home page.
 
 Is there a way to use modal window in another modal window?
There is: http://www.wicketstuff.org/wicket14/ajax/modal-window 

But you should use ModalWindow with a Page, not with Panel.
 
 Thanks!
 
 Regards,
 Martin
 
 -
 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



RE: modal window contained and displayed by another modal window

2010-01-26 Thread Martin Asenov
Here's the code:



first modal:



public class DisplayEventsPage extends WebPage implements RepeaterHoldingPage {



public DisplayEventsPage(final ModalWindow parent) {



 ModalWindow dialog = new ModalWindow(modal);



 AjaxLinkString entryRemovalLink = new 
AjaxLinkString(event_removal_link) {



   private static final long serialVersionUID = 1L;



   @Override

   public void onClick(AjaxRequestTarget target) {



dialog.setPageCreator(new ModalWindow.PageCreator() 
{



  private final static long 
serialVersionUID = 1l;



  public Page createPage() {

  return new 
ConfirmationDialog(getString(event_deletion), dialog, DisplayEventsPage.this);

 }

});

  dialog.show(target);



}



add(entryRemovalLink);

add(dialog);

}

}



and



public class ConfirmationDialog extends WebPage {

 public ConfirmationDialog(String question, final ModalWindow parent, 
final RepeaterHoldingPage page, Object entry) {

 add(new AjaxButton(yes_button, new ModelString(getString(yes))) {



   private static final long serialVersionUID = 1l;



   @Override

   protected void onSubmit(AjaxRequestTarget target, Form? 
form) {

  parent.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback() {



   @Override

   public void 
onClose(AjaxRequestTarget target) {

page.removeItem(entry, 
target);

   }

  });



  parent.close(target);

}

   };

}

}



Obviously there's something wrong with the code. First of all the 
removeItem(entry, target) never gets called, and also, when I click on close 
button of the top modal (confirmation dialog) the middle one 
(displayeventspage) shows 'page expired' message and everything gets messed up, 
no matter if I've put closebutton callback of the top modal or not.



I would be glad if someone shed more light on this issue, because I can't solve 
it.



Thank you in advance!

BR,

Martin



-Original Message-
From: Martin Asenov [mailto:mase...@velti.com]
Sent: Tuesday, January 26, 2010 4:03 PM
To: users@wicket.apache.org; mcgreg...@e-card.bg
Subject: RE: modal window contained and displayed by another modal window



Yes, in this example when it comes to closing the second modal from the 'x' 
button the callback returns false obviously. When it does not, everything gets 
messed up and middle modal gets 'page expired'. How can I close the second 
modal and get back to middle modal with no obstacles like these?



Thanks,

Martin



-Original Message-

From: Martin Grigorov [mailto:mcgreg...@e-card.bg]

Sent: Monday, January 25, 2010 12:06 PM

To: users@wicket.apache.org

Subject: Re: modal window contained and displayed by another modal window



On Mon, 2010-01-25 at 11:26 +0200, Martin Asenov wrote:

 Hello guys!



 I was trying to trigger a modal window from another modal window, but on top 
 modal window closing seems like the bottom page gets refreshed, or something 
 like this, because when I click on something on the middle frame (first 
 modal) that is active after the closing of the top modal, I get something 
 like 'component not found [modal]' and get redirected to home page.



 Is there a way to use modal window in another modal window?

There is: http://www.wicketstuff.org/wicket14/ajax/modal-window



But you should use ModalWindow with a Page, not with Panel.



 Thanks!



 Regards,

 Martin



 -

 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




Page load after an action

2010-01-26 Thread Stéphane Jeanjean

Hello,

My page displays a list of items, for each of them, an icon is available 
to delete it. The action is managed in a Link.onClick() method.
When I click on the link, the page is refreshed but the item is always 
in my list, I have to do refresh again manually the page to have a list 
wihtout this item.


In the logs, it seems that the deletion in the onClick() method is 
called after the load of the page :(


Somebody has an idea to avoid this manual refresh ?

Thanks,

Stéphane

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



Re: Page load after an action

2010-01-26 Thread Jeremy Thomerson
You're probably not using models correctly - specifically for your list
view.  You could post some code, but make sure that you're reloading the
data for the list view after the onClick is called and the item is deleted.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:

 Hello,

 My page displays a list of items, for each of them, an icon is available to
 delete it. The action is managed in a Link.onClick() method.
 When I click on the link, the page is refreshed but the item is always in
 my list, I have to do refresh again manually the page to have a list wihtout
 this item.

 In the logs, it seems that the deletion in the onClick() method is called
 after the load of the page :(

 Somebody has an idea to avoid this manual refresh ?

 Thanks,

 Stéphane

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




Image Bundler For Apache Wicket

2010-01-26 Thread Anantha Kumaran
http://ananthakumaran.github.com/imagebundler-wicket


Should Duration be deprecated?

2010-01-26 Thread Objelean Alex
I was wondering why would wicket need Duration class as long as java
provides a similar TimeUnit. Maybe it would be a good idea to deprecate this
class  encourage usage of TimeUnit?

Alex Objelean


Re: Page load after an action

2010-01-26 Thread Stéphane Jeanjean


Please find my code just below :


public class NewsListPage  {

   protected static transient NewsDao myNewsDao;

   public NewsListPage() {
   PageableListViewNews news =
   new PageableListViewNews(list, new NewsModel(), 15){

   @Override
   protected void populateItem(final ListItemNews item) {
   ourLogger.debug(Getting item value 
+item.getModelObject().getTitle());


   News news = item.getModelObject();
  
   item.add(new Label(date, new Model(news.getDate(;
  
   LinkNews l = new LinkNews(edit){


   @Override
   public void onClick() {
   setResponsePage(new 
NewsPage(item.getModelObject()));
  
   }   
   };


   item.add(l);
   l.add(new Label(title, news.getTitle()));

   item.add(new LinkNews(delete, new Model()){

   @Override
   public void onClick() {
   // TODO : check the refresh issue
   getNewsDao().delete(item.getModelObject());
   ourLogger.debug(News deleted);
  
   }
  
   });
  
   }


  
   };


   add(news);
   add(new OrPagingNavigator(navigator, news));
  
   add(new BookmarkablePageLinkVoid(add, NewsPage.class));


  
   }


   /**
* Model for the news List to load the news from the db each time
*
*/
   public class NewsModel extends LoadableDetachableModelListNews {

   @Override
   protected ListNews load() {
   ourLogger.debug(Loading all news);
   return new NewsDao().load();
   }


   }
 
}




Jeremy Thomerson a écrit :

You're probably not using models correctly - specifically for your list
view.  You could post some code, but make sure that you're reloading the
data for the list view after the onClick is called and the item is deleted.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:

  

Hello,

My page displays a list of items, for each of them, an icon is available to
delete it. The action is managed in a Link.onClick() method.
When I click on the link, the page is refreshed but the item is always in
my list, I have to do refresh again manually the page to have a list wihtout
this item.

In the logs, it seems that the deletion in the onClick() method is called
after the load of the page :(

Somebody has an idea to avoid this manual refresh ?

Thanks,

Stéphane

-
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: modal window contained and displayed by another modal window

2010-01-26 Thread Martin Asenov
Please, can someone help me with this?

Thanks again!
Regards,
Martin

-Original Message-
From: Martin Asenov [mailto:mase...@velti.com] 
Sent: Tuesday, January 26, 2010 4:17 PM
To: users@wicket.apache.org
Subject: RE: modal window contained and displayed by another modal window

Here's the code:



first modal:



public class DisplayEventsPage extends WebPage implements RepeaterHoldingPage {



public DisplayEventsPage(final ModalWindow parent) {



 ModalWindow dialog = new ModalWindow(modal);



 AjaxLinkString entryRemovalLink = new 
AjaxLinkString(event_removal_link) {



   private static final long serialVersionUID = 1L;



   @Override

   public void onClick(AjaxRequestTarget target) {



dialog.setPageCreator(new ModalWindow.PageCreator() 
{



  private final static long 
serialVersionUID = 1l;



  public Page createPage() {

  return new 
ConfirmationDialog(getString(event_deletion), dialog, DisplayEventsPage.this);

 }

});

  dialog.show(target);



}



add(entryRemovalLink);

add(dialog);

}

}



and



public class ConfirmationDialog extends WebPage {

 public ConfirmationDialog(String question, final ModalWindow parent, 
final RepeaterHoldingPage page, Object entry) {

 add(new AjaxButton(yes_button, new ModelString(getString(yes))) {



   private static final long serialVersionUID = 1l;



   @Override

   protected void onSubmit(AjaxRequestTarget target, Form? 
form) {

  parent.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback() {



   @Override

   public void 
onClose(AjaxRequestTarget target) {

page.removeItem(entry, 
target);

   }

  });



  parent.close(target);

}

   };

}

}



Obviously there's something wrong with the code. First of all the 
removeItem(entry, target) never gets called, and also, when I click on close 
button of the top modal (confirmation dialog) the middle one 
(displayeventspage) shows 'page expired' message and everything gets messed up, 
no matter if I've put closebutton callback of the top modal or not.



I would be glad if someone shed more light on this issue, because I can't solve 
it.



Thank you in advance!

BR,

Martin



-Original Message-
From: Martin Asenov [mailto:mase...@velti.com]
Sent: Tuesday, January 26, 2010 4:03 PM
To: users@wicket.apache.org; mcgreg...@e-card.bg
Subject: RE: modal window contained and displayed by another modal window



Yes, in this example when it comes to closing the second modal from the 'x' 
button the callback returns false obviously. When it does not, everything gets 
messed up and middle modal gets 'page expired'. How can I close the second 
modal and get back to middle modal with no obstacles like these?



Thanks,

Martin



-Original Message-

From: Martin Grigorov [mailto:mcgreg...@e-card.bg]

Sent: Monday, January 25, 2010 12:06 PM

To: users@wicket.apache.org

Subject: Re: modal window contained and displayed by another modal window



On Mon, 2010-01-25 at 11:26 +0200, Martin Asenov wrote:

 Hello guys!



 I was trying to trigger a modal window from another modal window, but on top 
 modal window closing seems like the bottom page gets refreshed, or something 
 like this, because when I click on something on the middle frame (first 
 modal) that is active after the closing of the top modal, I get something 
 like 'component not found [modal]' and get redirected to home page.



 Is there a way to use modal window in another modal window?

There is: http://www.wicketstuff.org/wicket14/ajax/modal-window



But you should use ModalWindow with a Page, not with Panel.



 Thanks!



 Regards,

 Martin



 -

 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




Bug in FormComponent.MessageSource.getMessage(String) getValidatorKeyPrefix()

2010-01-26 Thread Guillaume Mary
Hi all,

I tried to use the getValidatorKeyPrefix() feature to have a more suitable 
translation key for a RequiredTextField and the  required  message.
But Wicket wasn't able to find my key : the debug log said that it couldn't 
find my key whereas it is well-formed (getValidatorKeyPrefix() + .Required).
So i debugged the getMessage(String) and I understood the problem. Arround the 
line 175 (in Wicket 1.4.5) we find :
// If not found try a more general form [prefix].[key]
if (Strings.isEmpty(message))
{
resource = prefix(prefix, key);
message = getString(localizer, key, formComponent);
}

The comment is good, but the code is wrong : the resource variable isn't used 
in the getString(...) ! (I think it's a kind of bad copy/paste from surrounding 
code)
We should find :
message = getString(localizer, resource, formComponent);

I did it and it works.

If OK for you I can create the Jira issue to follow it.


Re: add id to body with onComponentTag?

2010-01-26 Thread kurtadam

Just making the example more clear:

add(new WebMarkupContainer(bodyId) {
 @Override
 public boolean isTransparentResolver() {
  return true;
 }
 @Override
 protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
  tag.put(id, someId);
}
 }
 });


htmlbody wicket:id=bodyId.../body/html
results in 
htmlbody wicket:id=bodyId id=someId.../body/html



igor.vaynberg wrote:
 
 add(new webmarkupcontainer(body) { istransparentresolver() { return
 true; } oncomponenttag(tag) { tag.put(id,foo); }});
 
 htmlbody wicket:id=body.../body/html
 
 -igor
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/add-id-to-body-with-onComponentTag--tp24211496p27324093.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: wicketstuff-push and component replacing

2010-01-26 Thread Rodolfo Hansen
I have basically concentrated on the CometD Service
This should be a simple bug to fix.


On Fri, Jan 22, 2010 at 10:34 AM, Roland Vares roland.va...@uptime.eewrote:

 Hello,

 I'm currently developing wicket based application, which displays alarms on
 map and allows their modification.
 New alarms are sent to server through soap service and map with few other
 components on page for all browser clients needs to be refreshed.

 I'm using wicketstuff-push for the push service implementation.
 org.wicketstuff.push.timer.TimerPushService to be clear.



 As an in examples I have method on wicket page which is activated when
 server sends notification about an event:
// set new listener for incoming events
final IPushTarget pushTarget =
 getTimerPushService().installPush(this);
getPushService().addMapListener(new
 MapServiceListener() {
public void onEventChange(final Event event) {
if
 (pushTarget.isConnected()) {
Label label = new Label(labelonpage,label); //label
 to be replaced
pushTarget.addComponent(label);
pushTarget.trigger();
}
else { // remove inactive listener

LOG.debug(Removing map listener  + this);

getPushService().removeMapListener(this);
}
...

 Problems start with line :
 Label label = new Label(labelonpage,label);

 which results with:
 org.apache.wicket.WicketRuntimeException: There is no application attached
 to current thread btpool0-2
at org.apache.wicket.Application.get(Application.java:179)
at
 org.apache.wicket.Component.getApplication(Component.java:1323)
at org.apache.wicket.Component.init(Component.java:920)

 It seems that in this push method, context is lost, I have no session,
 request,...

 Is there any way I gan regain it or make new?

 Or how should I implement push service, which needs to replace some
 components on page?

 Thanks in advance,
 Roland




-- 
Rodolfo Hansen
CTO, KindleIT Software Development
Email: rhan...@kindleit.net
Mobile: +1 (809) 860-6669


Re: Image Bundler For Apache Wicket

2010-01-26 Thread Riyad Kalla
Very cool Anantha, do you have a site online that uses the bundler that we
could take a peek at as a running example?

On Tue, Jan 26, 2010 at 7:42 AM, Anantha Kumaran
ananthakuma...@gmail.comwrote:

 http://ananthakumaran.github.com/imagebundler-wicket



Re: Page load after an action

2010-01-26 Thread Riyad Kalla
Stephane,

I'll let someone smarter than me address the wicket issue of removing the
item from the ListView and seeing if that helps -- but is there a chance you
are using Hibernate and the Level 2 ehcache plugin or any 2nd-level caching
with your persistence code? I ask because I've seen code like this I don't
see my changes until the 2nd refresh! a lot with folks using 2nd level
caches and not seeing immediate persistence of those changes.

On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:


 Please find my code just below :


 public class NewsListPage  {

   protected static transient NewsDao myNewsDao;

   public NewsListPage() {
   PageableListViewNews news =
   new PageableListViewNews(list, new NewsModel(), 15){

   @Override
   protected void populateItem(final ListItemNews item) {
   ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

   News news = item.getModelObject();
 item.add(new Label(date, new
 Model(news.getDate(;
 LinkNews l = new LinkNews(edit){

   @Override
   public void onClick() {
   setResponsePage(new NewsPage(item.getModelObject()));
 }
 };

   item.add(l);
   l.add(new Label(title, news.getTitle()));

   item.add(new LinkNews(delete, new Model()){

   @Override
   public void onClick() {
   // TODO : check the refresh issue
   getNewsDao().delete(item.getModelObject());
   ourLogger.debug(News deleted);
 }
 });
 }

 };

   add(news);
   add(new OrPagingNavigator(navigator, news));
 add(new BookmarkablePageLinkVoid(add, NewsPage.class));

 }

   /**
* Model for the news List to load the news from the db each time
*
*/
   public class NewsModel extends LoadableDetachableModelListNews {

   @Override
   protected ListNews load() {
   ourLogger.debug(Loading all news);
   return new NewsDao().load();
   }


   }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your list
 view.  You could post some code, but make sure that you're reloading the
 data for the list view after the onClick is called and the item is
 deleted.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 Hello,

 My page displays a list of items, for each of them, an icon is available
 to
 delete it. The action is managed in a Link.onClick() method.
 When I click on the link, the page is refreshed but the item is always in
 my list, I have to do refresh again manually the page to have a list
 wihtout
 this item.

 In the logs, it seems that the deletion in the onClick() method is called
 after the load of the page :(

 Somebody has an idea to avoid this manual refresh ?

 Thanks,

 Stéphane

 -
 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: Page load after an action

2010-01-26 Thread Stéphane Jeanjean

Hi,

I don't use Hibernate. My persistence layer uses JDBC.

What is strange when I click the delete link, it's the logs order :

Loading all news
News deleted

So it seems that the deletion is done after the data reload :(

Stéphane


Riyad Kalla a écrit :

Stephane,

I'll let someone smarter than me address the wicket issue of removing the
item from the ListView and seeing if that helps -- but is there a chance you
are using Hibernate and the Level 2 ehcache plugin or any 2nd-level caching
with your persistence code? I ask because I've seen code like this I don't
see my changes until the 2nd refresh! a lot with folks using 2nd level
caches and not seeing immediate persistence of those changes.

On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:

  

Please find my code just below :


public class NewsListPage  {

  protected static transient NewsDao myNewsDao;

  public NewsListPage() {
  PageableListViewNews news =
  new PageableListViewNews(list, new NewsModel(), 15){

  @Override
  protected void populateItem(final ListItemNews item) {
  ourLogger.debug(Getting item value
+item.getModelObject().getTitle());

  News news = item.getModelObject();
item.add(new Label(date, new
Model(news.getDate(;
LinkNews l = new LinkNews(edit){

  @Override
  public void onClick() {
  setResponsePage(new NewsPage(item.getModelObject()));
}
};

  item.add(l);
  l.add(new Label(title, news.getTitle()));

  item.add(new LinkNews(delete, new Model()){

  @Override
  public void onClick() {
  // TODO : check the refresh issue
  getNewsDao().delete(item.getModelObject());
  ourLogger.debug(News deleted);
}
});
}

};

  add(news);
  add(new OrPagingNavigator(navigator, news));
add(new BookmarkablePageLinkVoid(add, NewsPage.class));

}

  /**
   * Model for the news List to load the news from the db each time
   *
   */
  public class NewsModel extends LoadableDetachableModelListNews {

  @Override
  protected ListNews load() {
  ourLogger.debug(Loading all news);
  return new NewsDao().load();
  }


  }
 }



Jeremy Thomerson a écrit :

 You're probably not using models correctly - specifically for your list


view.  You could post some code, but make sure that you're reloading the
data for the list view after the onClick is called and the item is
deleted.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:



  

Hello,

My page displays a list of items, for each of them, an icon is available
to
delete it. The action is managed in a Link.onClick() method.
When I click on the link, the page is refreshed but the item is always in
my list, I have to do refresh again manually the page to have a list
wihtout
this item.

In the logs, it seems that the deletion in the onClick() method is called
after the load of the page :(

Somebody has an idea to avoid this manual refresh ?

Thanks,

Stéphane

-
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



Re: Should Duration be deprecated?

2010-01-26 Thread Jonas
java.util.concurrent.TimeUnit only covers units from nanos to seconds
(in java 1.5, that is)
So before wicket moves to java 1.6 we probably have a 'no go' here...

On Tue, Jan 26, 2010 at 3:42 PM, Objelean Alex alex.objel...@gmail.com wrote:
 I was wondering why would wicket need Duration class as long as java
 provides a similar TimeUnit. Maybe it would be a good idea to deprecate this
 class  encourage usage of TimeUnit?

 Alex Objelean


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



Re: Page load after an action

2010-01-26 Thread Pedro Santos
Call news.getDefaultModel().detach(), and look for more info about
detachable models.

http://cwiki.apache.org/WICKET/detachable-models.html

On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:

 Hi,

 I don't use Hibernate. My persistence layer uses JDBC.

 What is strange when I click the delete link, it's the logs order :

 Loading all news
 News deleted

 So it seems that the deletion is done after the data reload :(

 Stéphane


 Riyad Kalla a écrit :

  Stephane,

 I'll let someone smarter than me address the wicket issue of removing the
 item from the ListView and seeing if that helps -- but is there a chance
 you
 are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
 caching
 with your persistence code? I ask because I've seen code like this I
 don't
 see my changes until the 2nd refresh! a lot with folks using 2nd level
 caches and not seeing immediate persistence of those changes.

 On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 Please find my code just below :


 public class NewsListPage  {

  protected static transient NewsDao myNewsDao;

  public NewsListPage() {
  PageableListViewNews news =
  new PageableListViewNews(list, new NewsModel(), 15){

  @Override
  protected void populateItem(final ListItemNews item) {
  ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

  News news = item.getModelObject();
item.add(new Label(date, new
 Model(news.getDate(;
LinkNews l = new LinkNews(edit){

  @Override
  public void onClick() {
  setResponsePage(new
 NewsPage(item.getModelObject()));
}
 };

  item.add(l);
  l.add(new Label(title, news.getTitle()));

  item.add(new LinkNews(delete, new Model()){

  @Override
  public void onClick() {
  // TODO : check the refresh issue
  getNewsDao().delete(item.getModelObject());
  ourLogger.debug(News deleted);
}
});
}

};

  add(news);
  add(new OrPagingNavigator(navigator, news));
add(new BookmarkablePageLinkVoid(add, NewsPage.class));

}

  /**
   * Model for the news List to load the news from the db each time
   *
   */
  public class NewsModel extends LoadableDetachableModelListNews {

  @Override
  protected ListNews load() {
  ourLogger.debug(Loading all news);
  return new NewsDao().load();
  }


  }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your list


 view.  You could post some code, but make sure that you're reloading the
 data for the list view after the onClick is called and the item is
 deleted.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:





 Hello,

 My page displays a list of items, for each of them, an icon is
 available
 to
 delete it. The action is managed in a Link.onClick() method.
 When I click on the link, the page is refreshed but the item is always
 in
 my list, I have to do refresh again manually the page to have a list
 wihtout
 this item.

 In the logs, it seems that the deletion in the onClick() method is
 called
 after the load of the page :(

 Somebody has an idea to avoid this manual refresh ?

 Thanks,

 Stéphane

 -
 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




-- 
Pedro Henrique Oliveira dos Santos


Re: Should Duration be deprecated?

2010-01-26 Thread Hauke Ingmar Schmidt
Hej,

2010/1/26 Objelean Alex alex.objel...@gmail.com:
 I was wondering why would wicket need Duration class as long as java
 provides a similar TimeUnit. Maybe it would be a good idea to deprecate this
 class  encourage usage of TimeUnit?

If I am correct TimeUnit doesn't store a duration, it is used for
informing about the interpretation of a value and helps converting it.

Hej då
Hauke Ingmar

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



Re: Page load after an action

2010-01-26 Thread Pedro Santos
missing line: call detach method just after delete your item.

On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com wrote:

 Call news.getDefaultModel().detach(), and look for more info about
 detachable models.

 http://cwiki.apache.org/WICKET/detachable-models.html

 On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:

 Hi,

 I don't use Hibernate. My persistence layer uses JDBC.

 What is strange when I click the delete link, it's the logs order :

 Loading all news
 News deleted

 So it seems that the deletion is done after the data reload :(

 Stéphane


 Riyad Kalla a écrit :

  Stephane,

 I'll let someone smarter than me address the wicket issue of removing the
 item from the ListView and seeing if that helps -- but is there a chance
 you
 are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
 caching
 with your persistence code? I ask because I've seen code like this I
 don't
 see my changes until the 2nd refresh! a lot with folks using 2nd level
 caches and not seeing immediate persistence of those changes.

 On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 Please find my code just below :


 public class NewsListPage  {

  protected static transient NewsDao myNewsDao;

  public NewsListPage() {
  PageableListViewNews news =
  new PageableListViewNews(list, new NewsModel(), 15){

  @Override
  protected void populateItem(final ListItemNews item) {
  ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

  News news = item.getModelObject();
item.add(new Label(date, new
 Model(news.getDate(;
LinkNews l = new LinkNews(edit){

  @Override
  public void onClick() {
  setResponsePage(new
 NewsPage(item.getModelObject()));
}
 };

  item.add(l);
  l.add(new Label(title, news.getTitle()));

  item.add(new LinkNews(delete, new Model()){

  @Override
  public void onClick() {
  // TODO : check the refresh issue
  getNewsDao().delete(item.getModelObject());
  ourLogger.debug(News deleted);
}
});
}

};

  add(news);
  add(new OrPagingNavigator(navigator, news));
add(new BookmarkablePageLinkVoid(add, NewsPage.class));

}

  /**
   * Model for the news List to load the news from the db each time
   *
   */
  public class NewsModel extends LoadableDetachableModelListNews {

  @Override
  protected ListNews load() {
  ourLogger.debug(Loading all news);
  return new NewsDao().load();
  }


  }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your list


 view.  You could post some code, but make sure that you're reloading
 the
 data for the list view after the onClick is called and the item is
 deleted.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:





 Hello,

 My page displays a list of items, for each of them, an icon is
 available
 to
 delete it. The action is managed in a Link.onClick() method.
 When I click on the link, the page is refreshed but the item is always
 in
 my list, I have to do refresh again manually the page to have a list
 wihtout
 this item.

 In the logs, it seems that the deletion in the onClick() method is
 called
 after the load of the page :(

 Somebody has an idea to avoid this manual refresh ?

 Thanks,

 Stéphane

 -
 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




 --
 Pedro Henrique Oliveira dos Santos




-- 
Pedro Henrique Oliveira dos Santos


Re: Page load after an action

2010-01-26 Thread Stéphane Jeanjean


The behaviour is the same with the following code :(

   public void onClick() {
   // TODO : check the refresh issue
   getNewsDao().delete(item.getModelObject());
   ourLogger.debug(News deleted);
   getDefaultModel().detach();
  
   }



Pedro Santos a écrit :

missing line: call detach method just after delete your item.

On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com wrote:

  

Call news.getDefaultModel().detach(), and look for more info about
detachable models.

http://cwiki.apache.org/WICKET/detachable-models.html

On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:



Hi,

I don't use Hibernate. My persistence layer uses JDBC.

What is strange when I click the delete link, it's the logs order :

Loading all news
News deleted

So it seems that the deletion is done after the data reload :(

Stéphane


Riyad Kalla a écrit :

 Stephane,
  

I'll let someone smarter than me address the wicket issue of removing the
item from the ListView and seeing if that helps -- but is there a chance
you
are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
caching
with your persistence code? I ask because I've seen code like this I
don't
see my changes until the 2nd refresh! a lot with folks using 2nd level
caches and not seeing immediate persistence of those changes.

On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:





Please find my code just below :


public class NewsListPage  {

 protected static transient NewsDao myNewsDao;

 public NewsListPage() {
 PageableListViewNews news =
 new PageableListViewNews(list, new NewsModel(), 15){

 @Override
 protected void populateItem(final ListItemNews item) {
 ourLogger.debug(Getting item value
+item.getModelObject().getTitle());

 News news = item.getModelObject();
   item.add(new Label(date, new
Model(news.getDate(;
   LinkNews l = new LinkNews(edit){

 @Override
 public void onClick() {
 setResponsePage(new
NewsPage(item.getModelObject()));
   }
};

 item.add(l);
 l.add(new Label(title, news.getTitle()));

 item.add(new LinkNews(delete, new Model()){

 @Override
 public void onClick() {
 // TODO : check the refresh issue
 getNewsDao().delete(item.getModelObject());
 ourLogger.debug(News deleted);
   }
   });
   }

   };

 add(news);
 add(new OrPagingNavigator(navigator, news));
   add(new BookmarkablePageLinkVoid(add, NewsPage.class));

   }

 /**
  * Model for the news List to load the news from the db each time
  *
  */
 public class NewsModel extends LoadableDetachableModelListNews {

 @Override
 protected ListNews load() {
 ourLogger.debug(Loading all news);
 return new NewsDao().load();
 }


 }
 }



Jeremy Thomerson a écrit :

 You're probably not using models correctly - specifically for your list


  

view.  You could post some code, but make sure that you're reloading
the
data for the list view after the onClick is called and the item is
deleted.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:







Hello,

My page displays a list of items, for each of them, an icon is
available
to
delete it. The action is managed in a Link.onClick() method.
When I click on the link, the page is refreshed but the item is always
in
my list, I have to do refresh again manually the page to have a list
wihtout
this item.

In the logs, it seems that the deletion in the onClick() method is
called
after the load of the page :(

Somebody has an idea to avoid this manual refresh ?

Thanks,

Stéphane

-
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


  

--
Pedro Henrique Oliveira dos Santos






  




Re: Page load after an action

2010-01-26 Thread Pedro Santos
by calling getDefaultModel inside onClick, you get an reference to the link
component model. You need to detach the model on your list view. You has an
reference to it on your variable news. So: news.getDefaultModel().detach()
If you need, you can change that variable modifiers or turn it an instance
variable for have acess to it inside your onClick implementation.

On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:


 The behaviour is the same with the following code :(


   public void onClick() {
   // TODO : check the refresh issue
   getNewsDao().delete(item.getModelObject());
   ourLogger.debug(News deleted);
   getDefaultModel().detach();
 }


 Pedro Santos a écrit :

  missing line: call detach method just after delete your item.

 On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
 wrote:



 Call news.getDefaultModel().detach(), and look for more info about
 detachable models.

 http://cwiki.apache.org/WICKET/detachable-models.html

 On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 Hi,

 I don't use Hibernate. My persistence layer uses JDBC.

 What is strange when I click the delete link, it's the logs order :

 Loading all news
 News deleted

 So it seems that the deletion is done after the data reload :(

 Stéphane


 Riyad Kalla a écrit :

  Stephane,


 I'll let someone smarter than me address the wicket issue of removing
 the
 item from the ListView and seeing if that helps -- but is there a
 chance
 you
 are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
 caching
 with your persistence code? I ask because I've seen code like this I
 don't
 see my changes until the 2nd refresh! a lot with folks using 2nd level
 caches and not seeing immediate persistence of those changes.

 On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:





 Please find my code just below :


 public class NewsListPage  {

  protected static transient NewsDao myNewsDao;

  public NewsListPage() {
 PageableListViewNews news =
 new PageableListViewNews(list, new NewsModel(), 15){

 @Override
 protected void populateItem(final ListItemNews item) {
 ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

 News news = item.getModelObject();
   item.add(new Label(date, new
 Model(news.getDate(;
   LinkNews l = new LinkNews(edit){

 @Override
 public void onClick() {
 setResponsePage(new
 NewsPage(item.getModelObject()));
   }
 };

 item.add(l);
 l.add(new Label(title, news.getTitle()));

 item.add(new LinkNews(delete, new Model()){

 @Override
 public void onClick() {
 // TODO : check the refresh issue
 getNewsDao().delete(item.getModelObject());
 ourLogger.debug(News deleted);
   }
   });
   }

   };

 add(news);
 add(new OrPagingNavigator(navigator, news));
   add(new BookmarkablePageLinkVoid(add, NewsPage.class));

   }

  /**
  * Model for the news List to load the news from the db each time
  *
  */
  public class NewsModel extends LoadableDetachableModelListNews {

 @Override
 protected ListNews load() {
 ourLogger.debug(Loading all news);
 return new NewsDao().load();
 }


  }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your
 list




 view.  You could post some code, but make sure that you're reloading
 the
 data for the list view after the onClick is called and the item is
 deleted.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:







 Hello,

 My page displays a list of items, for each of them, an icon is
 available
 to
 delete it. The action is managed in a Link.onClick() method.
 When I click on the link, the page is refreshed but the item is
 always
 in
 my list, I have to do refresh again manually the page to have a list
 wihtout
 this item.

 In the logs, it seems that the deletion in the onClick() method is
 called
 after the load of the page :(

 Somebody has an idea to avoid this manual refresh ?

 Thanks,

 Stéphane


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













 -
 To 

Re: Page load after an action

2010-01-26 Thread Stéphane Jeanjean


Thanks Pedro, it's ok now ;-)

I use LoadableDetachableModel to avoid the call to detach() method. It 
does not seem that is the right way. Somebody can explain me why ?


Stéphane


Pedro Santos a écrit :

by calling getDefaultModel inside onClick, you get an reference to the link
component model. You need to detach the model on your list view. You has an
reference to it on your variable news. So: news.getDefaultModel().detach()
If you need, you can change that variable modifiers or turn it an instance
variable for have acess to it inside your onClick implementation.

On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:

  

The behaviour is the same with the following code :(


  public void onClick() {
  // TODO : check the refresh issue
  getNewsDao().delete(item.getModelObject());
  ourLogger.debug(News deleted);
  getDefaultModel().detach();
}


Pedro Santos a écrit :

 missing line: call detach method just after delete your item.


On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
wrote:



  

Call news.getDefaultModel().detach(), and look for more info about
detachable models.

http://cwiki.apache.org/WICKET/detachable-models.html

On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:





Hi,

I don't use Hibernate. My persistence layer uses JDBC.

What is strange when I click the delete link, it's the logs order :

Loading all news
News deleted

So it seems that the deletion is done after the data reload :(

Stéphane


Riyad Kalla a écrit :

 Stephane,


  

I'll let someone smarter than me address the wicket issue of removing
the
item from the ListView and seeing if that helps -- but is there a
chance
you
are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
caching
with your persistence code? I ask because I've seen code like this I
don't
see my changes until the 2nd refresh! a lot with folks using 2nd level
caches and not seeing immediate persistence of those changes.

On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:







Please find my code just below :


public class NewsListPage  {

 protected static transient NewsDao myNewsDao;

 public NewsListPage() {
PageableListViewNews news =
new PageableListViewNews(list, new NewsModel(), 15){

@Override
protected void populateItem(final ListItemNews item) {
ourLogger.debug(Getting item value
+item.getModelObject().getTitle());

News news = item.getModelObject();
  item.add(new Label(date, new
Model(news.getDate(;
  LinkNews l = new LinkNews(edit){

@Override
public void onClick() {
setResponsePage(new
NewsPage(item.getModelObject()));
  }
};

item.add(l);
l.add(new Label(title, news.getTitle()));

item.add(new LinkNews(delete, new Model()){

@Override
public void onClick() {
// TODO : check the refresh issue
getNewsDao().delete(item.getModelObject());
ourLogger.debug(News deleted);
  }
  });
  }

  };

add(news);
add(new OrPagingNavigator(navigator, news));
  add(new BookmarkablePageLinkVoid(add, NewsPage.class));

  }

 /**
 * Model for the news List to load the news from the db each time
 *
 */
 public class NewsModel extends LoadableDetachableModelListNews {

@Override
protected ListNews load() {
ourLogger.debug(Loading all news);
return new NewsDao().load();
}


 }
 }



Jeremy Thomerson a écrit :

 You're probably not using models correctly - specifically for your
list




  

view.  You could post some code, but make sure that you're reloading
the
data for the list view after the onClick is called and the item is
deleted.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:









Hello,

My page displays a list of items, for each of them, an icon is
available
to
delete it. The action is managed in a Link.onClick() method.
When I click on the link, the page is refreshed but the item is
always
in
my list, I have to do refresh again manually the page to have a list
wihtout
this item.

In the logs, it seems that the deletion in the onClick() method is
called
after the load of the page :(

Somebody has an idea to avoid this manual refresh ?

Thanks,

Stéphane


-
To unsubscribe, e-mail: 

Re: Image Bundler For Apache Wicket

2010-01-26 Thread Anantha Kumaran
i will try to put it in the google appspot later. Here is the source code of
a sample http://github.com/ananthakumaran/imagebundler-wicket

On Tue, Jan 26, 2010 at 7:20 AM, Riyad Kalla rka...@gmail.com wrote:

 Very cool Anantha, do you have a site online that uses the bundler that we
 could take a peek at as a running example?

 On Tue, Jan 26, 2010 at 7:42 AM, Anantha Kumaran
 ananthakuma...@gmail.comwrote:

  http://ananthakumaran.github.com/imagebundler-wicket
 



Re: Image Bundler For Apache Wicket

2010-01-26 Thread Andrew Lombardi
This is very very cool.

Congrats Anantha!  

On Jan 26, 2010, at 9:07 AM, Anantha Kumaran wrote:

 i will try to put it in the google appspot later. Here is the source code of
 a sample http://github.com/ananthakumaran/imagebundler-wicket
 
 On Tue, Jan 26, 2010 at 7:20 AM, Riyad Kalla rka...@gmail.com wrote:
 
 Very cool Anantha, do you have a site online that uses the bundler that we
 could take a peek at as a running example?
 
 On Tue, Jan 26, 2010 at 7:42 AM, Anantha Kumaran
 ananthakuma...@gmail.comwrote:
 
 http://ananthakumaran.github.com/imagebundler-wicket
 
 


To our success!

Mystic Coders, LLC | Code Magic | www.mysticcoders.com

ANDREW LOMBARDI | and...@mysticcoders.com
2321 E 4th St. Ste C-128, Santa Ana CA 92705
ofc: 714-816-4488
fax: 714-782-6024
cell: 714-697-8046
linked-in: http://www.linkedin.com/in/andrewlombardi
twitter: http://www.twitter.com/kinabalu

Eco-Tip: Printing e-mails is usually a waste.


This message is for the named person's use only. You must not, directly or 
indirectly, use,
 disclose, distribute, print, or copy any part of this message if you are not 
the intended recipient.




Wizard busy indicators

2010-01-26 Thread Jeffrey Schneller
I am trying to figure out how I could add a busy indicator to my wizard
so that when transitioning between  steps the busy indicator appears.
The transition between steps in my wizard may take a long time.

 

1.How could this be done with just Wicket?

2.   How could this be done using JQuery and Wicket?

 

Also, how would I add a busy indicator to a dropdown within a wizard
panel with an onchange behavior.  I tried adding an
inidicatingAjaxButton instead of using the onchange behavior but can't
seem to access the model correctly to get the value of the dropdown.
Any ideas??

 

Thanks.



Re: Wizard busy indicators

2010-01-26 Thread Martin Makundi
Hi!

You do not need Wicket to make a busy indicator. It's plain HTML + JavaScript.

The only thing about wicket that is relevant is that you want to
remove the busy indicator after ajax-request has been processed.

Here is an example:
http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

**
Martin

2010/1/26 Jeffrey Schneller jeffrey.schnel...@envisa.com:
 I am trying to figure out how I could add a busy indicator to my wizard
 so that when transitioning between  steps the busy indicator appears.
 The transition between steps in my wizard may take a long time.



 1.        How could this be done with just Wicket?

 2.       How could this be done using JQuery and Wicket?



 Also, how would I add a busy indicator to a dropdown within a wizard
 panel with an onchange behavior.  I tried adding an
 inidicatingAjaxButton instead of using the onchange behavior but can't
 seem to access the model correctly to get the value of the dropdown.
 Any ideas??



 Thanks.



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



Using AjaxFormSubmitBehavior

2010-01-26 Thread Anna Simbirtsev
Hello,

I have a modal window that is used to create a contact and needs to submit
data to the server once submit button is called.

The submit button is defined as follows:

button wicket:id=contact_submitbutton type=submitSUBMIT/button


contact_form.add(new Button(contact_submitbutton).add(new
AjaxFormSubmitBehavior(contact_form, onclick) {

private static final long serialVersionUID =
4192112499051970470L;

protected void onSubmit(AjaxRequestTarget target)
{
System.out.println(Inside contact link's onSubmit is
called );

}

@Override
protected void onError(AjaxRequestTarget target)
{
}
}));


But nothing happens when I click on the button.

Thanks,

Anna


Re: Using AjaxFormSubmitBehavior

2010-01-26 Thread Pedro Santos
Do you have an feedback panel on the model?  If don't, add one and see if
your form don't pass in some validation like on required field.

On Tue, Jan 26, 2010 at 4:07 PM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 Hello,

 I have a modal window that is used to create a contact and needs to submit
 data to the server once submit button is called.

 The submit button is defined as follows:

 button wicket:id=contact_submitbutton type=submitSUBMIT/button


 contact_form.add(new Button(contact_submitbutton).add(new
 AjaxFormSubmitBehavior(contact_form, onclick) {

private static final long serialVersionUID =
 4192112499051970470L;

protected void onSubmit(AjaxRequestTarget target)
{
System.out.println(Inside contact link's onSubmit is
 called );

}

@Override
protected void onError(AjaxRequestTarget target)
{
}
}));


 But nothing happens when I click on the button.

 Thanks,

 Anna




-- 
Pedro Henrique Oliveira dos Santos


Re: Using AjaxFormSubmitBehavior

2010-01-26 Thread Anna Simbirtsev
I have, but maybe its incorrect.

div wicket:id=popup_feedback id=popup_feedback/div

contact_form.add(new FeedbackPanel(popup_feedback, new
ContainerFeedbackMessageFilter(contact_form) ));

On Tue, Jan 26, 2010 at 1:32 PM, Pedro Santos pedros...@gmail.com wrote:

 Do you have an feedback panel on the model?  If don't, add one and see if
 your form don't pass in some validation like on required field.

 On Tue, Jan 26, 2010 at 4:07 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:

  Hello,
 
  I have a modal window that is used to create a contact and needs to
 submit
  data to the server once submit button is called.
 
  The submit button is defined as follows:
 
  button wicket:id=contact_submitbutton type=submitSUBMIT/button
 
 
  contact_form.add(new Button(contact_submitbutton).add(new
  AjaxFormSubmitBehavior(contact_form, onclick) {
 
 private static final long serialVersionUID =
  4192112499051970470L;
 
 protected void onSubmit(AjaxRequestTarget target)
 {
 System.out.println(Inside contact link's onSubmit is
  called );
 
 }
 
 @Override
 protected void onError(AjaxRequestTarget target)
 {
 }
 }));
 
 
  But nothing happens when I click on the button.
 
  Thanks,
 
  Anna
 



 --
 Pedro Henrique Oliveira dos Santos




-- 
Anna Simbirtsev
(416) 729-7331


Re: Using AjaxFormSubmitBehavior

2010-01-26 Thread Pedro Santos
Take a look at the AjaxButton if you need an asynchronous submit, and
implement your onError handlers with:

target.addComponent( myFeedbackPanelThatMabyWillShowSomeMessageIfGetUpdated
);

On Tue, Jan 26, 2010 at 4:34 PM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 I have, but maybe its incorrect.

 div wicket:id=popup_feedback id=popup_feedback/div

 contact_form.add(new FeedbackPanel(popup_feedback, new
 ContainerFeedbackMessageFilter(contact_form) ));

 On Tue, Jan 26, 2010 at 1:32 PM, Pedro Santos pedros...@gmail.com wrote:

  Do you have an feedback panel on the model?  If don't, add one and see if
  your form don't pass in some validation like on required field.
 
  On Tue, Jan 26, 2010 at 4:07 PM, Anna Simbirtsev asimbirt...@gmail.com
  wrote:
 
   Hello,
  
   I have a modal window that is used to create a contact and needs to
  submit
   data to the server once submit button is called.
  
   The submit button is defined as follows:
  
   button wicket:id=contact_submitbutton type=submitSUBMIT/button
  
  
   contact_form.add(new Button(contact_submitbutton).add(new
   AjaxFormSubmitBehavior(contact_form, onclick) {
  
  private static final long serialVersionUID =
   4192112499051970470L;
  
  protected void onSubmit(AjaxRequestTarget target)
  {
  System.out.println(Inside contact link's onSubmit is
   called );
  
  }
  
  @Override
  protected void onError(AjaxRequestTarget target)
  {
  }
  }));
  
  
   But nothing happens when I click on the button.
  
   Thanks,
  
   Anna
  
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 



 --
 Anna Simbirtsev
 (416) 729-7331




-- 
Pedro Henrique Oliveira dos Santos


Re: Using AjaxFormSubmitBehavior

2010-01-26 Thread Anna Simbirtsev
Thanks, now in my feedback it displays errors that all required fields are
empty. But the problem is, that even if I put the values in those fields it
still does not see them and gives the same errors in the feedback panel.

On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com wrote:

 Take a look at the AjaxButton if you need an asynchronous submit, and
 implement your onError handlers with:

 target.addComponent( myFeedbackPanelThatMabyWillShowSomeMessageIfGetUpdated
 );

 On Tue, Jan 26, 2010 at 4:34 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:

  I have, but maybe its incorrect.
 
  div wicket:id=popup_feedback id=popup_feedback/div
 
  contact_form.add(new FeedbackPanel(popup_feedback, new
  ContainerFeedbackMessageFilter(contact_form) ));
 
  On Tue, Jan 26, 2010 at 1:32 PM, Pedro Santos pedros...@gmail.com
 wrote:
 
   Do you have an feedback panel on the model?  If don't, add one and see
 if
   your form don't pass in some validation like on required field.
  
   On Tue, Jan 26, 2010 at 4:07 PM, Anna Simbirtsev 
 asimbirt...@gmail.com
   wrote:
  
Hello,
   
I have a modal window that is used to create a contact and needs to
   submit
data to the server once submit button is called.
   
The submit button is defined as follows:
   
button wicket:id=contact_submitbutton
 type=submitSUBMIT/button
   
   
contact_form.add(new Button(contact_submitbutton).add(new
AjaxFormSubmitBehavior(contact_form, onclick) {
   
   private static final long serialVersionUID =
4192112499051970470L;
   
   protected void onSubmit(AjaxRequestTarget target)
   {
   System.out.println(Inside contact link's onSubmit is
called );
   
   }
   
   @Override
   protected void onError(AjaxRequestTarget target)
   {
   }
   }));
   
   
But nothing happens when I click on the button.
   
Thanks,
   
Anna
   
  
  
  
   --
   Pedro Henrique Oliveira dos Santos
  
 
 
 
  --
  Anna Simbirtsev
  (416) 729-7331
 



 --
 Pedro Henrique Oliveira dos Santos




-- 
Anna Simbirtsev
(416) 729-7331


Re: Using AjaxFormSubmitBehavior

2010-01-26 Thread Pedro Santos
Even using AjaxButton? Can you send the code?

On Tue, Jan 26, 2010 at 4:55 PM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 Thanks, now in my feedback it displays errors that all required fields are
 empty. But the problem is, that even if I put the values in those fields it
 still does not see them and gives the same errors in the feedback panel.

 On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com wrote:

  Take a look at the AjaxButton if you need an asynchronous submit, and
  implement your onError handlers with:
 
  target.addComponent(
 myFeedbackPanelThatMabyWillShowSomeMessageIfGetUpdated
  );
 
  On Tue, Jan 26, 2010 at 4:34 PM, Anna Simbirtsev asimbirt...@gmail.com
  wrote:
 
   I have, but maybe its incorrect.
  
   div wicket:id=popup_feedback id=popup_feedback/div
  
   contact_form.add(new FeedbackPanel(popup_feedback, new
   ContainerFeedbackMessageFilter(contact_form) ));
  
   On Tue, Jan 26, 2010 at 1:32 PM, Pedro Santos pedros...@gmail.com
  wrote:
  
Do you have an feedback panel on the model?  If don't, add one and
 see
  if
your form don't pass in some validation like on required field.
   
On Tue, Jan 26, 2010 at 4:07 PM, Anna Simbirtsev 
  asimbirt...@gmail.com
wrote:
   
 Hello,

 I have a modal window that is used to create a contact and needs to
submit
 data to the server once submit button is called.

 The submit button is defined as follows:

 button wicket:id=contact_submitbutton
  type=submitSUBMIT/button


 contact_form.add(new Button(contact_submitbutton).add(new
 AjaxFormSubmitBehavior(contact_form, onclick) {

private static final long serialVersionUID =
 4192112499051970470L;

protected void onSubmit(AjaxRequestTarget target)
{
System.out.println(Inside contact link's onSubmit
 is
 called );

}

@Override
protected void onError(AjaxRequestTarget target)
{
}
}));


 But nothing happens when I click on the button.

 Thanks,

 Anna

   
   
   
--
Pedro Henrique Oliveira dos Santos
   
  
  
  
   --
   Anna Simbirtsev
   (416) 729-7331
  
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 



 --
 Anna Simbirtsev
 (416) 729-7331




-- 
Pedro Henrique Oliveira dos Santos


RE: Wizard busy indicators

2010-01-26 Thread Jeffrey Schneller
Martin,

Thanks.  That should do it.  I should be able to use Jquery instead using the 
functions provided.

-Original Message-
From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] 
Sent: Tuesday, January 26, 2010 12:40 PM
To: users@wicket.apache.org
Subject: Re: Wizard busy indicators

Hi!

You do not need Wicket to make a busy indicator. It's plain HTML + JavaScript.

The only thing about wicket that is relevant is that you want to
remove the busy indicator after ajax-request has been processed.

Here is an example:
http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

**
Martin

2010/1/26 Jeffrey Schneller jeffrey.schnel...@envisa.com:
 I am trying to figure out how I could add a busy indicator to my wizard
 so that when transitioning between  steps the busy indicator appears.
 The transition between steps in my wizard may take a long time.



 1.        How could this be done with just Wicket?

 2.       How could this be done using JQuery and Wicket?



 Also, how would I add a busy indicator to a dropdown within a wizard
 panel with an onchange behavior.  I tried adding an
 inidicatingAjaxButton instead of using the onchange behavior but can't
 seem to access the model correctly to get the value of the dropdown.
 Any ideas??



 Thanks.



-
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: Page load after an action

2010-01-26 Thread Riyad Kalla
Seems weird to me as well that 'detach' has to be explicitly called. Also
still curious why Stephane was seeing the log ordering he did when the link
was clicked:


Loading all news
News deleted


I'd expect to see news deleted first, from his onClick handler then the
loading all news caused by the call to load() before the response was
sent -- in which case it seems he wouldn't have run into this issue in the
first place.

It's entirely possible I'm missing the wicket processing sequence here being
something else which would explain this.

On Tue, Jan 26, 2010 at 9:59 AM, Stéphane Jeanjean 
stephane.jeanj...@softeam.com wrote:


 Thanks Pedro, it's ok now ;-)

 I use LoadableDetachableModel to avoid the call to detach() method. It does
 not seem that is the right way. Somebody can explain me why ?

 Stéphane


 Pedro Santos a écrit :

  by calling getDefaultModel inside onClick, you get an reference to the
 link
 component model. You need to detach the model on your list view. You has
 an
 reference to it on your variable news. So:
 news.getDefaultModel().detach()
 If you need, you can change that variable modifiers or turn it an instance
 variable for have acess to it inside your onClick implementation.

 On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 The behaviour is the same with the following code :(


  public void onClick() {
  // TODO : check the refresh issue
  getNewsDao().delete(item.getModelObject());
  ourLogger.debug(News deleted);
  getDefaultModel().detach();
}


 Pedro Santos a écrit :

  missing line: call detach method just after delete your item.


 On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
 wrote:





 Call news.getDefaultModel().detach(), and look for more info about
 detachable models.

 http://cwiki.apache.org/WICKET/detachable-models.html

 On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:





 Hi,

 I don't use Hibernate. My persistence layer uses JDBC.

 What is strange when I click the delete link, it's the logs order :

 Loading all news
 News deleted

 So it seems that the deletion is done after the data reload :(

 Stéphane


 Riyad Kalla a écrit :

  Stephane,




 I'll let someone smarter than me address the wicket issue of removing
 the
 item from the ListView and seeing if that helps -- but is there a
 chance
 you
 are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
 caching
 with your persistence code? I ask because I've seen code like this I
 don't
 see my changes until the 2nd refresh! a lot with folks using 2nd
 level
 caches and not seeing immediate persistence of those changes.

 On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:







 Please find my code just below :


 public class NewsListPage  {

  protected static transient NewsDao myNewsDao;

  public NewsListPage() {
PageableListViewNews news =
new PageableListViewNews(list, new NewsModel(), 15){

@Override
protected void populateItem(final ListItemNews item) {
ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

News news = item.getModelObject();
  item.add(new Label(date, new
 Model(news.getDate(;
  LinkNews l = new LinkNews(edit){

@Override
public void onClick() {
setResponsePage(new
 NewsPage(item.getModelObject()));
  }
 };

item.add(l);
l.add(new Label(title, news.getTitle()));

item.add(new LinkNews(delete, new Model()){

@Override
public void onClick() {
// TODO : check the refresh issue
getNewsDao().delete(item.getModelObject());
ourLogger.debug(News deleted);
  }
  });
  }

  };

add(news);
add(new OrPagingNavigator(navigator, news));
  add(new BookmarkablePageLinkVoid(add, NewsPage.class));

  }

  /**
  * Model for the news List to load the news from the db each time
  *
  */
  public class NewsModel extends LoadableDetachableModelListNews
 {

@Override
protected ListNews load() {
ourLogger.debug(Loading all news);
return new NewsDao().load();
}


  }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your
 list






 view.  You could post some code, but make sure that you're
 reloading
 the
 data for the list view after the onClick is called and the item is
 deleted.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 

Re: Page load after an action

2010-01-26 Thread James Carman
Doesn't it have to load the model so that it knows what item it's talking to?

On Tue, Jan 26, 2010 at 2:12 PM, Riyad Kalla rka...@gmail.com wrote:
 Seems weird to me as well that 'detach' has to be explicitly called. Also
 still curious why Stephane was seeing the log ordering he did when the link
 was clicked:

 
 Loading all news
 News deleted
 

 I'd expect to see news deleted first, from his onClick handler then the
 loading all news caused by the call to load() before the response was
 sent -- in which case it seems he wouldn't have run into this issue in the
 first place.

 It's entirely possible I'm missing the wicket processing sequence here being
 something else which would explain this.

 On Tue, Jan 26, 2010 at 9:59 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:


 Thanks Pedro, it's ok now ;-)

 I use LoadableDetachableModel to avoid the call to detach() method. It does
 not seem that is the right way. Somebody can explain me why ?

 Stéphane


 Pedro Santos a écrit :

  by calling getDefaultModel inside onClick, you get an reference to the
 link
 component model. You need to detach the model on your list view. You has
 an
 reference to it on your variable news. So:
 news.getDefaultModel().detach()
 If you need, you can change that variable modifiers or turn it an instance
 variable for have acess to it inside your onClick implementation.

 On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:



 The behaviour is the same with the following code :(


                  public void onClick() {
                      // TODO : check the refresh issue
                      getNewsDao().delete(item.getModelObject());
                      ourLogger.debug(News deleted);
                      getDefaultModel().detach();
                                        }


 Pedro Santos a écrit :

  missing line: call detach method just after delete your item.


 On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
 wrote:





 Call news.getDefaultModel().detach(), and look for more info about
 detachable models.

 http://cwiki.apache.org/WICKET/detachable-models.html

 On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:





 Hi,

 I don't use Hibernate. My persistence layer uses JDBC.

 What is strange when I click the delete link, it's the logs order :

 Loading all news
 News deleted

 So it seems that the deletion is done after the data reload :(

 Stéphane


 Riyad Kalla a écrit :

  Stephane,




 I'll let someone smarter than me address the wicket issue of removing
 the
 item from the ListView and seeing if that helps -- but is there a
 chance
 you
 are using Hibernate and the Level 2 ehcache plugin or any 2nd-level
 caching
 with your persistence code? I ask because I've seen code like this I
 don't
 see my changes until the 2nd refresh! a lot with folks using 2nd
 level
 caches and not seeing immediate persistence of those changes.

 On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
 stephane.jeanj...@softeam.com wrote:







 Please find my code just below :


 public class NewsListPage  {

  protected static transient NewsDao myNewsDao;

  public NewsListPage() {
    PageableListViewNews news =
    new PageableListViewNews(list, new NewsModel(), 15){

       �...@override
        protected void populateItem(final ListItemNews item) {
            ourLogger.debug(Getting item value
 +item.getModelObject().getTitle());

            News news = item.getModelObject();
                          item.add(new Label(date, new
 Model(news.getDate(;
                          LinkNews l = new LinkNews(edit){

               �...@override
                public void onClick() {
                    setResponsePage(new
 NewsPage(item.getModelObject()));
                                      }
 };

            item.add(l);
            l.add(new Label(title, news.getTitle()));

            item.add(new LinkNews(delete, new Model()){

               �...@override
                public void onClick() {
                    // TODO : check the refresh issue
                    getNewsDao().delete(item.getModelObject());
                    ourLogger.debug(News deleted);
                                      }
                              });
                      }

              };

    add(news);
    add(new OrPagingNavigator(navigator, news));
          add(new BookmarkablePageLinkVoid(add, NewsPage.class));

      }

  /**
  * Model for the news List to load the news from the db each time
  *
  */
  public class NewsModel extends LoadableDetachableModelListNews
 {

   �...@override
    protected ListNews load() {
        ourLogger.debug(Loading all news);
        return new NewsDao().load();
    }


  }
  }



 Jeremy Thomerson a écrit :

  You're probably not using models correctly - specifically for your
 list






 view.  You could post some code, but make sure that you're
 

Re: wicketstuff push, publishing event in a page2 and component installed with channel listener in page1

2010-01-26 Thread Rodolfo Hansen
Ok, thanks for the quickstart.

I just submitted the fix to svn...

On Tue, Jan 19, 2010 at 2:38 AM, vineet semwal
vineetsemwal1...@gmail.comwrote:

 thanks,
 i will take a look at them.

 On Mon, Jan 18, 2010 at 9:32 PM, Rodolfo Hansen kry...@gmail.com wrote:

  On Fri, Jan 15, 2010 at 5:24 AM, vineet semwal
  vineetsemwal1...@gmail.comwrote:
 
  
   Sorry ,a little late ..
   push is a great project,thanks for your efforts.
  
   i am a little confused,
   1)does the time out only happens after a remove event is published or
  apart
   from this, there is another
   timeout  which happens when server is finished pushing into the client?
  
 
  Here are the configuration options for the Jetty implementation of
 cometd.
  You can change the connection timeout value
  to notice disconects sooner (at the cost of ineffiency)
  http://cometd.org/documentation/cometd-java/server/configuration
 
  You can check the bayeux  specificition for the details. (
  http://svn.cometd.com/trunk/bayeux/bayeux.html)
 
 
 
 
  
   2)i see some problems when using more than one listener on one
 component,
  i
   tried
   reproducing the problem by a little tinkering in your example ,
   currently the example in the quickstart i am attaching has two
 listeners
  on
   different
   components ,you can reproduce the problem by adding listeners to the
 same
   component.
a event in one channel is caught by channel listener meant for another
   channel.
  
 
  Great, I'll look into this.
 
  
  
   thanks again ..
  
  
  
   On Sat, Dec 26, 2009 at 11:15 PM, Rodolfo Hansen kry...@gmail.com
  wrote:
  
   Regarding remove listeners:
  
   Most browsers fail to report the remove event.
   Only firefox reports removal immediately, all other browsers depend on
  the
   timeout for a comet reconnect to notice and fire the remove event; you
  may
   need to lower the timeout for the cometd connections.
  
  
   Also,can i install more than one channel listener on a component?
   Never tried it, but there should be no problem, can you write a
  quickstart
   with your use cases, so I can flesh any bugs out?
  
  
   On Thu, Dec 24, 2009 at 10:03 AM, vineet semwal
   vineetsemwal1...@gmail.comwrote:
  
Hellos,
recently i started using wicketstuff push ,i have few doubts as
   following
..
i have a situation where i need to publish a event in page 2 and add
  the
channel listener in page 1 .
for eg. a sign out event published in page 2 which i do using a
 remove
listener.
   
Also,can i install more than one channel listener on a component?
   
--
regards,
Vineet Semwal
   
  
  
  
   --
   Rodolfo Hansen
   CTO, KindleIT Software Development
   Email: rhan...@kindleit.net
   Mobile: +1 (809) 860-6669
  
  
  
  
   --
   regards,
   Vineet Semwal
  
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
 
 
 
  --
  Rodolfo Hansen
  CTO, KindleIT Software Development
  Email: rhan...@kindleit.net
  Mobile: +1 (809) 860-6669
 



 --
 regards,
 Vineet Semwal




-- 
Rodolfo Hansen
CTO, KindleIT Software Development
Email: rhan...@kindleit.net
Mobile: +1 (809) 860-6669


Re: Image Bundler For Apache Wicket

2010-01-26 Thread Edward Zarecor
Do the comments in the inspiration design document about localization
also apply to your Wicket ImageBundle implementation?  If Wicket's
built in image handling functions as a locale-specific factory does
image localization work as expected with bundles?

Ed.


On Tue, Jan 26, 2010 at 12:23 PM, Andrew Lombardi
and...@mysticcoders.com wrote:
 This is very very cool.

 Congrats Anantha!

 On Jan 26, 2010, at 9:07 AM, Anantha Kumaran wrote:

 i will try to put it in the google appspot later. Here is the source code of
 a sample http://github.com/ananthakumaran/imagebundler-wicket

 On Tue, Jan 26, 2010 at 7:20 AM, Riyad Kalla rka...@gmail.com wrote:

 Very cool Anantha, do you have a site online that uses the bundler that we
 could take a peek at as a running example?

 On Tue, Jan 26, 2010 at 7:42 AM, Anantha Kumaran
 ananthakuma...@gmail.comwrote:

 http://ananthakumaran.github.com/imagebundler-wicket




 To our success!

 Mystic Coders, LLC | Code Magic | www.mysticcoders.com

 ANDREW LOMBARDI | and...@mysticcoders.com
 2321 E 4th St. Ste C-128, Santa Ana CA 92705
 ofc: 714-816-4488
 fax: 714-782-6024
 cell: 714-697-8046
 linked-in: http://www.linkedin.com/in/andrewlombardi
 twitter: http://www.twitter.com/kinabalu

 Eco-Tip: Printing e-mails is usually a waste.

 
 This message is for the named person's use only. You must not, directly or 
 indirectly, use,
  disclose, distribute, print, or copy any part of this message if you are not 
 the intended recipient.
 



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



Re: Using AjaxFormSubmitBehavior

2010-01-26 Thread Anna Simbirtsev
I changed it to use AjaxButton instead of AjaxFormSubmitBehavior and it
still does not see the values.

div class=submitareainput type=button
wicket:id=contact_submitbutton class=button/SUBMIT/div

FeedbackPanel contact_feedback = new FeedbackPanel(popup_feedback, new
ContainerFeedbackMessageFilter(contact_form));

contact_feedback.setOutputMarkupId(true);

contact_form.add(new RequiredTextFieldString(contact_id));

contact_form.add(new AjaxButton(contact_submitbutton) {
private static final long serialVersionUID =
4192112499051970470L;

@Override
protected void onSubmit(AjaxRequestTarget target, Form form)
{
System.out.println(Inside contact link's onSubmit is
called: + contact_data.getContactId());

}

@SuppressWarnings(unchecked)
@Override
protected void onError(AjaxRequestTarget target, Form form)
{
System.out.println(Inside contact link's onError is
called.);
target.addComponent(contact_feedback);
}
});

On Tue, Jan 26, 2010 at 2:05 PM, Pedro Santos pedros...@gmail.com wrote:

 Even using AjaxButton? Can you send the code?

 On Tue, Jan 26, 2010 at 4:55 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:

  Thanks, now in my feedback it displays errors that all required fields
 are
  empty. But the problem is, that even if I put the values in those fields
 it
  still does not see them and gives the same errors in the feedback panel.
 
  On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
 wrote:
 
   Take a look at the AjaxButton if you need an asynchronous submit, and
   implement your onError handlers with:
  
   target.addComponent(
  myFeedbackPanelThatMabyWillShowSomeMessageIfGetUpdated
   );
  
   On Tue, Jan 26, 2010 at 4:34 PM, Anna Simbirtsev 
 asimbirt...@gmail.com
   wrote:
  
I have, but maybe its incorrect.
   
div wicket:id=popup_feedback id=popup_feedback/div
   
contact_form.add(new FeedbackPanel(popup_feedback, new
ContainerFeedbackMessageFilter(contact_form) ));
   
On Tue, Jan 26, 2010 at 1:32 PM, Pedro Santos pedros...@gmail.com
   wrote:
   
 Do you have an feedback panel on the model?  If don't, add one and
  see
   if
 your form don't pass in some validation like on required field.

 On Tue, Jan 26, 2010 at 4:07 PM, Anna Simbirtsev 
   asimbirt...@gmail.com
 wrote:

  Hello,
 
  I have a modal window that is used to create a contact and needs
 to
 submit
  data to the server once submit button is called.
 
  The submit button is defined as follows:
 
  button wicket:id=contact_submitbutton
   type=submitSUBMIT/button
 
 
  contact_form.add(new Button(contact_submitbutton).add(new
  AjaxFormSubmitBehavior(contact_form, onclick) {
 
 private static final long serialVersionUID =
  4192112499051970470L;
 
 protected void onSubmit(AjaxRequestTarget target)
 {
 System.out.println(Inside contact link's onSubmit
  is
  called );
 
 }
 
 @Override
 protected void onError(AjaxRequestTarget target)
 {
 }
 }));
 
 
  But nothing happens when I click on the button.
 
  Thanks,
 
  Anna
 



 --
 Pedro Henrique Oliveira dos Santos

   
   
   
--
Anna Simbirtsev
(416) 729-7331
   
  
  
  
   --
   Pedro Henrique Oliveira dos Santos
  
 
 
 
  --
  Anna Simbirtsev
  (416) 729-7331
 



 --
 Pedro Henrique Oliveira dos Santos




-- 
Anna Simbirtsev
(416) 729-7331


Re: Should Duration be deprecated?

2010-01-26 Thread Jonathan Locke


TimeUnit is icky and storing time values in primitive types is a bad idea.


Alexandru Objelean wrote:
 
 I was wondering why would wicket need Duration class as long as java
 provides a similar TimeUnit. Maybe it would be a good idea to deprecate
 this
 class  encourage usage of TimeUnit?
 
 Alex Objelean
 
 

-- 
View this message in context: 
http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.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: Should Duration be deprecated?

2010-01-26 Thread James Carman
All data in Java is ultimately stored as some sort of primitive type.

On Tue, Jan 26, 2010 at 2:55 PM, Jonathan Locke
jonathan.lo...@gmail.com wrote:


 TimeUnit is icky and storing time values in primitive types is a bad idea.


 Alexandru Objelean wrote:

 I was wondering why would wicket need Duration class as long as java
 provides a similar TimeUnit. Maybe it would be a good idea to deprecate
 this
 class  encourage usage of TimeUnit?

 Alex Objelean



 --
 View this message in context: 
 http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.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: Using AjaxFormSubmitBehavior

2010-01-26 Thread Anna Simbirtsev
I have to add that its all done inside a modal window.

div class=addicon img src=images/add-ico.gif border=0nbsp;a
href=#a
href=#TB_inline?height=605amp;width=820amp;inlineId=CreateContactContentamp;modal=true
title= class=thickboxCreate Contact/a/a/div

On Tue, Jan 26, 2010 at 2:26 PM, Anna Simbirtsev asimbirt...@gmail.comwrote:

 I changed it to use AjaxButton instead of AjaxFormSubmitBehavior and it
 still does not see the values.

 div class=submitareainput type=button
 wicket:id=contact_submitbutton class=button/SUBMIT/div

 FeedbackPanel contact_feedback = new FeedbackPanel(popup_feedback, new
 ContainerFeedbackMessageFilter(contact_form));

 contact_feedback.setOutputMarkupId(true);

 contact_form.add(new RequiredTextFieldString(contact_id));

 contact_form.add(new AjaxButton(contact_submitbutton) {

 private static final long serialVersionUID =
 4192112499051970470L;

 @Override
 protected void onSubmit(AjaxRequestTarget target, Form form)
 {
 System.out.println(Inside contact link's onSubmit is
 called: + contact_data.getContactId());

 }

 @SuppressWarnings(unchecked)
 @Override
 protected void onError(AjaxRequestTarget target, Form form)
 {
 System.out.println(Inside contact link's onError is
 called.);
 target.addComponent(contact_feedback);
 }
 });


 On Tue, Jan 26, 2010 at 2:05 PM, Pedro Santos pedros...@gmail.com wrote:

 Even using AjaxButton? Can you send the code?

 On Tue, Jan 26, 2010 at 4:55 PM, Anna Simbirtsev asimbirt...@gmail.com
 wrote:

  Thanks, now in my feedback it displays errors that all required fields
 are
  empty. But the problem is, that even if I put the values in those fields
 it
  still does not see them and gives the same errors in the feedback panel.
 
  On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
 wrote:
 
   Take a look at the AjaxButton if you need an asynchronous submit, and
   implement your onError handlers with:
  
   target.addComponent(
  myFeedbackPanelThatMabyWillShowSomeMessageIfGetUpdated
   );
  
   On Tue, Jan 26, 2010 at 4:34 PM, Anna Simbirtsev 
 asimbirt...@gmail.com
   wrote:
  
I have, but maybe its incorrect.
   
div wicket:id=popup_feedback id=popup_feedback/div
   
contact_form.add(new FeedbackPanel(popup_feedback, new
ContainerFeedbackMessageFilter(contact_form) ));
   
On Tue, Jan 26, 2010 at 1:32 PM, Pedro Santos pedros...@gmail.com
   wrote:
   
 Do you have an feedback panel on the model?  If don't, add one and
  see
   if
 your form don't pass in some validation like on required field.

 On Tue, Jan 26, 2010 at 4:07 PM, Anna Simbirtsev 
   asimbirt...@gmail.com
 wrote:

  Hello,
 
  I have a modal window that is used to create a contact and needs
 to
 submit
  data to the server once submit button is called.
 
  The submit button is defined as follows:
 
  button wicket:id=contact_submitbutton
   type=submitSUBMIT/button
 
 
  contact_form.add(new Button(contact_submitbutton).add(new
  AjaxFormSubmitBehavior(contact_form, onclick) {
 
 private static final long serialVersionUID =
  4192112499051970470L;
 
 protected void onSubmit(AjaxRequestTarget target)
 {
 System.out.println(Inside contact link's
 onSubmit
  is
  called );
 
 }
 
 @Override
 protected void onError(AjaxRequestTarget target)
 {
 }
 }));
 
 
  But nothing happens when I click on the button.
 
  Thanks,
 
  Anna
 



 --
 Pedro Henrique Oliveira dos Santos

   
   
   
--
Anna Simbirtsev
(416) 729-7331
   
  
  
  
   --
   Pedro Henrique Oliveira dos Santos
  
 
 
 
  --
  Anna Simbirtsev
  (416) 729-7331
 



 --
 Pedro Henrique Oliveira dos Santos




 --
 Anna Simbirtsev
 (416) 729-7331




-- 
Anna Simbirtsev
(416) 729-7331


Re: wicketstuff-push and component replacing

2010-01-26 Thread Rodolfo Hansen
Try now...

To me, the push service is overly complicated, and you could easily get away
with simply using Wicket's AjaxTimeoutBehavior as there are no technical
advantages over the later.

The comet version of push offers a couple of serious advantages for the
server, and client side. Why can't you use that instead?


On Tue, Jan 26, 2010 at 11:12 AM, Rodolfo Hansen kry...@gmail.com wrote:

 I have basically concentrated on the CometD Service
 This should be a simple bug to fix.



 On Fri, Jan 22, 2010 at 10:34 AM, Roland Vares roland.va...@uptime.eewrote:

 Hello,

 I'm currently developing wicket based application, which displays alarms
 on map and allows their modification.
 New alarms are sent to server through soap service and map with few other
 components on page for all browser clients needs to be refreshed.

 I'm using wicketstuff-push for the push service implementation.
 org.wicketstuff.push.timer.TimerPushService to be clear.



 As an in examples I have method on wicket page which is activated when
 server sends notification about an event:
// set new listener for incoming events
final IPushTarget pushTarget =
 getTimerPushService().installPush(this);
getPushService().addMapListener(new
 MapServiceListener() {
public void onEventChange(final Event event) {
if
 (pushTarget.isConnected()) {
Label label = new Label(labelonpage,label); //label
 to be replaced
pushTarget.addComponent(label);
pushTarget.trigger();
}
else { // remove inactive listener

  LOG.debug(Removing map listener  + this);

  getPushService().removeMapListener(this);
}
...

 Problems start with line :
 Label label = new Label(labelonpage,label);

 which results with:
 org.apache.wicket.WicketRuntimeException: There is no application attached
 to current thread btpool0-2
at org.apache.wicket.Application.get(Application.java:179)
at
 org.apache.wicket.Component.getApplication(Component.java:1323)
at org.apache.wicket.Component.init(Component.java:920)

 It seems that in this push method, context is lost, I have no session,
 request,...

 Is there any way I gan regain it or make new?

 Or how should I implement push service, which needs to replace some
 components on page?

 Thanks in advance,
 Roland




 --
 Rodolfo Hansen
 CTO, KindleIT Software Development
 Email: rhan...@kindleit.net
 Mobile: +1 (809) 860-6669




-- 
Rodolfo Hansen
CTO, KindleIT Software Development
Email: rhan...@kindleit.net
Mobile: +1 (809) 860-6669


Re: Image Bundler For Apache Wicket

2010-01-26 Thread Jeremy Thomerson
Looks cool - but rather than generating a static string, why don't you
generate a string that includes a call to urlFor(Class, imageName) so that
you can allow for internationalization? (Wicket will generate the proper
internationalized URL for you this way)...

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 8:42 AM, Anantha Kumaran
ananthakuma...@gmail.comwrote:

 http://ananthakumaran.github.com/imagebundler-wicket



Re: Should Duration be deprecated?

2010-01-26 Thread Igor Vaynberg
i thought they were all stored as electrons

-igor

On Tue, Jan 26, 2010 at 12:00 PM, James Carman
jcar...@carmanconsulting.com wrote:
 All data in Java is ultimately stored as some sort of primitive type.

 On Tue, Jan 26, 2010 at 2:55 PM, Jonathan Locke
 jonathan.lo...@gmail.com wrote:


 TimeUnit is icky and storing time values in primitive types is a bad idea.


 Alexandru Objelean wrote:

 I was wondering why would wicket need Duration class as long as java
 provides a similar TimeUnit. Maybe it would be a good idea to deprecate
 this
 class  encourage usage of TimeUnit?

 Alex Objelean



 --
 View this message in context: 
 http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.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



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



Re: Page load after an action

2010-01-26 Thread Jeremy Thomerson
Yes - James is right here - it's a loadable detachable model - so it needs
to load the data in order to repopulate the list before deleting the item.

My guess is either you need to call the detach so that on the re-render it
gets reloaded, or you need to make sure your delete is being committed to
the DB before the re-render.  Perhaps the transaction was not committed?

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 1:14 PM, James Carman
jcar...@carmanconsulting.comwrote:

 Doesn't it have to load the model so that it knows what item it's talking
 to?

 On Tue, Jan 26, 2010 at 2:12 PM, Riyad Kalla rka...@gmail.com wrote:
  Seems weird to me as well that 'detach' has to be explicitly called. Also
  still curious why Stephane was seeing the log ordering he did when the
 link
  was clicked:
 
  
  Loading all news
  News deleted
  
 
  I'd expect to see news deleted first, from his onClick handler then the
  loading all news caused by the call to load() before the response was
  sent -- in which case it seems he wouldn't have run into this issue in
 the
  first place.
 
  It's entirely possible I'm missing the wicket processing sequence here
 being
  something else which would explain this.
 
  On Tue, Jan 26, 2010 at 9:59 AM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
  Thanks Pedro, it's ok now ;-)
 
  I use LoadableDetachableModel to avoid the call to detach() method. It
 does
  not seem that is the right way. Somebody can explain me why ?
 
  Stéphane
 
 
  Pedro Santos a écrit :
 
   by calling getDefaultModel inside onClick, you get an reference to the
  link
  component model. You need to detach the model on your list view. You
 has
  an
  reference to it on your variable news. So:
  news.getDefaultModel().detach()
  If you need, you can change that variable modifiers or turn it an
 instance
  variable for have acess to it inside your onClick implementation.
 
  On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
 
  The behaviour is the same with the following code :(
 
 
   public void onClick() {
   // TODO : check the refresh issue
   getNewsDao().delete(item.getModelObject());
   ourLogger.debug(News deleted);
   getDefaultModel().detach();
 }
 
 
  Pedro Santos a écrit :
 
   missing line: call detach method just after delete your item.
 
 
  On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
  wrote:
 
 
 
 
 
  Call news.getDefaultModel().detach(), and look for more info about
  detachable models.
 
  http://cwiki.apache.org/WICKET/detachable-models.html
 
  On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
 
 
 
  Hi,
 
  I don't use Hibernate. My persistence layer uses JDBC.
 
  What is strange when I click the delete link, it's the logs order :
 
  Loading all news
  News deleted
 
  So it seems that the deletion is done after the data reload :(
 
  Stéphane
 
 
  Riyad Kalla a écrit :
 
   Stephane,
 
 
 
 
  I'll let someone smarter than me address the wicket issue of
 removing
  the
  item from the ListView and seeing if that helps -- but is there a
  chance
  you
  are using Hibernate and the Level 2 ehcache plugin or any
 2nd-level
  caching
  with your persistence code? I ask because I've seen code like this
 I
  don't
  see my changes until the 2nd refresh! a lot with folks using 2nd
  level
  caches and not seeing immediate persistence of those changes.
 
  On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
 
 
 
 
 
  Please find my code just below :
 
 
  public class NewsListPage  {
 
   protected static transient NewsDao myNewsDao;
 
   public NewsListPage() {
 PageableListViewNews news =
 new PageableListViewNews(list, new NewsModel(), 15){
 
 @Override
 protected void populateItem(final ListItemNews item) {
 ourLogger.debug(Getting item value
  +item.getModelObject().getTitle());
 
 News news = item.getModelObject();
   item.add(new Label(date, new
  Model(news.getDate(;
   LinkNews l = new LinkNews(edit){
 
 @Override
 public void onClick() {
 setResponsePage(new
  NewsPage(item.getModelObject()));
   }
  };
 
 item.add(l);
 l.add(new Label(title, news.getTitle()));
 
 item.add(new LinkNews(delete, new Model()){
 
 @Override
 public void onClick() {
 // TODO : check the refresh issue
 getNewsDao().delete(item.getModelObject());
 ourLogger.debug(News deleted);
   }
 

Re: Should Duration be deprecated?

2010-01-26 Thread Riyad Kalla
... touche? :)

On Tue, Jan 26, 2010 at 2:00 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 i thought they were all stored as electrons

 -igor

 On Tue, Jan 26, 2010 at 12:00 PM, James Carman
 jcar...@carmanconsulting.com wrote:
  All data in Java is ultimately stored as some sort of primitive type.
 
  On Tue, Jan 26, 2010 at 2:55 PM, Jonathan Locke
  jonathan.lo...@gmail.com wrote:
 
 
  TimeUnit is icky and storing time values in primitive types is a bad
 idea.
 
 
  Alexandru Objelean wrote:
 
  I was wondering why would wicket need Duration class as long as java
  provides a similar TimeUnit. Maybe it would be a good idea to deprecate
  this
  class  encourage usage of TimeUnit?
 
  Alex Objelean
 
 
 
  --
  View this message in context:
 http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.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
 
 

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




Re: Should Duration be deprecated?

2010-01-26 Thread Jeremy Thomerson
Yeah - and although I haven't confirmed it myself, I have been told that all
dates are actually stored as 0's and 1's - and that must be why there was
such a fuss in 2000 - too many zeroes and not enough ones - or something
like that.

:)

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Jan 26, 2010 at 2:00 PM, James Carman
jcar...@carmanconsulting.comwrote:

 All data in Java is ultimately stored as some sort of primitive type.

 On Tue, Jan 26, 2010 at 2:55 PM, Jonathan Locke
 jonathan.lo...@gmail.com wrote:
 
 
  TimeUnit is icky and storing time values in primitive types is a bad
 idea.
 
 
  Alexandru Objelean wrote:
 
  I was wondering why would wicket need Duration class as long as java
  provides a similar TimeUnit. Maybe it would be a good idea to deprecate
  this
  class  encourage usage of TimeUnit?
 
  Alex Objelean
 
 
 
  --
  View this message in context:
 http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.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: Should Duration be deprecated?

2010-01-26 Thread Matej Knopp
There is a difference between

MILLISECONDS.toSeconds(duration) and duration.toSeconds()

As for all data being stored as primitives, sometimes being able to
access it on higher level can be kinda nice...

-Matej

On Tue, Jan 26, 2010 at 9:00 PM, James Carman
jcar...@carmanconsulting.com wrote:
 All data in Java is ultimately stored as some sort of primitive type.

 On Tue, Jan 26, 2010 at 2:55 PM, Jonathan Locke
 jonathan.lo...@gmail.com wrote:


 TimeUnit is icky and storing time values in primitive types is a bad idea.


 Alexandru Objelean wrote:

 I was wondering why would wicket need Duration class as long as java
 provides a similar TimeUnit. Maybe it would be a good idea to deprecate
 this
 class  encourage usage of TimeUnit?

 Alex Objelean



 --
 View this message in context: 
 http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.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



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



Re: Should Duration be deprecated?

2010-01-26 Thread James Carman
I was misinformed.  I stand corrected! :)

On Tue, Jan 26, 2010 at 4:00 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 i thought they were all stored as electrons

 -igor

 On Tue, Jan 26, 2010 at 12:00 PM, James Carman
 jcar...@carmanconsulting.com wrote:
 All data in Java is ultimately stored as some sort of primitive type.

 On Tue, Jan 26, 2010 at 2:55 PM, Jonathan Locke
 jonathan.lo...@gmail.com wrote:


 TimeUnit is icky and storing time values in primitive types is a bad idea.


 Alexandru Objelean wrote:

 I was wondering why would wicket need Duration class as long as java
 provides a similar TimeUnit. Maybe it would be a good idea to deprecate
 this
 class  encourage usage of TimeUnit?

 Alex Objelean



 --
 View this message in context: 
 http://old.nabble.com/Should-Duration-be-deprecated--tp27323675p27328738.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



 -
 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: Page load after an action

2010-01-26 Thread James Carman
Or, call detach(), then call modelChanged()?

On Tue, Jan 26, 2010 at 4:02 PM, Jeremy Thomerson
jer...@wickettraining.com wrote:
 Yes - James is right here - it's a loadable detachable model - so it needs
 to load the data in order to repopulate the list before deleting the item.

 My guess is either you need to call the detach so that on the re-render it
 gets reloaded, or you need to make sure your delete is being committed to
 the DB before the re-render.  Perhaps the transaction was not committed?

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 1:14 PM, James Carman
 jcar...@carmanconsulting.comwrote:

 Doesn't it have to load the model so that it knows what item it's talking
 to?

 On Tue, Jan 26, 2010 at 2:12 PM, Riyad Kalla rka...@gmail.com wrote:
  Seems weird to me as well that 'detach' has to be explicitly called. Also
  still curious why Stephane was seeing the log ordering he did when the
 link
  was clicked:
 
  
  Loading all news
  News deleted
  
 
  I'd expect to see news deleted first, from his onClick handler then the
  loading all news caused by the call to load() before the response was
  sent -- in which case it seems he wouldn't have run into this issue in
 the
  first place.
 
  It's entirely possible I'm missing the wicket processing sequence here
 being
  something else which would explain this.
 
  On Tue, Jan 26, 2010 at 9:59 AM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
  Thanks Pedro, it's ok now ;-)
 
  I use LoadableDetachableModel to avoid the call to detach() method. It
 does
  not seem that is the right way. Somebody can explain me why ?
 
  Stéphane
 
 
  Pedro Santos a écrit :
 
   by calling getDefaultModel inside onClick, you get an reference to the
  link
  component model. You need to detach the model on your list view. You
 has
  an
  reference to it on your variable news. So:
  news.getDefaultModel().detach()
  If you need, you can change that variable modifiers or turn it an
 instance
  variable for have acess to it inside your onClick implementation.
 
  On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
 
  The behaviour is the same with the following code :(
 
 
                   public void onClick() {
                       // TODO : check the refresh issue
                       getNewsDao().delete(item.getModelObject());
                       ourLogger.debug(News deleted);
                       getDefaultModel().detach();
                                         }
 
 
  Pedro Santos a écrit :
 
   missing line: call detach method just after delete your item.
 
 
  On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos pedros...@gmail.com
  wrote:
 
 
 
 
 
  Call news.getDefaultModel().detach(), and look for more info about
  detachable models.
 
  http://cwiki.apache.org/WICKET/detachable-models.html
 
  On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
 
 
 
  Hi,
 
  I don't use Hibernate. My persistence layer uses JDBC.
 
  What is strange when I click the delete link, it's the logs order :
 
  Loading all news
  News deleted
 
  So it seems that the deletion is done after the data reload :(
 
  Stéphane
 
 
  Riyad Kalla a écrit :
 
   Stephane,
 
 
 
 
  I'll let someone smarter than me address the wicket issue of
 removing
  the
  item from the ListView and seeing if that helps -- but is there a
  chance
  you
  are using Hibernate and the Level 2 ehcache plugin or any
 2nd-level
  caching
  with your persistence code? I ask because I've seen code like this
 I
  don't
  see my changes until the 2nd refresh! a lot with folks using 2nd
  level
  caches and not seeing immediate persistence of those changes.
 
  On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean 
  stephane.jeanj...@softeam.com wrote:
 
 
 
 
 
 
 
  Please find my code just below :
 
 
  public class NewsListPage  {
 
   protected static transient NewsDao myNewsDao;
 
   public NewsListPage() {
     PageableListViewNews news =
     new PageableListViewNews(list, new NewsModel(), 15){
 
        �...@override
         protected void populateItem(final ListItemNews item) {
             ourLogger.debug(Getting item value
  +item.getModelObject().getTitle());
 
             News news = item.getModelObject();
                           item.add(new Label(date, new
  Model(news.getDate(;
                           LinkNews l = new LinkNews(edit){
 
                �...@override
                 public void onClick() {
                     setResponsePage(new
  NewsPage(item.getModelObject()));
                                       }
  };
 
             item.add(l);
             l.add(new Label(title, news.getTitle()));
 
             item.add(new LinkNews(delete, new Model()){
 
                �...@override
                 public void onClick() {
                     // TODO : check the refresh issue
                     

Scrolling wicket components into View?

2010-01-26 Thread Corbin, James
Hello,

 

I have a page that I dynamically add components to using a repeating
view.  At some point in the process, my components are rendered off the
visible browser page.

Is there a slick way in Wicket to ensure that a component dynamically
added to a repeating view is in view on the page?

 

I've looked into the window.onScroll functionality but wanted to see if
there were any best practices in the wicket community around solving
this issue.

 

Thanks,

 

J.D.



Re: Image Bundler For Apache Wicket

2010-01-26 Thread Riyad Kalla
Just ran across another base64-based method of spriting images that
Cappuccino is using:
http://cappuccino.org/discuss/2009/11/11/just-one-file-with-cappuccino-0-8

pretty interesting and supports back to IE6. Just wanted to share incase
anyone else reading on this subject was curious about other techniques.

-R

On Tue, Jan 26, 2010 at 1:59 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Looks cool - but rather than generating a static string, why don't you
 generate a string that includes a call to urlFor(Class, imageName) so that
 you can allow for internationalization? (Wicket will generate the proper
 internationalized URL for you this way)...

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 8:42 AM, Anantha Kumaran
 ananthakuma...@gmail.comwrote:

  http://ananthakumaran.github.com/imagebundler-wicket
 



Maven problem with wicketstuff

2010-01-26 Thread Warren Bell
I am trying to retrieve wicketstuff-core from repository and am getting 
the following Missing artifact.


Missing artifact org.wicketstuff:wicketstuff-core:jar:1.4.2-SNAPSHOT:compile

my pom

...
   repository
   idwicket-snaps/id
   urlhttp://wicketstuff.org/maven/repository/url
   snapshots
   enabledtrue/enabled
   /snapshots
   releases
   enabledtrue/enabled
   /releases
   /repository
...

   dependency
   groupIdorg.wicketstuff/groupId
   artifactIdwicketstuff-core/artifactId
   version1.4.2-SNAPSHOT/version
   /dependency
...


What am I doing wrong?

Thanks,

Warren

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



Re: How to change content in ModalWindow - minor success!

2010-01-26 Thread Steve Swinsburg
You could just have the ModalWindow's contents be set in the onClick of the 
button that shows the window.
Then you know if the checkbox has been checked or not and you can add in the 
appropriate panel, then just show the window.

In my app I have any number of modal windows that might show depending on the 
state of the page so I just construct it when I need it.

cheers,
Steve



On 26/01/2010, at 5:30 AM, Chris Colman wrote:

 Also, it seems like ModalWindow.setTitle will not update the title after
 the initial ModalWindow.show has been called.
 
 Is there any way to trigger a title update after show has been called?
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 5:15 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow - minor success!
 
 Well I managed to get the panels to replace without adding a new
 ModalWindow to the stack each time:
 
 replacePanel(Panel existingPanel, Panel newPanel, String title,
 AjaxRequestTarget target)
 {
  existingPanel.replaceWith(newPanel);
  newPanel.setOutputMarkupId(true);
  modalContentWindow.setTitle(title);
  target.addComponent(newPanel);
 }
 
 This appears to work wonderfully - it allows me to toggle the
 ModalWindow content between two different PanelS and it does so
 cleanly
 with no flicker.
 
 However the 'Close' button that I added to each Panel will only work
 if
 no content toggling has taken place. Once the content has been toggled
 the Close button doesn't trigger a modal close. The 'X' in the top
 right
 of the Modal still works fine.
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 4:27 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow
 
 For this to work can I use Panels for the Modal content or do I need
 to
 use Pages for the content and set up a PageCreator?
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 4:03 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow
 
 My use case might explain the situation better:
 
 User visits a page that needs authentication. A ModalWindow
 appears
 with
 a username/password field pair and a 'sign in' button. In case
 they
 are
 a new user it also contains a 'create account' button. If they
 click
 this then the contents of the ModalWindow changes to hold more
 fields,
 name, email, password, confirm password etc., sufficient to
 creating
 a
 new account. I wanted to do a nice smooth switch from the 'sign
 in'
 presentation to the 'create account' presentation without the
 flicker
 of
 closing the form and bringing up a new form.
 
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 3:58 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow
 
 I tried that initially but calling modalContentWindow.show when
 there
 already is a ModalWindow being displayed creates a new
 ModalWindow
 that
 sits over the top of the original one meaning I now have 2
 windows
 that
 the user has to close.
 
 My aim is to have only one ModalWindow but just switch its
 contents.
 
 Aren't you missing a :
 
 modalContentWindow.show(target)
 
 in the onClick callback ?
 
 2010/1/25 Chris Colman chr...@stepaheadsoftware.com
 
 Searching Nable shows this question has been asked before
 but
 there
 none
 of the solutions proposed there work for me.
 
 I have a link in PanelA that, when clicked, should cause
 PanelB
 to
 display in the same ModalWindow (PanelB replaced PanelA).
 
 The onClick event handler does something like the following:
 
   add
   (
   new AjaxLink(selectionLink)
   {
   public void onClick(AjaxRequestTarget target)
   {
   PanelB panelB = new
 
 PanelB(modalContentWindow.getContentId());
 
   modalContentWindow.setContent(panelB);
   modalContentWindow.setTitle(Hi, I'm
 PanelB);
   target.addComponent(panelB);
   }
   }
   );
 
 When the link is pressed the panel A content disappears
 (popup
 content
 goes blank) but the panel B content does not appear.
 
 Should this work or have I missed something?
 
 
 
 
 -
 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
 
 
 
 

Re: Maven problem with wicketstuff

2010-01-26 Thread mbrictson

What part of wicketstuff do you want to use in your project? The
wicketstuff-core artifact is not a JAR artifact. You have to specify the
actual JAR you need, like annotation, for example:

dependency
  groupIdorg.wicketstuff/groupId
  artifactIdannotation/artifactId
  version1.4.2-SNAPSHOT/version
/dependency


Warren Bell-2 wrote:
 
 I am trying to retrieve wicketstuff-core from repository and am getting 
 the following Missing artifact.
 
 Missing artifact
 org.wicketstuff:wicketstuff-core:jar:1.4.2-SNAPSHOT:compile
 
 my pom
 
 ...
 repository
 idwicket-snaps/id
 urlhttp://wicketstuff.org/maven/repository/url
 snapshots
 enabledtrue/enabled
 /snapshots
 releases
 enabledtrue/enabled
 /releases
 /repository
 ...
 
 dependency
 groupIdorg.wicketstuff/groupId
 artifactIdwicketstuff-core/artifactId
 version1.4.2-SNAPSHOT/version
 /dependency
 ...
 
 
 What am I doing wrong?
 
 Thanks,
 
 Warren
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Maven-problem-with-wicketstuff-tp27332061p27332549.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: Maven problem with wicketstuff

2010-01-26 Thread Warren Bell

wicketstuff-minis

I found it:

   dependency
   groupIdorg.wicketstuff/groupId
   artifactIdminis/artifactId
   version1.4.1/version
   /dependency

Thanks

mbrictson wrote:

What part of wicketstuff do you want to use in your project? The
wicketstuff-core artifact is not a JAR artifact. You have to specify the
actual JAR you need, like annotation, for example:

dependency
  groupIdorg.wicketstuff/groupId
  artifactIdannotation/artifactId
  version1.4.2-SNAPSHOT/version
/dependency


Warren Bell-2 wrote:
  
I am trying to retrieve wicketstuff-core from repository and am getting 
the following Missing artifact.


Missing artifact
org.wicketstuff:wicketstuff-core:jar:1.4.2-SNAPSHOT:compile

my pom

...
repository
idwicket-snaps/id
urlhttp://wicketstuff.org/maven/repository/url
snapshots
enabledtrue/enabled
/snapshots
releases
enabledtrue/enabled
/releases
/repository
...

dependency
groupIdorg.wicketstuff/groupId
artifactIdwicketstuff-core/artifactId
version1.4.2-SNAPSHOT/version
/dependency
...


What am I doing wrong?

Thanks,

Warren

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






  



--
Thanks,

Warren Bell


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



Re: Wicket, Spring 3 and UnitTesting

2010-01-26 Thread mbrictson

Why not use Spring's StaticWebApplicationContext?

StaticWebApplicationContext ctx = new StaticWebApplicationContext();
ctx.getBeanFactory().registerSingleton(serviceOfDoom, mock);

http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/web/context/support/StaticWebApplicationContext.html


Jochen Mader-2 wrote:
 
 Just figured out how to do UnitTesting with Spring 3 and Wicket.
 Spring 3 introduced a check to see if a given context was a
 WebApplicationContext. That means ApplicationContextMock is not suitable
 for
 testing (giving the infamous  No WebApplicationContext found: no
 ContextLoaderListener registered? message).
 I simply extended the class and added WebApplicationContext interface.
 
 The following example shows how to get it going (I hope the code doesn't
 get
 messed up):
 
 
 public class TestHomePage extends TestCase {
 
 private WicketTester tester;
 
 
  @Override
 
 public void setUp() {
 
 final WebApplicationContextMock appctx = new WebApplicationContextMock();
 
 
  final ServiceOfDoom mock = createMock(ServiceOfDoom.class);
 
 expect(mock.getIt()).andReturn(whups).anyTimes();
 
 replay(mock);
 
  tester = new WicketTester(new WicketApplication()) {
 
 @Override
 
 public ServletContext newServletContext(String path) {
 
 MockServletContext servletContext = (MockServletContext) super
 
 .newServletContext(path);
 
 appctx.setServletContext(servletContext);
 
 appctx.putBean(scratchy, mock);
 
 servletContext
 
 .setAttribute(
 
 WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
 
 appctx);
 
 return servletContext;
 
 }
 
 };
 
 tester.getApplication().addComponentInstantiationListener(
 
 new SpringComponentInjector(tester.getApplication(), appctx,
 
 false));
 
 }
 
 
  public void testRenderMyPage() {
 
 // start and render the test page
 
 tester.startPage(HomePage.class);
 
 
  // assert rendered page class
 
 tester.assertRenderedPage(HomePage.class);
 
 
  // assert rendered label component
 
 tester
 
 .assertLabel(message,
 
 whups);
 
 }
 
 
  private class WebApplicationContextMock extends ApplicationContextMock
 
 implements WebApplicationContext {
 
 private ServletContext servletContext;
 
 
  public T T getBean(ClassT requiredType) throws BeansException {
 
 // TODO Auto-generated method stub
 
 return null;
 
 }
 
 
  public   A findAnnotationOnBean(String beanName,
 
 Class  annotationType) {
 
 // TODO Auto-generated method stub
 
 return null;
 
 }
 
 
  public MapString, Object getBeansWithAnnotation(
 
 Class? extends Annotation annotationType)
 
 throws BeansException {
 
 // TODO Auto-generated method stub
 
 return null;
 
 }
 
 
  public void setServletContext(ServletContext servletContext) {
 
 this.servletContext = servletContext;
 
 }
 
 
  public ServletContext getServletContext() {
 
 return null;
 
 }
 
 
  }
 
 }
 
 

-- 
View this message in context: 
http://old.nabble.com/Wicket%2C-Spring-3-and-UnitTesting-tp27320784p27332886.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: Image Bundler For Apache Wicket

2010-01-26 Thread Anantha Kumaran
Thanks for the Reply. I will look into it.

On Tue, Jan 26, 2010 at 12:59 PM, Jeremy Thomerson 
jer...@wickettraining.com wrote:

 Looks cool - but rather than generating a static string, why don't you
 generate a string that includes a call to urlFor(Class, imageName) so that
 you can allow for internationalization? (Wicket will generate the proper
 internationalized URL for you this way)...

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Tue, Jan 26, 2010 at 8:42 AM, Anantha Kumaran
 ananthakuma...@gmail.comwrote:

  http://ananthakumaran.github.com/imagebundler-wicket
 



Re: Resetting a form after ajax submit

2010-01-26 Thread Flavius


For anybody who's interested, I got this to work by just
calling form.textField.setModelValue(new String[]{});
I had to make the fields member vars of the form, though.

If there's another cleaner way of doing it, I'd appreciate seeing it.


Flavius wrote:
 
  
 I have a panel with a form on it.  I've attached an ajaxButton to submit
 the form.  Afterward, I want the inputs to be reset with the backing model
 reset.  I've done a lot of refreshing with an ajax submit, but I can't
 seem
 to get the form's values to reset in the webpage.  The backing model seems
 to be reset, but when I add the form (or it's individual children) to the
 target,
 they don't refresh.
 
 I've done a variation of this where I have a repeating view up top and
 when 
 that row is selected, it would populate the form, but I had to put the
 form
 in a fragment and add the fragment to the target to get that to work.  Can
 somebody tell me what I'm doing wrong here?
 
 Thanks
 
 public class MyPanel extends Panel
 {
   public MyPanel(String id, Widget myWidget)
   {
   MyForm myForm = new MyForm(myForm, new MyWidget());
   add(myForm);
   add(new AjaxButton(saveLink, myForm)
   {
   @Override
   protected void onSubmit(AjaxRequestTarget target,
 Form form)
   {
   //save stuff
   //refresh repeating view
   //now reset the form so the input fields are
 cleared and there's
   //a new backing model
   form.clearInput();  //this isn't working
   form.setDefaultModelObject(new MyWidget());
 //this seems to reset the backing model, but the inputs are still popuated
 on the page
   target.addComponent(form);
   }
   }
   }
 
   private MyForm myForm extends Form
   {
   public MyForm(String id, Widget myWidget)
   {   
   TextField textField = new
 TextFieldString(myField, new PropertyModelString(myWidget,
 myField));
   add(textField);
   ...
   }
   }
 }
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Resetting-a-form-after-ajax-submit-tp27318108p27334057.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: Resetting a form after ajax submit

2010-01-26 Thread Andrew Lombardi
You should only need access to the Model on the Form, which you would set to 
empty, and then you have two options 

1. Get access to the TextField so you can repaint it with AjaxRequestTarget
2. Use FormComponent's IVisitor pattern to visit everything in that form to 
repaint

On Jan 26, 2010, at 8:36 PM, Flavius wrote:

 
 
 For anybody who's interested, I got this to work by just
 calling form.textField.setModelValue(new String[]{});
 I had to make the fields member vars of the form, though.
 
 If there's another cleaner way of doing it, I'd appreciate seeing it.
 
 
 Flavius wrote:
 
 
 I have a panel with a form on it.  I've attached an ajaxButton to submit
 the form.  Afterward, I want the inputs to be reset with the backing model
 reset.  I've done a lot of refreshing with an ajax submit, but I can't
 seem
 to get the form's values to reset in the webpage.  The backing model seems
 to be reset, but when I add the form (or it's individual children) to the
 target,
 they don't refresh.
 
 I've done a variation of this where I have a repeating view up top and
 when 
 that row is selected, it would populate the form, but I had to put the
 form
 in a fragment and add the fragment to the target to get that to work.  Can
 somebody tell me what I'm doing wrong here?
 
 Thanks
 
 public class MyPanel extends Panel
 {
  public MyPanel(String id, Widget myWidget)
  {
  MyForm myForm = new MyForm(myForm, new MyWidget());
  add(myForm);
  add(new AjaxButton(saveLink, myForm)
  {
  @Override
  protected void onSubmit(AjaxRequestTarget target,
 Form form)
  {
  //save stuff
  //refresh repeating view
  //now reset the form so the input fields are
 cleared and there's
  //a new backing model
  form.clearInput();  //this isn't working
  form.setDefaultModelObject(new MyWidget());
 //this seems to reset the backing model, but the inputs are still popuated
 on the page
  target.addComponent(form);
  }
  }
  }
 
  private MyForm myForm extends Form
  {
  public MyForm(String id, Widget myWidget)
  {   
  TextField textField = new
 TextFieldString(myField, new PropertyModelString(myWidget,
 myField));
  add(textField);
  ...
  }
  }
 }
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -- 
 View this message in context: 
 http://old.nabble.com/Resetting-a-form-after-ajax-submit-tp27318108p27334057.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 our success!

Mystic Coders, LLC | Code Magic | www.mysticcoders.com

ANDREW LOMBARDI | and...@mysticcoders.com
2321 E 4th St. Ste C-128, Santa Ana CA 92705
ofc: 714-816-4488
fax: 714-782-6024
cell: 714-697-8046
linked-in: http://www.linkedin.com/in/andrewlombardi
twitter: http://www.twitter.com/kinabalu

Eco-Tip: Printing e-mails is usually a waste.


This message is for the named person's use only. You must not, directly or 
indirectly, use,
 disclose, distribute, print, or copy any part of this message if you are not 
the intended recipient.




RE: How to change content in ModalWindow - minor success!

2010-01-26 Thread Chris Colman

 You could just have the ModalWindow's contents be set in the onClick
of
 the button that shows the window.

That's how I'm opening them but that's not the problem. The problem is
once I have a ModalWindow open I want to switch the contents without the
'flicker' of shutting down the ModalWindow and opening up another one.

Although I tried doing the shut down/reopen and didn't have much success
with that either. Maybe that's not possible with Wicket/AJAX - it might
want to do only major action for any AJAX event i.e. either close or
open a modal but not both together.

 Then you know if the checkbox has been checked or not and you can add
in
 the appropriate panel, then just show the window.
 
 In my app I have any number of modal windows that might show depending
on
 the state of the page so I just construct it when I need it.
 
 cheers,
 Steve
 
 
 
 On 26/01/2010, at 5:30 AM, Chris Colman wrote:
 
  Also, it seems like ModalWindow.setTitle will not update the title
after
  the initial ModalWindow.show has been called.
 
  Is there any way to trigger a title update after show has been
called?
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 5:15 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow - minor success!
 
  Well I managed to get the panels to replace without adding a new
  ModalWindow to the stack each time:
 
  replacePanel(Panel existingPanel, Panel newPanel, String title,
  AjaxRequestTarget target)
  {
 existingPanel.replaceWith(newPanel);
 newPanel.setOutputMarkupId(true);
 modalContentWindow.setTitle(title);
 target.addComponent(newPanel);
  }
 
  This appears to work wonderfully - it allows me to toggle the
  ModalWindow content between two different PanelS and it does so
  cleanly
  with no flicker.
 
  However the 'Close' button that I added to each Panel will only
work
  if
  no content toggling has taken place. Once the content has been
toggled
  the Close button doesn't trigger a modal close. The 'X' in the top
  right
  of the Modal still works fine.
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 4:27 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow
 
  For this to work can I use Panels for the Modal content or do I
need
  to
  use Pages for the content and set up a PageCreator?
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 4:03 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow
 
  My use case might explain the situation better:
 
  User visits a page that needs authentication. A ModalWindow
  appears
  with
  a username/password field pair and a 'sign in' button. In case
  they
  are
  a new user it also contains a 'create account' button. If they
  click
  this then the contents of the ModalWindow changes to hold more
  fields,
  name, email, password, confirm password etc., sufficient to
  creating
  a
  new account. I wanted to do a nice smooth switch from the 'sign
  in'
  presentation to the 'create account' presentation without the
  flicker
  of
  closing the form and bringing up a new form.
 
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 3:58 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow
 
  I tried that initially but calling modalContentWindow.show when
  there
  already is a ModalWindow being displayed creates a new
  ModalWindow
  that
  sits over the top of the original one meaning I now have 2
  windows
  that
  the user has to close.
 
  My aim is to have only one ModalWindow but just switch its
  contents.
 
  Aren't you missing a :
 
  modalContentWindow.show(target)
 
  in the onClick callback ?
 
  2010/1/25 Chris Colman chr...@stepaheadsoftware.com
 
  Searching Nable shows this question has been asked before
  but
  there
  none
  of the solutions proposed there work for me.
 
  I have a link in PanelA that, when clicked, should cause
  PanelB
  to
  display in the same ModalWindow (PanelB replaced PanelA).
 
  The onClick event handler does something like the following:
 
add
(
new AjaxLink(selectionLink)
{
public void onClick(AjaxRequestTarget target)
{
PanelB panelB = new
 
  PanelB(modalContentWindow.getContentId());
 
modalContentWindow.setContent(panelB);
modalContentWindow.setTitle(Hi, I'm
  PanelB);
target.addComponent(panelB);
}
}
);
 
  When the link is pressed the panel A content disappears
  (popup
  content
  goes blank) but the panel B content does not appear.
 
  Should this work or have I missed something?
 
 
 
 
 

Re: How to change content in ModalWindow - minor success!

2010-01-26 Thread Martin Makundi
Hi!

 That's how I'm opening them but that's not the problem. The problem is
 once I have a ModalWindow open I want to switch the contents without the
 'flicker' of shutting down the ModalWindow and opening up another one.

For us we have done it just by replacing the content panel:

modalWindow.setContent(newContent);
ajaxRequestTarget.addComponent(newContent);

**
Martin

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



Re: How to change content in ModalWindow - minor success!

2010-01-26 Thread Martin Makundi
Hi!

Actually no, we did not use setContent but we used
modalWindow.replace(newContent);

**
Martin

2010/1/27 Martin Makundi martin.maku...@koodaripalvelut.com:
 Hi!

 That's how I'm opening them but that's not the problem. The problem is
 once I have a ModalWindow open I want to switch the contents without the
 'flicker' of shutting down the ModalWindow and opening up another one.

 For us we have done it just by replacing the content panel:

 modalWindow.setContent(newContent);
 ajaxRequestTarget.addComponent(newContent);

 **
 Martin


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



Re: PageExpiredException after fourth call modal window

2010-01-26 Thread Alexey Tomin

1.4.5



In window with list, I call modal window
(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)
with my edit window (extends org.apache.wicket.markup.html.WebPage with
WebSession.get().createAutoPageMap()).

This edit window contains some link, wich also create modal window for
select value from list.
If user click on this link fourth times (even user click on same link
and close select modal window without any select), after close edit
window wicket throws exception PageExpiredException.


... else select page created with
WebSession.get().createAutoPageMap()
in constructor...

What case to use WebSession.get().createAutoPageMap() in page constructor?
Why in not select window?


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



Re: How to change content in ModalWindow - minor success!

2010-01-26 Thread Steve Swinsburg
Ah I thought the 'create new account' check box was on the parent page and 
checked before the Window was opened. But its in the window itself. Right so 
you want to replace a panel in the page. In that case:

I do this as well as I have a form in my ModalWindow that allows a user to 
confirm an action and then a message is displayed. The content of the 
ModalWindow is just a Panel, the components of which you can just replace 
normally via the AjaxRequestTarget.

cheers,
Steve





On 27/01/2010, at 4:33 PM, Chris Colman wrote:

 
 You could just have the ModalWindow's contents be set in the onClick
 of
 the button that shows the window.
 
 That's how I'm opening them but that's not the problem. The problem is
 once I have a ModalWindow open I want to switch the contents without the
 'flicker' of shutting down the ModalWindow and opening up another one.
 
 Although I tried doing the shut down/reopen and didn't have much success
 with that either. Maybe that's not possible with Wicket/AJAX - it might
 want to do only major action for any AJAX event i.e. either close or
 open a modal but not both together.
 
 Then you know if the checkbox has been checked or not and you can add
 in
 the appropriate panel, then just show the window.
 
 In my app I have any number of modal windows that might show depending
 on
 the state of the page so I just construct it when I need it.
 
 cheers,
 Steve
 
 
 
 On 26/01/2010, at 5:30 AM, Chris Colman wrote:
 
 Also, it seems like ModalWindow.setTitle will not update the title
 after
 the initial ModalWindow.show has been called.
 
 Is there any way to trigger a title update after show has been
 called?
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 5:15 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow - minor success!
 
 Well I managed to get the panels to replace without adding a new
 ModalWindow to the stack each time:
 
 replacePanel(Panel existingPanel, Panel newPanel, String title,
 AjaxRequestTarget target)
 {
existingPanel.replaceWith(newPanel);
newPanel.setOutputMarkupId(true);
modalContentWindow.setTitle(title);
target.addComponent(newPanel);
 }
 
 This appears to work wonderfully - it allows me to toggle the
 ModalWindow content between two different PanelS and it does so
 cleanly
 with no flicker.
 
 However the 'Close' button that I added to each Panel will only
 work
 if
 no content toggling has taken place. Once the content has been
 toggled
 the Close button doesn't trigger a modal close. The 'X' in the top
 right
 of the Modal still works fine.
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 4:27 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow
 
 For this to work can I use Panels for the Modal content or do I
 need
 to
 use Pages for the content and set up a PageCreator?
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 4:03 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow
 
 My use case might explain the situation better:
 
 User visits a page that needs authentication. A ModalWindow
 appears
 with
 a username/password field pair and a 'sign in' button. In case
 they
 are
 a new user it also contains a 'create account' button. If they
 click
 this then the contents of the ModalWindow changes to hold more
 fields,
 name, email, password, confirm password etc., sufficient to
 creating
 a
 new account. I wanted to do a nice smooth switch from the 'sign
 in'
 presentation to the 'create account' presentation without the
 flicker
 of
 closing the form and bringing up a new form.
 
 
 -Original Message-
 From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
 Sent: Tuesday, 26 January 2010 3:58 AM
 To: users@wicket.apache.org
 Subject: RE: How to change content in ModalWindow
 
 I tried that initially but calling modalContentWindow.show when
 there
 already is a ModalWindow being displayed creates a new
 ModalWindow
 that
 sits over the top of the original one meaning I now have 2
 windows
 that
 the user has to close.
 
 My aim is to have only one ModalWindow but just switch its
 contents.
 
 Aren't you missing a :
 
 modalContentWindow.show(target)
 
 in the onClick callback ?
 
 2010/1/25 Chris Colman chr...@stepaheadsoftware.com
 
 Searching Nable shows this question has been asked before
 but
 there
 none
 of the solutions proposed there work for me.
 
 I have a link in PanelA that, when clicked, should cause
 PanelB
 to
 display in the same ModalWindow (PanelB replaced PanelA).
 
 The onClick event handler does something like the following:
 
  add
  (
  new AjaxLink(selectionLink)
  {
  public void onClick(AjaxRequestTarget target)
  {
  PanelB panelB = new
 
 

Re: wicket bench in eclipse

2010-01-26 Thread Lionel Port
Agree with Huake Ingmar. The functionality doesn't overlap at all. My
main reason for wanting the plugin to work is to switch easily between
the html and the java code for the same component. In a maven project
this is particular a hassle because the java code is in packages under
/src/main/java and the html code is in packages under
/src/main/resources. I can't really find a quick way (preferable
single keystroke to flip between them). I also ideally want code
completion on the wicket ids but thats secondary.

regards,
Lionel

On Tue, Jan 26, 2010 at 12:48 AM, Hauke Ingmar Schmidt
haukeing...@gmail.com wrote:
 Hej,

 2010/1/25 Peter Karich peat...@yahoo.de:
 Is it
 time to buy an IDEA license where there seems to be a quite nice
 toolset for Wicket?

 I downloaded the open source version of IntelliJ and the wicket plugin seems
 to work.

 Yes, but the free version of IDEA is lacking too much in other fields:
 http://www.jetbrains.com/idea/features/editions_comparison_matrix.html
 .

 There is also a wicket plugin for NetBeans, which is working.

 Well, yes, but then it's Netbeans...

 But a pure maven project wihtout a plugin isn't that different.
 Or am I missing an important feature of the eclipse plugin?

 Hm... Maven and the different Wicket IDE plugins don't intersect in
 functionality. The plugins all try to give a little help when working
 with Wicket components and pages, e.g. showing the wicket:ids when
 working with the Java code to prevent hierarchy mismatch or offering
 property model navigation as this is (still) string based.

 Eclipse plugin features:
 http://www.laughingpanda.org/~inhuman/wicket-bench/docs/features-0.5.html
 Netbeans: https://nbwicketsupport.dev.java.net/ (well, that page needs
 a little make over...)
 IDEA: http://code.google.com/p/wicketforge/wiki/PluginFeatures

 Hej då
 Hauke Ingmar

 -
 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: How to change content in ModalWindow - minor success!

2010-01-26 Thread Chris Colman
I ended up creating an AjaxTabbedPanel inside the modal and let the
users switch between Sign in and Create account by choosing the
appropriate tab.

It actually a fairly reasonable solution.

I had tried the modalWindow.replace(newContent); idea but that didn't
work either for some reason.

 -Original Message-
 From: Steve Swinsburg [mailto:steve.swinsb...@gmail.com]
 Sent: Wednesday, 27 January 2010 4:53 PM
 To: users@wicket.apache.org
 Subject: Re: How to change content in ModalWindow - minor success!
 
 Ah I thought the 'create new account' check box was on the parent page
and
 checked before the Window was opened. But its in the window itself.
Right
 so you want to replace a panel in the page. In that case:
 
 I do this as well as I have a form in my ModalWindow that allows a
user to
 confirm an action and then a message is displayed. The content of the
 ModalWindow is just a Panel, the components of which you can just
replace
 normally via the AjaxRequestTarget.
 
 cheers,
 Steve
 
 
 
 
 
 On 27/01/2010, at 4:33 PM, Chris Colman wrote:
 
 
  You could just have the ModalWindow's contents be set in the
onClick
  of
  the button that shows the window.
 
  That's how I'm opening them but that's not the problem. The problem
is
  once I have a ModalWindow open I want to switch the contents without
the
  'flicker' of shutting down the ModalWindow and opening up another
one.
 
  Although I tried doing the shut down/reopen and didn't have much
success
  with that either. Maybe that's not possible with Wicket/AJAX - it
might
  want to do only major action for any AJAX event i.e. either close or
  open a modal but not both together.
 
  Then you know if the checkbox has been checked or not and you can
add
  in
  the appropriate panel, then just show the window.
 
  In my app I have any number of modal windows that might show
depending
  on
  the state of the page so I just construct it when I need it.
 
  cheers,
  Steve
 
 
 
  On 26/01/2010, at 5:30 AM, Chris Colman wrote:
 
  Also, it seems like ModalWindow.setTitle will not update the title
  after
  the initial ModalWindow.show has been called.
 
  Is there any way to trigger a title update after show has been
  called?
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 5:15 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow - minor
success!
 
  Well I managed to get the panels to replace without adding a new
  ModalWindow to the stack each time:
 
  replacePanel(Panel existingPanel, Panel newPanel, String title,
  AjaxRequestTarget target)
  {
   existingPanel.replaceWith(newPanel);
   newPanel.setOutputMarkupId(true);
   modalContentWindow.setTitle(title);
   target.addComponent(newPanel);
  }
 
  This appears to work wonderfully - it allows me to toggle the
  ModalWindow content between two different PanelS and it does so
  cleanly
  with no flicker.
 
  However the 'Close' button that I added to each Panel will only
  work
  if
  no content toggling has taken place. Once the content has been
  toggled
  the Close button doesn't trigger a modal close. The 'X' in the
top
  right
  of the Modal still works fine.
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 4:27 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow
 
  For this to work can I use Panels for the Modal content or do I
  need
  to
  use Pages for the content and set up a PageCreator?
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 4:03 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow
 
  My use case might explain the situation better:
 
  User visits a page that needs authentication. A ModalWindow
  appears
  with
  a username/password field pair and a 'sign in' button. In case
  they
  are
  a new user it also contains a 'create account' button. If they
  click
  this then the contents of the ModalWindow changes to hold more
  fields,
  name, email, password, confirm password etc., sufficient to
  creating
  a
  new account. I wanted to do a nice smooth switch from the 'sign
  in'
  presentation to the 'create account' presentation without the
  flicker
  of
  closing the form and bringing up a new form.
 
 
  -Original Message-
  From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
  Sent: Tuesday, 26 January 2010 3:58 AM
  To: users@wicket.apache.org
  Subject: RE: How to change content in ModalWindow
 
  I tried that initially but calling modalContentWindow.show
when
  there
  already is a ModalWindow being displayed creates a new
  ModalWindow
  that
  sits over the top of the original one meaning I now have 2
  windows
  that
  the user has to close.
 
  My aim is to have only one ModalWindow but just switch its
  contents.
 
  Aren't you 

Re: wicket bench in eclipse

2010-01-26 Thread Chuck Brinkman
I had not heard of wicket bench before reading this email thread.  So, I
installed it and found that it doesn't play well with 'myeclipse'; not sure
where the fault lies.  So I just don't use it as a default editor.  I do
like some of the features.  If you just want to switch between java and html
use 'alt + leftarrow' and 'alt + rightarrow'.  This switches between
recently edited files.

On Wed, Jan 27, 2010 at 1:06 AM, Lionel Port lionel.p...@gmail.com wrote:

 Agree with Huake Ingmar. The functionality doesn't overlap at all. My
 main reason for wanting the plugin to work is to switch easily between
 the html and the java code for the same component. In a maven project
 this is particular a hassle because the java code is in packages under
 /src/main/java and the html code is in packages under
 /src/main/resources. I can't really find a quick way (preferable
 single keystroke to flip between them). I also ideally want code
 completion on the wicket ids but thats secondary.

 regards,
 Lionel

 On Tue, Jan 26, 2010 at 12:48 AM, Hauke Ingmar Schmidt
 haukeing...@gmail.com wrote:
  Hej,
 
  2010/1/25 Peter Karich peat...@yahoo.de:
  Is it
  time to buy an IDEA license where there seems to be a quite nice
  toolset for Wicket?
 
  I downloaded the open source version of IntelliJ and the wicket plugin
 seems
  to work.
 
  Yes, but the free version of IDEA is lacking too much in other fields:
  http://www.jetbrains.com/idea/features/editions_comparison_matrix.html
  .
 
  There is also a wicket plugin for NetBeans, which is working.
 
  Well, yes, but then it's Netbeans...
 
  But a pure maven project wihtout a plugin isn't that different.
  Or am I missing an important feature of the eclipse plugin?
 
  Hm... Maven and the different Wicket IDE plugins don't intersect in
  functionality. The plugins all try to give a little help when working
  with Wicket components and pages, e.g. showing the wicket:ids when
  working with the Java code to prevent hierarchy mismatch or offering
  property model navigation as this is (still) string based.
 
  Eclipse plugin features:
 
 http://www.laughingpanda.org/~inhuman/wicket-bench/docs/features-0.5.htmlhttp://www.laughingpanda.org/%7Einhuman/wicket-bench/docs/features-0.5.html
  Netbeans: https://nbwicketsupport.dev.java.net/ (well, that page needs
  a little make over...)
  IDEA: http://code.google.com/p/wicketforge/wiki/PluginFeatures
 
  Hej då
  Hauke Ingmar
 
  -
  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: Should Duration be deprecated?

2010-01-26 Thread Martijn Dashorst
On Tue, Jan 26, 2010 at 10:00 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 i thought they were all stored as electrons

My vote goes to Umpalumpa's shifting miniature pumpkins on scales

Martijn

-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4

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