Re: setDefaultFormProcessing and models

2013-04-08 Thread Bernard
Hi,

Perhaps you can use a combination of what is avaliable in the javadoc
of org.apache.wicket.markup.html.form.Form e.g.
FormComponent#updateModel()

Regards,

Bernard


On Sun, 7 Apr 2013 15:14:19 -0700 (PDT), you wrote:

Maybe I just need this explained to me a little clearer, but I was wondering
about what appears to me to be a contradiction in how validation and
model-setting and the setDefaultFormProcessing(false) works.  Maybe
contradiction is the wrong word.  Let's say inconvenience.

So I get that when I set form processing to false that validators are not
called.  I need this on any ajax event I want to perform.  However, it is
very rare that my ajax events don't operate on some number of inputs set by
the user.  So I want the models to be loaded with the data from the form as
if form processing were happening.

Instead, I seem to be forced to use this getInput() method which is much
less refined than the model setting mechanisms and forces me to do more
coding.  Is there a way I can turn validators off, but still get my models
loaded with data as if form processing were on?  Or is getInput() really my
only alternative?


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



Re: AjaxFallbackDefaultDataTable

2013-04-08 Thread Martin Grigorov
Hi,

Try with : target.appendJavaScript(window.scrollTo(0, 0);)



On Mon, Apr 8, 2013 at 5:20 AM, Vignesh Palanisamy vign...@mcruncher.comwrote:

 hi,

I had create a CustomAjaxFallbackDefaultDataTable to add the
 AjaxNavigationToolbar in bottomToolBar.

my DataTable content is so big. while i come down and navigate to
 next page the focus was in the end of the table itself, i want it to set
 focus on the top of the table. how can i set it.

 please trow some suggestion for it.


 thanks in advance
 Vignesh Palanisamy




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


Wicket free guide updated.

2013-04-08 Thread Andrea Del Bene

Hi,

I bother you just to tell that I released an updated version of the 
guide with some typo corrections and two small additions.

http://code.google.com/p/wicket-guide/

Bye! :)

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



Re: AjaxFallbackDefaultDataTable

2013-04-08 Thread Vignesh Palanisamy
thanks martin,

i try it already, my problem is, i had two dataTable in a same page. while
i paginate focus move  to the top of the page, i want top of the table. i
had tried target.focusComponent(to the topToolBar) but its outputMarkId was
not true.  is there any way to focus to the top of the table.


thanks in advance
Vignesh Palanisamy


On Mon, Apr 8, 2013 at 3:33 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Try with : target.appendJavaScript(window.scrollTo(0, 0);)



 On Mon, Apr 8, 2013 at 5:20 AM, Vignesh Palanisamy vign...@mcruncher.com
 wrote:

  hi,
 
 I had create a CustomAjaxFallbackDefaultDataTable to add the
  AjaxNavigationToolbar in bottomToolBar.
 
 my DataTable content is so big. while i come down and navigate to
  next page the focus was in the end of the table itself, i want it to set
  focus on the top of the table. how can i set it.
 
  please trow some suggestion for it.
 
 
  thanks in advance
  Vignesh Palanisamy
 



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



Re: AjaxFallbackDefaultDataTable

2013-04-08 Thread Martin Grigorov
Check http://stackoverflow.com/questions/6677035/jquery-scroll-to-element
You will need to use some sort of selector to find the table. If it doesn't
have id then by class for example.


On Mon, Apr 8, 2013 at 12:51 PM, Vignesh Palanisamy
vign...@mcruncher.comwrote:

 thanks martin,

 i try it already, my problem is, i had two dataTable in a same page. while
 i paginate focus move  to the top of the page, i want top of the table. i
 had tried target.focusComponent(to the topToolBar) but its outputMarkId was
 not true.  is there any way to focus to the top of the table.


 thanks in advance
 Vignesh Palanisamy


 On Mon, Apr 8, 2013 at 3:33 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  Hi,
 
  Try with : target.appendJavaScript(window.scrollTo(0, 0);)
 
 
 
  On Mon, Apr 8, 2013 at 5:20 AM, Vignesh Palanisamy 
 vign...@mcruncher.com
  wrote:
 
   hi,
  
  I had create a CustomAjaxFallbackDefaultDataTable to add the
   AjaxNavigationToolbar in bottomToolBar.
  
  my DataTable content is so big. while i come down and navigate
 to
   next page the focus was in the end of the table itself, i want it to
 set
   focus on the top of the table. how can i set it.
  
   please trow some suggestion for it.
  
  
   thanks in advance
   Vignesh Palanisamy
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/
 




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


Re: AjaxFallbackDefaultDataTable

2013-04-08 Thread Vignesh Palanisamy
thanks martin... i will try it and come back to you


On Mon, Apr 8, 2013 at 5:59 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Check http://stackoverflow.com/questions/6677035/jquery-scroll-to-element
 You will need to use some sort of selector to find the table. If it doesn't
 have id then by class for example.


 On Mon, Apr 8, 2013 at 12:51 PM, Vignesh Palanisamy
 vign...@mcruncher.comwrote:

  thanks martin,
 
  i try it already, my problem is, i had two dataTable in a same page.
 while
  i paginate focus move  to the top of the page, i want top of the table. i
  had tried target.focusComponent(to the topToolBar) but its outputMarkId
 was
  not true.  is there any way to focus to the top of the table.
 
 
  thanks in advance
  Vignesh Palanisamy
 
 
  On Mon, Apr 8, 2013 at 3:33 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   Hi,
  
   Try with : target.appendJavaScript(window.scrollTo(0, 0);)
  
  
  
   On Mon, Apr 8, 2013 at 5:20 AM, Vignesh Palanisamy 
  vign...@mcruncher.com
   wrote:
  
hi,
   
   I had create a CustomAjaxFallbackDefaultDataTable to add the
AjaxNavigationToolbar in bottomToolBar.
   
   my DataTable content is so big. while i come down and navigate
  to
next page the focus was in the end of the table itself, i want it to
  set
focus on the top of the table. how can i set it.
   
please trow some suggestion for it.
   
   
thanks in advance
Vignesh Palanisamy
   
  
  
  
   --
   Martin Grigorov
   jWeekend
   Training, Consulting, Development
   http://jWeekend.com http://jweekend.com/
  
 



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



Re: Browser Cookie detection

2013-04-08 Thread Martin Grigorov
Hi,

org.apache.wicket.NonResettingRestartException does lead to HTTP redirect.
It just restarts the processing of the current request at the server side.
That is after throwing this exception you should not expect that the cookie
has been delivered to the browser. There is no interaction with the browser
at all.

In contrast to RestartResponseException it preserves any cookies (and some
other headers) in the buffering web response.




On Fri, Apr 5, 2013 at 9:49 PM, divad91 diva...@hotmail.com wrote:

 I just created a new wicket 6.6.0 quickstart project
 (http://wicket.apache.org/start/quickstart.html)
 and I have the same problem.

 If I add the following code in the HomePage class,

 Cookie requestCookie = ((WebRequest) getRequest()).getCookie(appCoookie);
 System.out.println(--- + (requestCookie != null));

 Cookie appCookie = new Cookie(appCoookie, 1);
 appCookie.setMaxAge(3600 * 5);
 appCookie.setPath(/);
 appCookie.setSecure(false);

 ((WebResponse) getResponse()).addCookie(appCookie);
 if (getSession().getAttribute(init) == null) {
 getSession().setAttribute(init, true);
System.out.println(here...);
throw new NonResettingRestartException(HomePage.class);
 }

 the second time I enter the HomePage constructor, the cookie is not present
 in the request.




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Browser-Cookie-detection-tp4657744p4657789.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




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


Re: setDefaultFormProcessing and models

2013-04-08 Thread Entropy
Bernard wrote
 Hi,
 
 Perhaps you can use a combination of what is avaliable in the javadoc
 of org.apache.wicket.markup.html.form.Form e.g.
 FormComponent#updateModel()

That ALMOST works.  The javadoc for updateModel says it assumes that
convertInput() has been called.  But convertInput() is protected, and
invoked when you validate().  Now as it turns out, the specific component I
am working on doesn't have any component level validation (the validation i
was avoiding was form level), so i can call validate() then updateModel()
and that works for me in this particular case.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setDefaultFormProcessing-and-models-tp4657804p4657816.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



How to mock Session using Mockito for a Wicket application?

2013-04-08 Thread madmax108
Hi there,
I'm using Wicket+Spring+Mockito for an application and am trying to work
alongside a set of well defined test code.

For a feature I'm working on, I need to get the userid of a given user,
which is stored by Wicket in the user session, and need to test out the
feature using WicketTester

How do I go about this?

I know that I need to mock the session, but no matter what I try, it keeps
returning a null value returned by the mock. I'm using the
when().thenReturn() method of mocking (but have tried with the doReturn as
well)

How do I go about this? 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-mock-Session-using-Mockito-for-a-Wicket-application-tp4657817.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: How to mock Session using Mockito for a Wicket application?

2013-04-08 Thread Martin Grigorov
Hi,

Since you use WicketTester I see no reason to mock the Session.
Just use ((MySession) tester.getSession()).getUserId()


On Mon, Apr 8, 2013 at 3:25 PM, madmax108 lifeofna...@gmail.com wrote:

 Hi there,
 I'm using Wicket+Spring+Mockito for an application and am trying to work
 alongside a set of well defined test code.

 For a feature I'm working on, I need to get the userid of a given user,
 which is stored by Wicket in the user session, and need to test out the
 feature using WicketTester

 How do I go about this?

 I know that I need to mock the session, but no matter what I try, it keeps
 returning a null value returned by the mock. I'm using the
 when().thenReturn() method of mocking (but have tried with the doReturn as
 well)

 How do I go about this?



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-mock-Session-using-Mockito-for-a-Wicket-application-tp4657817.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




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


Re: How to mock Session using Mockito for a Wicket application?

2013-04-08 Thread madmax108
Wow, that helped... thanks a lot!

Just another question. I now have to use this id to get a database request.
I just realised that even that needs to be mocked as well, using a similar
method.

Assuming the db call function to be mocked is makeDBcall(int userid){
}

How do I mock this to return a DTO that contains the userRecord (The actual
DB call returns a DTO object that contains the user record fields)?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-mock-Session-using-Mockito-for-a-Wicket-application-tp4657817p4657819.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



Twitter Bootstrap Integration

2013-04-08 Thread David Beer

Hi All

Our web application site has been mocked up in Twitter Bootstrap using 
specific features from and components from the framework. We would like 
to integrate this with Wicket. I am not sure on the best way to 
integrate twitter bootstrap is it using the wicket project or using 
agilecoders. There seems to be little documentation on either and how to 
start.


How best to integrate twitter bootstrap and which resources should we 
use and where best to start?


Thanks

David

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



Re: Twitter Bootstrap Integration

2013-04-08 Thread Martin Grigorov
Hi,

Use AgileCoders' one.
Check its sample application. Especially the code in
WicketApplication#init().


On Mon, Apr 8, 2013 at 4:16 PM, David Beer david.m.b...@gmail.com wrote:

 Hi All

 Our web application site has been mocked up in Twitter Bootstrap using
 specific features from and components from the framework. We would like to
 integrate this with Wicket. I am not sure on the best way to integrate
 twitter bootstrap is it using the wicket project or using agilecoders.
 There seems to be little documentation on either and how to start.

 How best to integrate twitter bootstrap and which resources should we use
 and where best to start?

 Thanks

 David

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




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


Re: Browser Cookie detection

2013-04-08 Thread divad91
In wicket 1.4.21, I was using the RedirectException class. Cookies were
transfered.

public HomePage(final PageParameters parameters) {
super(parameters);

if (MySession.session().isSessionSetup()) {
Cookie requestCookie = ((WebRequest)
getRequest()).getCookie(appCoookie);
if (requestCookie == null) {
// Cookies are not enabled. 
}
// Working with wicket 1.4.21
}

Cookie appCookie = new Cookie(appCoookie, 1);
appCookie.setMaxAge(3600 * 5);
appCookie.setPath(/);
appCookie.setSecure(false); 
((WebResponse) getResponse()).addCookie(appCookie);

if (!MySession.session().isSessionSetup()) {
MySession.session().setIsSessionSetup(true);

throw new RedirectException(HomePage.class);
}
}

Is there a similar exception that I could use in wicket 6.6.0 to do the same
work  (add the cookie to the response and then check it in the request) ?

Thanks




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Browser-Cookie-detection-tp4657744p4657822.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: Browser Cookie detection

2013-04-08 Thread Martin Grigorov
Hi,

You can use something like:
String url = urlFor(page, page.getPageParameters());
throw new RedirectToUrlException(url, 302);



On Mon, Apr 8, 2013 at 4:33 PM, divad91 diva...@hotmail.com wrote:

 In wicket 1.4.21, I was using the RedirectException class. Cookies were
 transfered.

 public HomePage(final PageParameters parameters) {
 super(parameters);

 if (MySession.session().isSessionSetup()) {
 Cookie requestCookie = ((WebRequest)
 getRequest()).getCookie(appCoookie);
 if (requestCookie == null) {
 // Cookies are not enabled.
 }
 // Working with wicket 1.4.21
 }

 Cookie appCookie = new Cookie(appCoookie, 1);
 appCookie.setMaxAge(3600 * 5);
 appCookie.setPath(/);
 appCookie.setSecure(false);
 ((WebResponse) getResponse()).addCookie(appCookie);

 if (!MySession.session().isSessionSetup()) {
 MySession.session().setIsSessionSetup(true);
 throw new RedirectException(HomePage.class);
 }
 }

 Is there a similar exception that I could use in wicket 6.6.0 to do the
 same
 work  (add the cookie to the response and then check it in the request) ?

 Thanks




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Browser-Cookie-detection-tp4657744p4657822.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




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


Re: Twitter Bootstrap Integration

2013-04-08 Thread David Beer

Hi Martin

Thanks for your reply. I assume looking at the source for the Sample 
Application that I need to add the resource bundles to use bootstrap 
properly.


Thanks

David
On 08/04/13 14:25, Martin Grigorov wrote:

Hi,

Use AgileCoders' one.
Check its sample application. Especially the code in
WicketApplication#init().


On Mon, Apr 8, 2013 at 4:16 PM, David Beer david.m.b...@gmail.com wrote:


Hi All

Our web application site has been mocked up in Twitter Bootstrap using
specific features from and components from the framework. We would like to
integrate this with Wicket. I am not sure on the best way to integrate
twitter bootstrap is it using the wicket project or using agilecoders.
There seems to be little documentation on either and how to start.

How best to integrate twitter bootstrap and which resources should we use
and where best to start?

Thanks

David

--**--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.orgusers-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: Twitter Bootstrap Integration

2013-04-08 Thread Martin Grigorov
If you use any of the provided behaviors and components then the resources
are delivered automatically.


On Mon, Apr 8, 2013 at 5:30 PM, David Beer david.m.b...@gmail.com wrote:

 Hi Martin

 Thanks for your reply. I assume looking at the source for the Sample
 Application that I need to add the resource bundles to use bootstrap
 properly.

 Thanks

 David

 On 08/04/13 14:25, Martin Grigorov wrote:

 Hi,

 Use AgileCoders' one.
 Check its sample application. Especially the code in
 WicketApplication#init().


 On Mon, Apr 8, 2013 at 4:16 PM, David Beer david.m.b...@gmail.com
 wrote:

  Hi All

 Our web application site has been mocked up in Twitter Bootstrap using
 specific features from and components from the framework. We would like
 to
 integrate this with Wicket. I am not sure on the best way to integrate
 twitter bootstrap is it using the wicket project or using agilecoders.
 There seems to be little documentation on either and how to start.

 How best to integrate twitter bootstrap and which resources should we use
 and where best to start?

 Thanks

 David

 --**
 --**-
 To unsubscribe, e-mail: 
 users-unsubscribe@wicket.**apa**che.orghttp://apache.org
 users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org
 

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





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




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


Re: Browser Cookie detection

2013-04-08 Thread divad91
thanks it's working !



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Browser-Cookie-detection-tp4657744p4657826.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: Twitter Bootstrap Integration

2013-04-08 Thread David Beer

Hi Martin

Thanks for that I have a working project thanks for pointers.

David
On 08/04/13 15:36, Martin Grigorov wrote:

If you use any of the provided behaviors and components then the resources
are delivered automatically.


On Mon, Apr 8, 2013 at 5:30 PM, David Beer david.m.b...@gmail.com wrote:


Hi Martin

Thanks for your reply. I assume looking at the source for the Sample
Application that I need to add the resource bundles to use bootstrap
properly.

Thanks

David

On 08/04/13 14:25, Martin Grigorov wrote:


Hi,

Use AgileCoders' one.
Check its sample application. Especially the code in
WicketApplication#init().


On Mon, Apr 8, 2013 at 4:16 PM, David Beer david.m.b...@gmail.com
wrote:

  Hi All

Our web application site has been mocked up in Twitter Bootstrap using
specific features from and components from the framework. We would like
to
integrate this with Wicket. I am not sure on the best way to integrate
twitter bootstrap is it using the wicket project or using agilecoders.
There seems to be little documentation on either and how to start.

How best to integrate twitter bootstrap and which resources should we use
and where best to start?

Thanks

David

--**
--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.orghttp://apache.org
users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




--**--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apache.orgusers-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



Ajax updating panel inside ModalWindow

2013-04-08 Thread jarnis
Hey Guys

I'm using a panel inside wicket's native ModalWindow. The panel contains a
form with an AjaxSubmitLink. The onSubmit method of the form does some
processing (reading an submitted file into a BufferedImage component) and
then adds some components to the AjaxRequestTarget. The problem is that the
added components are not updated.

I have tried adding the form's containing div, the form itself as well as
single components (a label and an image component) to the AjaxRequestTarget,
without any luck. A debugger confirms that the onSubmit code is executed
correctly and that the components are added to the AjaxRequestTarget as
expected.

If I close the ModalWindow and open it again (calling it's show() method,
the components I tried to update in the submit are now showing their updated
content.

If I add the panel, that I use as content for the modal window, directly to
a div on the enclosing page (or enclosing panel) it is updated as expected
on submit. Somehow the fact that it is showing inside the ModalWindow
prevents the ajax updating from taking effect.

I am using Wicket 6.6.0 (also tried downgrading to 6.0.0 and 6.5.0, same
result). If it makes any difference, the application runs inside a Jetty 8
server.

I assume that I'm using the ModalWindow in a wrong way somehow, but I have
no idea what I could possibly be doing wrong. Any suggestions are very
welcome.

Thanks in advance,
Jarnis



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-updating-panel-inside-ModalWindow-tp4657829.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: Ajax updating panel inside ModalWindow

2013-04-08 Thread Sven Meier
You're probably not wrapping the modal window in a Form, please read 
ModalWindow's javadoc.


Sven

On 04/08/2013 10:38 PM, jarnis wrote:

Hey Guys

I'm using a panel inside wicket's native ModalWindow. The panel contains a
form with an AjaxSubmitLink. The onSubmit method of the form does some
processing (reading an submitted file into a BufferedImage component) and
then adds some components to the AjaxRequestTarget. The problem is that the
added components are not updated.

I have tried adding the form's containing div, the form itself as well as
single components (a label and an image component) to the AjaxRequestTarget,
without any luck. A debugger confirms that the onSubmit code is executed
correctly and that the components are added to the AjaxRequestTarget as
expected.

If I close the ModalWindow and open it again (calling it's show() method,
the components I tried to update in the submit are now showing their updated
content.

If I add the panel, that I use as content for the modal window, directly to
a div on the enclosing page (or enclosing panel) it is updated as expected
on submit. Somehow the fact that it is showing inside the ModalWindow
prevents the ajax updating from taking effect.

I am using Wicket 6.6.0 (also tried downgrading to 6.0.0 and 6.5.0, same
result). If it makes any difference, the application runs inside a Jetty 8
server.

I assume that I'm using the ModalWindow in a wrong way somehow, but I have
no idea what I could possibly be doing wrong. Any suggestions are very
welcome.

Thanks in advance,
Jarnis



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-updating-panel-inside-ModalWindow-tp4657829.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: Ajax updating panel inside ModalWindow

2013-04-08 Thread jarnis
I have tried the ModalWindow both inside and outside an enclosing form, with
no difference. I also tried to put updating behavior in the onClick method
of an AjaxLink (just updating a counter and adding the div showing the value
to the AjaxRequestTarget) and it still does not update the modal window
content. If the modal window is closed and reopened, the updated value of
the counter is shown correctly. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-updating-panel-inside-ModalWindow-tp4657829p4657831.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



FileUploadField best approach to populating a file

2013-04-08 Thread mohallo
I have an Excell file that I want to populate with Data .
I am using the FileUploadField component to do this .
The user locates the file that they want to populate throgh the microsoft
popup window .
The issus I am having is locating an OutputStream to populate .
When I access a fileItem OutputStream it is pointing to a Temp location .

Any Ideas how to approach this .

Thanks for your help .



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUploadField-best-approach-to-populating-a-file-tp4657832.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: FileUploadField best approach to populating a file

2013-04-08 Thread Dan Retzlaff
If I understand you, the user uploads an Excel template, and the response
is a populated version of that template. In this case, your form's
onSubmit() should
1. get the template from an enclosed FileUploadField's model,
2. create a new file for download (temp directory is okay), and
3. schedule a ResourceRequestHandler to return that file.

The last can be accomplished with:
  IResource resource = new AbstractResource() {
protected ResourceResponse newResourceResponse(Attributes attributes) {
/* TODO */ }
  };
  RequestCycle.get().replaceAllRequestHandlers(new
ResourceRequestHandler(resource, null));

See ByteArrayResource for an example of constructing a resource response.
The OutputStream you want is in the Attributes object given to your
WriteCallback.

Dan


On Mon, Apr 8, 2013 at 4:26 PM, mohallo moha...@qwest.com wrote:

 I have an Excell file that I want to populate with Data .
 I am using the FileUploadField component to do this .
 The user locates the file that they want to populate throgh the microsoft
 popup window .
 The issus I am having is locating an OutputStream to populate .
 When I access a fileItem OutputStream it is pointing to a Temp location .

 Any Ideas how to approach this .

 Thanks for your help .



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/FileUploadField-best-approach-to-populating-a-file-tp4657832.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




Update Model on DropDown Item Selection

2013-04-08 Thread Bruno Moura
I need to update a model or object immediately after select
a DropDownChoice item.


Bellow is the code that I'm working:

//
-

 add(new ListView[Company](listCompanies, listData) {

override protected def onBeforeRender() {
  //
  // ...
  super.onBeforeRender()
}

def populateItem(item: ListItem[Company]) = {
  var company = item.getModelObject()

  //...

  val listClients: java.util.List[Client] = clientControler.listClients


  item.add(new DropDownChoice(clientSelection, listClients,new
ChoiceRenderer[Client](name)))

//
-

In the Listview with properties of Company Object,
after choose a name property of the DropDownChoice, the model
Company would be updated with the Client Name selected.

How can I achieve this?

Thanks


Re: Update Model on DropDown Item Selection

2013-04-08 Thread Martin Makundi
Use ajax behavior, e.g., OnChangeAjaxBehavior


**
Martin

2013/4/9 Bruno Moura brunormo...@gmail.com:
 I need to update a model or object immediately after select
 a DropDownChoice item.


 Bellow is the code that I'm working:

 //
 -

  add(new ListView[Company](listCompanies, listData) {

 override protected def onBeforeRender() {
   //
   // ...
   super.onBeforeRender()
 }

 def populateItem(item: ListItem[Company]) = {
   var company = item.getModelObject()

   //...

   val listClients: java.util.List[Client] = clientControler.listClients


   item.add(new DropDownChoice(clientSelection, listClients,new
 ChoiceRenderer[Client](name)))

 //
 -

 In the Listview with properties of Company Object,
 after choose a name property of the DropDownChoice, the model
 Company would be updated with the Client Name selected.

 How can I achieve this?

 Thanks

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



Re: Wicket free guide updated.

2013-04-08 Thread hantsy
Thanks, Andrea.


On 4/8/2013 17:42, Andrea Del Bene wrote:
 Hi,

 I bother you just to tell that I released an updated version of the
 guide with some typo corrections and two small additions.
 http://code.google.com/p/wicket-guide/

 Bye! :)

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



-- 
Fulltime Java EE Freelancer/Developer from China.

Blog: http://hantsy.blogspot.com
LinkedIn: http://cn.linkedin.com/in/hantsy

Hire me on oDesk https://www.odesk.com/users/%7E01364b53cb1f4c5597 or
Elance http://hantsy.elance.com.


Using a Inline-label Editable inside a ListView and update a model after change label value

2013-04-08 Thread Bruno Moura
I need to use a editable label or inline-label in a ListView and after
change the
value of this component I want to know how I can Update the property of
the Object displayed in this listView

add(new ListView[SomeObject](listSomeObject, listData) {

override protected def onBeforeRender() {
 ...
  super.onBeforeRender()
}

def populateItem(item: ListItem[SomeObject]) = {
  var objValue = item.getModelObject()

  item.add(new Label(total, objValue.toString(getFormatter(
 }
}
  })

In the code above, the object SomeObject has a property called total, the
listView
shows a set of SomeObject, when the label total is changed in some line of
the
listview the corresponding object SomeObject should be updated with the new
value of the label total.

Someone can provide some useful example for help me with this task?

Thanks

Bruno Moura