Re: SwramWebApplication and session

2011-01-21 Thread Martin Makundi
Hi!

I am not sure what you mean, but we have like this:

/**
   * @see com.myapp.MyApplication#newSession(org.apache.wicket.Request,
org.apache.wicket.Response)
   */
  @Override
  public Session newSession(Request request, Response response) {
  return session = new MySession(request, response);
  }

**
Martin

2011/1/20 jussi isokangas jussi.isokan...@gmail.com:
 Hi,

 My application extends SwramWebApplication. Session doesn't accpet that for
 paramater. I need to use session for ShoppingCart.
 How to solve it?

 Regards Jussi


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



Re: How can i change lang attribute in html markup tag?

2011-01-21 Thread Martin Grigorov
Try with :

in .html:
html wicket:id=html


in .java:
WebMarkupContainer htmlTag = new WebMarkupContainer(html);
htmlTag.add(new SimpleAttributeModifier(lang,
getSession().getLocale().toString());
htmlTag.setTransparentResolver(true); // check the javadoc of this method

On Fri, Jan 21, 2011 at 8:19 AM, Mike Mander wicket-m...@gmx.de wrote:

 With further investigation i found a hint on using an IMarkupFilter.

 Is there an example with this for my problem?

 Thanks

 Mike

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




Re: Submit form from other form onClick

2011-01-21 Thread Martin Grigorov
Just add temporarily an AjaxButton to your form and see the generated HTML
for that button.
There you'll see the needed javascript.

I suggest you to leave the button and change your code to:
Wicket.$('%s').click(); } catch(err) { if (window.console !=
undefined) { console.log(err); } }, myAjaxButton.getMarkupId()));


On Thu, Jan 20, 2011 at 9:49 PM, Brown, Berlin [GCG-PFS] 
berlin.br...@primerica.com wrote:

 This works, thanks.

 Another similar question based on your question.

 Can I use an ajax form submit, maybe using a wicket javascript utility.

 I guess I could use jquery but  does wicket have something available.

 E.g. as opposed to document.forms[xxx].submit().  Is there some generic
 ajax submit I could use.

 ...
this.add(new AjaxLinkObject(nextLink) {


@Override
public void onClick(final AjaxRequestTarget target)
 {
// Find the dynamic form on the page.
final Object objAtStopTraversal =
 HomePage.this.visitChildren(new FindFormVisitor());
if (objAtStopTraversal instanceof Form?) {
// Form found, invoke javascript submit
final Form? form = (Form?)
 objAtStopTraversal;
target.appendJavascript(String.format(try {
 document.forms['%s'].submit(); } catch(err) { if (window.console !=
 undefined) { console.log(err); } }, form.getMarkupId()));
}
}
} );

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, January 20, 2011 9:01 AM
 To: users@wicket.apache.org
 Subject: Re: Submit form from other form onClick

 you can submit any form with pure javascript:
 document.getElementById('myform').submit();
 this will call the respective myForm.onSubmit() method at the server
 side

 at server side you may call directly your methods e.g.
 new Form() {onSubmit() { myService.do(); }} new AjaxLink() {onClick() {
 myService.do(); }} no need to call Wicket methods

 On Thu, Jan 20, 2011 at 2:49 PM, Brown, Berlin [GCG-PFS] 
 berlin.br...@primerica.com wrote:

  Is there a way to manually submit a form.  E.g. normally we would have

  action handler methods onSubmit (on a button or a form).
 
  E.g.
 
  new AjaxLink() {
onClick() {
  someOtherForm.submit();
}
  }
 
  Berlin Brown
 


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




Re: Embedded jetty maven profile.xml

2011-01-21 Thread Martin Grigorov
profile.xml sounds like Maven 1 ?!

better ask in Jetty mailing lists

2011/1/21 Altuğ Bilgin Altıntaş alt...@gmail.com

 I try to start jetty in embedded form but i have problems

 I need to read properties values in profile.xml before embedded jetty
 starts.

 Any suggestions ?

 Thanks.


 --
 *Altuğ*
 *www.kodcu.com* http://www.kodcu.com**



DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Swanthe Lindgren

Hello
I have a text field with jQuery DatePickerBehavior. When the page is 
loaded and the field is initially visible, the behavior works just fine. 
But when toggling the visibility from hidden to visible, the client 
function is gone. The little date packer icon is gone and so is the 
click event on the input field.


What do I have to do?

//Swanthe


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



Re: How can i change lang attribute in html markup tag?

2011-01-21 Thread Mike Mander

Am 21.01.2011 09:17, schrieb Martin Grigorov:

Try with :

in .html:
html wicket:id=html


in .java:
WebMarkupContainer htmlTag = new WebMarkupContainer(html);
htmlTag.add(new SimpleAttributeModifier(lang,
getSession().getLocale().toString());
htmlTag.setTransparentResolver(true); // check the javadoc of this method

On Fri, Jan 21, 2011 at 8:19 AM, Mike Manderwicket-m...@gmx.de  wrote:


Thanks Martin for your reply.

But i couldn't find

WebMarkupContainer.setTransparentResolver

There is only a Border.setTransparentResolver in wicket 1.4.15

Thanks
Mike

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



Re: How can i change lang attribute in html markup tag?

2011-01-21 Thread Martin Grigorov
Yes, sorry.
You need to override
#isTransparentResolver()

WebMarkupContainer htmlTag = new WebMarkupContainer(html) {
public boolean isTransparentResolver()
{
return true;
}
};

On Fri, Jan 21, 2011 at 12:25 PM, Mike Mander wicket-m...@gmx.de wrote:

 Am 21.01.2011 09:17, schrieb Martin Grigorov:

  Try with :

 in .html:
 html wicket:id=html
 

 in .java:
 WebMarkupContainer htmlTag = new WebMarkupContainer(html);
 htmlTag.add(new SimpleAttributeModifier(lang,
 getSession().getLocale().toString());
 htmlTag.setTransparentResolver(true); // check the javadoc of this method

 On Fri, Jan 21, 2011 at 8:19 AM, Mike Manderwicket-m...@gmx.de  wrote:

  Thanks Martin for your reply.

 But i couldn't find

 WebMarkupContainer.setTransparentResolver

 There is only a Border.setTransparentResolver in wicket 1.4.15


 Thanks
 Mike

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




Re: DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Ernesto Reinaldo Barreiro
How do you toggle visibility? Replacing panels via AJAX or client side
JavaScript? The AJAX way will work for sure. I think via JavaScript
you will have to manually recreate it when making it visible

Ernesto

On Fri, Jan 21, 2011 at 12:11 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se wrote:
 Hello
 I have a text field with jQuery DatePickerBehavior. When the page is loaded
 and the field is initially visible, the behavior works just fine. But when
 toggling the visibility from hidden to visible, the client function is gone.
 The little date packer icon is gone and so is the click event on the input
 field.

 What do I have to do?

 //Swanthe


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



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



Re: DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Swanthe Lindgren
A drop down box fires an AJAX request and the text field  with the date 
picker has an overridden isVisible() method.


On 2011-01-21 12:35, Ernesto Reinaldo Barreiro wrote:

How do you toggle visibility? Replacing panels via AJAX or client side
JavaScript? The AJAX way will work for sure. I think via JavaScript
you will have to manually recreate it when making it visible

Ernesto

On Fri, Jan 21, 2011 at 12:11 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se  wrote:

Hello
I have a text field with jQuery DatePickerBehavior. When the page is loaded
and the field is initially visible, the behavior works just fine. But when
toggling the visibility from hidden to visible, the client function is gone.
The little date packer icon is gone and so is the click event on the input
field.

What do I have to do?

//Swanthe


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



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





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



Re: DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Ernesto Reinaldo Barreiro
Are you using wiquery? If so, can you show me your code or send me a
simplified Panel showing this behavior? I use wiquery  datepickers on
my applications in combination with via AJAX replacements and do not
have this issue.

Ernesto

On Fri, Jan 21, 2011 at 12:41 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se wrote:
 A drop down box fires an AJAX request and the text field  with the date
 picker has an overridden isVisible() method.

 On 2011-01-21 12:35, Ernesto Reinaldo Barreiro wrote:

 How do you toggle visibility? Replacing panels via AJAX or client side
 JavaScript? The AJAX way will work for sure. I think via JavaScript
 you will have to manually recreate it when making it visible

 Ernesto

 On Fri, Jan 21, 2011 at 12:11 PM, Swanthe Lindgren
 swanthe.lindg...@megasol.se  wrote:

 Hello
 I have a text field with jQuery DatePickerBehavior. When the page is
 loaded
 and the field is initially visible, the behavior works just fine. But
 when
 toggling the visibility from hidden to visible, the client function is
 gone.
 The little date packer icon is gone and so is the click event on the
 input
 field.

 What do I have to do?

 //Swanthe


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


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




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



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



RE: DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Wilhelmsen Tor Iver
 A drop down box fires an AJAX request and the text field  with the date 
 picker has an overridden isVisible() method.

You have used setOutputMarkupPlaceholderTag(true) on the component that 
visibility is toggled for yes?

- Tor Iver

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



Re: DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Swanthe Lindgren
I have just changed to jQuery DatePickerBehavior from wicket extensions 
YUI DatePicker, which of course worked just fine in this scenario, but 
since I want some of the customizations available in jQuery we made a 
switch.


On 2011-01-21 12:49, Ernesto Reinaldo Barreiro wrote:

Are you using wiquery? If so, can you show me your code or send me a
simplified Panel showing this behavior? I use wiquery  datepickers on
my applications in combination with via AJAX replacements and do not
have this issue.

Ernesto

On Fri, Jan 21, 2011 at 12:41 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se  wrote:

A drop down box fires an AJAX request and the text field  with the date
picker has an overridden isVisible() method.

On 2011-01-21 12:35, Ernesto Reinaldo Barreiro wrote:

How do you toggle visibility? Replacing panels via AJAX or client side
JavaScript? The AJAX way will work for sure. I think via JavaScript
you will have to manually recreate it when making it visible

Ernesto

On Fri, Jan 21, 2011 at 12:11 PM, Swanthe Lindgren
swanthe.lindg...@megasol.sewrote:

Hello
I have a text field with jQuery DatePickerBehavior. When the page is
loaded
and the field is initially visible, the behavior works just fine. But
when
toggling the visibility from hidden to visible, the client function is
gone.
The little date packer icon is gone and so is the click event on the
input
field.

What do I have to do?

//Swanthe


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



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




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



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





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



Re: How can i change lang attribute in html markup tag?

2011-01-21 Thread Mike Mander

Great Martin. Thanks alot it works as expected.

My solution:
LocalizedHtmlTag.java
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.WebMarkupContainer;

public class LocalizedHtmlTag extends WebMarkupContainer {

public LocalizedHtmlTag(String id) {
super(id);
String language = getSession().getLocale().getLanguage();
add(new SimpleAttributeModifier(lang, language));
add(new SimpleAttributeModifier(xml:lang, language));
}

@Override
public boolean isTransparentResolver() {
return true;
}
}

MyPage.java
public class MyPage extends WebPage {

public MyPage() {
add(new LocalizedHtmlTag(html));
}
}

MyPage.html
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html wicket:id=html xmlns=http://www.w3.org/1999/xhtml; 
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

/html

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



Re: DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Ernesto Reinaldo Barreiro
A said: this works fine on my applications using latest versions of
wiquery DatePicker [(see 1]) + AJAX replacements.

1-http://www.google.com/codesearch/p?hl=en#pdLMIUTpzpE/trunk/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePicker.java

Ernesto


On Fri, Jan 21, 2011 at 12:55 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se wrote:
 I have just changed to jQuery DatePickerBehavior from wicket extensions YUI
 DatePicker, which of course worked just fine in this scenario, but since I
 want some of the customizations available in jQuery we made a switch.

 On 2011-01-21 12:49, Ernesto Reinaldo Barreiro wrote:

 Are you using wiquery? If so, can you show me your code or send me a
 simplified Panel showing this behavior? I use wiquery  datepickers on
 my applications in combination with via AJAX replacements and do not
 have this issue.

 Ernesto

 On Fri, Jan 21, 2011 at 12:41 PM, Swanthe Lindgren
 swanthe.lindg...@megasol.se  wrote:

 A drop down box fires an AJAX request and the text field  with the date
 picker has an overridden isVisible() method.

 On 2011-01-21 12:35, Ernesto Reinaldo Barreiro wrote:

 How do you toggle visibility? Replacing panels via AJAX or client side
 JavaScript? The AJAX way will work for sure. I think via JavaScript
 you will have to manually recreate it when making it visible

 Ernesto

 On Fri, Jan 21, 2011 at 12:11 PM, Swanthe Lindgren
 swanthe.lindg...@megasol.se    wrote:

 Hello
 I have a text field with jQuery DatePickerBehavior. When the page is
 loaded
 and the field is initially visible, the behavior works just fine. But
 when
 toggling the visibility from hidden to visible, the client function is
 gone.
 The little date packer icon is gone and so is the click event on the
 input
 field.

 What do I have to do?

 //Swanthe


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


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



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


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




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



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



About AbstractLink

2011-01-21 Thread Heitor Machado
Hi all,

I noticed some days ago that the AbstractLink component when disabled,
render itself as a span.
Is there some especific motivation for that ?

I´m asking because I think that a component/element does not have to change
itself in that way, its suposed to be a responsability of its holder, and
any way, why a span ? All applications should render a span instead of an
anchor when that anchor was disabled? Could I perhaps change it´s css class
and strip its actions ? Or nor even render it ?

Of course we can override the disableLink of AbstractLink (this is the
method that does the magic), but it becomes a problem because now we *have*
to do it.
One of the characteristics that I like most in wicket is freedom, I can use
whatever css and javascript the way I want, I can model my application in
any way I like it, and this is a point of advantage of wicket over other
frameworks, wicket is not pervasive, and the way that method is wrote is
very pervasive.

Cheers
Heitor


Re: Question regarding AjaxFormSubmitBehavior

2011-01-21 Thread Daniel Bartl
Many thanks for your feedback!

I am well aware of the fact that HTML spec actually does not allow nested
forms and that wicket is already doing great job while transforming those
nested forms into divs.

I also expected that the bigger form gets submitted as well but only the
nested one processed and the rest ignored, but that's not exactly what's
happening in our case.

The reason for this is that AjaxFormSubmitBehavior always delegates to the
#onFormSubmitted() of the root form

AjaxFormSubmitBehavior, line 135:

getForm().getRootForm().onFormSubmitted();

which then looks up if there is any enabled, visible
IFormSubmittingComponent in the hierarchy that has been triggered. Only in
case that one such IFormSubmittingComponent gets identified, it sets
*formToProcess* to the form of the identified submittingComponent and then
finally invokes

Form, line 920: formToProcess.process(submittingComponent);

The problem with our crazy liitle nested form ;) is that it does not have
any IFormSubmittingComponent but rather a TextField with
AjaxFormSubmitBehavior attached to its onchange event that should then
submit the nested form accordingly. This leads to formToProcess being left
assigned to the parentForm that then gets processed at the end:

- from Form#onFormSubmitted():

// this is the root form
Form? formToProcess = this;

// find out whether it was a nested form that was
submitted
if (submittingComponent != null)
{
formToProcess = submittingComponent.getForm();
}

// process the form for this request
formToProcess.process(submittingComponent);


We have in the meantime subclassed AjaxFormSubmitBehavior with our own
implementation of AjaxFormSubmitBehavior#onEvent(AjaxRequestTarget target)
method the only difference being the line 135 that was changed from

getForm().getRootForm().onFormSubmitted();

to

getForm().onFormSubmitted();

and did not experience any problems with it, at least so far ;)

Daniel



On Fri, Jan 21, 2011 at 12:25 AM, jcgarciam jcgarc...@gmail.com wrote:


 Adding to Igor's comment, remember that nested form is not allow in HTML
 spec per se, so what wicket is doing a trick where the root form is submit
 but only elements of nested form (which get transform in DIV tag) are
 processed

 On Thu, Jan 20, 2011 at 4:47 PM, Igor Vaynberg-2 [via Apache Wicket] 
 ml-node+3228304-1818027643-65...@n4.nabble.comml-node%2b3228304-1818027643-65...@n4.nabble.com
 ml-node%2b3228304-1818027643-65...@n4.nabble.comml-node%252b3228304-1818027643-65...@n4.nabble.com
 
  wrote:

  the bigger form needs to be processed because what is submitted is the
  root form's formtag. however, validation, etc, will probably be
  delegated only to the inner form.
 
  -igor
 
  On Thu, Jan 20, 2011 at 4:14 AM, Daniel Bartl [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3228304i=0
  wrote:
 
   Have a small question regarding using AjaxFormSubmitBehavoir with
 nested
   forms.
  
   Would like to use it to submit a smaller nested form within a bigger
  parent
   form.
  
   Even though I passed a nested form as a *form that will be submitted*
   while calling the following constructor of AjaxFormSubmitBehavoir :
  /**
   * Construct.
   *
   * @param form
   *   * form that will be submitted*
   * @param event
   *javascript event this behavior is attached to, like
   onclick
   */
  public AjaxFormSubmitBehavior(Form? form, String
   event) - passing nested form here
  {
  super(event);
  __form = form;
  
  if (form != null)
  {
  form.setOutputMarkupId(true);
  }
  }
  
  
   I noticed that the AjaxFormSubmitBehavior#onEvent(AjaxRequestTarget
  target)
   executes the following line first:
   getForm().getRootForm().onFormSubmitted();
   Why does it still delegate to the root form?
  
   Shouldn't the line be getForm().onFormSubmitted(); so that the nested
  form
   and possibly its children get processed only.
  
  
   Many thanks!
   Daniel
  
 
  -
  To unsubscribe, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3228304i=1
  For additional commands, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3228304i=2
 
 
 
  --
   If you reply to this email, your message will be added to the discussion
  below:
 
 
 http://apache-wicket.1842946.n4.nabble.com/Question-regarding-AjaxFormSubmitBehavior-tp3227451p3228304.html
   To start a new topic under Apache Wicket, email
  ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 ml-node%2b1842946-398011874-65...@n4.nabble.comml-node%252b1842946-398011874-65...@n4.nabble.com
 
  To 

Re: modal window IE8 parent page scrolbar

2011-01-21 Thread vov

Do anybody know solutions for this issue?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/modal-window-IE8-parent-page-scrolbar-tp3056439p3229703.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 with fest assert

2011-01-21 Thread Jarosław Pałka
Hi happy Wicket users!

For last couple of months I was using Wicket in 2 projects I am working on.
The only thing that drives me crazy from time to time is support for
testing. It is obviously better then in any Java web framework I every used,
but I think it could be simpler to use and more readable.
I have developed small utility that uses fest-assert (
http://code.google.com/p/fest/), a fluent assertions framework. It replaces
WicketTester.assert* with fluent assertions. Basically with this library
your assertions look like this:

WicketTester tester = new WicketTester();
Panel panel = tester.startPanel(MenuPanel.class);


assertComponent(panel).bookmarkablePageLink(at(home-link)).linksTo(
IndexPage.class);


assertComponent(panel).bookmarkablePageLink(at(artists-link)).linksTo(
ArtistPage.class);


assertComponent(panel).bookmarkablePageLink(at(albums-link)).linksTo(
AlbumPage.class);

or this:

assertComponent(panel)
.component(at(ID_ALBUM_DETAILS_URL, ID_ALBUM_TITLE))
.modelValue().isEqualTo(albumTitle);

assertComponent(panel)
.component(at(ID_ARTIST_DETAILS_URL, ID_ARTIST_NAME))
.modelValue().isEqualTo(artistName);

This library was derived from code I am working on for presentation. It is
really in early stage as this is side development, but I would like to get
your views on this and if you think it will bring value to Wicket community.
You can find it at https://bitbucket.org/kcrimson/fest-assert-wicket/ and
more examples how you can use it at https://bitbucket.org/kcrimson/nosql-web.
I will be more than happy to get your requests for enhancements and
hopefully release this project in near future.

Regards,
Jarek


Re: About AbstractLink

2011-01-21 Thread Jeremy Thomerson
WebApplication.get().getMarkupSettings().setDefaultBeforeDisabledLink(div);
WebApplication.get().getMarkupSettings().setDefaultAfterDisabledLink(/div);

On Fri, Jan 21, 2011 at 7:19 AM, Heitor Machado heito...@gmail.com wrote:

 Hi all,

 I noticed some days ago that the AbstractLink component when disabled,
 render itself as a span.
 Is there some especific motivation for that ?

 I´m asking because I think that a component/element does not have to change
 itself in that way, its suposed to be a responsability of its holder, and
 any way, why a span ? All applications should render a span instead of an
 anchor when that anchor was disabled? Could I perhaps change it´s css class
 and strip its actions ? Or nor even render it ?

 Of course we can override the disableLink of AbstractLink (this is the
 method that does the magic), but it becomes a problem because now we *have*
 to do it.
 One of the characteristics that I like most in wicket is freedom, I can use
 whatever css and javascript the way I want, I can model my application in
 any way I like it, and this is a point of advantage of wicket over other
 frameworks, wicket is not pervasive, and the way that method is wrote is
 very pervasive.

 Cheers
 Heitor




-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: Wicket with fest assert

2011-01-21 Thread Martin Grigorov
Nice!

I'll check your work soon.
Recently a friend of mine also asked me why we don't include the useful
things from EnhancedWicketTester( http://www.paulszulc.com/tag/wickettester/
 )
There is a room for improvement in that area.

2011/1/21 Jarosław Pałka jpa...@gmail.com

 Hi happy Wicket users!

 For last couple of months I was using Wicket in 2 projects I am working on.
 The only thing that drives me crazy from time to time is support for
 testing. It is obviously better then in any Java web framework I every
 used,
 but I think it could be simpler to use and more readable.
 I have developed small utility that uses fest-assert (
 http://code.google.com/p/fest/), a fluent assertions framework. It
 replaces
 WicketTester.assert* with fluent assertions. Basically with this library
 your assertions look like this:

WicketTester tester = new WicketTester();
Panel panel = tester.startPanel(MenuPanel.class);


 assertComponent(panel).bookmarkablePageLink(at(home-link)).linksTo(
IndexPage.class);


 assertComponent(panel).bookmarkablePageLink(at(artists-link)).linksTo(
ArtistPage.class);


 assertComponent(panel).bookmarkablePageLink(at(albums-link)).linksTo(
AlbumPage.class);

 or this:

assertComponent(panel)
.component(at(ID_ALBUM_DETAILS_URL, ID_ALBUM_TITLE))
.modelValue().isEqualTo(albumTitle);

assertComponent(panel)
.component(at(ID_ARTIST_DETAILS_URL, ID_ARTIST_NAME))
.modelValue().isEqualTo(artistName);

 This library was derived from code I am working on for presentation. It is
 really in early stage as this is side development, but I would like to get
 your views on this and if you think it will bring value to Wicket
 community.
 You can find it at https://bitbucket.org/kcrimson/fest-assert-wicket/ and
 more examples how you can use it at
 https://bitbucket.org/kcrimson/nosql-web.
 I will be more than happy to get your requests for enhancements and
 hopefully release this project in near future.

 Regards,
 Jarek



Re: DatePickerBehavior lost when toggling visibility

2011-01-21 Thread Swanthe Lindgren
Sorry, I didn't get that wiquery also used jQuery. After changing to 
wiquery I at least got my quickstart-app running


On 2011-01-21 13:34, Ernesto Reinaldo Barreiro wrote:

A said: this works fine on my applications using latest versions of
wiquery DatePicker [(see 1]) + AJAX replacements.

1-http://www.google.com/codesearch/p?hl=en#pdLMIUTpzpE/trunk/src/main/java/org/odlabs/wiquery/ui/datepicker/DatePicker.java

Ernesto


On Fri, Jan 21, 2011 at 12:55 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se  wrote:

I have just changed to jQuery DatePickerBehavior from wicket extensions YUI
DatePicker, which of course worked just fine in this scenario, but since I
want some of the customizations available in jQuery we made a switch.

On 2011-01-21 12:49, Ernesto Reinaldo Barreiro wrote:

Are you using wiquery? If so, can you show me your code or send me a
simplified Panel showing this behavior? I use wiquery  datepickers on
my applications in combination with via AJAX replacements and do not
have this issue.

Ernesto

On Fri, Jan 21, 2011 at 12:41 PM, Swanthe Lindgren
swanthe.lindg...@megasol.sewrote:

A drop down box fires an AJAX request and the text field  with the date
picker has an overridden isVisible() method.

On 2011-01-21 12:35, Ernesto Reinaldo Barreiro wrote:

How do you toggle visibility? Replacing panels via AJAX or client side
JavaScript? The AJAX way will work for sure. I think via JavaScript
you will have to manually recreate it when making it visible

Ernesto

On Fri, Jan 21, 2011 at 12:11 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se  wrote:

Hello
I have a text field with jQuery DatePickerBehavior. When the page is
loaded
and the field is initially visible, the behavior works just fine. But
when
toggling the visibility from hidden to visible, the client function is
gone.
The little date packer icon is gone and so is the click event on the
input
field.

What do I have to do?

//Swanthe


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



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



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



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




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



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





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



Re: About AbstractLink

2011-01-21 Thread Heitor Machado
Very nice, tanks Jeremy, but the main question is not about SPANs X DIVs, or
whatever. And even with this nice snipet, should all disabled links in my
app appear with DIVs ? Without exceptions ?

tanks
Heitor


Re: About AbstractLink

2011-01-21 Thread Jeremy Thomerson
On Fri, Jan 21, 2011 at 10:08 AM, Heitor Machado heito...@gmail.com wrote:

 Very nice, tanks Jeremy, but the main question is not about SPANs X DIVs,
 or
 whatever. And even with this nice snipet, should all disabled links in my
 app appear with DIVs ? Without exceptions ?


A link doesn't have corresponding markup (as a separate markup file).  So,
it has to be set programmatically.  So, you can set a default (like I showed
before), and individual links can have AbstractLink#setAfterDisabledLink
called.  (and setBefore)


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Re: Question regarding AjaxFormSubmitBehavior

2011-01-21 Thread Igor Vaynberg
you are welcome to submit a jira issue with a unit test/quickstart
that demonstrates the problem.

-igor

On Fri, Jan 21, 2011 at 5:42 AM, Daniel Bartl d.ba...@comsysto.com wrote:
 Many thanks for your feedback!

 I am well aware of the fact that HTML spec actually does not allow nested
 forms and that wicket is already doing great job while transforming those
 nested forms into divs.

 I also expected that the bigger form gets submitted as well but only the
 nested one processed and the rest ignored, but that's not exactly what's
 happening in our case.

 The reason for this is that AjaxFormSubmitBehavior always delegates to the
 #onFormSubmitted() of the root form

 AjaxFormSubmitBehavior, line 135:

 getForm().getRootForm().onFormSubmitted();

 which then looks up if there is any enabled, visible
 IFormSubmittingComponent in the hierarchy that has been triggered. Only in
 case that one such IFormSubmittingComponent gets identified, it sets
 *formToProcess* to the form of the identified submittingComponent and then
 finally invokes

 Form, line 920: formToProcess.process(submittingComponent);

 The problem with our crazy liitle nested form ;) is that it does not have
 any IFormSubmittingComponent but rather a TextField with
 AjaxFormSubmitBehavior attached to its onchange event that should then
 submit the nested form accordingly. This leads to formToProcess being left
 assigned to the parentForm that then gets processed at the end:

 - from Form#onFormSubmitted():

                    // this is the root form
                    Form? formToProcess = this;

                    // find out whether it was a nested form that was
 submitted
                    if (submittingComponent != null)
                    {
                        formToProcess = submittingComponent.getForm();
                    }

                    // process the form for this request
                    formToProcess.process(submittingComponent);


 We have in the meantime subclassed AjaxFormSubmitBehavior with our own
 implementation of AjaxFormSubmitBehavior#onEvent(AjaxRequestTarget target)
 method the only difference being the line 135 that was changed from

 getForm().getRootForm().onFormSubmitted();

 to

 getForm().onFormSubmitted();

 and did not experience any problems with it, at least so far ;)

 Daniel



 On Fri, Jan 21, 2011 at 12:25 AM, jcgarciam jcgarc...@gmail.com wrote:


 Adding to Igor's comment, remember that nested form is not allow in HTML
 spec per se, so what wicket is doing a trick where the root form is submit
 but only elements of nested form (which get transform in DIV tag) are
 processed

 On Thu, Jan 20, 2011 at 4:47 PM, Igor Vaynberg-2 [via Apache Wicket] 
 ml-node+3228304-1818027643-65...@n4.nabble.comml-node%2b3228304-1818027643-65...@n4.nabble.com
 ml-node%2b3228304-1818027643-65...@n4.nabble.comml-node%252b3228304-1818027643-65...@n4.nabble.com
 
  wrote:

  the bigger form needs to be processed because what is submitted is the
  root form's formtag. however, validation, etc, will probably be
  delegated only to the inner form.
 
  -igor
 
  On Thu, Jan 20, 2011 at 4:14 AM, Daniel Bartl [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3228304i=0
  wrote:
 
   Have a small question regarding using AjaxFormSubmitBehavoir with
 nested
   forms.
  
   Would like to use it to submit a smaller nested form within a bigger
  parent
   form.
  
   Even though I passed a nested form as a *form that will be submitted*
   while calling the following constructor of AjaxFormSubmitBehavoir :
      /**
       * Construct.
       *
       * @param form
       *           * form that will be submitted*
       * @param event
       *            javascript event this behavior is attached to, like
   onclick
       */
      public AjaxFormSubmitBehavior(Form? form, String
   event)                 - passing nested form here
      {
          super(event);
          __form = form;
  
          if (form != null)
          {
              form.setOutputMarkupId(true);
          }
      }
  
  
   I noticed that the AjaxFormSubmitBehavior#onEvent(AjaxRequestTarget
  target)
   executes the following line first:
   getForm().getRootForm().onFormSubmitted();
   Why does it still delegate to the root form?
  
   Shouldn't the line be getForm().onFormSubmitted(); so that the nested
  form
   and possibly its children get processed only.
  
  
   Many thanks!
   Daniel
  
 
  -
  To unsubscribe, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3228304i=1
  For additional commands, e-mail: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3228304i=2
 
 
 
  --
   If you reply to this email, your message will be added to the discussion
  below:
 
 
 http://apache-wicket.1842946.n4.nabble.com/Question-regarding-AjaxFormSubmitBehavior-tp3227451p3228304.html
   To start a new topic under Apache Wicket, 

Re: About AbstractLink

2011-01-21 Thread Igor Vaynberg
afaik anchors in html do not support a disabled attribute. so the only
way to make it really unclickable is to not render it as an anchor.

of course you can change that by tweaking Jeremy's example

WebApplication.get().getMarkupSettings().setDefaultBeforeDisabledLink(a);
WebApplication.get().getMarkupSettings().setDefaultAfterDisabledLink(/a);

-igor

On Fri, Jan 21, 2011 at 5:19 AM, Heitor Machado heito...@gmail.com wrote:
 Hi all,

 I noticed some days ago that the AbstractLink component when disabled,
 render itself as a span.
 Is there some especific motivation for that ?

 I´m asking because I think that a component/element does not have to change
 itself in that way, its suposed to be a responsability of its holder, and
 any way, why a span ? All applications should render a span instead of an
 anchor when that anchor was disabled? Could I perhaps change it´s css class
 and strip its actions ? Or nor even render it ?

 Of course we can override the disableLink of AbstractLink (this is the
 method that does the magic), but it becomes a problem because now we *have*
 to do it.
 One of the characteristics that I like most in wicket is freedom, I can use
 whatever css and javascript the way I want, I can model my application in
 any way I like it, and this is a point of advantage of wicket over other
 frameworks, wicket is not pervasive, and the way that method is wrote is
 very pervasive.

 Cheers
 Heitor


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



Re: About AbstractLink

2011-01-21 Thread Martin Grigorov
On Fri, Jan 21, 2011 at 5:26 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 afaik anchors in html do not support a disabled attribute. so the only
 way to make it really unclickable is to not render it as an anchor.

 of course you can change that by tweaking Jeremy's example


 WebApplication.get().getMarkupSettings().setDefaultBeforeDisabledLink(a);

 WebApplication.get().getMarkupSettings().setDefaultAfterDisabledLink(/a);


Am I wrong or these methods replace the default em with div/a and the
span Heitor talks about is still inside them ?


 -igor

 On Fri, Jan 21, 2011 at 5:19 AM, Heitor Machado heito...@gmail.com
 wrote:
  Hi all,
 
  I noticed some days ago that the AbstractLink component when disabled,
  render itself as a span.
  Is there some especific motivation for that ?
 
  I´m asking because I think that a component/element does not have to
 change
  itself in that way, its suposed to be a responsability of its holder, and
  any way, why a span ? All applications should render a span instead of an
  anchor when that anchor was disabled? Could I perhaps change it´s css
 class
  and strip its actions ? Or nor even render it ?
 
  Of course we can override the disableLink of AbstractLink (this is the
  method that does the magic), but it becomes a problem because now we
 *have*
  to do it.
  One of the characteristics that I like most in wicket is freedom, I can
 use
  whatever css and javascript the way I want, I can model my application in
  any way I like it, and this is a point of advantage of wicket over other
  frameworks, wicket is not pervasive, and the way that method is wrote is
  very pervasive.
 
  Cheers
  Heitor
 

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




Re: About AbstractLink

2011-01-21 Thread Igor Vaynberg
no, they will replace the span. and iirc em was changed to span a
while back as the default

-igor

On Fri, Jan 21, 2011 at 8:42 AM, Martin Grigorov mgrigo...@apache.org wrote:
 On Fri, Jan 21, 2011 at 5:26 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 afaik anchors in html do not support a disabled attribute. so the only
 way to make it really unclickable is to not render it as an anchor.

 of course you can change that by tweaking Jeremy's example


 WebApplication.get().getMarkupSettings().setDefaultBeforeDisabledLink(a);

 WebApplication.get().getMarkupSettings().setDefaultAfterDisabledLink(/a);


 Am I wrong or these methods replace the default em with div/a and the
 span Heitor talks about is still inside them ?


 -igor

 On Fri, Jan 21, 2011 at 5:19 AM, Heitor Machado heito...@gmail.com
 wrote:
  Hi all,
 
  I noticed some days ago that the AbstractLink component when disabled,
  render itself as a span.
  Is there some especific motivation for that ?
 
  I´m asking because I think that a component/element does not have to
 change
  itself in that way, its suposed to be a responsability of its holder, and
  any way, why a span ? All applications should render a span instead of an
  anchor when that anchor was disabled? Could I perhaps change it´s css
 class
  and strip its actions ? Or nor even render it ?
 
  Of course we can override the disableLink of AbstractLink (this is the
  method that does the magic), but it becomes a problem because now we
 *have*
  to do it.
  One of the characteristics that I like most in wicket is freedom, I can
 use
  whatever css and javascript the way I want, I can model my application in
  any way I like it, and this is a point of advantage of wicket over other
  frameworks, wicket is not pervasive, and the way that method is wrote is
  very pervasive.
 
  Cheers
  Heitor
 

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




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



Re: Wicket with fest assert

2011-01-21 Thread Anton Bessonov

Of course!

https://cwiki.apache.org/WICKET/type-safe-testing-in-wicket.html

It must be built in :)


There is a room for improvement in that area.



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



Re: About AbstractLink

2011-01-21 Thread uudashr

Sent from my BlackBerry®
powered by Sinyal Kuat INDOSAT

-Original Message-
From: Heitor Machado heito...@gmail.com
Date: Fri, 21 Jan 2011 14:08:25 
To: users@wicket.apache.org
Reply-To: users@wicket.apache.org
Subject: Re: About AbstractLink

Very nice, tanks Jeremy, but the main question is not about SPANs X DIVs, or
whatever. And even with this nice snipet, should all disabled links in my
app appear with DIVs ? Without exceptions ?

tanks
Heitor