Re: Loading Javascript for wicket component

2015-05-29 Thread MartinoSuperman
When you use the 'target' of AjaxRequestTarget, you can use the method
appendJavaScript(..) in it.

You can call a function in JavaScript in it. In that way, you are loading a
JavaScript with and for a Wicket component. 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Loading-Javascript-for-wicket-component-tp4670871p4670989.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



Making RadioChoice horizontal

2015-05-29 Thread MartinoSuperman
Dear,

I made a RadioChoice on my Wicket web page with 3 radio buttons in it.

These radio buttons in this RadioChoice are shown vertically.

I want to make those horizontally.

Can someone tell me how to do that?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Making-RadioChoice-horizontal-tp4670988.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



Redirecting to another Wicket after 5 seconds

2015-05-22 Thread MartinoSuperman
Dear,

I want to make a timer on a WicketPage.

When my Wicket website starts at the begin page, it must redirect after 5
seconds to another. 

I already have the following code:

=

public final class TimerTestPage extends WebPage {

Timer timer; 

public TimerTestPage() {
super();

ActionListener actionListener;
actionListener = new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
setResponsePage(DemoPage.class);
//getRequestCycle().setRequestTarget(DemoPage.class);
}
};

timer = new Timer(5000, actionListener);
timer.start();
}


}
=

The timer works, but after 5 seconds, the Wicket page is not redirected to
DemoPage.

It gives the following NullPointer exception:
===

Severe:   Exception in thread AWT-EventQueue-0
Severe:   java.lang.NullPointerException
at org.apache.wicket.Component.setResponsePage(Component.java:3141)
at 
com.myapp.wicket.TimerTestPage$1.actionPerformed(TimerTestPage.java:30)
at javax.swing.Timer.fireActionPerformed(Timer.java:312)
at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:699)
at java.awt.EventQueue$3.run(EventQueue.java:697)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:708)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)



Does anyone know what I am doing wrong? What exactly generates that
NullPointer exception? 





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Redirecting-to-another-Wicket-after-5-seconds-tp4670858.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: Sign to Google with Java Wicket

2013-11-24 Thread MartinoSuperman
Hi,

Thanks for your help.

I tried it in 2 ways:

Here are the codes:

1.

public class GoogleClientLogin {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) throws IOException,
URISyntaxException {
//Open the Connection
URL url = new URL(https://www.google.com/accounts/ClientLogin;);

HttpURLConnection urlConnection = (HttpURLConnection)
url.openConnection();
urlConnection.setRequestMethod(POST);
urlConnection.setDoInput(true);
urlConnection.setDoOutput(true);
urlConnection.setUseCaches(false);
urlConnection.setRequestProperty(Content-Type,
application/x-www-form-urlencoded);

// Form the POST parameters
StringBuilder content = new StringBuilder();
content.append(Email=).append(URLEncoder.encode(m...@gmail.com,
UTF-8));
content.append(Passwd=).append(URLEncoder.encode(password,
UTF-8));
//content.append(service=).append(URLEncoder.encode(yourapp,
UTF-8));
OutputStream outputStream = urlConnection.getOutputStream();
outputStream.write(content.toString().getBytes(UTF-8));
outputStream.close();

// Retrieve the output
int responseCode = urlConnection.getResponseCode();
InputStream inputStream;
if (responseCode == HttpURLConnection.HTTP_OK) {
inputStream = urlConnection.getInputStream();
if(Desktop.isDesktopSupported())
{
Desktop.getDesktop().browse(new URI(http://www.gmail.com;));
}
System.out.println(Connection is OK);
} else {
inputStream = urlConnection.getErrorStream();
System.out.println(Connection is not OK);
}
}
}

2.
public class BigQuerySample {
  public static void main(String[] args) throws IOException,
URISyntaxException {
HttpTransport transport = GoogleTransport.create();
transport.addParser(new JsonCParser());
try {
  // authenticate with ClientLogin
  ClientLogin authenticator = new ClientLogin();
  authenticator.authTokenType = ndev;
  authenticator.username = mail;
  authenticator.password = password;
  authenticator.authenticate().setAuthorizationHeader(transport);
  
  if(Desktop.isDesktopSupported())
{
Desktop.getDesktop().browse(new URI(http://www.gmail.com;));
}
  //authenticator.
  
  //openWebpage(new URL(www.google.com));
  
  // make query request
/*  HttpRequest request = transport.buildGetRequest();
  request.setUrl(https://www.googleapis.com/bigquery/v1/query;);
  request.url.put(
  q, select count(*) from [bigquery/samples/shakespeare];);
  System.out.println(request.execute().parseAsString());*/
} catch (HttpResponseException e) {
  System.err.println(e.response.parseAsString());
  throw e;
}
  }

As you can see, directly, when a connection is made to Google account and
when signing in succeeds, I am opening a page of gmail in a new browser
page. But when the page opens, gmail is not opened.

What am I doing wrong here? In both cases, it is said that the connection
was established.





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Sign-to-Google-with-Java-Wicket-tp4662591p4662634.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



Sign to Google with Java Wicket

2013-11-21 Thread MartinoSuperman
Hi,

Does someone know how to open a Google account in Java (Wicket) and how to
close it again?

I read several pages about it on the internet, but I cannot figure it out.

I accomplished to open a connection to GoogleMail, after which a mail is
being sent via the SMTP server of Google. 

Now, I only want an automatic login in Java. When I have finished it has to
log out again.

Can someone help me?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Sign-to-Google-with-Java-Wicket-tp4662591.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



PackageResource

2013-11-18 Thread MartinoSuperman
Hi

For my website, I am using a ResourceReference, in which a PNG file is
loaded to show it on the web page.

The PNG picture shown well, but when I change that PNG picture by redrawing
it in Java with the help of Graphics2D, you still see the former PNG picture
on the web page, whereas the newest PNG picture is drawn behind the scenes.
That redrawing works fine.

What I want, is the following:

Each time, when the PNG picture is redrawn that new PNG picture must be
shown on the web page, immediately after that, when you refreshes the page.
Now, you only get that new PNG picture, when you close your browser and
reopens it and goed to the webpage again.

Does someone know how to 'refresh' that newly redrawn PNG picture in the
webpage?





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



Refreshing PNG picture in web page after redrawing it.

2013-11-18 Thread MartinoSuperman
Hi

For my website, I am using a ResourceReference, in which a PNG file is
loaded to show it on the web page.

The PNG picture shown well, but when I change that PNG picture by redrawing
it in Java with the help of Graphics2D, you still see the former PNG picture
on the web page, whereas the newest PNG picture is drawn behind the scenes.
That redrawing works fine.

What I want, is the following:

Each time, when the PNG picture is redrawn that new PNG picture must be
shown on the web page, immediately after that, when you refreshes the page.
Now, you only get that new PNG picture, when you close your browser and
reopens it and goed to the webpage again.

Does someone know how to 'refresh' that newly redrawn PNG picture in the
webpage? 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refreshing-PNG-picture-in-web-page-after-redrawing-it-tp4662487.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: Advice for upgrading from an old version of Wicket

2013-11-18 Thread MartinoSuperman
When you use a different version of Wicket, check, if the version is the same
in NetBeans.

Otherwise, it will be get stuck...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Advice-for-upgrading-from-an-old-version-of-Wicket-tp4662469p4662488.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: Rendering a component into a String

2013-11-18 Thread MartinoSuperman
What I do in solving such problems, is making my own custom component class
in Java, in which extension takes place.

Example:

I wanted to get text out of a TextField. 

Example code:

TextFieldString tfExample = new TextFieldString(name, Model.of*))

This example code generates an empty text field.

It is easier to make your own textfield that extends TextFieldString

Here:

public class OpenTextField extends TextFieldString
{
public OpenTextField(String id, String text)
{
  super(id);
  

Etc.
}

Here you make your own setText and getText. Then, you do not have to convert
to or back from Model again. That is much easier!




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Rendering-a-component-into-a-String-tp4662391p4662490.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



Signing in works on localhost but not on VPS server

2013-11-06 Thread MartinoSuperman
Hello,

I made authentication and authorization in my website.

Signing in works perfectly on my own computer on localhost, but it does not
work on my VPS server. 

I installed everything according to plan. 

But now I want to sign in and that does not work.

Does someone know what the cause of that can be?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Signing-in-works-on-localhost-but-not-on-VPS-server-tp4662167.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: Installing Wicket application on a VPS server - How?!

2013-11-02 Thread MartinoSuperman
Hi David,

Thanks for your help and answer.

I tried what you did. 

In the command line, I deployed an example WAR file of Oracle hello.war
according to the descriptions of the following link:

http://docs.oracle.com/cd/E18930_01/html/821-2432/geyvr.html#ghgis

And that worked.

But now, I pressed the button Clean and Build in Netbeans, after which a WAR
file of my own Wicket Application was made. 

I did the same procedure for installing my WAR file on my VPS server, but
now it does not work. I think I forgot something to do in my own generated
WAR file, because I did the same installations as at the example hello.war
of Oracle. And that worked.

Do you know what I could have done wrong in generating my own WAR file in
NetBeans. Did I forget something? If so, what did I forget?

Thanks in advance for your help. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Installing-Wicket-application-on-a-VPS-server-How-tp4662064p4662083.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



Installing Wicket application on a VPS server - How?!

2013-10-31 Thread MartinoSuperman
Hi,

I have a website address online on the internet. It is a VPS server. Here, I
installed Glassfish 3 and it works perfect.

But now, I would like to upload the Wicket Application I built on the VPS
server running on GlassFish.

So, when you go to the website address in Internet Explorer, you come on the
beginning webpage of the Wicket application directly.

My question is:

Can somebody tell how I have to install my own built Wicket application that
I built in NetBeans, on that VPS server running on Glassfish.

Thanks in advance!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Installing-Wicket-application-on-a-VPS-server-How-tp4662064.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Add or remove a row in RefreshingView with Ajax

2013-10-25 Thread MartinoSuperman
Hi,

Thanks for the advice. You're right. I also read those pages.

I already implemented it.

But now my question is:

I put the RefreshingView in a panel. And that panel is situated a
WebMarkupContainer. After I pressed the button on submit of Ajax, the
RefreshingView should refresh, but still it does not work.

Which commands do I have to use to make that refreshing possible? Do I have
to replace the whole RefreshingView for example?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-or-remove-a-row-in-RefreshingView-with-Ajax-tp4661944p4661960.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



Add or remove a row in RefreshingView with Ajax

2013-10-24 Thread MartinoSuperman
Hi,

I have a RefreshingView, which consists of TextFields, Labels and a
DownloadLink.

When a button is pressed, a new row should be added with the help of Ajax. 

Unfortunately, this does not work.

Can somebody tell me what I have to program to make adding and removing rows
in RefreshingView possible?

Thanks in advance!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-or-remove-a-row-in-RefreshingView-with-Ajax-tp4661944.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



Requirements for a progress bar in a file upload form

2013-10-23 Thread MartinoSuperman
Hi,

I built a form in Wicket, in which a file can be uploaded to the server.

Furthermore, to show the progress of uploading I also built in a progress
bar.

The problem now is that that progress bar does not work. I do not know what
I forgot to implement and/or what I did. I think I forgot something.

My question is: What are the requirements for the working of a progress bar
in a form for uploading a file?

Thanks for your help in advance!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Requirements-for-a-progress-bar-in-a-file-upload-form-tp4661935.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



Authorization problem in frames

2013-10-16 Thread MartinoSuperman
Hi,

The website I am building has frames like this:

http://www.wicket-library.com/wicket-examples-6.0.x/frames/

I also built in authentication and authorization in it. In the previous
version of it, you got on a page, in which you were to subscribe to get
access (authentication) to the website. 

The person for which I am building the website does not want to have that
anymore. He wants that you should get on the site with frames immediately.
In the left an menu item 'Sign In' must be there. When you subscribe to it,
then other pages will be enabled that can be accessed. 

Now I have a problem.

When you have authentication on a Wicket website, a visitor cannot visit any
page of the page, if he is nog enrolled. Now, I have to build the site in
that way that a visitor without authentication can acces 'public' pages, but
not protected pages. So, in other words: When a person is not enrolled with
authentication, it must be possible for that person to enroll. When he signs
in, more page links in the menu will appear that he could not visit before,
because he was not authenticated to it. 

How do I have to solve this problem? I know I have to use authorization
here. But how do I have to tell Wicket which pages a visitor without
authentication is allowed to visit and which pages not.

Thanks for your help in advance!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Authorization-problem-in-frames-tp4661839.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Browser Page Refresh Not Really Refreshing

2013-10-16 Thread MartinoSuperman
Hi,

Isn't it an idea to use Javascript for this?

In JavaScript, it is also possible to refresh a page?

Example code:

http://www.quackit.com/javascript/javascript_refresh_page.cfm





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Browser-Page-Refresh-Not-Really-Refreshing-tp4661826p4661837.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



Refresh whole site with iframes

2013-10-05 Thread MartinoSuperman
Hi,

I am using frames in Wicket in the website I am building.

Unfortunately, when I sign out in my authenticated webapplication it only
refreshes that frame. The other irames not.

I am using this technique of frames:

http://www.wicket-library.com/wicket-examples/frames/ 

So, my question is as follows:

When I want to refresh the site, I want to refresh the WHOLE site with all
the other frames in it and not only the frame in which I have the focus.

How can I make it to refresh the WHOLE site, inclusive the other frames?
After signing out, it has to go back to the sign in screen.

Thanks for your help in advance. 







--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refresh-whole-site-with-iframes-tp4661720.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: Refresh whole site with iframes

2013-10-05 Thread MartinoSuperman
Hi,

They are all running on the same wicket app.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Refresh-whole-site-with-iframes-tp4661720p4661724.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



Error in authentication

2013-10-03 Thread MartinoSuperman
Hi,

I have an authentication error.

I do not know what I am doing wrong.

The error is as follows:

Last cause:
org.apache.wicket.authroles.authentication.AuthenticatedWebSession.authenticate(Ljava/lang/String;Ljava/lang/String;)Z
WicketMessage: Method onFormSubmitted of interface
org.apache.wicket.markup.html.form.IFormSubmitListener targeted at
[SignInForm [Component id = signInForm]] on component [SignInForm [Component
id = signInForm]] threw an exception


java.lang.NoSuchMethodError:
org.apache.wicket.authroles.authentication.AuthenticatedWebSession.authenticate(Ljava/lang/String;Ljava/lang/String;)Z
 at
org.apache.wicket.authroles.authentication.AuthenticatedWebSession.signIn(AuthenticatedWebSession.java:65)
 at com.myapp.wicket.SignIn$SignInForm.onSubmit(SignIn.java:87)
 at org.apache.wicket.markup.html.form.Form$9.component(Form.java:1249)
 ..


Can somebody help me?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-authentication-tp4661680.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: Error in authentication

2013-10-03 Thread MartinoSuperman
Hi,

Thanks!!!

I changed the version of wicket-auth-roles to 6.0.0. That is the version I
use in my wicket-core.

But now, I am getting a different. Now a warning:

WARNING: Couldn't resolve model type of
Model:classname=[org.apache.wicket.model.PropertyModel]:nestedModel=[]:expression=[username]
for [TextField [Component id = username]], please set the type yourself.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Error-in-authentication-tp4661680p4661687.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



Internal frame in Wicket Page to external website

2013-08-22 Thread MartinoSuperman
Hi,

I am building a website in Wicket.

I would like to make an iframe that points to an external website.

Does someone know what code I have to use for that in Java?

Thank you in advance!

Martino



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Internal-frame-in-Wicket-Page-to-external-website-tp4661032.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