Re: DataTable update components on Page Change

2013-05-12 Thread Francois Meillet
Hi David,

With the event mechanism, you don't need to keep reference.
Yours components keep loosely coupled.

In the onPageChanged() method you can send an event like this
send(getPage(), Broadcast.BREADTH, new YourEvent());


see the exemple: http://www.wicket-library.com/wicket-examples/events/
and at the end of this page : 
http://wicket.apache.org/2011/09/07/wicket-1.5-released.html


François Meillet
Formation Wicket - Développement Wicket





Le 11 mai 2013 à 17:37, David Beer david.m.b...@gmail.com a écrit :

 Hi Francois
 
 Thanks for the reply I am not sure howfrom a reference to my table which 
 Extends DataTable I can update the button when the onPageChanged() method is 
 fired. My Table looks like the following.
 
 AJaxTableContact, String contacts = new AJaxTableContact, 
 String(persons, columns, new SortableContactDataProvider(), 10) {
@Override
protected void onPageChanged() {
super.onPageChanged();
System.out.println(Page Changed);
//enable or disable submitButton
}
};
 
 submitButton is initialized as follows:
 
 submitButton = new DefaultBootstrapButton(submit-button, 
 Model.of(Submit));
submitButton.add(new ButtonBehavior(Buttons.Type.Primary));
submitButton.setOutputMarkupId(true);
submitButton.setEnabled(false);
 
 AjaxTable class looks like the following:
 
 public class AJaxTableT, S extends DataTableT, S {
 
public AJaxTable(String id, List columns, ISortableDataProvider 
 dataProvider, int rowsPerPage) {
super(id, columns, dataProvider, rowsPerPage);
setOutputMarkupId(true);
setVersioned(false);
addTopToolbar(new HeadersToolbar(this, dataProvider));
addBottomToolbar(new NoRecordsToolbar(this));
addBottomToolbar(new BootstrapNavigationToolbar(this));
}
 
 }
 
 Any help or examples are much appreciated.
 
 Thanks
 
 David
 
 On 11/05/13 08:27, Francois Meillet wrote:
 You can use the event handling mechanism.
 
 
 François Meillet
 Formation Wicket - Développement Wicket
 
 
 
 
 
 Le 11 mai 2013 à 01:17, David Beer david.m.b...@gmail.com a écrit :
 
 Hi All
 
 I have an Ajax DataTable that extends DataTable and when I click the 
 navigation panel to change page in the table I would like to make sure that 
 the necessary components are disable or enabled. What is the best way of 
 doing this?
 
 So on onPageChanged I would like to enable or disable my form submit 
 buttons. The buttons are Ajax enabled.
 
 Thanks
 
 David
 
 -
 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: Spring @Autowire not working

2013-05-12 Thread Joachim Schrod
ORACLEADF wrote:
 Hi Nick
 Thank you.
 I create a file applicationContext.xml like the following pic and I use it
 in DAO and BO classes :

Is your applicationContext.xml read at all?
I.e., are your beans actually created?

To check: Does your log contains a line like

INFO XmlBeanDefinitionReader - Loading XML bean definitions from
ServletContext resource [/WEB-INF/applicationContext.xml]

(Actual format may be different, depends on your logging
configuration.)

If not, you need to declare the ContextLoaderListener in web.xml,
and maybe the location of applicationContext.xml if it's not in
WEB-INF.

Joachim

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod, Roedermark, Germany
Email: jsch...@acm.org


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



Re: Spring @Autowire not working

2013-05-12 Thread Nick Pratt
OK, your test doesnt test anything Wicket related, and is purely a Spring
application.

In order to use Spring in a wicket app, you need to check out some of the
articles on the web - Google for Wicket spring application and there are
several full working examples of how to use Spring in a Wicket application.

Primarily you have to initialize the Spring app context in the web.xml via
a ContextLoaderListener, and then in your Wicket Application's init()
method, you need to add a SpringComponentInjector as a listener.  Then as I
mentioned a few days back, you need to use @SpringBean to annotate the
fields you want autowired.  There are a handful of other cases where you
will have to trigger the bean injection manually, but get your basic app
working first with Spring.

N


On Sun, May 12, 2013 at 12:34 AM, ORACLEADF ora@gmail.com wrote:

 Hi Nick
 Thank you.
 I create a file applicationContext.xml like the following pic and I use it
 in DAO and BO classes :
 applicationContext.xml_.png
 
 http://apache-wicket.1842946.n4.nabble.com/file/n4658733/applicationContext.xml_.png
 

 and I tested it using public static void main like the following pic :
 psvm.png 
 http://apache-wicket.1842946.n4.nabble.com/file/n4658733/psvm.png




 -
 Regards
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Spring-Autowire-not-working-tp4658728p4658733.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: DataTable update components on Page Change

2013-05-12 Thread David Beer

Hi Francois

Thanks for your help, this useful in firing the event but how can I get 
it so that the buttons state is updated on the page. Sorry If I am 
missing something but am having trouble seeing how I can do this if I  
can't get hold of the AjaxRequestTarget.


I am using wicket 6.6.0

Thanks for your help really appreciated

David

On 12/05/13 09:40, Francois Meillet wrote:

Hi David,

With the event mechanism, you don't need to keep reference.
Yours components keep loosely coupled.

In the onPageChanged() method you can send an event like this
send(getPage(), Broadcast.BREADTH, new YourEvent());


see the exemple: http://www.wicket-library.com/wicket-examples/events/
and at the end of this page : 
http://wicket.apache.org/2011/09/07/wicket-1.5-released.html


François Meillet
Formation Wicket - Développement Wicket





Le 11 mai 2013 à 17:37, David Beer david.m.b...@gmail.com a écrit :


Hi Francois

Thanks for the reply I am not sure howfrom a reference to my table which 
Extends DataTable I can update the button when the onPageChanged() method is 
fired. My Table looks like the following.

AJaxTableContact, String contacts = new AJaxTableContact, String(persons, 
columns, new SortableContactDataProvider(), 10) {
@Override
protected void onPageChanged() {
super.onPageChanged();
System.out.println(Page Changed);
//enable or disable submitButton
}
};

submitButton is initialized as follows:

submitButton = new DefaultBootstrapButton(submit-button, Model.of(Submit));
submitButton.add(new ButtonBehavior(Buttons.Type.Primary));
submitButton.setOutputMarkupId(true);
submitButton.setEnabled(false);

AjaxTable class looks like the following:

public class AJaxTableT, S extends DataTableT, S {

public AJaxTable(String id, List columns, ISortableDataProvider 
dataProvider, int rowsPerPage) {
super(id, columns, dataProvider, rowsPerPage);
setOutputMarkupId(true);
setVersioned(false);
addTopToolbar(new HeadersToolbar(this, dataProvider));
addBottomToolbar(new NoRecordsToolbar(this));
addBottomToolbar(new BootstrapNavigationToolbar(this));
}

}

Any help or examples are much appreciated.

Thanks

David

On 11/05/13 08:27, Francois Meillet wrote:

You can use the event handling mechanism.


François Meillet
Formation Wicket - Développement Wicket





Le 11 mai 2013 à 01:17, David Beer david.m.b...@gmail.com a écrit :


Hi All

I have an Ajax DataTable that extends DataTable and when I click the navigation 
panel to change page in the table I would like to make sure that the necessary 
components are disable or enabled. What is the best way of doing this?

So on onPageChanged I would like to enable or disable my form submit buttons. 
The buttons are Ajax enabled.

Thanks

David

-
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: DataTable update components on Page Change

2013-05-12 Thread David Beer

Hi Francois

Thanks for the pointers I have now solved this problem thanks again.

David
On 12/05/13 18:38, David Beer wrote:

Hi Francois

Thanks for your help, this useful in firing the event but how can I 
get it so that the buttons state is updated on the page. Sorry If I am 
missing something but am having trouble seeing how I can do this if I  
can't get hold of the AjaxRequestTarget.


I am using wicket 6.6.0

Thanks for your help really appreciated

David

On 12/05/13 09:40, Francois Meillet wrote:

Hi David,

With the event mechanism, you don't need to keep reference.
Yours components keep loosely coupled.

In the onPageChanged() method you can send an event like this
send(getPage(), Broadcast.BREADTH, new YourEvent());


see the exemple: http://www.wicket-library.com/wicket-examples/events/
and at the end of this page : 
http://wicket.apache.org/2011/09/07/wicket-1.5-released.html



François Meillet
Formation Wicket - Développement Wicket





Le 11 mai 2013 à 17:37, David Beer david.m.b...@gmail.com a écrit :


Hi Francois

Thanks for the reply I am not sure howfrom a reference to my table 
which Extends DataTable I can update the button when the 
onPageChanged() method is fired. My Table looks like the following.


AJaxTableContact, String contacts = new AJaxTableContact, 
String(persons, columns, new SortableContactDataProvider(), 10) {

@Override
protected void onPageChanged() {
super.onPageChanged();
System.out.println(Page Changed);
//enable or disable submitButton
}
};

submitButton is initialized as follows:

submitButton = new DefaultBootstrapButton(submit-button, 
Model.of(Submit));

submitButton.add(new ButtonBehavior(Buttons.Type.Primary));
submitButton.setOutputMarkupId(true);
submitButton.setEnabled(false);

AjaxTable class looks like the following:

public class AJaxTableT, S extends DataTableT, S {

public AJaxTable(String id, List columns, ISortableDataProvider 
dataProvider, int rowsPerPage) {

super(id, columns, dataProvider, rowsPerPage);
setOutputMarkupId(true);
setVersioned(false);
addTopToolbar(new HeadersToolbar(this, dataProvider));
addBottomToolbar(new NoRecordsToolbar(this));
addBottomToolbar(new BootstrapNavigationToolbar(this));
}

}

Any help or examples are much appreciated.

Thanks

David

On 11/05/13 08:27, Francois Meillet wrote:

You can use the event handling mechanism.


François Meillet
Formation Wicket - Développement Wicket





Le 11 mai 2013 à 01:17, David Beer david.m.b...@gmail.com a écrit :


Hi All

I have an Ajax DataTable that extends DataTable and when I click 
the navigation panel to change page in the table I would like to 
make sure that the necessary components are disable or enabled. 
What is the best way of doing this?


So on onPageChanged I would like to enable or disable my form 
submit buttons. The buttons are Ajax enabled.


Thanks

David

-
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