Re: JSR356 Websocket with Wicket 6.18

2015-01-28 Thread Alexander Landsnes Keül
I forked Wicket to my github repo and took a look at it. Compiling
wicket-native-websocket-javax with Java 6 and Wicket 6.19.0-SNAPSHOT was no
problem at all, my problem popped up when I tried to get the embedded jetty
server to run the test case. It fails with WebSocket connection to
'ws://localhost:8080/wicket/websocket?pageId=6wicket-ajax-baseurl=behavior%3F6wicket-app-name=jsr356.websockets'
failed: Error during WebSocket handshake: Unexpected response code: 404

Setting breakpoints in AbstractUpgradeFilter confirms that requests for
css/html/js files get processed, but it never intercepts the WebSocket
request and I'll be damned if I can figure out why. This is running with
Jetty 9.2.2 (from Wicket 7.0.0-M4).

I pretty much just copied the -javax project from master, switched to the
wicket-6.x branch and copied it in. Then downgraded dependencies to Wicket
6.19-SNAPSHOT and Java 6 and fixed the 4-5 compilation issues, so no
witchcraft or wizardry has been attempted. If you do have a few pointers
I'll be happy to see if I can manage to get it running, however WebSockets
are hardly my forte.

Alex

On Tue, Jan 27, 2015 at 1:26 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 The needed changes to make -javax module working with Wicket 6.x are not
 too big.
 I think the easiest way to make it available for Wicket 6.x is to add (a
 clone/copy of) the module to WicketStuff project. This way it could be part
 of 6.19.0 too.
 Is this something you are interested to help with ?

 On Tue, Jan 27, 2015 at 2:11 PM, Alexander Landsnes Keül 
 alexander.landsnes.k...@visma.com wrote:

  I checked out Wicket 6.18 and fiddled a bit with it, but it seems there
  are a few minor API breaks. One of the most pervasive ones is
  Application#setMetaData(...), in 6.18.0 it's a void function while
  7.0.0-M4
  returns this for chaining. I'm not sure JSR356 should be listed as an
  option for Wicket 6.x. It's certainly possible to fix it without too much
  effort, but since it changes a few signatures in wicket-core it requires
  all the projects checked out and modified. I don't have the time for it
  right now, and I do quite understand it if no one else feels like
 spending
  the time either.
 
  Naming conventions are the spice of policies. Milestones are viewed as
  dangerously buggy and unstable, and hence unfit for the hallowed halls of
  shippable code. I may try to sneak it in nonetheless, since I do need
  websocket support and the stable release is weeks away.
 
  Alex
 
  -Original Message-
  From: Martin Grigorov [mailto:mgrigo...@apache.org]
  Sent: 27 January 2015 10:30
  To: users@wicket.apache.org
  Subject: Re: JSR356 Websocket with Wicket 6.18
 
  Hi,
 
  JSR356 API jar is built with Java 7. This is the main reason why this
  module is not part of Wicket 6.x.
  If this single method is the only problem to use
  wicket-native-websocket-javax:7.0.0-M4 with Wicket 6.18.0 then please
  create a ticket in JIRA and we will make it public for 6.20.0.
 
  I think 7.0.0-M5 (currently being in vote) is as stable as 6.19.0 (also
 in
  vote). There were no API breaks since 7.0.0-M4 and hopefully M5 will be
  released as 7.0.0.Final in few weeks. We need your feedback now! It is
  mite annoying that most users don't want to even try it because of
  naming
  conventions :-/
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Tue, Jan 27, 2015 at 11:08 AM, Alexander Landsnes Keül 
  alexander.landsnes.k...@visma.com wrote:
 
   Reading the documentation I was under the impression that
   wicket-native-websocket-javax could be used along with Wicket 6.X,
   however that seems to not be the case.
  
   In the constructor of
   org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor
   line 120 (7.0.0-M4) it accesses WicketFilter#getFilterPath(), which is
   public in Wicket 7 but private in Wicket 6.X.
  
   Is there a way to sort this, or do I simply have to wait until Wicket
   7 is finalized? Upgrading while it's a milestone release isn't an
   option, sadly, but on the other hand we just upgraded to Tomcat 8 and
   not having a functional websocket implementation is a mite annoying.
  
   Alex
  
 



Re: JSR356 Websocket with Wicket 6.18

2015-01-28 Thread Alexander Landsnes Keül
https://github.com/alexanderlk/wicket

It's under the wicket-6.x branch, same exact structure as the one in
7.0.0-M4

Alex

On Wed, Jan 28, 2015 at 4:25 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 url to your github repo ?

 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov

 On Wed, Jan 28, 2015 at 5:02 PM, Alexander Landsnes Keül 
 alexander.landsnes.k...@visma.com wrote:

  I forked Wicket to my github repo and took a look at it. Compiling
  wicket-native-websocket-javax with Java 6 and Wicket 6.19.0-SNAPSHOT was
 no
  problem at all, my problem popped up when I tried to get the embedded
 jetty
  server to run the test case. It fails with WebSocket connection to
 
 
 'ws://localhost:8080/wicket/websocket?pageId=6wicket-ajax-baseurl=behavior%3F6wicket-app-name=jsr356.websockets'
  failed: Error during WebSocket handshake: Unexpected response code: 404
 
  Setting breakpoints in AbstractUpgradeFilter confirms that requests for
  css/html/js files get processed, but it never intercepts the WebSocket
  request and I'll be damned if I can figure out why. This is running with
  Jetty 9.2.2 (from Wicket 7.0.0-M4).
 
  I pretty much just copied the -javax project from master, switched to the
  wicket-6.x branch and copied it in. Then downgraded dependencies to
 Wicket
  6.19-SNAPSHOT and Java 6 and fixed the 4-5 compilation issues, so no
  witchcraft or wizardry has been attempted. If you do have a few pointers
  I'll be happy to see if I can manage to get it running, however
 WebSockets
  are hardly my forte.
 
  Alex
 
  On Tue, Jan 27, 2015 at 1:26 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   The needed changes to make -javax module working with Wicket 6.x are
 not
   too big.
   I think the easiest way to make it available for Wicket 6.x is to add
 (a
   clone/copy of) the module to WicketStuff project. This way it could be
  part
   of 6.19.0 too.
   Is this something you are interested to help with ?
  
   On Tue, Jan 27, 2015 at 2:11 PM, Alexander Landsnes Keül 
   alexander.landsnes.k...@visma.com wrote:
  
I checked out Wicket 6.18 and fiddled a bit with it, but it seems
 there
are a few minor API breaks. One of the most pervasive ones is
Application#setMetaData(...), in 6.18.0 it's a void function while
7.0.0-M4
returns this for chaining. I'm not sure JSR356 should be listed as an
option for Wicket 6.x. It's certainly possible to fix it without too
  much
effort, but since it changes a few signatures in wicket-core it
  requires
all the projects checked out and modified. I don't have the time for
 it
right now, and I do quite understand it if no one else feels like
   spending
the time either.
   
Naming conventions are the spice of policies. Milestones are viewed
 as
dangerously buggy and unstable, and hence unfit for the hallowed
 halls
  of
shippable code. I may try to sneak it in nonetheless, since I do need
websocket support and the stable release is weeks away.
   
Alex
   
-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: 27 January 2015 10:30
To: users@wicket.apache.org
Subject: Re: JSR356 Websocket with Wicket 6.18
   
Hi,
   
JSR356 API jar is built with Java 7. This is the main reason why this
module is not part of Wicket 6.x.
If this single method is the only problem to use
wicket-native-websocket-javax:7.0.0-M4 with Wicket 6.18.0 then please
create a ticket in JIRA and we will make it public for 6.20.0.
   
I think 7.0.0-M5 (currently being in vote) is as stable as 6.19.0
 (also
   in
vote). There were no API breaks since 7.0.0-M4 and hopefully M5 will
 be
released as 7.0.0.Final in few weeks. We need your feedback now! It
 is
mite annoying that most users don't want to even try it because of
naming
conventions :-/
   
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
   
On Tue, Jan 27, 2015 at 11:08 AM, Alexander Landsnes Keül 
alexander.landsnes.k...@visma.com wrote:
   
 Reading the documentation I was under the impression that
 wicket-native-websocket-javax could be used along with Wicket 6.X,
 however that seems to not be the case.

 In the constructor of
 org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor
 line 120 (7.0.0-M4) it accesses WicketFilter#getFilterPath(), which
  is
 public in Wicket 7 but private in Wicket 6.X.

 Is there a way to sort this, or do I simply have to wait until
 Wicket
 7 is finalized? Upgrading while it's a milestone release isn't an
 option, sadly, but on the other hand we just upgraded to Tomcat 8
 and
 not having a functional websocket implementation is a mite
 annoying.

 Alex

   
  
 



JSR356 Websocket with Wicket 6.18

2015-01-27 Thread Alexander Landsnes Keül
Reading the documentation I was under the impression that 
wicket-native-websocket-javax could be used along with Wicket 6.X, however that 
seems to not be the case.

In the constructor of
org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor
line 120 (7.0.0-M4) it accesses WicketFilter#getFilterPath(), which is public 
in Wicket 7 but private in Wicket 6.X.

Is there a way to sort this, or do I simply have to wait until Wicket 7 is 
finalized? Upgrading while it's a milestone release isn't an option, sadly, but 
on the other hand we just upgraded to Tomcat 8 and not having a functional 
websocket implementation is a mite annoying.

Alex


RE: JSR356 Websocket with Wicket 6.18

2015-01-27 Thread Alexander Landsnes Keül
I checked out Wicket 6.18 and fiddled a bit with it, but it seems there are a 
few minor API breaks. One of the most pervasive ones is 
Application#setMetaData(...), in 6.18.0 it's a void function while 7.0.0-M4 
returns this for chaining. I'm not sure JSR356 should be listed as an option 
for Wicket 6.x. It's certainly possible to fix it without too much effort, but 
since it changes a few signatures in wicket-core it requires all the projects 
checked out and modified. I don't have the time for it right now, and I do 
quite understand it if no one else feels like spending the time either.

Naming conventions are the spice of policies. Milestones are viewed as 
dangerously buggy and unstable, and hence unfit for the hallowed halls of 
shippable code. I may try to sneak it in nonetheless, since I do need websocket 
support and the stable release is weeks away.

Alex

-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: 27 January 2015 10:30
To: users@wicket.apache.org
Subject: Re: JSR356 Websocket with Wicket 6.18

Hi,

JSR356 API jar is built with Java 7. This is the main reason why this module is 
not part of Wicket 6.x.
If this single method is the only problem to use
wicket-native-websocket-javax:7.0.0-M4 with Wicket 6.18.0 then please create a 
ticket in JIRA and we will make it public for 6.20.0.

I think 7.0.0-M5 (currently being in vote) is as stable as 6.19.0 (also in 
vote). There were no API breaks since 7.0.0-M4 and hopefully M5 will be 
released as 7.0.0.Final in few weeks. We need your feedback now! It is mite 
annoying that most users don't want to even try it because of naming 
conventions :-/

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Jan 27, 2015 at 11:08 AM, Alexander Landsnes Keül  
alexander.landsnes.k...@visma.com wrote:

 Reading the documentation I was under the impression that 
 wicket-native-websocket-javax could be used along with Wicket 6.X, 
 however that seems to not be the case.

 In the constructor of
 org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor
 line 120 (7.0.0-M4) it accesses WicketFilter#getFilterPath(), which is 
 public in Wicket 7 but private in Wicket 6.X.

 Is there a way to sort this, or do I simply have to wait until Wicket 
 7 is finalized? Upgrading while it's a milestone release isn't an 
 option, sadly, but on the other hand we just upgraded to Tomcat 8 and 
 not having a functional websocket implementation is a mite annoying.

 Alex



Wicket-3438 seems to cause issues if a form is removed

2011-03-01 Thread Alexander Landsnes Keül
Upgraded to wicket 1.4.16 yesterday, and it seems to cause issues when a form 
is removed after submit. Problem is probably related to the change in 
Wicket-3438 (https://issues.apache.org/jira/browse/WICKET-3438 
https://issues.apache.org/jira/browse/WICKET-3438 )

 

The usage we have a few places is something like this

onSubmit() {

  updateData();

  replacePanel();

}

 

Used to work fine, but looking at Form#process(IFormSubmittingComponent 
submittingComponent)  it first delegates the submit to our button 
implementation, then calls parameters.remove(getHiddenFieldId()); 

getHiddenFieldId() tries to look up the page to check if it's stateless, but as 
the panel containing the form has been replaced already the form has no parent 
page. 

 

The only place I've encountered that is in parameters.remove(hiddenFieldId); 
could be solved by retrieving the parameter before delegating the submit, and 
removing the parameter after processing is done. Looking at the code it doesn't 
seem like it would be a terribly good idea to remove all the parameters before 
delegating the process, but retrieving it shouldn't be an issue. The rest of 
the parameter cleanup seems to be safe even if the form is removed.

 

Alex



Model equals/hashCode

2008-10-20 Thread Alexander Landsnes Keül
Hi,

 

Is there any particular reason why Model doesn't implement a default equals(..) 
and hashCode() function? I have a very simple IDataProvider that simply wraps 
the returned object in a Model, and since I want to reuse the items I had to 
inline override the aforementioned functions.

 

Would it be possible to have those two functions implemented with a default in 
Model to just use the getObject().hashCode() and similar for equals for some 
future version? 

 

Alex



RE: Ajax loading tooltip?

2008-08-18 Thread Alexander Landsnes Keül
I can't say anything about having done it, I certainly haven't even if I'm 
using the prototip-minis, but I can comment on upgrading to prototip 2.

I asked the same question a month ago, and the thing is that Richard has 
permission to use prototip 1.2 for free whereas prototip 2.x has a license from 
€3 for non commercial and upwards to €295 for a multi site commercial license. 
It is quite easy to upgrade it to 2.x though, I tried it and it all seemed to 
work fine but I reverted back to the free version again.

Alex

-Opprinnelig melding-
Fra: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] 
Sendt: 16. august 2008 12:20
Til: users@wicket.apache.org
Emne: Ajax loading tooltip?

Hi

Has anyone done an ajaxloading tool tip? Maybe even for prototip in minies?

I see that prototip 2 has support for this actually: 
http://www.nickstakenburg.com/projects/prototip2/ .. Im crossing my 
fingers, and elsewise i'll do it:) But what about hte prototip in minies 
I guess that should be upgraded to prototip 2 if not already?

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to build a dynamic navigation bar

2008-07-22 Thread Alexander Landsnes Keül
I'd use a ListView :)

Assuming this lil code

add( new ListView(list, linkList )
{
public void populateItem(ListItem item)
{
item.add( (Link)linkList );
}
});

You'd have the html look something like this

ul wicket:id=list
lia href=# wicket:id=linkIdLink text here/a/li
/ul

Just remember to add whatever you want to the item, and not just use add(...). 

http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/list/ListView.html

Alex

-Opprinnelig melding-
Fra: Edbay [mailto:[EMAIL PROTECTED] 
Sendt: 22. juli 2008 18:08
Til: users@wicket.apache.org
Emne: How to build a dynamic navigation bar


Hello, 
  
I want to be able to build a left-side dynamic navigation bar based on user
permissions. For example, if the user does not have access to the Prices
page, I do not want to show the Prices link on the navigation bar. Also,
since the link will point to a Wicket page, it has to be a Wicket link. 

This is how I would like the NavBar to appear: 

div id=mainNav
ul
li Home /li
li Prices /li
li Contracts /li
li Products /li
li Transactions /li
/ul
/div

I tried using ListView, but I could not get it to work, as it forces the
wicket id of the line items to be all the same. 


Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/How-to-build-a-dynamic-navigation-bar-tp18592899p18592899.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to build a dynamic navigation bar

2008-07-22 Thread Alexander Landsnes Keül
They need the same wicket:id yes, but that doesn't mean that they need the same 
text or targets. Just create as many links as you want/need, with whatever 
behaviour they need. Just make sure they all have the same id :)

Alex

-Opprinnelig melding-
Fra: Edbay [mailto:[EMAIL PROTECTED] 
Sendt: 22. juli 2008 19:00
Til: users@wicket.apache.org
Emne: RE: How to build a dynamic navigation bar


Thanks for the quick reply.

Wouldn't this force all links to have the same wicket ids (linkid)?
I'd like to be able to have the line items look like this:

ul wicket:id=list
li # Link01 text here /li
li # Link02 text here /li
li # Link03 text here /li
/ul





Alexander Landsnes Keül wrote:
 
 I'd use a ListView :)
 
 Assuming this lil code
 
 add( new ListView(list, linkList )
 {
   public void populateItem(ListItem item)
   {
   item.add( (Link)linkList );
   }
 });
 
 You'd have the html look something like this
 
 ul wicket:id=list
   li # Link text here /li
 /ul
 
 Just remember to add whatever you want to the item, and not just use
 add(...). 
 
 http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/list/ListView.html
 
 Alex
 
 -Opprinnelig melding-
 Fra: Edbay [mailto:[EMAIL PROTECTED] 
 Sendt: 22. juli 2008 18:08
 Til: users@wicket.apache.org
 Emne: How to build a dynamic navigation bar
 
 
 Hello, 
   
 I want to be able to build a left-side dynamic navigation bar based on
 user
 permissions. For example, if the user does not have access to the Prices
 page, I do not want to show the Prices link on the navigation bar. Also,
 since the link will point to a Wicket page, it has to be a Wicket link. 
 
 This is how I would like the NavBar to appear: 
 
   div id=mainNav
   ul
   li Home /li
   li Prices /li
   li Contracts /li
   li Products /li
   li Transactions /li
   /ul
   /div
 
 I tried using ListView, but I could not get it to work, as it forces the
 wicket id of the line items to be all the same. 
 
 
 Thanks in advance.
 -- 
 View this message in context:
 http://www.nabble.com/How-to-build-a-dynamic-navigation-bar-tp18592899p18592899.html
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-build-a-dynamic-navigation-bar-tp18592899p18593941.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: TextField in IE and Opera

2008-07-04 Thread Alexander Landsnes Keül

I found the problem with this eventually, it was related to using NTLM 
authentication. IE doesn't perform any POST on forms until you've negotiated 
the password hashes again. Something which we seem to not do :)

Alex

-Opprinnelig melding-
Fra: Alexander Landsnes Keül [mailto:[EMAIL PROTECTED] 
Sendt: 3. juli 2008 12:21
Til: users@wicket.apache.org
Emne: TextField in IE and Opera

I'm having a wee bit of a problem getting TextFields to cooperate in our 
project. I'm baffled by the problem, because it's something that's been working 
fine for months.

 

The panel I'm working with is very a simple, a form with two text fields; 
username and password. If I submit the form in Opera it processes the input 
correctly and I can proceed with the login. If I submit with IE 7, both 
TextFields are submitted with a null value which isn't terribly useful to me.

 

The code is as follows:

 

public LoginPanel ( final String id )

  {

super(id, new ResourceModel(message.login_header));

setOutputMarkupId(true);

 

final FeedbackPanel feedback = new FeedbackPanel(feedback);

feedback.setOutputMarkupId(true);

add(feedback);

 

final Form form = new Form(form);

form.setOutputMarkupId(true);

add(form);

 

final FormComponent username = new TextField(username, new 
Model(), String.class);

username.setLabel(new ResourceModel(label.username));

username.setRequired(true);

form.add(username);

form.add(new SimpleFormComponentLabel(username_label, username));

 

final FormComponent password = new PasswordTextField(password, 
new Model());

password.setLabel(new ResourceModel(label.password));

password.setRequired(true);

form.add(password);

form.add(new SimpleFormComponentLabel(password_label, password));

 

final AjaxFallbackButton submit = new AjaxFallbackButton(submit, 
form)

{

  private static final long serialVersionUID = 1L;

 

  @Override

  public void onSubmit( final AjaxRequestTarget target, final 
Form form )

  {

String user = (String) username.getConvertedInput();

String pwd = (String) password.getConvertedInput();

String abc = username.getRawInput();



loginAction(user, pwd, target);

  }

 

  @Override

  public void onError( final AjaxRequestTarget target, final 
Form form )

  {

error(BAD!);

  }

};

 

submit.setModel(new ResourceModel(button.login));

form.add(submit);

  }

 

I've tried to create class member models for the TextFields, I've tried to 
fetch the values from the TextFields with getModelObject(), 
getModelObjectAsString(), getInput()...none of them work. I've tried to 
downgrade from wicket 1.3.4 to wicket 1.3.3, which I know worked with IE, and 
still no joy.

 

I don't think my code will help overly much, but it's worth pasting it at 
least. The panel replaces another panel when I click on an ajax link, might be 
related to that but again it's worked like this before.

 

Alex


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



TextField in IE and Opera

2008-07-03 Thread Alexander Landsnes Keül
I'm having a wee bit of a problem getting TextFields to cooperate in our 
project. I'm baffled by the problem, because it's something that's been working 
fine for months.

 

The panel I'm working with is very a simple, a form with two text fields; 
username and password. If I submit the form in Opera it processes the input 
correctly and I can proceed with the login. If I submit with IE 7, both 
TextFields are submitted with a null value which isn't terribly useful to me.

 

The code is as follows:

 

public LoginPanel ( final String id )

  {

super(id, new ResourceModel(message.login_header));

setOutputMarkupId(true);

 

final FeedbackPanel feedback = new FeedbackPanel(feedback);

feedback.setOutputMarkupId(true);

add(feedback);

 

final Form form = new Form(form);

form.setOutputMarkupId(true);

add(form);

 

final FormComponent username = new TextField(username, new 
Model(), String.class);

username.setLabel(new ResourceModel(label.username));

username.setRequired(true);

form.add(username);

form.add(new SimpleFormComponentLabel(username_label, username));

 

final FormComponent password = new PasswordTextField(password, 
new Model());

password.setLabel(new ResourceModel(label.password));

password.setRequired(true);

form.add(password);

form.add(new SimpleFormComponentLabel(password_label, password));

 

final AjaxFallbackButton submit = new AjaxFallbackButton(submit, 
form)

{

  private static final long serialVersionUID = 1L;

 

  @Override

  public void onSubmit( final AjaxRequestTarget target, final 
Form form )

  {

String user = (String) username.getConvertedInput();

String pwd = (String) password.getConvertedInput();

String abc = username.getRawInput();



loginAction(user, pwd, target);

  }

 

  @Override

  public void onError( final AjaxRequestTarget target, final 
Form form )

  {

error(BAD!);

  }

};

 

submit.setModel(new ResourceModel(button.login));

form.add(submit);

  }

 

I've tried to create class member models for the TextFields, I've tried to 
fetch the values from the TextFields with getModelObject(), 
getModelObjectAsString(), getInput()...none of them work. I've tried to 
downgrade from wicket 1.3.4 to wicket 1.3.3, which I know worked with IE, and 
still no joy.

 

I don't think my code will help overly much, but it's worth pasting it at 
least. The panel replaces another panel when I click on an ajax link, might be 
related to that but again it's worked like this before.

 

Alex



FileUploadField and AjaxButton

2008-06-11 Thread Alexander Landsnes Keül
Hi,

I'm trying to use an AjaxButton along with a FileUploadField, and that produces 
an unfortunate but predictable result. Whenever I call 
_fileUploadField.getFileUpload() it returns null. If I try to replace the 
button with a regular one it works just fine. Am I missing something obvious 
here, or is it an issue?

This is in a function called by the onSubmit() in both cases:


FileUpload upload = _fileUploadField.getFileUpload();

if( upload != null )
{
// some code
} else
{
log.error();
}

I always get to the error bit here. I've solved the issue another place by 
simply using a regular button. However that isn't really an option for me at 
this location. I'd appreciate it if anyone could explain why this acts as it 
does, or even better have a solution for me :)

Alex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AjaxEditableChoiceLabel woes

2008-05-06 Thread Alexander Landsnes Keül
I may very well be daft, but it seems that the AjaxEditableChoiceLabel doesn't 
take the ChoiceRenderer into account when creating the label version of itself. 
There's no override, so in my case the toString() of most Enum's have to be the 
database value which means my labels are F instead of Female, 2 instead of Yes 
please etc.

 

I got around the problem by overriding the newLabel(...), however that was 
complicated further by not having access to the ChoiceRenderer in my override. 
It's a private member without any accessors. The resulting code is a bit 
peculiar, and I know I changed the behaviour of the Label slightly, but it's 
just a quick hack. Any chance of seeing something like this added as a default 
behaviour in AECL?

 

Alex

 

label = new AjaxEditableChoiceLabel(cvStatus, new PropertyModel(careerData, 
cvStatus), Arrays.asList(CvStatus.values()), new ChoiceRenderer(status))

{

  private static final long serialVersionUID = 1L;

 

  @Override

  protected Component newLabel( MarkupContainer parent, String 
componentId, IModel model )

  {

Label label = new Label(componentId, model)

{

 private static final long serialVersionUID = 1L;

 

 @Override

 public IConverter getConverter( Class type )

 {

   //IConverter c = getConverter(type);

   //return c != null ? c : 
super.getConverter(type);

   return super.getConverter(type);

 }

 

 @Override

 protected void onComponentTagBody( MarkupStream 
markupStream, ComponentTag openTag )

 {

   Object modelObject = getModelObject();

   if (modelObject == null || 
.equals(modelObject))

   {

 replaceComponentTagBody(markupStream, 
openTag, defaultNullLabel());

   } else

   {

 // Workaround to get to the 
ChoiceRenderer

 String displayValue = (String) 
((DropDownChoice) getEditor()).getChoiceRenderer().getDisplayValue(modelObject);

 replaceComponentTagBody(markupStream, 
openTag, displayValue);

   }

 }

};

label.setOutputMarkupId(true);

label.add(new LabelAjaxBehavior(getLabelAjaxEvent()));

return label;

  } 

};



AuthenticatedWebSession

2008-04-25 Thread Alexander Landsnes Keül
Hi,

 

I'm trying to have a user signed on directly with an id rather than the 
username/pwd when a new user is created. This gives me some trouble seeing as 
the boolean signedIn is private.

 

I considered writing my own WebSession to handle this, but the problem here is 
that there is no interface for the AuthenticatedWebSession and the 
AuthenticatedWebApplication requires it's session to extend 
AuthenticatedWebSession. I guess I can write a new class extending 
WebApplication to handle this, is that the intent here?

 

Otherwise, is it possible to have an interface for the AuthenticatedWebSession 
or the signedIn made protected rather than private?

 

Alexander

 

 



Roles and Tabbed Panel

2008-02-25 Thread Alexander Landsnes Keül
Hi,

 

I'm looking at using Roles more fully in our application, and I'm trying to 
hide the tabs if the user isn't authorized for it. The way I'm doing it now is 
manually checking before I add each Abstract Tab to the List. If the user has 
the right role, well and good.

 

What I'm wondering, is if there's something similar to 

 

@AuthorizeAction(action=RENDER, roles = { ADMIN, EMPLOYEE } ) 

 

Which could be added to the Panel or tab? So far I haven't found a way to do 
that. Am I just daft or do I have to keep the check manually?

 

Alexander



SV: defaultNullLabel()

2007-11-30 Thread Alexander Landsnes Keül
I have something of the same issue, if you have a value of  in an 
AjaxEditableLabel it's unclickable. It's not removed from the markup, I just 
can't click it. Probably because the Label is 0 pixels wide.

For me the solution was to have ... if the String was null, and have all 
getters translate  into null. A pain, but it works.

Alex

-Opprinnelig melding-
Fra: Roy van Rijn [mailto:[EMAIL PROTECTED] 
Sendt: 30. november 2007 13:55
Til: users@wicket.apache.org
Emne: Re: defaultNullLabel()

It doesn't look like the defaultNullLabel() can cause such a problem..
Have you tried your code without overwriting the default label?

Also, when you create your RLabel you use the string label, is this
on purpose or did you mean to use componentId.
(the original code has:Label label = new Label(componentId, model))

Roy

On 11/30/07, leonardouit [EMAIL PROTECTED] wrote:

 Hi here.

 I have a class that extends AjaxEditableLabel. The overriden methods
 newEditor and newLabel look as following:

protected FormComponent newEditor(MarkupContainer parent, String
 componentId, IModel model){

RTextField editor =
(fieldType == null) ?
editor = new RTextField(componentId, model, 
 String.class){
protected void onComponentTag(ComponentTag 
 tag) {
super.onComponentTag(tag);
add(new 
 SimpleAttributeModifier(class, e0));
}
} :
new RTextField(componentId, model, fieldType){
protected void onComponentTag(ComponentTag 
 tag) {
super.onComponentTag(tag);
add(new 
 SimpleAttributeModifier(class, e0));
}
};

editor.setOutputMarkupId(true);
editor.setVisible(false);
editor.add(new EditorAjaxBehavior());
return editor;
}

protected Component newLabel(MarkupContainer parent, String 
 componentId,
 IModel model){

RLabel label = new RLabel(label, model)
{
private static final long serialVersionUID = 1L;

protected void onComponentTagBody
(MarkupStream markupStream, ComponentTag openTag)
{
if (getModelObject() == null) {
replaceComponentTagBody(markupStream, 
 openTag, defaultNullLabel());
}
else
{
super.onComponentTagBody(markupStream, 
 openTag);
}
}
};
label.setOutputMarkupId(true);
label.add(new LabelAjaxBehavior(onclick));
return label;
}

 Note that if the model, on newLabel, is null, then it uses
 defaultNullLabel(), which defaults to the ... string. I believed that I
 could override that method to print whatever I wanted to, including the
 empty string . However, if a have something like

@Override
protected String defaultNullLabel() {
return  ;
}

 the cell that was meant to be editable, after clicking in and then clicking
 out, become NOT EDITABLE!

 Any help?
 --
 View this message in context: 
 http://www.nabble.com/defaultNullLabel%28%29-tf4904412.html#a14046749
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Custom implementation of TabbedPanel HTML

2007-11-27 Thread Alexander Landsnes Keül

Is there some way for me to control the HTML of the TabbedPanel implementation? 
I need to provide a tab panel with tables for our designers, however that's 
proven to be a mite hard to get done. A solution I can see is to rewrite the 
TabbedPanel class, but that's not something I'd prefere to do. Makes me do all 
the maintainance on it, but right now that's the only solution I can see to it.

What I'm really after is having the TabbedPanel html look something like this:

tabletr
ul
li wicket:id=tabs
td
a href=# wicket:id=linkspan 
wicket:id=title[[tab title]]/span/a
/td
/li
/ul
/tr/table


Alexander


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AuthenticatedWebSession

2007-11-22 Thread Alexander Landsnes Keül

Hi,

In setting up the logon of our application, I'd like to use the 
AuthenticatedWebSession to hold some additional information. There shouldn't be 
a problem with that I assume, however I'm getting a problem with this.

It seems the session isn't created until the user encounters an 
@AuthorizeInstantiation(...), but there are parts of the page which doesn't 
require authentication and thus no session for me to use. Is there a better 
strategy for containing the business layer main object, or a way to ensure that 
the AuthenticatedWebSession is created at the same time as the Application?

Alexander

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Dynamic content on a panel

2007-11-19 Thread Alexander Landsnes Keül
Hi,

I'm having a bit of trouble setting up a panel with a dynamic content. What I'm 
working on is a panel where the customers can specify what they want to ask for 
in a CV.

Basically they can choose if they want dropdowns, textfields etc. Is there a 
way to support this? I'm thinking of adding the panels they want to a ListView, 
and my thought was to add the Components they specify to a ListView in the 
panels.

The problem I'm having here is that that does require a markup for the panels, 
which I'm not quite certain how to handle. Does anyone have any pointers as to 
how I might go about doing this?

As an example, one customer might want to have your job experience with a from 
date, to date and company. Another might also want to know the name of your 
boss in that company.

Alexander  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



SV: Setting up Wicket with Tomcat

2007-10-31 Thread Alexander Landsnes Keül
I looked at that one, and for some reason my exact copy of the web.xml file 
wasn't exact enough. We're implementing wickets in another project, so setting 
up a new project wasn't practical. However good old copy-paste worked wonders.

Thanks :)

-Opprinnelig melding-
Fra: Igor Vaynberg [mailto:[EMAIL PROTECTED] 
Sendt: 30. oktober 2007 17:16
Til: users@wicket.apache.org
Emne: Re: Setting up Wicket with Tomcat

or just use the damn archetype to create a properly configured project
in the first place, thats why we have it... :)
http://wicket.apache.org/quickstart.html

-igor


On 10/30/07, Frank Bille [EMAIL PROTECTED] wrote:
 On 10/30/07, Alexander Landsnes Keül [EMAIL PROTECTED]
 wrote:
 
  ?xml version=1.0?
  web-app xmlns=http://java.sun.com/xml/ns/j2ee;
  xmlns:xsi=http://www.w3.org/TR/xmlschema-1/;
  xsi:schemaLocation=
  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
  version=2.4
  display-nameAnsatt/display-name
  filter
  filter-nameWicketFilter/filter-name
  filter-classorg.apache.wicket.protocol.http.WicketFilter
  /filter-class
  init-param
  param-nameapplicationClassName/param-name
  param-value
  no.unique.ansatt.presentation.StartPage/param-value
 

 no.unique.ansatt.presentation.StartPage?

 Is this what you mean?
 Don't you mean something like:

 init-param
 param-nameapplicationClassName/param-name
 param-valueno.unique.ansatt.presentation.AnsattApplication
 /param-value
 /init-param


 I'm not entirely sure what you are asking about, but have Kent Tong has a
 free tutorial on setting up an environment with wicket, eclipse and tomcat:
 http://www.agileskills2.org/EWDW/index.html

 Frank


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tabbed panels

2007-10-31 Thread Alexander Landsnes Keül

I have two questions regarding tabbed panels. I've read the example, so I've 
been able to create a navigation with it but it's a bit limited.

First thing, is it possible to nest tabbed panels? I tried to do so, but then 
all the wickets in the panels stopped working. Way I set it up was create a 
TabbedPanel where the different tabs referred to new TabbedPanels. Not really 
sure if this is doable, but if so how would I go about it, and is it possible 
to change the CSS style for the two tab panels?

Second thing, I tried to make a helper class for adding tabs to a Tabbed Panel. 
It works fine, except for the getPanel() overloading. I tried to do it as 
follows:

public void addTab( final String label, final Panel tabPanel ) {
tabs.add( new AbstractTab( new Model( label )) 
{
private static final long serialVersionUID = 1L;
public Panel getPanel( String panelID )
{
return tabpanel;
}
});
}

Simply changing it to return new PersondataPanel( panelID ); works, but this 
would mean creating one addTab(..) for each possible panel. Is there an elegant 
way of solving this?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Setting up Wicket with Tomcat

2007-10-30 Thread Alexander Landsnes Keül
After much sweat and tears I've finally been able to get web.xml to load 
properly in tomcat, however I'm having a bit of issues actually starting the 
Web app. What I've got is the very bare bones of a wicket application. Just a 
class extending WebApplication, and StartPage.java/html. Startpage.html only 
prints Hello, so the wicket code itself ought to be clean, had much more 
complicated wickets with the embedded Jetty plugin.

They belong to the package no.unique.ansatt.presentation, my web.xml looks as 
follows: 

?xml version=1.0?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/TR/xmlschema-1/;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
version=2.4
display-nameAnsatt/display-name
filter
filter-nameWicketFilter/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
param-nameapplicationClassName/param-name

param-valueno.unique.ansatt.presentation.StartPage/param-value
/init-param
/filter
filter-mapping
filter-name
filter-nameWicketFilter/filter-name
url-pattern/ansatt/*/url-pattern
/filter-name
/filter-mapping
/web-app

Now, the problem is where should I build the output? I've tried pretty much all 
the combinations I can think of, and currently it's built to:
- ansatt/target/WEB-INF/web.xml
- ansatt/target/WEB-INF/classes/no/unique/ansatt

Here's my ansatt.xml in $CATALINA/localhost


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Issue with border

2007-10-26 Thread Alexander Landsnes Keül
Hi,

 

We're looking into moving our presentation layer over to Wickets, and I'm 
creating a mockup of our current web interface to see how it works. So far I'm 
quite pleased, but I have an issue with borders.

 

I'm trying to create a navigation border similar to the Navomatic example on 
the wicket page, but I'm having a problem there. The error message is:

 

WicketMessage: Unable to find component with id 'personaliaPanel' in 
[MarkupContainer [Component id = _body, page = com.visma.HomePage, path = 
0:tabPanel:panel:personaliaBorder:_body.Border$BorderBodyContainer, isVisible = 
true, isVersioned = true]]. This means that you declared 
wicket:id=personaliaPanel in your markup, but that you either did not add the 
component to your page at all, or that the hierarchy does not match.
[markup = 
file:/C:/javadev/wicket/workspaces/wicket/target/classes/com/visma/PersonData.html
html xmlns:wicket
body
  wicket:panel
  
  center
  span wicket:id=personaliaBorder
  span wicket:id=personaliaPanelpersonaliaForm goes here/span
  span wicket:id=skillsPanelskillsPanel goes here/span
  span wicket:id=feedbackFeedback panel here/span
  /span
  /center
  
  /wicket:panel
/body
/html
  , index = 5, current = 'span wicket:id=personaliaPanel' (line 7, column 
2)]

 

This is in my PersonData.html file, but personaliaPanel is declared in 
PersonData.java. Works fine until I tuck in the PersonaliaBorder. Java and HTML 
file are as follows:

 

package com.visma;

 

import org.apache.wicket.markup.html.border.Border;

import org.apache.wicket.markup.html.border.BoxBorder;

 

 

/**

 * @author alexanderlk

 */

public class PersonaliaBorder extends Border

{

  private static final long serialVersionUID = 1L;

  

  public PersonaliaBorder( String id )

  {

super( id );

add( new BoxBorder(myBorder));

  }

 

}

 

 

html xmlns:wicket

body

  wicket:border

  span wicket:id=myBorder

wicket:body/

  /span

  /wicket:border 

/body

/html

  

 

This looks quite similar to the Navomatic example, just without the navigation 
part. I must be doing something wrong, but I can't quite figure out what it is.

 

The other thing I'm wondering about is if there's an easy way to just tell a 
component to be surrounded by a BoxBorder. Seems you have to use 
setComponent(..), but then you have to define a border with an html to go along 
with it. I just want to add a thin border around a panel or somesuch.

 

Regards,

 

Alexander