Re: FileUploadField with AJAX Behavior

2017-08-24 Thread lucast
I had the same requirement,I wanted to display the contents of the file, once
the file has been selected.
I found the code on 
https://github.com/apache/openmeetings/blob/4a5e859f886253086e51a2ac26bbc501d621e590/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/UploadableImagePanel.java

 
, line 77, new AjaxFormSubmitBehavior(form, "change") to be extremely
helpful and just what I was looking for.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUploadField-with-AJAX-Behavior-tp4677874p4678594.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



RadioGroup (or even RadioChoice) with Map<String,String> values

2017-08-15 Thread lucast
Dear Forum,

I would like to display a group of radio choices and I will use RadioGroup
since it seems to be the fittest for my purpose. I got the implementation
example from  http://examples7x.wicket.apache.org/forminput/?
  

I have, a map of key->values. On the RadioGroup, I would like to display the
value from the map as label, but when getting the RadioGroup's model object,
I would like to get the key value from the map.

The only way I thought I could implement the desired behaviour is to use
List> on the RadioGroup. However, it seems like a
convoluted workaround.

Would you have a suggestion of how to implement a RadioGroup (or even
RadioChoice) using Map rather than List?


Thanks,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioGroup-or-even-RadioChoice-with-Map-String-String-values-tp4678526.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



Hidden to visible not working, even after having set up .setOutputMarkupId(true);

2017-08-03 Thread lucast
Dear Forum,

I have a page component that initially is hidden. 
These are the steps taken:


When I try to make the component visible, inside an AjaxLink.onClick(), I do
it like so:
pageComponent.setVisible(true);
target.add(pageComponent);

However, on the page, the component is not made visible at all. On wicket
Ajax debug, I get the following error:


Would you happen to know what I am missing, please?

Thank you,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Hidden-to-visible-not-working-even-after-having-set-up-setOutputMarkupId-true-tp4678430.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: using CssResourceReference for css file that lives in webapp

2017-08-03 Thread lucast
I'd like to second Maxim on this.
I am loading font files from the css file, and using
ContextRelativeResourceReference did not work.

I did not post my findings since I presumed it must have been something I
did wrong, or that it didn't work due to lack of understanding on my part.

Kind regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-CssResourceReference-for-css-file-that-lives-in-webapp-tp4678358p4678413.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: using CssResourceReference for css file that lives in webapp

2017-07-31 Thread lucast
Thank you, Maxim.

Since I am managing all css files and js files form my java class, I was
wondering if there is an equivalent to the HTML of http://apache-wicket.1842946.n4.nabble.com/using-CssResourceReference-for-css-file-that-lives-in-webapp-tp4678358p4678360.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



using CssResourceReference for css file that lives in webapp

2017-07-31 Thread lucast
Dear Forum,
I'm implementing a base wicket page where I load all of my CSS and
javascript.

I'm loading files from java class by using 



Is there a way to load a css file that lives under the webapp folder
directly from the java class?
At the moment, I'm using 

response_.render( CssHeaderItem.forReference(new
CssResourceReference(WicketBasePage.class, "mcc-style.css" ) ) );

where mcc-style.css lives alongside my java class, and inside of the
mcc-style.css, I have placed a very long reference to the css file that
lives under webapp:



Thanks in advance,



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-CssResourceReference-for-css-file-that-lives-in-webapp-tp4678358.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



HTTP PUT, POSTs to arbitrary URLs within wicket without use of any other 3rd party library

2017-07-28 Thread lucast
Dear forum, 
I need to send an HTTP PUT/POST request to an arbitrary URL and I have to
set headers and body.

Is there a way of doing this within wicket without using 3rd party libraries
such as spring framework's RestTemplate?

I looked at  wicketstuff-restannotations

 
, but it looks like it's more about publishing REST APIs rather than making
HTTP calls to external URLs. This is my limited understanding and it is
likely I may be wrong.

Thanks in advance,
Lucas

PS: this is my first post in 2 years. It's good to be back working with
wicket once more. =0)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/HTTP-PUT-POSTs-to-arbitrary-URLs-within-wicket-without-use-of-any-other-3rd-party-library-tp4678338.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: Firefox 39+ Error code: ssl_error_weak_server_ephemeral_dh_key on ssl connection

2015-07-29 Thread lucast
Thank you, niestroj,
I have solved the issue for my apache tomcat server. It was quite
straightforward. I found the solution here:

https://jamfnation.jamfsoftware.com/discussion.html?id=15032

The problem is, as Martin Grigorov pointed, a purely server issue, not a
wicket issue.

I did have a quick look to see if one could tweak the embedded jetty server
to resolve the issue, for when one is unit testing.

I'm afraid I have run out of time and I have to move on to my next task. But
if I can spare  30 minutes, I'll go back to it and hopefully post the
solution for the embedded jetty server here.

Thanks, once more,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Firefox-39-Error-code-ssl-error-weak-server-ephemeral-dh-key-on-ssl-connection-tp4671661p4671691.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



Firefox 39+ Error code: ssl_error_weak_server_ephemeral_dh_key on ssl connection

2015-07-27 Thread lucast
Dear Forum,
Since I have upgraded to Firefox 39 I have not been able to run my
application on https since on the browser, I get the following error:



This applies to the embedded jetty server and also the tomcat deployment
server.

Is this something that can be solved via Wicket, perhaps using
SslContextFactory or is it a purely server problem, exclusive of the wicket
application?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Firefox-39-Error-code-ssl-error-weak-server-ephemeral-dh-key-on-ssl-connection-tp4671661.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: Panels not refreshing when calling AjaxRequestTarget.add(), only in production mode

2015-06-03 Thread lucast
Hi Sven,
Thank you for your reply.

Yes, I call formComponentPanel#setOutputMarkupPlaceholderTag(true) on all
elements involved with the AjaxRequestTarget.

I'm still trying to get to the bottom of this.

What I am baffled about is why it doesn't work on production mode when it
works without any problems in development mode.

when on production mode, on firebug, I get the following error:

*Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id [[id29]]
was not found while trying to perform markup update. Make sure you called
component.setOutputMarkupId(true) on the component whose markup you are
trying to update.*

I have called setOutputMarkupPlaceholderTag(true) on the panel I am adding
to AjaxRequestTarget.

So the question is, has anyone experienced that a panel is refreshed when
running a wicket app in development mode, and that the panel is not
refreshed when running a wicket app in production mode?

Thanks, once more,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panels-not-refreshing-when-calling-AjaxRequestTarget-add-only-in-production-mode-tp4671035p4671041.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: Panels not refreshing when calling AjaxRequestTarget.add(), only in production mode

2015-06-03 Thread lucast
Hi Martin,
Thank you for your reply.

Yes, you're absolutely right. 

I use: *wicket:container wicket:id=emptyPanel /* and it is pretty much
how I add panels in the HTML code.

What should I use instead, div, span, anything else?

Thank you very much for pointing this out. I have been racking my brain for
almost 5 days in total!!!

Kind regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panels-not-refreshing-when-calling-AjaxRequestTarget-add-only-in-production-mode-tp4671035p4671044.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



Panels not refreshing when calling AjaxRequestTarget.add(), only in production mode

2015-06-02 Thread lucast
Dear Forum,
On a form which is inside a modal window, I have an ajax checkbox where if I
tick the box, I display a number of panels and if the checkbox is not
ticked, I hide said panels.

The functionality works well on development mode and does not work at all on
deployment mode.

I call 
FormComponentPanel.setVisible( True/False ); and then,

AjaxRequestTarget.add( FormComponentPanel );

Has anyone experienced anything similar where ajax works on development mode
but not on deployment mode?


Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Panels-not-refreshing-when-calling-AjaxRequestTarget-add-only-in-production-mode-tp4671035.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: Paypal Integration in wicket

2015-04-24 Thread lucast
Hi Jayesh,
For IPN whether it is the the sandbox or live, you have to provide an URL
that is accessible from outside your local network.

IPN is a third party system, so if you tell IPN to send its requests to
localhost, it will send requests to IPN's localhost.

You need to open up a port on your network: 80, 443, 8080 or 8443, look up
your public IP address and provide it to IPN simulator.

Since I'm working from home, on my router, I opened up port 80 directed all
traffic to my development machine.
You can tell your router to redirect all traffic from port 80, to send it to
your machine on port 8080. 

Don't forget to open up the above ports on your development machine as well.

If you are at an office then you can ask your sys admin to open up the above
ports and redirect them to your machine, but you still have to open up the
ports on your development machine.

I hope this helps and not make things more confusing for you.
Any questions, just ask.

Regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Paypal-Integration-in-wicket-tp4670325p4670495.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: Submitlink + PageParameters

2015-04-22 Thread lucast
Hi Chris,
Have you tried the following?:



In my case, the above solution was not properly redirecting to external url
in production mode, so I resorted to using RedirectToUrlException:



On the onSubmit(), I then calledsetResponsePage(new RedirectPage(
external url ) );

I hope this helps.
Regards,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitlink-PageParameters-tp4670454p4670464.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: Paypal Integration in wicket

2015-04-20 Thread lucast
Hi Jayeshps,
I have implemented a wicket pay with paypal button a few weeks ago.

The beauty of working with wicket is that you do not have to hard-code and
hide the html parameters you pass to paypal on your html.
It can all be done on the AjaxButton.onSubmit();

I am assuming you're familiar with the parameter's passed to paypal, if not,
here is a good example:
http://www.onlineinteract.com/wiki/viewpage.php?pageId=179
http://www.onlineinteract.com/wiki/viewpage.php?pageId=179  

Also, an explanation of each parameter can be  found here
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HF009YW
 
.


Ok, onto the code:

Inside the AjaxButton.onSubmit() button, you need to construct the URL with
parameters to pass to paypal:
An example url is this:
https://www.paypal.com/cgi-bin/webscr?cmd=_cartupload=1no_shipping=1no_note=1custom=0A566EC9F6AC27E9currency_code=GBPlc=GBbn=business_BuyNow_WPS_GBreturn=https://localhost:8443/paymentpage/sucessParameterscancel_return=https://localhost:8443/paymentpage/cancelParametersnotify_url=https://localhost:8443/paypalipnprocessbusiness=ad...@businessowner.comitem_name_1=entry_test_testitem_number_1=DB3BE2BD0BFC8D03amount_1=0.30


Notice how all parameters are separated by ''. 

You can produce the above URL from the server side, avoiding posting all of
the above info in hidden fields on the HTML form post parameters. 

The way I have implemented is as follow:
AjaxButton.onSubmit() 
{
   setResponsePage(new PayPalPaymentGatewayExampleClass(parameters to
construct the url));
}


I've attached the PayPalPaymentGatewayExampleClass which extends
RedirectPage2 on this post.
PayPalPaymentGatewayExampleClass.java
http://apache-wicket.1842946.n4.nabble.com/file/n4670405/PayPalPaymentGatewayExampleClass.java
  
RedirectPage2.html
http://apache-wicket.1842946.n4.nabble.com/file/n4670405/RedirectPage2.html  
RedirectPage2.java
http://apache-wicket.1842946.n4.nabble.com/file/n4670405/RedirectPage2.java  

PayPalPaymentGatewayExampleClass builds the URL with the necessary
parameters before posting the request to Paypal.


Notice that on RedirectPage2 I throw new RedirectToUrlException(
url.toString() );
That's because I was having trouble to properly rediderct a page running
wicket on production mode. I spent days trying to find a solution. Finally,
I had to settle for the workaround but functional RedirectToUrlException.



Part 2, processing the IPN:

Once the payment has taken place, Paypal will send the IPN request to you.
If you haven't played with Paypal's IPN simulator, you can do so  here
https://developer.paypal.com/developer/ipnSimulator  . Remember to provide
a valid url to IPN handler URL since IPN is a 3rd party trying to contact
your application. localhost will not do.

More on IPN
https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/
 
. Although, based on your post, you are already familiar with it.

As explained on this picture:
http://apache-wicket.1842946.n4.nabble.com/file/n4670405/IPN_auth_flow.gif 

and on this
link:http://codeoftheday.blogspot.co.uk/2013/07/paypal-button-and-instant-payment_6.html,
Paypal sends an IPN message, which if the URL is valid, automatically sends
a http 200 response back. Then you need to send the exact IPN message back
to Paypal with the code cmd=_notify-validate (valid at time of writing).

When Paypal replies to you with a valid code, only then is advisable to do
your back end processing of the payments and everything else you need to do.

I've attached the code for PayPalIPNProcessingPortal class which is an empty
page and should be a bookmarkable page.

If you read through the code and try to understand it, it might be better
than me trying to explain step by step.

PayPalIPNProcessingPortal.java
http://apache-wicket.1842946.n4.nabble.com/file/n4670405/PayPalIPNProcessingPortal.java
  
PayPalIPNProcessingPortal.html
http://apache-wicket.1842946.n4.nabble.com/file/n4670405/PayPalIPNProcessingPortal.html
  
IPN_Parameter.java
http://apache-wicket.1842946.n4.nabble.com/file/n4670405/IPN_Parameter.java  


Let me know if you have any questions. I am sorry if my code doesn't seem
clear enough. I work from home and although I try to make the code as
readable as possible for my future self, I don't have a team member to
code-review with.

All the best =0)
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Paypal-Integration-in-wicket-tp4670325p4670405.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



trying to redirect to external URL when using HttpsMapper

2015-03-05 Thread lucast
Dear Forum,
I have a form on a page where user enters personal data, and the page has
the @RequireHttps because I'm trying to make the information captured more
secure.

When the user clicks submit, the page should redirect to an external URL. In
this case, PayPal checkout page.


Unfortunately, on form submission, the page is not always redirected to the
desired external URL. This problem only occurs on Production mode. Very
frequently it is redirected to the 404 page-not-found page instead of the
external URL.

On my Wicket application, I call


If I remove that line, then redirecting to an external page works without
problem, but HTTPS  on pages is no longer enforced.

Has any of you encountered this problem in the past?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/trying-to-redirect-to-external-URL-when-using-HttpsMapper-tp4669869.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: trying to redirect to external URL when using HttpsMapper

2015-03-05 Thread lucast
Hi Sven,
Thanks for replying.

on the ajax submit button I call:

@Override
protected void onSubmit(AjaxRequestTarget target, Form? form) 
{
redirectToInterceptPage(new RedirectPage(URLString));
}

Have you compared the request sequence in the browser (e.g. with Firebug)? 

That is something I am not aware of. I'll look it up.

Thanks,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/trying-to-redirect-to-external-URL-when-using-HttpsMapper-tp4669869p4669871.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 send respons to user after payments has been done

2015-03-03 Thread lucast
Hi Long,
I'm not sure how Buckaroor works and how you communicate with it to process
payment.

I'll give a  description of how I went implementing the paypal
functionality, in the hope you will find similarities.

In my functionality, a user selects a number of different types of entries
and based on the number and the types of entries, I pass paypal the relevant
information to charge the right amount.

Here is an example of what is passed to paypal :
http://www.onlineinteract.com/wiki/viewpage.php?pageId=179 and here is a
description of all parameters:
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HF009YW

Your question states when I reveive an answer from this site, how do I show
a page to the user so he can login?

In paypal you have three relevant urls parameters (reference found on the
above links): 
*  Return: When the payment has been successful, where should paypal
redirect to? 
For that, you can provide a bookmarkable page with the relevant page
parameters. I trust you'll use ssl and encode your page parameters as well.
Based on those parameters (item id, amount paid, etc) you can retrieve your
relevant data and display whatever you need displayed.
*  cancel_return: when the user cancels the payment on paypal, before it
is completed. This is the page the user will be redirected to. Similar to
the return parameter
*  *notify_url*: this is also known as  IPN
https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/
 
. This is a url that paypal calls when a transaction has taken place, it can
be a successful payment, a refund and other things. This url is independent
of the return/cancel_return urls and it is mainly used to automate
back-office and administrative functions.

So, in my case, I use the return url to take the user to a page that says
your payment is being processed or something like that. and it is on the
calls to notify_url that I perform the necessary checks, such as transaction
ID, id of items paid, checking that the amount paid matches what the items
cost, etc. 

The difference between return/cancel_return and notify_url (IPN) is that for
return/cancel_return, you provide the parameters. For notify_url, you
extract the data from paypal specific parameters.

I hope this helps,

let me know if you have any other questions.

Regards,
Lucas

Relevant links:

http://www.onlineinteract.com/wiki/viewpage.php?pageId=179
http://www.onlineinteract.com/wiki/viewpage.php?pageId=179  

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/formbasics/
  

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HF009YW
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HF009YW
  


*Paypal IPN*:
https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/
https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/
  

https://developer.paypal.com/webapps/developer/applications/ipn_simulator
https://developer.paypal.com/webapps/developer/applications/ipn_simulator  

java example of IPN integration:
http://codeoftheday.blogspot.co.uk/2013/07/paypal-button-and-instant-payment_6.html
http://codeoftheday.blogspot.co.uk/2013/07/paypal-button-and-instant-payment_6.html
  






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-send-respons-to-user-after-payments-has-been-done-tp4669785p4669802.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: redirect to external URL page on form submit - deployment mode problem

2015-03-03 Thread lucast
Hi there,
Has anyone experienced this problem?

How do you redirect to an external page?

thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/redirect-to-external-URL-page-on-form-submit-deployment-mode-problem-tp4669791p4669804.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



redirect to external URL page on form submit - deployment mode problem

2015-03-02 Thread lucast
Dear forum,
I am working on a pay-pal functionality.

After the user has selected a number of entries and clicks submit, the user
is redirected to an external paypal payment form. The url is unique for
every submit, with various parameters.

In order to implement this, I have made use of  

I have based my implementation on the  wicket linkomatic examples page
http://www.wicket-library.com/wicket-examples-6.0.x/linkomatic/home  
This works well on development mode.

However, on deployment mode, it doesn't quite work as it should. 

When submitting the form, the page either gets redirected to page not found
page, or I get a generic browser's Unable to connect or I get redirected
to a blank page. 

Sometimes I get redirected to the paypal page, which is the intended
behaviour.

I have to emphasise that I do not have this problem when running in
development mode.

What would be the best way to redirect to external url, please? I am
encrypting the url on my application. I'm not sure if that is of any
relevance.

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/redirect-to-external-URL-page-on-form-submit-deployment-mode-problem-tp4669791.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 send respons to user after payments has been done

2015-03-02 Thread lucast
Hi Long,
Are you working with Paypal?

If so, I'll post the relevant answer to you.

Regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-send-respons-to-user-after-payments-has-been-done-tp4669785p4669790.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



URL Encryption in detail

2015-02-19 Thread lucast
Dear forum,


Reading the Apache Wicket Guide on  URL Encryption in detail
https://wicket.apache.org/guide/guide/security.html#security_4  , the
section suggests that simply calling 

is not enough for url encryption at production level.

Further down on that section, there is one recommendation of making the url
encryption stronger:



Is simply adding *getSecuritySettings().setCryptFactory(new
KeyInSessionSunJceCryptFactory())*; line enough to make the URLs on my
application better as suggested on  URL Encryption in detail
https://wicket.apache.org/guide/guide/security.html#security_4  ?

My impression is that maybe it isn't since I understand
KeyInSessionSunJceCryptFactory is the default CryptFactory for the
application.

In addition to this, CryptoMapper(IRequestMapper wrappedMapper,  Application
application) API Doc states that: For better security it is recommended to
use CryptoMapper(IRequestMapper, IProvider) with a specific ICrypt
implementation that generates a separate key for each user.
KeyInSessionSunJceCryptFactory provides such an implementation that stores
the key in the HTTP session.

Does the above sentence mean that one ought to implement a CryptProvider
class using KeyInSessionSunJceCryptFactory or something better/stronger ?

Encryption and security are not my forte and at the same time I admit I am
looking for an out-of-the-box solution where I can just simply carry on
implementing the rest of my wicket app.


Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/URL-Encryption-in-detail-tp4669640.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: Removing table coloumn headers in wicket pageablelistview when list is empty

2015-02-06 Thread lucast
Hi K,

If you want to hide the headers when the table is empty, you could use
wicket:enclosure as suggested on the  wicket guide
https://wicket.apache.org/guide/guide/single.html#keepControl_9  .

I have used the PagingPage from Wicket Examples (you can download it from
Apache Wicket page) to illustrate this.

I don't know how you check if the table is empty. I just went for
dataView.getItemCount().

If you want the table with headers hidden, just call
dataView.setVisible(false);
And on HTML, use wicket:enclosure.

Example:


Note that on wicket:enclosure tag, I had to name the child it was referring
to: pageable. Otherwise, it will throw an exception because wicket will not
know which element you are referring to, in this case.

Let me know if that works,

Kind regards,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Removing-table-coloumn-headers-in-wicket-pageablelistview-when-list-is-empty-tp4669246p4669328.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: validation in form component panels in RefreshingView

2015-01-22 Thread lucast
Thank you, Martin,

I have used ReuseIfModelsEqualStrategy and the validation message side of it
work but now I have a different problem.

When I navigate away from the form panel, update the list of objects and
navigate back to the FormComponentPanel that holds the RefreshingView, only
one item from the list gets displayed.

I use a ListModel to pass the list of objects to the FormComponentPanel.

When used for the first time, the RefreshingView calls getItemModels() and
populateItem(), but after updating the ListModel, RefreshingView only calls
getItemModels() and *not* populateItem(). 

Would you happen to know why that is?

If I use DefaultItemReuseStrategy.getInstance() then  getItemModels() and
populateItem() get called every time. But that just takes me back to square
1.

I'm not sure if this is relevant. ReuseIfModelsEqualStrategy documentation
states that  the model and not the model object needs to implement the
Object.equals(Object) and Object.hashCode() methods.

I'm terribly sorry but I'm not sure completely understand that statement.
Would that be something to do with the RefreshingView not displaying all
items in the list model.

On trying to interpret that statement, on RefreshingView.getItemModels(), I
return an anonymous class that extends ModelIteratorAdapter. And on
ModelIteratorAdapter.model, I return an custom Model with extends ModelMy
Application Object. It is there that I implement hashcode and equals. But
the problem still persists.

I hope I'm not making things more confusing by writing extensively, but I
just wanted to put it out there, in case there was something simple and
small that I am missing.

Thanks in advance,
Lucas




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068p4669081.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: validation in form component panels in RefreshingView

2015-01-22 Thread lucast
Hi Martin,
Thank you for taking the time to reply.

I have implemented hashcode and equals on the object, and the Model class
used inside the RefreshingView and the ListModel class that is passed to the
RefreshingView.


In order to be able to display the right number of entries, I clear the list
inside the ListModel and populate it again with  N numbers of initialized
objects. The variables in those objects are all null. 


This works on the first run but not on the second.

In stepping through the code with debugger, hashcode and equal are called
only for the the actual object and the model object, not for the ListModel.

Since all objects are empty (no variables have been populated) the models
and the actual objects all return the same hash code.

But this surely is of no relevance since I am using a List, not a set. 

I've been looking at this for a while, and perhaps I have lost the sense of
perspective, but I cannot see what I am doing wrong.

Kind regards,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068p4669088.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: validation in form component panels in RefreshingView

2015-01-22 Thread lucast
Hi Martin,

I'm sorry to bother you with a second post. 

I have reproduced the behaviour described above in a simple project ( 
refreshingview.zip
http://apache-wicket.1842946.n4.nabble.com/file/n4669090/refreshingview.zip 
). Also, I put the mercurial project on bitbucket( hg clone
https://luc...@bitbucket.org/lucast/refreshingview).


The behaviour is as follow. 

Step 1, choose a number (3, for example) from the drop down list. A list of
3 entries of text fields will be displayed.

Step 2, choose a different number (2, for example) from the drop down list.
Only one entry of text field will be displayed. Even though the list model
has 2 entries, not one.

When an entry from the drop down list, located in HomePage is selected,
PersonListFormComponentPanel is updated.

On running the debugger, I noticed that inside
ReuseIfModelsEqualStrategy.getItems(), (line 86), on the bit that compares 
if (oldItem == null), on the first run, oldItem *is* null.
On the second run, *oldItem* *is not*.

That is why PersonRefreshingView.populateItem() is not called the second
time a number is selected from the drop down list.

How can I set *oldItem* to null so that it follows the very same behaviour
as when executed the first time?

If you happen to look inside
PersonListFormComponentPanel.PersonRefreshingView, you will notice that I
have implemented PersonModel, with equals and hashcode functions.


Anyway, this is something I honestly cannot get my head around. I have tried
for days now and I find it most puzzling.

Any tips, or hints in the right direction will be much appreciated.

Thanks, once more,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068p4669090.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



validation in form component panels in RefreshingView

2015-01-21 Thread lucast
Dear forum,

I'm implementing a tabbed panel. 
On first panel, user selects number of items. On second tab, user enters
details for each item.

I've implemented a RefreshingView so that the number of items on list
reflects the number of items selected by user.

To bundle all of the fields together I use a form component panel and for
each entry on the RefreshingView, I add a form component panel.

The text fields have FieldDecorators, as explained on the Apache Wicket
Cookbook, chapter 3.

The problem is that when I submit the form, the error messages for each
field are not shown on the text field FieldDecorators.

If I use RepeatingView, error messages are displayed as intended. But my
list is dynamic.

How can I get the proper validation message displayed inside the form
component panel, used in a RefreshingView?

Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/validation-in-form-component-panels-in-RefreshingView-tp4669068.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



wicket framework and clickjacking risk

2014-12-18 Thread lucast
Dear Forum,
I recently ran  metasploit
https://en.wikipedia.org/wiki/Metasploit_Project   on my wicket 6
appilcation and one of the vulnerabilities found was  clickjacking
https://www.owasp.org/index.php/Clickjacking  

A quick search on google suggested a couple of solution for Java EE
applications: one from  OWASP
https://www.owasp.org/index.php/ClickjackFilter_for_Java_EE   and one for 
Java Evangelist blog
http://javaevangelist.blogspot.co.uk/2014/06/clickjacking-and-java-ee-some-practical.html
 
.   
The solutions in those posts, suggest the use of filters. 

I just would like to know if any of you were aware of this issue and how you
went implementing a solution for your wicket application, either just adding
code to the page header or creating filters or any other means.

Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-framework-and-clickjacking-risk-tp4668840.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



AjaxFormChoiceComponentUpdatingBehavior for custom CheckGroup and CheckGroupSelector

2014-11-06 Thread lucast
Dear Forum,

Based on wicket examples, I built a custom CheckGroup with added
CheckGroupSelector.
I also want to add an AjaxFormChoiceComponentUpdatingBehavior() instance to
the CheckGroup to update the items selected. And this is where the problem
lies.

I have extended CheckGroup class to make use of  ICheck jquery plugin
http://fronteed.com/iCheck/  .

Because CheckGroupSelector is  JavaScript sugar according to a previous
post
http://apache-wicket.1842946.n4.nabble.com/Wicket-FormTester-not-working-with-CheckGroupSelector-tp4668206p4668217.html
  
(thanks for the reply, Andrea), I had to replace CheckGroupSelector and
AbstractSelector class. For the custom AbstractSelector class, I replaced
the CheckSelector.js to make use of the ICheck functions,
$('#'+checkbox.id).iCheck('check'), $('#'+checkbox.id).iCheck('uncheck'),
etc.

The problem that I have now is that AjaxFormChoiceComponentUpdatingBehavior
no longer picks the click event from the checkboxes.
In order to resolve this problem, I am propagating the click event from
inside  CheckSelector.js  using javascript code from  this stackoverflow
answer http://stackoverflow.com/a/2381862/158499  . But this still doesn't
solve the problem.

My question is, how can I get AjaxFormChoiceComponentUpdatingBehavior to
pick up any event when I select/unselect any checkboxes from the custom
Icheck solution?

Failing that, how can I best create my own implementation of
AjaxFormChoiceComponentUpdatingBehavior to know when a checkbox has been
clicked?

Sorry for the long post.

Thanks,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormChoiceComponentUpdatingBehavior-for-custom-CheckGroup-and-CheckGroupSelector-tp4668281.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



Wicket FormTester not working with CheckGroupSelector.

2014-10-31 Thread lucast
Dear Forum, 
I'm implementing the CheckGroup example from  wicket-examples
http://www.wicket-library.com/wicket-examples-6.0.x/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.CheckGroupPage;jsessionid=B179E71FA0687FABCC91FC1D8759085F?0
  

I have added a AjaxFormChoiceComponentUpdatingBehavior() instance to the
CheckGroup to update the items selected. I got the idea from  RadioChoice
example page
http://www.wicket-library.com/wicket-examples-6.0.x/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.RadioChoicePage?3
  

The CheckGroup example makes use of a CheckGroupSelector and I am having
problem testing this one with formTester.

In the automated test, I am trying to run, I call 
  to unselect all.

However, I am getting an error message that says:
*org.apache.wicket.WicketRuntimeException: Component with id: groupSelector
is not a FormComponent*

How can I set/unset this CheckGroupSelector?

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-FormTester-not-working-with-CheckGroupSelector-tp4668206.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: EditablePropertyColumn and a callback to save

2014-10-23 Thread lucast
Hi Steve,
If I understand correctly, you would like to catch an ajax event fired from
the cell when you click away.

There are two ways you can do this, you can add an OnChangeAjaxBehavior()
class to the file:


Alternatively, you can add an AjaxEventBehavior to your object:



I hope that helps,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/EditablePropertyColumn-and-a-callback-to-save-tp4668048p4668049.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: Combine breadcrumb with a dataview

2014-10-23 Thread lucast
Hi Sanders,
I hope you don't mind me asking. Have you tried following the code execution
with a debugger?

I had a similar problem in the past and I realized that the existing
breadcrumb solution did not satisfy my needs so I had to extend the class to
make it fit.

I hope this helps.

Regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Combine-breadcrumb-with-a-dataview-tp4668040p4668050.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: Unit tests that use wicket's session and spring session

2014-09-02 Thread lucast
Hi Marios,
Have you had a look at the on-line wicket guide? 
https://wicket.apache.org/guide/guide/testingspring.html

That is a really good chapter for setting up Wicket Spring testing.

I hope that helps,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unit-tests-that-use-wicket-s-session-and-spring-session-tp4667270p4667297.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



getResourceBundles().add css or javascript in wicket application

2014-08-28 Thread lucast
Dear forum,
I want to bundle css files from inside my wicket application.

I read  wicket guide Resource management
https://wicket.apache.org/guide/guide/resources.html   chapter and wicket
in action   Wicket 6 resource management
http://wicketinaction.com/2012/07/wicket-6-resource-management/   blog.

The examples provided refer to static files that one packages with one's
project.

Is it possible to reference to remote css or java script files, like  Font
Awesome
http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css 
, for example?

Also, what is the recommended practice? To download third party css and
javascript files and bundle them in the application or to reference to them
via URL?

Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getResourceBundles-add-css-or-javascript-in-wicket-application-tp4667207.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: getResourceBundles().add css or javascript in wicket application

2014-08-28 Thread lucast
Hi Sebastein, and Martin
Thank you for your post.

I think until Martin's reply I had the impression that one could bundle
local resources AND third party resources together.

Based on Sebastien's post, that would not be possible for certain third
party libraries such as font-awesome. Would that be correct?

Thanks, once more,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getResourceBundles-add-css-or-javascript-in-wicket-application-tp4667207p4667210.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: listening to specic event in custom

2014-08-25 Thread lucast
Thank you, Chris.

That did the trick.

I have had a look at wicket-bootstrap. It's really good.

I wanted to implement the modal window in a similar way to the existing
wicket-extension modal, so that when I do code migration, I minimize the
number of changes I need to make.

Thank you for recommending wicket-bootstrap.

Kind regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-listening-to-specic-custom-event-tp4667138p4667157.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



Ajax: listening to specic event in custom

2014-08-22 Thread lucast
Dear forum,
I have implemented a custom-made modal window using twitter bootstrap
syntax.

The modal window has a confirm and a cancel ajax link.

Similarly to Wicket's own modal window, I have implemented a
show(AjaxRequestTarget) function that calls 



and I have managed to display the modal window no problem.

When I click either confirm/cancel, on AjaxLink.onClick(AjaxRequestTarget) I
close the modal window and I send and event:



on the main panel where the modal window is added to, I catch the events
sent from the modal window by implementing  onEvent(IEvent).

The problem is that on the main panel, upon catching the event, when I
replace the current panel, it hides the modal window but the blocking
greyed-out foreground remains. It therefore blocks the screen from any
usage. I have to refresh the screen for it to go away.


According to the  bootstrap documentation
http://getbootstrap.com/javascript/#modals-usage  , Bootstrap's modal
class exposes a few events for hooking into modal functionality.
One of them is *hidden.bs.modal*:   This event is fired when the modal has
finished being hidden from the user (will wait for CSS transitions to
complete).
Example taken from  tutorialrepublic.com
http://www.tutorialrepublic.com/codelab.php?topic=bootstrapfile=modal-events 
 

How can I, from the confirm/delete.onClick(AjaxRequestTarget) know when the
modal window has been completely closed before calling ?

I am assuming I need to listen for the *hidden.bs.modal* ajax event. would
that be right? if so, how can I listen for this custom ajax event?

I just want to get rid of the blocking foreground, when the panel has been
successfully replaced.

Thanks in advance. Sorry for the long post.

Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-listening-to-specic-event-in-custom-tp4667138.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: Unit testing FormComponentPanel

2014-08-07 Thread lucast
Thank you, Martin,

I have implemented the solution, as suggested:

wicketTester.getRequest().setParameter(formComponentPanel:radioChoice,
value)


However, AjaxFormChoiceComponentUpdatingBehavior.onUpdate() (which I have
added to radioChoice) does not behave as expected during test.

Normally, inside of onUpdate() I obtain the value from radioChoice by
calling radioChoice.getModelObject().

However, when I execute

radioChoice.getModelObject() returns null. 

From inside the test, the only way I can obtain a value from inside
AjaxFormChoiceComponentUpdatingBehavior.onUpdate() is by calling
radioChoice.getInput() which only returns a string.

How can I get radioChoice.getModelObject()  to return a value from inside
the test?

I fear I am missing something really obvious in my tests.

Thanks, once more,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unit-testing-FormComponentPanel-tp4666900p4666923.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



Unit testing FormComponentPanel

2014-08-06 Thread lucast
Dear Forum,
I am trying to unit test a FormComponentPanel. I would like to populate its
fields and test some ajax behaviour as well.

Is it possible to test a FormComponentPanel and its behaviour in isolation
and not as part of a form?

How can this be achieved? For testing a form, I call


Is there a similar call I can use to test FormComponentPanel?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unit-testing-FormComponentPanel-tp4666900.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: Unit testing FormComponentPanel

2014-08-06 Thread lucast
Thank you, Martin.

I am able to successfully call 



but when I try to get hold of the object above in order to use it in
tester.executeAjaxEvent I get null value.

These are the calls I have used:


I'm terribly sorry but what would be the function I need to execute to get
hold of the object I need to pass to tester.executeAjaxEvent(), please?

Thanks, once more,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unit-testing-FormComponentPanel-tp4666900p4666914.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



is it possible to add a css class to FormComponent.setLabel()?

2014-07-30 Thread lucast
Dear Forum,
Currently, I make heavy use of TextField.setLabel().
If adding a css field to TextField is as easy as TextField.add(new
AttributeAppender(class,  TestCSSClass )); then:

How can I add a CSS class to label that has been created for TextField?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/is-it-possible-to-add-a-css-class-to-FormComponent-setLabel-tp4666801.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



WicketTester.executeAjaxEvent causes problems with FormTester.setValue()

2014-06-25 Thread lucast
Dear Forum,
I have come across a strange behaviour when running
wicketTester.executeAjaxEvent and FormTester on form fields with
setRequired( true );

If I call formTester.setValue(), followed by
wicketTester.executeAjaxEvent(), followed by formTester.submit(), the values
on the form fields are cleared. Form return errors.

If I call wicketTester.executeAjaxEvent() *first*, followed by 
formTester.setValue(),  followed by formTester.submit(), then the test
executes as expected.

Is there a rule somewhere that says that ajax behaviour should be executed
first, before setting form values? 

Is this behaviour correct or could it be that it is a bug with WicketTester
or formTester?

I've attached the code for quick behaviour reproduction.

Thanks in advance,
Lucas

TestHomePage.java
http://apache-wicket.1842946.n4.nabble.com/file/n4666379/TestHomePage.java  
HomePage.java
http://apache-wicket.1842946.n4.nabble.com/file/n4666379/HomePage.java  
HomePage.html
http://apache-wicket.1842946.n4.nabble.com/file/n4666379/HomePage.html  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketTester-executeAjaxEvent-causes-problems-with-FormTester-setValue-tp4666379.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: WicketTester.executeAjaxEvent causes problems with FormTester.setValue()

2014-06-25 Thread lucast
Thanks for the reply.
I wasn't aware that values are consumed  after an ajax request.

My bad.

Thanks for taking the time to reply. It really does make a difference.

Regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketTester-executeAjaxEvent-causes-problems-with-FormTester-setValue-tp4666379p4666382.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



TDD - ajax button form submit via FormTester - Wicket 6

2014-06-24 Thread lucast
Dear Forum,
I am testing a form with has fields with ajax behaviours and form
components. The form has an ajax submit button to do all the necessary
processing.

Initially half of the form fields are hidden.

I then select a drop down list with has an OnChangeAjaxBehavior attached to
it in order to make the necessary fields visible and some, required.

I do it thus:



I then go on to set values on every field on form, including the ones nested
inside formComponents. Here are a few examples:



Finally, I submit the form, which is where the issue lies.

Initially I was calling 
 

But I came to the conclusion that if I am using an ajax button I should call
tester.executeAjaxEvent. Therefore I have placed the following line before
the formTester.submit() call.


When I call  it returns true. And after iterating through the code with the
debugger, some of the required fields have the following feedback messages:



Why would the above behaviour occur? What am I missing in order to make a
successful form submit?

I am really at a loss, since I have populated the necessary fields, as shown
on examples above.

Thanks in advance,
Lucas 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TDD-ajax-button-form-submit-via-FormTester-Wicket-6-tp4666367.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: Unit testing with Spring injected Application

2014-06-04 Thread lucast
Hi Nick,
I know you have posted this solution a long time ago but I happen to be
having the very same exception: IllegalStateException: Application name can
only be set once.

I'm using wicket 6, spring 4 (and hibernate). And I am trying to do an
integration, end-to-end test.

This is what my test looks like:





I tried implementing your suggested solution but I'm afraid I'm stuck in a
number of places:

Where do you get the  *applicationContext value from? If I add  to the above
class, it will throw a null pointer exception when running setUp. I tried a
number of workarounds but none of them seem to work.

I just would like to know how you initialized autowireCapableBeanFactory
from applicationContext, if the test environment is set up by Spring.

If I move setUpLoginEnvironment to inside userSuccessfullyLogsIn(), then I
don't have the problem. I just wanted to divide the test up for readability
purpose. 

Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unit-testing-with-Spring-injected-Application-tp4653110p4666117.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



TDD - End to End acceptance test - how to set form field values

2014-06-02 Thread lucast
Dear Forum,

I'm trying to (retro) fit TDD into my Wicket project (Wicket Spring
Hibernate) after reading growing object-oriented software guided by tests
by Steve Freeman and Nat Pryce.

One of the first thing the book suggest is to write an acceptance test for
each feature.

The simple feature I want to test is a user login.

Here are my steps to take:
1 create organisation
2 create user
   2.a set username
   2.b set password
   2.c set email
   2.d set organisation
3 start application
4 render login page
5 populate username and password fields
6 assert successful login

I am following the example from  Wicket's Wiki Spring Unit Testing the Proxy
Approach
https://cwiki.apache.org/confluence/display/WICKET/Spring#Spring-UnitTestingtheProxyApproach
 
. 

So far, I can render the login page and assert the form components.

How do I set the form username and password before calling
WicketTester.submitForm()?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TDD-End-to-End-acceptance-test-how-to-set-form-field-values-tp4666093.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



FormComponentPanel.validate() API Doc question

2014-04-04 Thread lucast
Dear forum,
I've written a FormComponentPanel in which one can select a date range and
during validation I want to check that start date is not in the past or that
end date is before start date.

I have decided to do these checks by overriding
FormComponentPanel.validate().

The FormComponentPanel.validate() API Documentation ends with *This method
should only be used if the form component needs to be fully validated
outside the form process.*

What exactly does *validate a component outside the form process* mean? 
English is not my first language so maybe that's why I don't get it.

All explanations will be much appreciated.

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FormComponentPanel-validate-API-Doc-question-tp4665262.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: E-Commerce and Open Source projects

2014-03-27 Thread lucast
Hi Arjun,
That's a good set of questions you have posted.
However, I am thinking that due to the nature of the question, you might get
more replies if you post it in a start-up related forum.
I think Stackexchange (stackoverflow.com is part of it) have one.
Alternatively, there are a couple of software start-up books written solely
for software developers that might be able to shed more light on this.  It
might not be relevant to your question (in terms of licensing) but there are
two books you might get better idea for pricing: Micro-ISV: From Vision to
Reality and Start Small, Stay Small: A Developer's Guide to Launching a
Startup.

You can look them up on Amazon.

I hope that helps.

Kind regards,

Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/E-Commerce-and-Open-Source-projects-tp4665137p4665146.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: getting values from FormComponentPanel outside form.onSubmit()

2014-02-17 Thread lucast
Hi Sven and Richter,
Thank you for your replies.

What I am trying to achieve is a refreshing view, with fields that are
editable, and rows that can be removed, as shown on  Wicket Examples -
Repeaters - Contacts Editor - based on the previous example, but with
editable values
http://www.wicket-library.com/wicket-examples-6.0.x/repeater/wicket/bookmarkable/org.apache.wicket.examples.repeater.FormPage?1
  

But in addition to those functionality, have one of having the list being
expandable instead of just contractile. 

That would be inside a form, with other fields, that's why I have been
setting the AjaxSubmitLink.setDefaultFormProcessing( false ).

I am making use of FormComponentPanel.onEvent(), as suggested, but the only
way to get the values from text fields is by using TextField.getInput(). 

TextField.getConvertedInput() will return null unless it is done via form
submit. Maybe I am missing something.

Thanks,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getting-values-from-FormComponentPanel-outside-form-onSubmit-tp4664462p4664498.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



getting values from FormComponentPanel outside form.onSubmit()

2014-02-14 Thread lucast
Dear forum,

I have implemented a FormComponentPanel as suggested both in the Apache
Wicket Cookbook (chapter 2) and  wicket guide (chapter 12.8)
http://wicket.apache.org/guide/guide/forms2.html#forms2_8  .

Before I submit the form, I would like to have the option of adding the
content from FormComponentPanel to a list.

I have made use of AjaxButton and  I have set 
AjaxButton.setDefaultFormProcessing( false).

In order to get value from FormComponentPanel when performing 
form.onSubmit(), one calls FormComponentPanel.getConvertedInput(), which in
turns calls FormComponentPanel.convertInput().

The problem is that if I call FormComponentPanel.getConvertedInput() from
inside AjaxButton.onSubmit(), FormComponentPanel.convertInput() is never
called.

My question is, how can I get the contents from FormComponentPanel using a
AjaxSubmitLink or AjaxButton without having to go via form.onSubmit()?

Is there, perhaps another form component that I could use to achieve my
goal?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/getting-values-from-FormComponentPanel-outside-form-onSubmit-tp4664462.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: techniques using of Form

2014-02-14 Thread lucast
Hi Farrukh,
From existing literature (Wicket in Action, Apache wicket Cookbook,  wicket
guide http://wicket.apache.org/guide/guide/index.html  ), there are a
number of ways you can go about it.

You can put your form in a panel, have a submit once form (to prevent
multiple submits) as template and extend that class. It all depends on what
your needs are.

FormComponentPanels are also very useful.

I'm sure people in this forum have better and more extensive suggestions
than me but at least, that's a starter. 
Both the Apache wicket Cookbook and wicket guide are good starting points
for creating your own best practices.

I hope that helps,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/techniques-using-of-Form-tp4664459p4664463.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: Extending TextField to display Joda's LocalTime in HH:mm format

2013-12-21 Thread lucast
Thank you, Sven.
I am pleasantly surprised to see how clear and easy to follow the
documentation was and more importantly, how clean and straightforward the
implementation of converters can be.

Regards,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-TextField-to-display-Joda-s-LocalTime-in-HH-mm-format-tp4663112p4663175.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



Extending TextField to display Joda's LocalTime in HH:mm format

2013-12-18 Thread lucast
Dear Forum,
I am trying to have an input field in which user inserts a time of the day
in HH:mm format.
In some cases, the field could be already populated.

I thought of extending TextFieldLocalTime and pass a LocalTime object to
the form field.

The problem is that when if the local time variable already has a value, the
LocalTime field will be populated in HH:mm:ss.SSS format.

How can I properly extend TextField so that when populating the field it
will do it in *HH:mm* format, please?

I would be grateful if someone could point me in the right direction?

I am trying to extend text field but I don't know which function I should
override.


My simple example is as follow:
HomePage class:



HomePage HTML:

And the maven import for joda time:


Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Extending-TextField-to-display-Joda-s-LocalTime-in-HH-mm-format-tp4663112.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



Field Decorator not working on a single dropdown field after form submit

2013-11-25 Thread lucast
Dear Forum,
I have created a Field Decorator solution based on Apache Wicket Cookbook,
chapter 3.
I have also created a drop down field validator which implements
INullAcceptingValidator.

When the form is first rendered, Field decorator beforeRender() and
afterRender() is called for all form fields.

When I submit the form with all fields empty, Field decorator beforeRender()
and afterRender() is called for all form fields EXCEPT the one drop down
field in question.

Has anyone come across this type of problem? Why is the Field decorator
beforeRender() and afterRender() not called for the drop down field? Even
the custom drop down field validator is called.

I'm extending a SubmitOnceForm, if that is of any relevance.

I'm afraid I cannot reproduce this scenario in a stand-alone example.


Thanks in advance,
Lucas




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Field-Decorator-not-working-on-a-single-dropdown-field-after-form-submit-tp4662650.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



upgrade from 1.5 to Wicket 6 Form field issue and Ajax Link

2013-11-18 Thread lucast
Dear Forum,
I have a main form and within this form, I have two fields: a drop-down list
and a text field followed by an ajax-link which is meant to add the values
from two fields to a list (scenario described in previous 
AjaxFormComponentUpdatingBehavior( change ) on a DropDownChoice
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-quot-change-quot-on-a-DropDownChoice-td4660065.html
   
post).

On the form, I change the value of the drop down list and the integer text
field. 
But when I click on the ajax-link, the value from the integer text field is
set to its original value (of 1). Even after I have manually changed the
value on the form, I still get the default value of 1.  
The drop-down list behaves with no problem, though.

I have tried every single function available on wicket, from
getConvertedInput() to getValue().

This only occurs on wicket 6. 

If I click on the submit button, instead of the ajax-link, then I get the
updated value from the form and not the default value from the integer text
field.

How can I get the updated value that I enter on the form, when I click on
the ajax-link?

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/upgrade-from-1-5-to-Wicket-6-Form-field-issue-and-Ajax-Link-tp4662497.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 free guide updated.

2013-07-06 Thread lucast
Hi Andrea,
Thank you for writing this really good book.
I would like to have a hard copy of it from amazon or any other site. Have
you found a publisher that would print it for you?

kind regards,
Lucas





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-free-guide-updated-tp4658427p4660101.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



AjaxFormComponentUpdatingBehavior( change ) on a DropDownChoice

2013-07-05 Thread lucast
Dear Forum, 

I have a drop down choice for populating form fields with default values. 

To achieve this, I have added an AjaxFormComponentUpdatingBehavior( change
) to the drop down choice. Inside the
AjaxFormComponentUpdatingBehavior.onUpdate() I populate all fields of the
form and call target.add() for refreshing the form fields.

Also, inside the form, I have an ajax button (not the main form submit
button), which I have set to ajaxbutton.setDefaultFormProcessing( false ); 

The ajaxbutton.onSubmit(AjaxRequestTarget target, Form? form) is empty.
Just a simple println() statement for testing purposes.

The problem I have now is that if I click the ajaxbutton, the drop down
choice ajax no longer updates the form fields. 

However, if I set ajaxbutton.setDefaultFormProcessing( true ); then the drop
down choice ajax works as expected.

Has anyone encountered a similar problem? I'm clueless and It's doing my
head in. 
The problem is that I tried to reproduce it on a stand-alone page and I
cannot even reproduce the bug.

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-change-on-a-DropDownChoice-tp4660065.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: AjaxFormComponentUpdatingBehavior( change ) on a DropDownChoice

2013-07-05 Thread lucast
Thank you, Martin. 
That seems to have done the trick. 
I would really like to found out why ajax functionality broke. The
irritating bit is the fact I cannot even reproduce the bug on a stand-alone
form.
Everything else inside the AjaxFormComponentUpdatingBehavior.onUpdate()
works. just target.add(formFields) is not updating the fields.

If any other reader out there has encountered this problem, please let me
know.


Thanks, once more.
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-change-on-a-DropDownChoice-tp4660065p4660069.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



http://wicket.apache.org/learn/examples/ still linking to wicket 5 examples

2013-06-10 Thread lucast
Dear forum,
I am sure someone has already noticed this but I thought of pointing it out.
I'm trying to get to the latest wicket examples page. My first port of call
was to go to http://wicket.apache.org/learn/examples/ and follow the live
action link but it takes me to the
http://www.wicket-library.com/wicket-examples/index.html link which displays
all wicket 5 examples.

I had to google the more up to date page:
http://www.wicket-library.com/wicket-examples-6.0.x/index.html in order to
find it.

Is the above link meant to work that way or should it be pointing to wicket
6 examples?

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/http-wicket-apache-org-learn-examples-still-linking-to-wicket-5-examples-tp4659308.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: Unable to succesfully propagate event from panel since getPage() throws error

2012-09-20 Thread lucast
Thank you, Martin. 
it works like a charm.

Sebastien, I have tried before the solution you have suggested but the event
wasn't being caught by the top web page.
Thank you, nevertheless for your help.

I have to say, I have learnt so much from this mailing list, not only on
wicket but everything related to it as well.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unable-to-succesfully-propagate-event-from-panel-since-getPage-throws-error-tp4652153p4652165.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



Unable to succesfully propagate event from panel since getPage() throws error

2012-09-19 Thread lucast
Dear Forum,
I have the following tree structure: WebPage has Panel A, which has Panel B.
I am trying to propagate an event from Panel B so that it is caught from
WebPage.

Normally, I would propagate an event in the usual way:
send(*getPage()*, Broadcast.BREADTH, new EventUpdate(someObject) );

However, getPage() is null when calling from PanelB.
How can I propagate the event from PanelB so that it is caught from WebPage
when calling getPage() returns null?
I really don't know how else I should propagate such event.

Thanks in advance,
Lucas





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unable-to-succesfully-propagate-event-from-panel-since-getPage-throws-error-tp4652153.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: bookmarkable page being processed twice, second time, extra parameters passed

2012-09-18 Thread lucast
Thank you, Jeremy.

I did look at any references for images. I stripped the page of wicket
components and I started added them one by one to see which component was
that was causing this problem.

I am reusing a form and from within that form I was referencing a CSS file
which is not present in the current bookmarkable page but it is used in
another part of the system, which is non book markable.

I removed the reference to CSS file and that solved the problem.

Thanks, 
Lucas




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/bookmarkable-page-being-processed-twice-second-time-extra-parameters-passed-tp4652031p4652107.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



bookmarkable page being processed twice, second time, extra parameters passed

2012-09-17 Thread lucast
Dear Forum,
I have a bookmarkable page which can take two parameters:
uniqueName=[uniqueName] and unique_id_key=[]

For some reason, the page is being instantiated twice.
The first time, the right parameters are being passed.

The second time, a lot of parameters are being passed and one of the
parameters has the wrong value:
0=[panel], 1=[style.css], uniqueName=[uniqueName], unique_id_key=[style]

Has anyone experienced this before? how can one stop the second request
coming through?

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/bookmarkable-page-being-processed-twice-second-time-extra-parameters-passed-tp4652031.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



Apache wicket cookbook ch5 - Filtering form example

2012-09-07 Thread lucast
Dear Forum,
For those of you familiar with the content of Apache wicket cookbook. There
is a wonderful example for filtering data tables on chapter 5 (recipe0502), 
When I click search, the entire page is refreshed. The main question I have
about this is:

Is there a way to implement this using ajax so that only the result table is
refreshed/repainted?

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-wicket-cookbook-ch5-Filtering-form-example-tp4651836.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: Apache wicket cookbook ch5 - Filtering form example

2012-09-07 Thread lucast
It works like a charm!
Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-wicket-cookbook-ch5-Filtering-form-example-tp4651836p4651839.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



Adding Ajax Validation to Individual Form components- Distinguishing error from multiple validators

2012-08-17 Thread lucast
Dear Forum,
I apologize if this question has come up before.

I have an email field and I want to check two things: one: that the email
address is well formed. And two: that the email address isn't already
registered.

For the first one I use EmailAddressValidator and for the second one I
create my own validator.

I then add AjaxFormComponentUpdatingBehavior to the email address field as
explained in the Apache Wicket Cookbook, Chapter 7: Adding Ajax Validation
to Individual Form components.

The problem I have is that, inside
AjaxFormComponentUpdatingBehavior.onError(AjaxRequestTarget target,
RuntimeException e) I don't know whether the error came from
EmailAddressValidator or my own validator. The error message should be
different depending which Validator is complaining.

Is there a way to find out which validator the error is coming from? that
would make things more efficient.

Thanks in advance.
Lucas





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-Ajax-Validation-to-Individual-Form-components-Distinguishing-error-from-multiple-validators-tp4651319.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: Adding Ajax Validation to Individual Form components- Distinguishing error from multiple validators

2012-08-17 Thread lucast
Hi Sven,
Sorry, I should have explained on the first post.
The reason I want to differentiate in #onError()  is because if the address
is already registered then I want to have a modal window popping up with
further options such as retrieving the person's details and so on.
Where as if the email address is not well formed, I don't want to have the
modal window being displayed.

Thanks once more.

Lucas





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-Ajax-Validation-to-Individual-Form-components-Distinguishing-error-from-multiple-validators-tp4651319p4651321.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: Adding Ajax Validation to Individual Form components- Distinguishing error from multiple validators

2012-08-17 Thread lucast
Thanks Sven, 
I'm afraid I don't know how to open a modal window from IValidator.validate
since as it stands it does not handle ajax (as far as my limited knowledge
goes).

I have moved email address validation to form.onValidate() and implemented
it in the following manner: 

if ( ! EmailAddressValidator.getInstance().getPattern().matcher( email
).find() ){ ...

I just thought one could perhaps, within
AjaxFormComponentUpdatingBehavior.onError  determine which validator is
complaining out of a group that have been assigned to a field.


Thanks,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-Ajax-Validation-to-Individual-Form-components-Distinguishing-error-from-multiple-validators-tp4651319p4651329.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: Feedback next to each input field on form

2012-06-27 Thread lucast
Hi srinash,
Since you have mentioned you have the wicket cookbook, I would suggest that
you implement the example step, by step.
Also, go to  http://www.packtpub.com/apache-wicket-cookbook/book apache
wicket cookbook website  and download the code for each example.

Once you have downloaded the sample code, you will have a working example
and the instructions from the book.

If you still have problems with feedback for each field, then post a
question again.

I know that the examples from the book are in wicket 1.4 and I had some
trouble with some examples running on wicket 1.5, make sure they work on the
wicket version you are running.

I hope that helps,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Feedback-next-to-each-input-field-on-form-tp4649886p4650253.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



Appending onbeforeunload javascript function and then disabling it

2012-06-23 Thread lucast
Dear Forum,
I have this panel in which I make an ajax button visible via ajax. Also, I
append the  following javascript to the AjaxRequestTarget to prevent the
user from navigating away:

When the user clicks on the ajax button, I hide it and I no longer prevent
him/her from navigating away so I append the  following javascript to the
AjaxRequestTarget:

and this works (I got this answer from 
http://stackoverflow.com/a/9717750/158499 stackoverflow ).

My question is, in wicket, is there any negative consequences to constantly
appending the mentioned javascript/jquery code to the AjaxRequestTarget?
I just don't know any other way to disabling such behaviour and I applied
the one solution I know.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Appending-onbeforeunload-javascript-function-and-then-disabling-it-tp4650203.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: Ajaxbutton, updating forms, broken persistence: strange, seemingly unrelated behaviour

2012-06-20 Thread lucast
Thank you, Sven.

In my code I was not calling LoadableDetachableModel.detach() after
persisting objects to the database. Something I should have done.

As for the new events mechanism, I just had a look at the Migration to
Wicket 1.5 and it looks like it's just what I need. The example from the
wicket-example page is clear and concise. This will indeed untangle my
code as you rightly put it.

I shall read the Migration to Wicket 1.5 document as up until now I was more
concern of having my code up and running and charging ahead with having my
1.4 code working on 1.5.

Thanks for your help,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajaxbutton-updating-forms-broken-persistence-strange-seemingly-unrelated-behaviour-tp4650049p4650112.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



Captcha cookbook example - image not refreshing on wicket 1.5.7

2012-06-12 Thread lucast
Dear forum,
Reading the Protecting against spam with a CAPTCHA section on chapter 2,
Apache Wicket cookbook, I noticed that the captcha picture gets refreshed
every time one clicks on the submit button and that no AJAX is involved.

the example, uses wicket 1.4.9 but when I test the very same code on wicket
1.5 the Captcha image is not refreshed when one enters the wrong number or
when one simply clicks submit button.

Is there a way for the captcha image to be refreshed/re-rendered as it does
on the original example without using AJAX?

I haven't changed anything from the example other than having created a
wicket 1.5.7 project on Eclipse and copied over the code.
I tried using NonCachingImage instead of Image but it made no difference.

Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Captcha-cookbook-example-image-not-refreshing-on-wicket-1-5-7-tp4649875.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: Captcha cookbook example - image not refreshing on wicket 1.5.7

2012-06-12 Thread lucast
Thanks for the answer Martin.
But the example from wicket-library is not quite the same.
Your answer, however, has help me find the solution that works on wicket
1.5.
I wanted to keep the captcha functionality independent of the form, much as
it is on the book.

So I only changed three lines:
First, instead of using an anonymous CaptchaImageResource object, i declared
it private and part of the Captcha class.
second, instead of using Image, I used NonCachingImage
finally on the book, it resets the captcha value on the onBeforeRender()
function of the panel. In there, I called captchaImageResource.invalidate()
before the call to super.onBeforeRender(); 

That solved the problem.

Thanks for your help,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Captcha-cookbook-example-image-not-refreshing-on-wicket-1-5-7-tp4649875p4649880.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



Adding onclick ajax behaviour to a panel

2012-01-31 Thread lucast
Dear Forum, 
I have a grid of panels (a calendar, really) and each panel may have a list
of people or no list at all.

Because the panels are so small, I'd like to be able to click on the panel
and have a modal window pop up.

Which Ajax updating behaviour should I add to the panel? I can't add
AjaxFormComponentUpdatingBehavior to it since it's not a form component.
If Ajax updating behaviour  is not the right element that I need to add,
then which one is it?

Silly as this question is, I am a bit lost.

Thanks in advance for any advice.

Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-onclick-ajax-behaviour-to-a-panel-tp4344504p4344504.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



Populate DropDownChoice, set Object Model and still keep Please Select option

2012-01-30 Thread lucast
Dear forum,
I'm dealing with a form in which I have a number of dropdown choices.
Some drop down choices will have value preselected (eg. second option on the
list). 

I would like the dropdown choices where the value is preselected to still
hold the Please Select option so that the user has the option to unselect
the value of the dropdown choice.

I tried using DropDownChoice.setNullValid(true); but that only works for the
dropdown choices in which no model has been set.

Thanks in advance,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Populate-DropDownChoice-set-Object-Model-and-still-keep-Please-Select-option-tp4340568p4340568.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



Setting object on Parent panel and checking its value on grand-child panel

2012-01-13 Thread lucast
Dear Forum,
I have set  a drop down list on a parent panel A and at one point or another
I need to check the value selected from that drop down on a grand-child
panel.The structure I have is as follows:
Parent Panel A contains
Child panel B which contains
grand-child panel C.

I have set object O as ModelObject of the drop down list in panel A.

How can I check the value of Object O in grand-child panel C?
I have passed the Object O as a parameter when initializing the panels, but
when checking the values of object O in grand-child panel C, they have not
been updated. I only see the values that O has been set with when
initializing panel C.

I could pass parent panel as a parameter to the child and grand-child panels
so I can call parent.getObject(). But is there a better way to do this? 
is it possible for  panel C to read the updated values of Object O without
the need to pass panel A to the constructor of grand-child panel C?

Thanks in advance and I apologise if I'm rather unclear in my question.

Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-object-on-Parent-panel-and-checking-its-value-on-grand-child-panel-tp4291808p4291808.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



wicket-fullCalendar Custom month View

2011-12-31 Thread lucast
Dear forum,
I am using wicket-fullCalendar and I am quite happy with it.
I have 2 questions, though.
1) The default month view shows 6 weeks instead or the customary 5. 
Is there a way to change the default month view so that it only displays 5
weeks or as many weeks as one wishes?

2)The default month view shows the entire current month, starting with the
first day of the month on the first row.  
Is there a way to make the month view display the current week as the start
of the month plus the next 3 or 4 weeks ahead?

Today, for example, being the last day of the month, it shows all of
December and only one row of January, if I want to see upcoming events, it's
not quite ideal to have the last week of December in the penultimate row.

I hope some wicket-fullCalendar user out there can shed some light on this.
Thanks in advance and happy New Year everyone!
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-fullCalendar-Custom-month-View-tp4248424p4248424.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



adding css class to AbstractColumn table header

2011-12-12 Thread lucast
Dear Forum,
I'm using a DefaultDataTable (structure almost identical to  clickable cell
example from chapter 5, Apache Wicket Cookbook).

I want one particular column to have a different css class to the rest.
For that reason, when extending AbstractColumnT, I add the css class to
populateItem method:

public void populateItem(ItemICellPopulatorlt;T cellItem, String
componentId, IModelT rowModel) {
cellItem.add(new SimpleAttributeModifier(class, nameOfCssClass));
...
}


That works fine for each cell but the class is not added to the column
header.
Is there a way to add a class to the column header for AbstractColumn?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/adding-css-class-to-AbstractColumn-table-header-tp4185280p4185280.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: Jquery Confirmation Dialog - or WiQuery Dialog?

2011-12-03 Thread lucast
Hi Ernesto,
I have just implemented the solution suggested for 1.4.x wiquery and it
works great, exactly what one needs!
I just added the dialog.close(target); to the onButtonClicked method to exit
the dialog.
Thank you very much for this. 
Wiquery is very useful for folks like me.
It's another incentive into looking at the source code to see how it works
and to start doing more complex javascript integration with wicket.

Thank you very much indeed.
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Jquery-Confirmation-Dialog-or-WiQuery-Dialog-tp4119238p4152782.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: Jquery Confirmation Dialog - or WiQuery Dialog?

2011-11-30 Thread lucast
Thank you, Ernesto.
I have checked out wiQuery trunk. I am still to upgrade from wicket 1.4.19
to 1.5.
As soon as I have, I'll let you know how the dialog button functionality
goes.
Thank you very much for adding this functionality. 
I am sure other developers will find it of much use.
Kind regards,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Jquery-Confirmation-Dialog-or-WiQuery-Dialog-tp4119238p4124155.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: Jquery Confirmation Dialog - or WiQuery Dialog?

2011-11-30 Thread lucast
Hi Ernesto,
Yes, I believe that porting it to 1.4.2 would be ideal. It means that I can
finish this functionality and upgrade wicket at a later date.
That, of course, would be most generous of you.

I was going to do that myself by doing a diff between the two files but I
noticed the new structure between wiquery 1.4.x and 1.5.x.

Also, (although, this would be more suitable for a different post), I'm
calling mvn -e package on wiquery-read-only and I'm getting some errors
(attached, just in case, 
http://apache-wicket.1842946.n4.nabble.com/file/n4124319/mvnPackageBuild.log
mvnPackageBuild.log ).
It starts with
...wiquery-core/src/main/java/org/odlabs/wiquery/core/WiQuerySettings.java:[31,28]
package org.apache.wicket.css does not exist. After that I get a long trace.
I don't know why maven is complaining.

But in short, having that functionality in 1.4.2 would be grand.
Thank you very much,
Lucas





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Jquery-Confirmation-Dialog-or-WiQuery-Dialog-tp4119238p4124319.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



Jquery Confirmation Dialog - or WiQuery Dialog?

2011-11-29 Thread lucast
Dear Forum,
I want to implement a modal window for confirming the deletion of objects. I
want to use Jquery confirmation dialog, just like on 
http://jqueryui.com/demos/dialog/modal-confirmation.html this example .

Is there a way to add this Jquery script to my code and to know if the
delete button has been clicked?
When I use jQuery widgets, I render them on load from renderHead function
but I never had to use dialogs. 

I thought of using wiQuery's functionality by creating a Dialog object and
adding DialogButton objects to it.
But I don't know how to how about adding the necessary code to record that
the delete button has been clicked.
I know I need to add the following code to the Dialog object:
  DialogButton deleteButton = new DialogButton(delete, jsScope);
but I don't know what I should put on jsScope.

I don't want to depend on wiQuery, if learning how to read a value from
javascript/jquery code gives me more freedom.

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Jquery-Confirmation-Dialog-or-WiQuery-Dialog-tp4119238p4119238.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



new wicket app going live

2011-08-31 Thread lucast
Dear Forum,

A quick note to let you know that next week a new wicket web app is going
live.

Mater Ecclesia is being built for Turnbull Hall, a busy Glasgow University
Catholic Church.

Mater Ecclesia is a (social) event management system. It creates (at the
moment, only rota) events and invites students to take part in them.

Although the functionality is still quite basic, I am working hard so that
it expands to include other types of social events.

Once it has a decent set of functions, I am also intending to make it open
source, in case there are other people out there who may find it useful.

Although first phase is not yet fully complete, I thought about sharing the
site with the forum until Friday, for those who wish to have a peek:

the site  http://www.materecclesia.net http://www.materecclesia.net  needs
login: test_user, password: MaterEcclesia

I have created two rota events typical of the parish: Reading rota and 40
hour adoration.

I understand that many will be unfamiliar with what these rota events mean
but you can see the type of functionality I have implemented.

Students that have been invited will receive an email containing links like 
http://www.materecclesia.net/?x=kxqZFhUdVza8aTrmjVGVV0b6qcs-ANGBxpOjqlzFNCmejnm6k8kw8ZbsJ9xOa2CQydfXzE0Nbqt30ayJz4Pv5W-lDDXdtlIvUl6R9m5uwy7aS34GZD3A09mfCS70e9dS7T7z2ZQW*nwqeGevH*LGgyBnJZSUYiZOWnMZIi9kLS2NY1cQ7FglC*yMbrSpn5kPr52FvBtQvYcHarfbA-vVnw
this one  or 
http://www.materecclesia.net/?x=kxqZFhUdVza8aTrmjVGVV0b6qcs-ANGBxpOjqlzFNCmejnm6k8kw8ZbsJ9xOa2CQydfXzE0Nbqt30ayJz4Pv5W-lDDXdtlIvUl6R9m5uwy7aS34GZD3A09mfCS70e9dS7T7z2ZQW*nyTby6TiQTMEy3RwVn-xy9NAc9Jg8hB71wd8CmUpUInf-Q3GIl3hN02s0KMpbEQC6Q
this one .

If you would like to see the student registration form, you can see it 
http://www.materecclesia.net/createParishioner/turnbull here .

If you have any comments, they are more than welcome.

Feel free to play around with it. I shall wipe the database clean at end of
day on Friday.

I would also like to thank all those who replied to my questions in this
forum. 

Kind regards,
Lucas








--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/new-wicket-app-going-live-tp3782064p3782064.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: Call urlFor(Class, PageParams) outside of request cycle

2011-08-24 Thread lucast
Hi Alex Swan,
I know the post is a bit old now.
I had a similar problem a couple of months ago and the way I got around it
is by creating a non bookmarkable link at same time I created the main
object via the wicket app and I stored it on the DB. 
Quartz then I would fetch the stored link from the DB and send the email
with that link.
The reason I did it that way was because at the time I wanted  to have a non
bookmarkable link with encoded url to hide the parameters I was passing.

Cheers,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Call-urlFor-Class-PageParams-outside-of-request-cycle-tp3392690p3764774.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



target.addComponent breaks Jquery date picker

2011-07-25 Thread lucast
Dear Forum,
I'm have a jquery date picker field that I can update by adding
AjaxFormComponentUpdatingBehavior to a drop down choice.

After I have updated the date field using ajax through the drop down choice,
the jquery date picker functionality is no longer working.


Following the advice on this 
http://apache-wicket.1842946.n4.nabble.com/target-addComponent-td2713413.html
post , 
I have added renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript(jquery here);
} 
to the form.
The behaviour is the same, the date picker works until the date field is
updated via ajax through the drop down choice.

Neither response.renderOnLoadJavascript or
response.renderOnDomReadyJavascript can make the date picker work after it
has been updated through  target.addComponent( startDateField );

Would anyone know how I can solve this problem?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/target-addComponent-breaks-Jquery-date-picker-tp3693121p3693121.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: target.addComponent breaks Jquery date picker

2011-07-25 Thread lucast
Thank you, Andrea.
I added target.appendJavascript( jquery code here ); and that solved the
problem.
Kind regards,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/target-addComponent-breaks-Jquery-date-picker-tp3693121p3693360.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



AjaxFormComponentUpdatingBehavior(onchange) not working on DropDownChoice

2011-07-18 Thread lucast
Dear Forum,
I have added AjaxFormComponentUpdatingBehavior to a DropDownChoice to hide a
text field or to make it visible, according to the value selected from
DropDownChoice.

AjaxFormComponentUpdatingBehavior is hiding the text field, as expected, but
it is not making it visible when it should.
Surely, if it hides a form object, it should equally make it visible, should
it not?
Code:

public class HomePage extends WebPage {
DropDownChoiceString choice = new DropDownChoiceString(choice, new
ModelString(), Arrays.asList( new String[] { A, B, C } ));
TextFieldString textField = new TextFieldString(textField, new
ModelString());
Form textDropDownAjaxForm = new Form(genericForm);

public HomePage(final PageParameters parameters) {

textDropDownAjaxForm.add(textField);
textDropDownAjaxForm.add(choice);
add(textDropDownAjaxForm);

textField.setOutputMarkupId(true);
choice.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(AjaxRequestTarget target) {
if ( choice.getModelObject() == A ){
*textField.setVisible(true);*
} else {
*textField.setVisible(false);*
}
*target.addComponent(textField);*
   }
});
}
}

and here is the HTML:
body
form wicket:id=genericForm
select wicket:id=choice
optionChoose one/option
/select
text field: input wicket:id=textField type=text /
/form
/body

Thanks in advance for any help,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-onchange-not-working-on-DropDownChoice-tp3674937p3674937.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: Forms across multiple panels

2011-06-20 Thread lucast
I know this thread hasn't been active for a while but I thought I'd ask.
How can one perform form field validation if the form fields are inside the
panels contained in the forms?

The form itself will not now what fields are contained in the panels.

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Forms-across-multiple-panels-tp2067607p3611293.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-dnd not working on IE9 and only partially on IE8

2011-06-13 Thread lucast
Sven very kindly found the source of the problem.
The problem is that in my app I was using 
head
  wicket:link
   link href=style.css rel=stylesheet 
  /wicket:link
/head
with no closing tag. If I have had closing tag /link then the problem
wouldn't have occurred.
Damn! I should have spotted this!
Thanks, Sven.
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3593344.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-dnd not working on IE9 and only partially on IE8

2011-06-08 Thread lucast
Hi Sven,
Thanks for your reply.
I've tested wicket-dnd on windows Vista, using IE9 and that's when the
problem occurs. 
The problem of the on drop functionality not displaying the object dropped,
described in my previous post occurs on IE8 under both windows vista and
windows xp. Wicket-dnd works fine in any other web browser I have tried.
As requested, here is the version I am using of wicket-dnd, extracted from
my pom file: 
dependency
groupIdwicket-dnd/groupId
artifactIdwicket-dnd/artifactId
version0.4-SNAPSHOT/version 
scopecompile/scope
/dependency
On repository section I have the following:
repository 
idwicket-dnd/id 
nameWicket-dnd Repository/name 
urlhttp://wicket-dnd.googlecode.com/svn/repo/url 
/repository

I will try to recreate the problem described above in a simple example, once
I know what triggers it.
I don't want to speculate as to the cause. All I can say is that it's the
way I make use of wicket-dnd that causes this. So it must be the way I coded
repeating views or something like that.
I'll post my code as soon as I get the chance. 
Thanks, once more,
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3581931.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-dnd not working on IE9 and only partially on IE8

2011-06-08 Thread lucast
Hi Sven,
I'm trying to build a standalone example of the error I am experiencing on
IE8, but in the meantime, I thought about posting the html produced on both
IE8 (where I'm experiencing the problem) and on Firefox (where there is no
problem).
I'll attach as text file so it doesn't clutter up this post.
I'm implementing wicket-dnd on a table, and the html produced in IE8  has
javascript functions and is a lot more verbose than on firefox. I am not
sure if you'd be able to understand why it is producing that.
I'll keep working on the standalone example in the meantime.
Thanks, 
Lucas
http://apache-wicket.1842946.n4.nabble.com/file/n3582180/wicket-dnd_tableCell_IE8.txt
wicket-dnd_tableCell_IE8.txt 
http://apache-wicket.1842946.n4.nabble.com/file/n3582180/wicket-dnd_tableCell_Firefox.txt
wicket-dnd_tableCell_Firefox.txt 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3582180.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-dnd not working on IE9 and only partially on IE8

2011-06-08 Thread lucast
Hi Sven,
I found what causes the drop functionality not to work on IE8.
I have a panel which has wicket-dnd draggable and droppable functionality. I
allocate that panel to each table cell.
On the html file for the panel, I have the following header which already
exists on the homePage.html file:
head
wicket:head
wicket:link
link href=panelStyle.css rel=stylesheet
/wicket:link
/wicket:head
/head
If I remove that from SlotDragDropPanel.html (attached), then wicket-dnd
works fine on IE8. 
Why that is, I just don't know. I should find out but I'm just happy and
relieved to have got this out of the way with my release date so soon.
Attached are the files I used for this app.
http://apache-wicket.1842946.n4.nabble.com/file/n3583128/WicketApplication.java
WicketApplication.java 
http://apache-wicket.1842946.n4.nabble.com/file/n3583128/HomePage.java
HomePage.java 
http://apache-wicket.1842946.n4.nabble.com/file/n3583128/HomePage.html
HomePage.html 
http://apache-wicket.1842946.n4.nabble.com/file/n3583128/GuestListView.java
GuestListView.java 
http://apache-wicket.1842946.n4.nabble.com/file/n3583128/SlotDragDropPanel.java
SlotDragDropPanel.java 
http://apache-wicket.1842946.n4.nabble.com/file/n3583128/SlotDragDropPanel.html
SlotDragDropPanel.html 
http://apache-wicket.1842946.n4.nabble.com/file/n3583128/style.css style.css 

If you comment out the head section on SlotDragDropPanel.html then the
problem disappears.
Thanks for taking the time to look into this,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3583128.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



wicket-dnd not working on IE9 and only partially on IE8

2011-06-07 Thread lucast
Dear Forum,
Has any wicked-dnd user out there noticed that the functionality doesn't
work on IE9? 
I have an implementation of wicket-dnd that I have used with repeating views
so that I can use it in tables and lists but while it works on firefox,
google chrome, even konkeror, it doesn't work at all on IE9.
On IE8, the drag functionality works but when dropping the object on a drop
area, it doesn't refresh the area to display the dropped object. I have to
refresh the page to see what I have dropped.

not even the examples page from wicket-dnd work (
http://wicket-dnd.appspot.com/ http://wicket-dnd.appspot.com/ ) on IE9. 

I'm about 3 weeks away from making my system go live and this doesn't look
good.

I've tested my web app on Windows Vista using IE9 and IE8.

Any help will be, as always, much appreciated.
Kind regards,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-dnd-not-working-on-IE9-and-only-partially-on-IE8-tp3580258p3580258.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 Cookbook - preventing multiple form submits

2011-05-20 Thread lucast
Hi Andrea,
As you have suggested, on the SubmitOnceForm class, I've added two
variables, page reference and page relative path,
on calling process I get the copy the values:
public void process(IFormSubmittingComponent submittingComponent)
{
pageReference = getPage().getPageReference();
pageRelativePath = getPageRelativePath();
if (isAlreadyProcessed())...
 ..
   }
And I am now getToken has the returns those copied values:
private FormToken getToken()
{
return new FormToken(pageReference, pageRelativePath);
}

That is the exception thrown solved. Thank you very much for taking the
time. Seriously, I really appreciate it.
I still have the problem that when I click the save button, If I go back,
the fields are blank.
If I fill the fields again and navigate back and forth with the internet
browser arrows then the form fields keep their values.
I suspect it has something to do with the submit button. 
That's something I need to investigate further.
Cheers,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3538263.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 Cookbook - preventing multiple form submits

2011-05-20 Thread lucast
Hi Andrea, 
That's correct, I move back from the view person panel to the create person
one with browser 'back' button.
Many thanks,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3539086.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 Cookbook - preventing multiple form submits

2011-05-20 Thread lucast
Hi Ayodeji,
The book is not an introduction to Wicket. It's for current users of Wicket.
I can personally say its a really good book and I wish it was published 5
months ago, at the beginning of my pet project.
you can find it in https://www.packtpub.com/ in hardcopy or electronic copy.
Amazon sells it too.
I recommend it.
Cheers,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3539314.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



Wicket Cookbook - preventing multiple form submits

2011-05-19 Thread lucast
Dear Forum, 
On implementing prevent-multiple-form-submits, ch 2 - Wicket Cookbook, I
found that when calling
 getToken()  {
return new FormToken(getPage().getPageReference(), 
getPageRelativePath());
 }
I get an error on getPage() because the current form doesn't have a page or
parent with a page.

I'll explain my layout.
I have a main page containing panels for navigating, instead of replacing
pages, I replace panels:
public class HomePage extends WebPage {
private Panel currentPanel = homePanel;
public HomePage(final String id, final ClassHomePage c){
add(currentPanel);
...
currentPanel.replaceWith(createPersonPanel);
currentPanel = createPersonPanel;
}

I have a createPerson panel and declared it in the following manner: 
public class CreatePersonPanel extends Panel {
..
public CreatePersonPanel(String id, WebPage parent){
add( new EventForm( createPersonForm, (IModelPerson) getDefaultModel() )
);
}
And I also have the form which is an extension of  SubmitOnceForm described
on the Apache Wicket cookbook:
private class PersonForm extends SubmitOnceFormEvent {
...
}

I noticed that that when I call getParent() inside CreatePersonPanel, that
throws an exception so maybe it's the way I am declaring my panels and
forms.
How can I solve this problem? 
I got around it, but I haven't solved it.
process(IFormSubmittingComponent submittingComponent) on SubmitOnceForm
class calls  updateProcessedForms(); and super.process(submittingComponent) 
if the form hasn't been processed, so I changed the order of the above so
that it calls super.process(submittingComponent) FIRST, and then
updateProcessedForms();
That way getParent() inside  getToken() doesn't throw an error any more and
the functionality works. Great!

Now, the confusing thing is that, after I created a person, if I go back
from the view person panel to the create person panel, the fields I have
entered are blank. 
The blank fields happen only once. If I fill in the fields again, they stay
filled.
How can I have it so that after having created a person, if I go back the
fields are not blank? 
Does it have anything to do with the order I am calling functions inside
SubmitOnceForm.process()?
Could it be with the way I am binding the fields: new
PropertyModelString(person,description) ?


I do apologise for the lenghty post and thanks for looking into this long
post.
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3535159.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 Cookbook - preventing multiple form submits

2011-05-19 Thread lucast
Hi Andrea,
Thanks for your reply.
I call updateProcessedForms() AND THEN super.process(submittingComponent).
The reverse order to what it is shown on pg 49 on book. I described it wrong
on original post, I apologise. It is now corrected.

When calling createPerson Panel, I execute the following in order to create
new instance of person variables:
public CreatePersonPanel(String id, WebPage parentPage){
super(id);
setDefaultModel(new ModelPerson(new Person(new
PersonCreatedTimestamp()));
add( new PersonForm( personCreationForm, (IModelPerson)
getDefaultModel() ) );
...
}
And for editing I do the following:

public CreatePersonPanel(String id, Long personId , WebPage parentPage){
super( id, new LoadablePersonModel(personId) );
this.parentPage = parentPage;
add( new PersonForm( personCreationForm, (IModelPerson)
getDefaultModel() ) );
... 
}

Inside the form, I get a copy of the default model object:
public EventForm(String id, IModelPerson model) {
super(id, model);
 person = (Person) this.getDefaultModel().getObject();
...
}
When submitting the form, I simply call the following service passing the
person object I extracted from the default model, as shown above:
WicketApplication.get().getPersons_service().savePerson(person);

The only place where I create a new instance of person is when I first call
the createPersonPanel.
I hope this helps. Thanks for looking into it.
Lucas


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3535415.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 Cookbook - preventing multiple form submits

2011-05-19 Thread lucast
Hi Andrea,
Here is form.onSubmit() functionality, as well as the panel swap
functionality and how I call it. It is pretty much all the functionality I
use:

public class CreateEditPersonPanel extends Panel {
   private WebPage parentPage;
   public CreatePersonPanel(String id, WebPage parentPage) {
  super(id); 
  this.parentPage = parentPage;
  add( new PersonForm( genericPersonCreationForm, (IModelPerson)
getDefaultModel() ) );
  }
   ...
   private void callViewPersonPanel(Long personID){ 
  //get parent page, pane container
  parentPage.replaceCurrentPanelWithViewPerson(personID);
   }
   ...
   private class PersonForm extends SubmitOnceFormPerson {
  @Override
  protected void onSubmit() {
 WicketApplication.get().getPersons_service().savePerson(person);
 callViewPersonPanel(person.getId());
 }   
  }
}
And on the Parent page I have the following functionality:
 public class ParentPage extends WebPage { 
...
   public void replaceCurrentPanelWithViewPerson(long personID){
viewGenericPersonPanel = new ViewGenericPersonPanel(mainPanel, 
personID);
currentPanel.replaceWith(viewGenericPersonPanel);
currentPanel = viewGenericPersonPanel;
   }
}

I'm sorry I cannot spot where I might have gone wrong. 
Thanks for your help,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Cookbook-preventing-multiple-form-submits-tp3535159p3536181.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



TextField not binding PropertyModel

2011-05-16 Thread lucast
Dear Forum,
I am trying to bind the field event.title to the eventTitleTextField in a
form in the following manner:

 TextFieldString eventTitleTextField = new TextFieldString(eventTitle,
new PropertyModelString(event, title));

title is a field of event object.

When processing the form, after having filled the eventTitleTextField,
event.getTitle() returns null.
When analysing the content of the above eventTitleTextField while debugging
on Eclipse, the eventTitleTextField.data contains an instance of event
object and the title field is populated.

However, the original event.title field is still null. 
Why is it not binding the TextField to the variable? what am I missing here?

Thanks in advance,
Lucas

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/TextField-not-binding-PropertyModel-tp3527074p3527074.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



  1   2   >