Re: Re: Re: Basic JUnit Test

2012-08-20 Thread JCoder
Hi Vineet,

thanks for the reply. The line 
tester.getServletRequest().setParameter(myParam, testParam);
But now Im breaking my head with the next issue. If you look at my first post, 
Im trying to do a test where a second page is rendered after a submit on an 
AjaxButton. The test code looks like this:

1. FirstPage page = (FirstPage) tester.startPage(FirstPage.class, 
pageParameters);
2. tester.assertRenderedPage(FirstPage.class);
3. page.getActionForm().setType(1); // where actionForm is a property/attribute 
of FirstPage.
4. FormTester formTester = tester.newFormTester(myForm);
5. tester.getServletRequest().setParameter(myParam, testParam);
6. tester.executeAjaxEvent(myForm:myAjaxButton, onclick);
7. tester.assertRenderedPage(SecondPage.class); 

The the test fails within the onSubmit(AjaxRequestTarget target, Form? 
form) saying that the attribute/property actionForm is null...
Obviously the second (Ajax-) request is not shipped with the attribute/property 
values of his containing panel. Is this correct? Who can help me out here?

Regards,
Yusuf

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



Modal Window set focus

2012-08-20 Thread Marco Di Sabatino Di Diodoro
Hi all,

I want to set the focus to a ModalWindow when it is opened. This allows me to 
close the ModalWIndow with the esc key without having to click on it before.

suggestions?

Thanks
M

--

Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PPMC Member
http://people.apache.org/~mdisabatino






Re: Modal Window set focus

2012-08-20 Thread Martin Grigorov
Hi,

You open it with modal.show(target), right ?
Since you have the 'target' you can use it to execute an arbitrary
JavaScript after opening the modal: target.append(someJsToFocus).

The JS should look like: document.getElementById(
+modal.getMarkupId()+ ).focus();

On Mon, Aug 20, 2012 at 11:44 AM, Marco Di Sabatino Di Diodoro
marco.disabat...@tirasa.net wrote:
 Hi all,

 I want to set the focus to a ModalWindow when it is opened. This allows me to 
 close the ModalWIndow with the esc key without having to click on it before.

 suggestions?

 Thanks
 M

 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Setfocus depending on error routine

2012-08-20 Thread Delange
Hi, possibly it's already discussed by I don't see it.

How to set focus on a variable field during a check? For example a form with
address fields. 
Every field is checked and when, for example, the zipcode is wrong I want to
set focus on the zipcode.
What to do?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setfocus-depending-on-error-routine-tp4651364.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: Modal Window set focus

2012-08-20 Thread Marco Di Sabatino Di Diodoro

I add target.appendJavaScript(document.getElementById(' + 
editModalWin.getMarkupId() + ').focus(););  

But not work...

Here you can found my code:

   final AjaxLink createLink = new IndicatingAjaxLink(createLink) {

private static final long serialVersionUID = -7978723352517770644L;

@Override
public void onClick(final AjaxRequestTarget target) {
editModalWin.setPageCreator(new ModalWindow.PageCreator() {

private static final long serialVersionUID = 
-7834632442532690940L;

@Override
public Page createPage() {
return new 
EditUserModalPage(Users.this.getPageReference(), editModalWin, new UserTO());
}
});
target.appendJavaScript(document.getElementById(' + 
editModalWin.getMarkupId() + ').focus(););
editModalWin.show(target);
}
};



On Aug 20, 2012, at 10:49 AM, Martin Grigorov wrote:

 Hi,
 
 You open it with modal.show(target), right ?
 Since you have the 'target' you can use it to execute an arbitrary
 JavaScript after opening the modal: target.append(someJsToFocus).
 
 The JS should look like: document.getElementById(
 +modal.getMarkupId()+ ).focus();
 
 On Mon, Aug 20, 2012 at 11:44 AM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:
 Hi all,
 
 I want to set the focus to a ModalWindow when it is opened. This allows me 
 to close the ModalWIndow with the esc key without having to click on it 
 before.
 
 suggestions?
 
 Thanks
 M
 
 --
 
 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570
 
 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net
 
 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino
 
 
 
 
 
 
 
 -- 
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

--

Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 085973
http://www.tirasa.net

Apache Syncope PPMC Member
http://people.apache.org/~mdisabatino






Re: Modal Window set focus

2012-08-20 Thread Martin Grigorov
Only form elements can be focused in HTML by default.
To make a normal div focusable you need to add 'tabindex' attribute to it.

Experiment with Firebug/DevTools first. Find the JS that can focus
your modal window and then just add it in your Java code.

On Mon, Aug 20, 2012 at 12:54 PM, Marco Di Sabatino Di Diodoro
marco.disabat...@tirasa.net wrote:

 I add target.appendJavaScript(document.getElementById(' + 
 editModalWin.getMarkupId() + ').focus(););

 But not work...

 Here you can found my code:

final AjaxLink createLink = new IndicatingAjaxLink(createLink) {

 private static final long serialVersionUID = 
 -7978723352517770644L;

 @Override
 public void onClick(final AjaxRequestTarget target) {
 editModalWin.setPageCreator(new ModalWindow.PageCreator() {

 private static final long serialVersionUID = 
 -7834632442532690940L;

 @Override
 public Page createPage() {
 return new 
 EditUserModalPage(Users.this.getPageReference(), editModalWin, new UserTO());
 }
 });
 target.appendJavaScript(document.getElementById(' + 
 editModalWin.getMarkupId() + ').focus(););
 editModalWin.show(target);
 }
 };



 On Aug 20, 2012, at 10:49 AM, Martin Grigorov wrote:

 Hi,

 You open it with modal.show(target), right ?
 Since you have the 'target' you can use it to execute an arbitrary
 JavaScript after opening the modal: target.append(someJsToFocus).

 The JS should look like: document.getElementById(
 +modal.getMarkupId()+ ).focus();

 On Mon, Aug 20, 2012 at 11:44 AM, Marco Di Sabatino Di Diodoro
 marco.disabat...@tirasa.net wrote:
 Hi all,

 I want to set the focus to a ModalWindow when it is opened. This allows me 
 to close the ModalWIndow with the esc key without having to click on it 
 before.

 suggestions?

 Thanks
 M

 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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


 --

 Dott. Marco Di Sabatino Di Diodoro
 Tel. +39 3939065570

 Tirasa S.r.l.
 Viale D'Annunzio 267 - 65127 Pescara
 Tel +39 0859116307 / FAX +39 085973
 http://www.tirasa.net

 Apache Syncope PPMC Member
 http://people.apache.org/~mdisabatino







-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Dataview: need message nothing found

2012-08-20 Thread Delange
I tried this, but I can't figure out how to convert from datatable to an
AbstractRepeater.



DataTable table = new DataTable(datatable, columns, kostenOVProvider, 10){
protected Item newRowItem(String id, int index, IModel 
model) { 
Item item = super.newRowItem(id, index, model); 
item.add(new AttributeModifier(class,  new Model( 
index % 2 == 0 ? even : odd))); 
return item; 
}  
};
FilterToolbar filterToolbar = new FilterToolbar(table, form,
kostenOVProvider);
table.addTopToolbar(new HeadersToolbar(table, 
kostenOVProvider));
table.addTopToolbar(filterToolbar);
table.addBottomToolbar(new NavigationToolbar(table));
form.add(table);
form.add(new NoRecordsContainer(norecordsFound, table));



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337p4651369.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: Wicket fragment is not working inside wicket extend in wicket 1.5.3

2012-08-20 Thread Thomas Matthijs
On Mon, Aug 20, 2012 at 11:57 AM, bala ji balaji@gmail.com wrote:
 I've added a scenario where i need to use wicket:fragments.
 wicket:extend
  ...
 span wicket:id=myPanelExample input (will be removed)/span
  ...
  wicket:fragment wicket:id=frag1panel 1/wicket:fragment
  wicket:fragment wicket:id=frag2panel 2/wicket:fragment
  /wicket:extend

  The above situation is working fine in case of wicket 1.4, but now in
 wicket 1.5.3 its giving me an error of No Markup found.

 I attached the sample project, please give me the solution for the problems


If you remove the TransparentWebMarkupContainer from the BasePage it
works, so fragments are fine in wicket:extends, but the transparent
container somehow seems to mess it up (i have never used TWMC before,
so not sure how its supposed to work)

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



Re: Wicket fragment is not working inside wicket extend in wicket 1.5.3

2012-08-20 Thread bala ji
hi,
Can u give me the exact solution whether the fragments inside wicket:extend
are working in wicket 1.5.3 or not.
On Mon, Aug 20, 2012 at 3:41 PM, Thomas Matthijs li...@selckin.be wrote:

 On Mon, Aug 20, 2012 at 11:57 AM, bala ji balaji@gmail.com wrote:
  I've added a scenario where i need to use wicket:fragments.
  wicket:extend
   ...
  span wicket:id=myPanelExample input (will be removed)/span
   ...
   wicket:fragment wicket:id=frag1panel 1/wicket:fragment
   wicket:fragment wicket:id=frag2panel 2/wicket:fragment
   /wicket:extend
 
   The above situation is working fine in case of wicket 1.4, but now in
  wicket 1.5.3 its giving me an error of No Markup found.
 
  I attached the sample project, please give me the solution for the
 problems
 

 If you remove the TransparentWebMarkupContainer from the BasePage it
 works, so fragments are fine in wicket:extends, but the transparent
 container somehow seems to mess it up (i have never used TWMC before,
 so not sure how its supposed to work)

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




-- 
Balaji.N


Re: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
Thoughts, anybody?

On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:
 The main problem I am facing is that in Wicket 1.4.x I can't figure
 out how to access ART from the component that was not added to this
 ART, e.g. during ajax form submission.

 I tried to add AjaxFormSubmitBehavior to every Form child of the page
 but that overrode those form ajax-submit functionality and basically
 broke them all. Now I am thinking about adding an onclick behavior
 which will add my component to ART to every AjaxSubmitLink child of
 the page. But this seems to be pretty ugly.

 Thoughts?

 Thanks,

 Ale

 On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Thank you for the link. I used your code to register an
 ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
 created, but it does not get called when the form is submitted and
 hence it never adds the FeedbackPanel to ART of form submission.

 Where should I add this listener?

 Thanks,

 Alec

 On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
 procrastinative.develo...@gmail.com wrote:
 Hello Alec,
 Could you take a look on this:

 https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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


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



Re: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Tibor Blénessy
You can access current ART associated with request by calling static
AjaxRequestTarget.get()

Tibor

On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan alecs...@gmail.com wrote:
 Thoughts, anybody?

 On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:
 The main problem I am facing is that in Wicket 1.4.x I can't figure
 out how to access ART from the component that was not added to this
 ART, e.g. during ajax form submission.

 I tried to add AjaxFormSubmitBehavior to every Form child of the page
 but that overrode those form ajax-submit functionality and basically
 broke them all. Now I am thinking about adding an onclick behavior
 which will add my component to ART to every AjaxSubmitLink child of
 the page. But this seems to be pretty ugly.

 Thoughts?

 Thanks,

 Ale

 On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Thank you for the link. I used your code to register an
 ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
 created, but it does not get called when the form is submitted and
 hence it never adds the FeedbackPanel to ART of form submission.

 Where should I add this listener?

 Thanks,

 Alec

 On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
 procrastinative.develo...@gmail.com wrote:
 Hello Alec,
 Could you take a look on this:

 https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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


 -
 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: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
It seems that I cannot access ART from the component that is not
updated by that ART because that component is not rendered during the
lifecycle of that ART.

Here is the problem description:

1. A page is rendered with a feedback panel and a form
2. The form is later submitted via AJAX and does not add any components to ART

How in step 1 can I make sure that feedback panel is updated when form
is submitted in step 2?

Thanks,

Alec

On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy blene...@gmail.com wrote:
 You can access current ART associated with request by calling static
 AjaxRequestTarget.get()

 Tibor

 On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan alecs...@gmail.com wrote:
 Thoughts, anybody?

 On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:
 The main problem I am facing is that in Wicket 1.4.x I can't figure
 out how to access ART from the component that was not added to this
 ART, e.g. during ajax form submission.

 I tried to add AjaxFormSubmitBehavior to every Form child of the page
 but that overrode those form ajax-submit functionality and basically
 broke them all. Now I am thinking about adding an onclick behavior
 which will add my component to ART to every AjaxSubmitLink child of
 the page. But this seems to be pretty ugly.

 Thoughts?

 Thanks,

 Ale

 On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:
 Hello,

 Thank you for the link. I used your code to register an
 ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
 created, but it does not get called when the form is submitted and
 hence it never adds the FeedbackPanel to ART of form submission.

 Where should I add this listener?

 Thanks,

 Alec

 On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
 procrastinative.develo...@gmail.com wrote:
 Hello Alec,
 Could you take a look on this:

 https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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


 -
 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: Dataview: need message nothing found

2012-08-20 Thread Igor Vaynberg
data table has the NoRecordsToolbar

-igor

On Mon, Aug 20, 2012 at 3:01 AM, Delange delan...@telfort.nl wrote:
 I tried this, but I can't figure out how to convert from datatable to an
 AbstractRepeater.



 DataTable table = new DataTable(datatable, columns, kostenOVProvider, 10){
 protected Item newRowItem(String id, int index, 
 IModel model) {
 Item item = super.newRowItem(id, index, model);
 item.add(new AttributeModifier(class,  new Model(
 index % 2 == 0 ? even : odd)));
 return item;
 }
 };
 FilterToolbar filterToolbar = new FilterToolbar(table, form,
 kostenOVProvider);
 table.addTopToolbar(new HeadersToolbar(table, 
 kostenOVProvider));
 table.addTopToolbar(filterToolbar);
 table.addBottomToolbar(new NavigationToolbar(table));
 form.add(table);
 form.add(new NoRecordsContainer(norecordsFound, table));



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Dataview-need-message-nothing-found-tp4651337p4651369.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


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



Re: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Bertrand Guay-Paquet

Hi,

I haven't used 1.4 much so I'm not sure it exists there. Maybe you could 
add a IRequestCycleListener to your app via getRequestCycleListeners() 
which adds the feedback panel in onRequestHandlerResolved? In that 
method, check if the handler type is an AjaxRequestTarget and add your 
feedback panel to it.


On 20/08/2012 11:45 AM, Alec Swan wrote:

It seems that I cannot access ART from the component that is not
updated by that ART because that component is not rendered during the
lifecycle of that ART.

Here is the problem description:

1. A page is rendered with a feedback panel and a form
2. The form is later submitted via AJAX and does not add any components to ART

How in step 1 can I make sure that feedback panel is updated when form
is submitted in step 2?

Thanks,

Alec

On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy blene...@gmail.com wrote:

You can access current ART associated with request by calling static
AjaxRequestTarget.get()

Tibor

On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan alecs...@gmail.com wrote:

Thoughts, anybody?

On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:

The main problem I am facing is that in Wicket 1.4.x I can't figure
out how to access ART from the component that was not added to this
ART, e.g. during ajax form submission.

I tried to add AjaxFormSubmitBehavior to every Form child of the page
but that overrode those form ajax-submit functionality and basically
broke them all. Now I am thinking about adding an onclick behavior
which will add my component to ART to every AjaxSubmitLink child of
the page. But this seems to be pretty ugly.

Thoughts?

Thanks,

Ale

On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:

Hello,

Thank you for the link. I used your code to register an
ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
created, but it does not get called when the form is submitted and
hence it never adds the FeedbackPanel to ART of form submission.

Where should I add this listener?

Thanks,

Alec

On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
procrastinative.develo...@gmail.com wrote:

Hello Alec,
Could you take a look on this:

https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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


-
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: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
IRequestCycleListener was added in 1.5.x. Is there anything else I can
do in 1.4.x?

On Mon, Aug 20, 2012 at 12:15 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:
 Hi,

 I haven't used 1.4 much so I'm not sure it exists there. Maybe you could add
 a IRequestCycleListener to your app via getRequestCycleListeners() which
 adds the feedback panel in onRequestHandlerResolved? In that method, check
 if the handler type is an AjaxRequestTarget and add your feedback panel to
 it.


 On 20/08/2012 11:45 AM, Alec Swan wrote:

 It seems that I cannot access ART from the component that is not
 updated by that ART because that component is not rendered during the
 lifecycle of that ART.

 Here is the problem description:

 1. A page is rendered with a feedback panel and a form
 2. The form is later submitted via AJAX and does not add any components to
 ART

 How in step 1 can I make sure that feedback panel is updated when form
 is submitted in step 2?

 Thanks,

 Alec

 On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy blene...@gmail.com
 wrote:

 You can access current ART associated with request by calling static
 AjaxRequestTarget.get()

 Tibor

 On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan alecs...@gmail.com wrote:

 Thoughts, anybody?

 On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:

 The main problem I am facing is that in Wicket 1.4.x I can't figure
 out how to access ART from the component that was not added to this
 ART, e.g. during ajax form submission.

 I tried to add AjaxFormSubmitBehavior to every Form child of the page
 but that overrode those form ajax-submit functionality and basically
 broke them all. Now I am thinking about adding an onclick behavior
 which will add my component to ART to every AjaxSubmitLink child of
 the page. But this seems to be pretty ugly.

 Thoughts?

 Thanks,

 Ale

 On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:

 Hello,

 Thank you for the link. I used your code to register an
 ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
 created, but it does not get called when the form is submitted and
 hence it never adds the FeedbackPanel to ART of form submission.

 Where should I add this listener?

 Thanks,

 Alec

 On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
 procrastinative.develo...@gmail.com wrote:

 Hello Alec,
 Could you take a look on this:


 https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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

 -
 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


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



Re: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Martin Grigorov
https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
is all you need.

in your AjaxButton#onSubmit(ART target) {
  target.addListener(new AjaxFeedbackPanelUpdater());
}

Or override WebApplication#newAjaxRequestTarget() and add it for each
and every ART.

On Mon, Aug 20, 2012 at 11:56 PM, Alec Swan alecs...@gmail.com wrote:
 IRequestCycleListener was added in 1.5.x. Is there anything else I can
 do in 1.4.x?

 On Mon, Aug 20, 2012 at 12:15 PM, Bertrand Guay-Paquet
 ber...@step.polymtl.ca wrote:
 Hi,

 I haven't used 1.4 much so I'm not sure it exists there. Maybe you could add
 a IRequestCycleListener to your app via getRequestCycleListeners() which
 adds the feedback panel in onRequestHandlerResolved? In that method, check
 if the handler type is an AjaxRequestTarget and add your feedback panel to
 it.


 On 20/08/2012 11:45 AM, Alec Swan wrote:

 It seems that I cannot access ART from the component that is not
 updated by that ART because that component is not rendered during the
 lifecycle of that ART.

 Here is the problem description:

 1. A page is rendered with a feedback panel and a form
 2. The form is later submitted via AJAX and does not add any components to
 ART

 How in step 1 can I make sure that feedback panel is updated when form
 is submitted in step 2?

 Thanks,

 Alec

 On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy blene...@gmail.com
 wrote:

 You can access current ART associated with request by calling static
 AjaxRequestTarget.get()

 Tibor

 On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan alecs...@gmail.com wrote:

 Thoughts, anybody?

 On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:

 The main problem I am facing is that in Wicket 1.4.x I can't figure
 out how to access ART from the component that was not added to this
 ART, e.g. during ajax form submission.

 I tried to add AjaxFormSubmitBehavior to every Form child of the page
 but that overrode those form ajax-submit functionality and basically
 broke them all. Now I am thinking about adding an onclick behavior
 which will add my component to ART to every AjaxSubmitLink child of
 the page. But this seems to be pretty ugly.

 Thoughts?

 Thanks,

 Ale

 On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:

 Hello,

 Thank you for the link. I used your code to register an
 ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
 created, but it does not get called when the form is submitted and
 hence it never adds the FeedbackPanel to ART of form submission.

 Where should I add this listener?

 Thanks,

 Alec

 On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
 procrastinative.develo...@gmail.com wrote:

 Hello Alec,
 Could you take a look on this:


 https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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

 -
 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


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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Re: Re: Basic JUnit Test

2012-08-20 Thread vineet semwal
that test looks ok to me ,please attach a quickstart

On Mon, Aug 20, 2012 at 12:23 PM, JCoder i...@jcoder.de wrote:
 Hi Vineet,

 thanks for the reply. The line 
 tester.getServletRequest().setParameter(myParam, testParam);
 But now Im breaking my head with the next issue. If you look at my first 
 post, Im trying to do a test where a second page is rendered after a submit 
 on an AjaxButton. The test code looks like this:

 1. FirstPage page = (FirstPage) tester.startPage(FirstPage.class, 
 pageParameters);
 2. tester.assertRenderedPage(FirstPage.class);
 3. page.getActionForm().setType(1); // where actionForm is a 
 property/attribute of FirstPage.
 4. FormTester formTester = tester.newFormTester(myForm);
 5. tester.getServletRequest().setParameter(myParam, testParam);
 6. tester.executeAjaxEvent(myForm:myAjaxButton, onclick);
 7. tester.assertRenderedPage(SecondPage.class);

 The the test fails within the onSubmit(AjaxRequestTarget target, Form? 
 form) saying that the attribute/property actionForm is null...
 Obviously the second (Ajax-) request is not shipped with the 
 attribute/property values of his containing panel. Is this correct? Who can 
 help me out here?

 Regards,
 Yusuf

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




-- 
regards,

Vineet Semwal

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



Can I use html in my messages?

2012-08-20 Thread Delange
I want to place some html in my messages. 
So that some text can be high lighted 

For example:
VKAB=Your licence will be downgraded to {1,date,medium} at 1 feb 2012
The message is added by a list 

ChoiceRendererString renderer = new
ChoiceRendererString(value,key);
ListMySelectOption list = new ArrayListMySelectOption();

list.add(new MySelectOption(1,this.getString(VkAb.Abo.same))
list.add(new MySelectOption(3,new StringResourceModel(
VkAb.Abo.toStandard,this,model,new Object[]{
eersteVolgendeMaand
}).getString()));



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Can-I-use-html-in-my-messages-tp4651383.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: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
Thanks, Martin. I ended up using WebApplication#newAjaxRequestTarget()
approach because AjaxFeedbackPanelUpdater approach requires me to know
all forms that can be displayed in the page ahead of time and modify
their onSubmit code.

On Mon, Aug 20, 2012 at 3:01 PM, Martin Grigorov mgrigo...@apache.org wrote:
 https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
 is all you need.

 in your AjaxButton#onSubmit(ART target) {
   target.addListener(new AjaxFeedbackPanelUpdater());
 }

 Or override WebApplication#newAjaxRequestTarget() and add it for each
 and every ART.

 On Mon, Aug 20, 2012 at 11:56 PM, Alec Swan alecs...@gmail.com wrote:
 IRequestCycleListener was added in 1.5.x. Is there anything else I can
 do in 1.4.x?

 On Mon, Aug 20, 2012 at 12:15 PM, Bertrand Guay-Paquet
 ber...@step.polymtl.ca wrote:
 Hi,

 I haven't used 1.4 much so I'm not sure it exists there. Maybe you could add
 a IRequestCycleListener to your app via getRequestCycleListeners() which
 adds the feedback panel in onRequestHandlerResolved? In that method, check
 if the handler type is an AjaxRequestTarget and add your feedback panel to
 it.


 On 20/08/2012 11:45 AM, Alec Swan wrote:

 It seems that I cannot access ART from the component that is not
 updated by that ART because that component is not rendered during the
 lifecycle of that ART.

 Here is the problem description:

 1. A page is rendered with a feedback panel and a form
 2. The form is later submitted via AJAX and does not add any components to
 ART

 How in step 1 can I make sure that feedback panel is updated when form
 is submitted in step 2?

 Thanks,

 Alec

 On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy blene...@gmail.com
 wrote:

 You can access current ART associated with request by calling static
 AjaxRequestTarget.get()

 Tibor

 On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan alecs...@gmail.com wrote:

 Thoughts, anybody?

 On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:

 The main problem I am facing is that in Wicket 1.4.x I can't figure
 out how to access ART from the component that was not added to this
 ART, e.g. during ajax form submission.

 I tried to add AjaxFormSubmitBehavior to every Form child of the page
 but that overrode those form ajax-submit functionality and basically
 broke them all. Now I am thinking about adding an onclick behavior
 which will add my component to ART to every AjaxSubmitLink child of
 the page. But this seems to be pretty ugly.

 Thoughts?

 Thanks,

 Ale

 On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:

 Hello,

 Thank you for the link. I used your code to register an
 ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
 created, but it does not get called when the form is submitted and
 hence it never adds the FeedbackPanel to ART of form submission.

 Where should I add this listener?

 Thanks,

 Alec

 On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
 procrastinative.develo...@gmail.com wrote:

 Hello Alec,
 Could you take a look on this:


 https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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

 -
 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


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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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