Re: TinyMCE & Twitter Bootstrap Toggle

2013-07-24 Thread Alec Swan
I noticed that TinyMce plugin in WicketStuff 1.5.9.1 packages an old
version of TinyMce. Does anybody know what is the latest TinyMce Wicket
plugin release compatible with Wicket 1.5.9?

Thanks,

Alec


On Tue, Jul 23, 2013 at 2:13 PM, Alec Swan  wrote:

> I am on Wicket 1.5.9 using WicketStuff 1.5.9.1.
>
> I ended up overriding TinyMceBehavior#beforeRender in order to inject
> class="collapse" on the TinyMCE wrapper DIV. Can you think of a cleaner
> solution?
>
> @Override
> public void beforeRender(Component component)
> {
> // see super#beforeRender(Component)
> component.getResponse().write(String.format(" id=\"%s\" class=\"collapse\">", getAjaxRegionMarkupId(component))); //
> collapse html editor by default
> }
>
> Thanks,
>
> Alec
>
>
> On Tue, Jul 23, 2013 at 9:52 AM, Andrea Del Bene wrote:
>
>> Which version of Wicket/WicketStuff are you using?
>> > Andrea, thank you for a good pointer. The thing I am struggling with is
>> > adding class="collapse" to the xxx_wrapper_component which seems to be
>> > created by TinyMCE JavaScript after my Wicket code can add
>> > AttributeModifier or even invoke $('#" + getAjaxRegionMarkupId() +
>> > "').css('class', 'collapse');".
>> >
>> > It seems like the class gets set by right after that is erased by
>> TinyMCE.
>> >
>> > Any ideas how I can run my code that sets CSS class of mce wrapper div
>> > after tinyMce.init()?
>> >
>> > Thanks,
>> >
>> > Alec
>> >
>> >
>> > On Mon, Jul 22, 2013 at 1:30 AM, Andrea Del Bene > >wrote:
>> >
>> >> Hi,
>> >>
>> >> you can have a look at InPlaceEditComponent which is used in the
>> example
>> >> page InlineTinyMCEPage (see code at
>> >>
>> >>
>> https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/tinymce-parent/tinymce-examples/src/main/java/wicket/contrib/examples/tinymce/InlineTinyMCEPage.java
>> >> )
>> >>> Hello,
>> >>>
>> >>> I have a bootstrap toggle button which the user can use to open and
>> close
>> >>> TinyMCE editor. When the page is rendered I would like the TinyMCE
>> editor
>> >>> to be closed and when user clicks on the toggle button - open.
>> >>>
>> >>> Note that twitter bootstrap button needs to know
>> >>> TinyMCE#getAjaxRegionMarkupId(area) in order to use it in
>> >>> toggle-target='xxx' attribute to toggle it.
>> >>>
>> >>> Is there a way to configure TinyMceBehavior to render hidden by
>> default?
>> >>> Any other ideas on how I can get this solved?
>> >>>
>> >>> Thanks,
>> >>>
>> >>> Alec
>> >>>
>> >>
>> >> -
>> >> 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: TinyMCE & Twitter Bootstrap Toggle

2013-07-23 Thread Alec Swan
I am on Wicket 1.5.9 using WicketStuff 1.5.9.1.

I ended up overriding TinyMceBehavior#beforeRender in order to inject
class="collapse" on the TinyMCE wrapper DIV. Can you think of a cleaner
solution?

@Override
public void beforeRender(Component component)
{
// see super#beforeRender(Component)
component.getResponse().write(String.format("", getAjaxRegionMarkupId(component))); // collapse html
editor by default
}

Thanks,

Alec


On Tue, Jul 23, 2013 at 9:52 AM, Andrea Del Bene wrote:

> Which version of Wicket/WicketStuff are you using?
> > Andrea, thank you for a good pointer. The thing I am struggling with is
> > adding class="collapse" to the xxx_wrapper_component which seems to be
> > created by TinyMCE JavaScript after my Wicket code can add
> > AttributeModifier or even invoke $('#" + getAjaxRegionMarkupId() +
> > "').css('class', 'collapse');".
> >
> > It seems like the class gets set by right after that is erased by
> TinyMCE.
> >
> > Any ideas how I can run my code that sets CSS class of mce wrapper div
> > after tinyMce.init()?
> >
> > Thanks,
> >
> > Alec
> >
> >
> > On Mon, Jul 22, 2013 at 1:30 AM, Andrea Del Bene  >wrote:
> >
> >> Hi,
> >>
> >> you can have a look at InPlaceEditComponent which is used in the example
> >> page InlineTinyMCEPage (see code at
> >>
> >>
> https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/tinymce-parent/tinymce-examples/src/main/java/wicket/contrib/examples/tinymce/InlineTinyMCEPage.java
> >> )
> >>> Hello,
> >>>
> >>> I have a bootstrap toggle button which the user can use to open and
> close
> >>> TinyMCE editor. When the page is rendered I would like the TinyMCE
> editor
> >>> to be closed and when user clicks on the toggle button - open.
> >>>
> >>> Note that twitter bootstrap button needs to know
> >>> TinyMCE#getAjaxRegionMarkupId(area) in order to use it in
> >>> toggle-target='xxx' attribute to toggle it.
> >>>
> >>> Is there a way to configure TinyMceBehavior to render hidden by
> default?
> >>> Any other ideas on how I can get this solved?
> >>>
> >>> Thanks,
> >>>
> >>> Alec
> >>>
> >>
> >> -
> >> 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: TinyMCE & Twitter Bootstrap Toggle

2013-07-22 Thread Alec Swan
Andrea, thank you for a good pointer. The thing I am struggling with is
adding class="collapse" to the xxx_wrapper_component which seems to be
created by TinyMCE JavaScript after my Wicket code can add
AttributeModifier or even invoke $('#" + getAjaxRegionMarkupId() +
"').css('class', 'collapse');".

It seems like the class gets set by right after that is erased by TinyMCE.

Any ideas how I can run my code that sets CSS class of mce wrapper div
after tinyMce.init()?

Thanks,

Alec


On Mon, Jul 22, 2013 at 1:30 AM, Andrea Del Bene wrote:

> Hi,
>
> you can have a look at InPlaceEditComponent which is used in the example
> page InlineTinyMCEPage (see code at
>
> https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/tinymce-parent/tinymce-examples/src/main/java/wicket/contrib/examples/tinymce/InlineTinyMCEPage.java
> )
> > Hello,
> >
> > I have a bootstrap toggle button which the user can use to open and close
> > TinyMCE editor. When the page is rendered I would like the TinyMCE editor
> > to be closed and when user clicks on the toggle button - open.
> >
> > Note that twitter bootstrap button needs to know
> > TinyMCE#getAjaxRegionMarkupId(area) in order to use it in
> > toggle-target='xxx' attribute to toggle it.
> >
> > Is there a way to configure TinyMceBehavior to render hidden by default?
> > Any other ideas on how I can get this solved?
> >
> > Thanks,
> >
> > Alec
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


TinyMCE & Twitter Bootstrap Toggle

2013-07-21 Thread Alec Swan
Hello,

I have a bootstrap toggle button which the user can use to open and close
TinyMCE editor. When the page is rendered I would like the TinyMCE editor
to be closed and when user clicks on the toggle button - open.

Note that twitter bootstrap button needs to know
TinyMCE#getAjaxRegionMarkupId(area) in order to use it in
toggle-target='xxx' attribute to toggle it.

Is there a way to configure TinyMceBehavior to render hidden by default?
Any other ideas on how I can get this solved?

Thanks,

Alec


Re: Relative Path and Resource loading in wicket

2012-11-16 Thread Alec Swan
I had a similar problem and considered Martin's approach, but ended up
creating a var value on my
page and accessed it from JS file using $("div.myVar").text() or
something like that.

The advantage of  approach is that you can test it statically
without deploying the webapp and your JS file can be safely cached by
the browser improving load time.

Alec

On Fri, Nov 16, 2012 at 7:58 AM, Ernesto Reinaldo Barreiro
 wrote:
> You can do something like
>
> On your panel
>
>  public void renderHead(final IHeaderResponse response) {
> PackagedTextTemplate template = new PackagedTextTemplate(MyPanel.class,
> "test.js");
> Map vars = new MiniMap(1);
> vars.put("val1", "MyValue");
> response.renderOnDomReadyJavascript(template.asString(vars));
>   }
>
> test.js=
>
> var bla = '${val1}';
>
>
> On Fri, Nov 16, 2012 at 3:51 PM, delta458  wrote:
>
>> @Ernest I just need to write some variables to the .js file
>> like
>>
>> var price;
>> var user;
>>
>> @MartinGrigorov so what should I do to make this work? How can I set my
>> resource to the classpath? and what should I call to make it work?
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Relative-Path-and-Resource-loading-in-wicket-tp4653930p4653945.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
>>
>>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ 

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



Re: retriving the actual page instance

2012-11-16 Thread Alec Swan
I used this approach
https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html to
retrieve the last page instance from request cycle.

1. Register handler in your Application:
getRequestCycleListeners().add(new PageRequestHandlerTracker());
2. Retrieve page as follows:
IPageRequestHandler lastHandler =
PageRequestHandlerTracker.getLastHandler(RequestCycle.get());
IRequestablePage page = lastHandler == null ? null : lastHandler.getPage();

Hope this helps,

Alec

On Fri, Nov 16, 2012 at 8:55 AM, Martin Grigorov  wrote:
> Why do you need this functionality ?
>
>
> On Fri, Nov 16, 2012 at 5:54 PM, Alfonso Quiroga 
> wrote:
>
>> Martin, thank you again!
>> This helps me a lot! what I dislike is that I need to know the page id, is
>> there a way to know the "last" page id? by now.. I'll put this id in the
>> session
>>
>>
>> On Fri, Nov 16, 2012 at 11:47 AM, Martin Grigorov > >wrote:
>>
>> > Hi,
>> >
>> > The official way is: session.getPageManager().getPage(pageId)
>> > This will look in the httpsession and fallback to disk.
>> >
>> >
>> > On Fri, Nov 16, 2012 at 4:33 PM, Alfonso Quiroga > > >wrote:
>> >
>> > > Hi, is there a way to get the actual IRequestablePage? I have only one,
>> > and
>> > > if I debug the HttpSession, I have this key:
>> > > "wicket:wicket.wicketGuide:wicket:persistentPageManagerData" which
>> holds
>> > > the PageStoreManager$SessionEntry, where is the actual page I'm looking
>> > > for.
>> > >
>> > > I don't want to access in that way (navigating throw the raw
>> > httpSession).
>> > > I think there should be a better way using Wicket classes. Does anybody
>> > > know? thanks!
>> > >
>> >
>> >
>> >
>> > --
>> > Martin Grigorov
>> > jWeekend
>> > Training, Consulting, Development
>> > http://jWeekend.com 
>> >
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 

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



Re: Wicket 1.5 migration: AbstractCrypt#decryptByteArray(..) throws IllegalBlockSizeException

2012-11-15 Thread Alec Swan
Does anybody have thoughts on this? Was this broken on 1.5?

On Sun, Nov 11, 2012 at 4:39 PM, Alec Swan  wrote:
>> what is the salt that you use?
>> because we use the session specific key, but that can also already be used
>> like that in 1.4 is it maybe a different default so that you now use a
>> session key as salt?
> We did not change the encryptionKey in cryptFactory = new
> CachingSunJceCryptFactory(encryptionKey). Is this what you are asking
> about?
>
>> does the database have enough room voor the encrypted? is it not truncated?
> This used to work in 1.4.x which means that we stored encrypted
> strings in the database correctly.
>
> Any other thoughts?
>
> Thanks!
>
> Alec

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



Re: Links in modal dialog are relative to dialog URL and not base page URL

2012-11-13 Thread Alec Swan
Martin,

My original problem was in the environment without any proxies but
relative URLs on the modal dialog loaded from jQuery were still
broken. If you have a chance could you please review my original email
and suggest what can be done to fix the links?

Thanks,

Alec

On Mon, Nov 12, 2012 at 8:51 AM, Martin Grigorov  wrote:
> This is the reason why Wicket works with relative urls.
> The absolute ones do not work well behind proxies.
>
>
> On Mon, Nov 12, 2012 at 5:46 PM, Alec Swan  wrote:
>
>> It turned out that
>> RequestCycle.get().getUrlRenderer().renderFullUrl(..) always returns
>> URL starting with http://localhost:8080 even when I deploy my on the
>> DEV server.
>>
>> Has anyone experienced this issue?
>>
>> Thanks,
>>
>> Alec
>>
>> On Tue, Nov 6, 2012 at 9:31 AM, Alec Swan  wrote:
>> > To solve the problem I decided to change all my links to use absolute
>> > URLs by overriding Link#getUrl() method as follows:
>> >
>> >@Override
>> > protected CharSequence getURL() {
>> > return
>> >
>> RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(super.getURL().toString()));
>> >     }
>> >
>> > Please let me know if there is a problem with this approach.
>> >
>> > Thanks,
>> >
>> > Alec
>> >
>> > On Mon, Nov 5, 2012 at 2:09 PM, Alec Swan  wrote:
>> >> Hello,
>> >>
>> >> I have a base page mounted at /app/root URL. This page loads and pops
>> >> up a modal dialog (DIV) which content is loaded from /app/root/dialog
>> >> URL. All links on the dialog are relative to the dialog URL and not
>> >> base page URL. However, the browser resolves relative links against
>> >> base page URL and hence all links are broken.
>> >>
>> >> The modal dialog is shown as follows:
>> >> $("#dialogId").load("/app/root/dialog").modal('show')
>> >>
>> >> How can I fix this?
>> >>
>> >> Thanks,
>> >>
>> >> Alec
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>

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



Re: Links in modal dialog are relative to dialog URL and not base page URL

2012-11-12 Thread Alec Swan
I was unable to figure this out and ended up changing the mount path
of the dialog from /root/dialog to /root-dialog in order to match the
depth of the parent page's mount path /root. I wish there was a
cleaner way to fix this.

Does anybody have any thoughts on this?

Thanks,

Alec

On Mon, Nov 12, 2012 at 8:46 AM, Alec Swan  wrote:
> It turned out that
> RequestCycle.get().getUrlRenderer().renderFullUrl(..) always returns
> URL starting with http://localhost:8080 even when I deploy my on the
> DEV server.
>
> Has anyone experienced this issue?
>
> Thanks,
>
> Alec
>
> On Tue, Nov 6, 2012 at 9:31 AM, Alec Swan  wrote:
>> To solve the problem I decided to change all my links to use absolute
>> URLs by overriding Link#getUrl() method as follows:
>>
>>@Override
>> protected CharSequence getURL() {
>> return
>> RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(super.getURL().toString()));
>> }
>>
>> Please let me know if there is a problem with this approach.
>>
>> Thanks,
>>
>> Alec
>>
>> On Mon, Nov 5, 2012 at 2:09 PM, Alec Swan  wrote:
>>> Hello,
>>>
>>> I have a base page mounted at /app/root URL. This page loads and pops
>>> up a modal dialog (DIV) which content is loaded from /app/root/dialog
>>> URL. All links on the dialog are relative to the dialog URL and not
>>> base page URL. However, the browser resolves relative links against
>>> base page URL and hence all links are broken.
>>>
>>> The modal dialog is shown as follows:
>>> $("#dialogId").load("/app/root/dialog").modal('show')
>>>
>>> How can I fix this?
>>>
>>> Thanks,
>>>
>>> Alec

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



Re: Links in modal dialog are relative to dialog URL and not base page URL

2012-11-12 Thread Alec Swan
It turned out that
RequestCycle.get().getUrlRenderer().renderFullUrl(..) always returns
URL starting with http://localhost:8080 even when I deploy my on the
DEV server.

Has anyone experienced this issue?

Thanks,

Alec

On Tue, Nov 6, 2012 at 9:31 AM, Alec Swan  wrote:
> To solve the problem I decided to change all my links to use absolute
> URLs by overriding Link#getUrl() method as follows:
>
>@Override
> protected CharSequence getURL() {
> return
> RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(super.getURL().toString()));
> }
>
> Please let me know if there is a problem with this approach.
>
> Thanks,
>
> Alec
>
> On Mon, Nov 5, 2012 at 2:09 PM, Alec Swan  wrote:
>> Hello,
>>
>> I have a base page mounted at /app/root URL. This page loads and pops
>> up a modal dialog (DIV) which content is loaded from /app/root/dialog
>> URL. All links on the dialog are relative to the dialog URL and not
>> base page URL. However, the browser resolves relative links against
>> base page URL and hence all links are broken.
>>
>> The modal dialog is shown as follows:
>> $("#dialogId").load("/app/root/dialog").modal('show')
>>
>> How can I fix this?
>>
>> Thanks,
>>
>> Alec

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



Re: Wicket 1.5 migration: AbstractCrypt#decryptByteArray(..) throws IllegalBlockSizeException

2012-11-11 Thread Alec Swan
> what is the salt that you use?
> because we use the session specific key, but that can also already be used
> like that in 1.4 is it maybe a different default so that you now use a
> session key as salt?
We did not change the encryptionKey in cryptFactory = new
CachingSunJceCryptFactory(encryptionKey). Is this what you are asking
about?

> does the database have enough room voor the encrypted? is it not truncated?
This used to work in 1.4.x which means that we stored encrypted
strings in the database correctly.

Any other thoughts?

Thanks!

Alec

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



Re: Wicket 1.5 migration: AbstractCrypt#decryptByteArray(..) throws IllegalBlockSizeException

2012-11-11 Thread Alec Swan
When a user submits a form we take all parameters, encode them and
store encoded string in the database. When the users want to see which
values they submitted we pull the encoded string from the database,
decode it and show values to the user.

Encoding is done with cryptFactory.newCrypt().encryptUrlSafe(str)
Decoding is done with cryptFactory.newCrypt().decryptUrlSafe(encodedStr)
Where cryptFactory = new CachingSunJceCryptFactory("x");

So, the encoded string was stored in the database with Wicket 1.4.19
and used to work when decoded with 1.4.19. However, now we are on
1.5.9 and we get the following exception during decoding of string
from the database:

org.apache.wicket.util.crypt.AbstractCrypt - Error decoding text:
xx
at 
org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
at 
org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
...
Caused by: javax.crypto.IllegalBlockSizeException: Input length must
be multiple of 8 when decrypting with padded cipher
at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
at com.sun.crypto.provider.SunJCE_ab.b(DashoA13*..)
at 
com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(DashoA13*..)
at javax.crypto.Cipher.doFinal(DashoA13*..)
at org.apache.wicket.util.crypt.SunJceCrypt.crypt(SunJceCrypt.java:94)
at 
org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:146)
... 63 more

Thanks,

Alec

On Sun, Nov 11, 2012 at 5:21 AM, Sven Meier  wrote:
> Where is encodedStr coming from? Are you using Cryptomapper?
>
> Please give us a stacktrace.
>
> Sven
>
>
> On 11/11/2012 02:13 AM, Alec Swan wrote:
>>
>> Hello,
>>
>> After we migrated from 1.4.x to 1.5.x my
>> CachingSunJceCryptFactory.newCrypt().decryptUrlSafe(encodedStr)
>> started returning null. In 1.4.x the same encodedStr parameter was
>> decrypted without problems. We did not change the Java version and are
>> still on 1.6.20.
>>
>> I debugged into AbstractCrypt#decryptSafeUrl(..) and found out that
>> inside of it decryptByteArray(..) call is now throwing the following
>> exception:
>> "javax.crypto.IllegalBlockSizeException: Input length must be multiple
>> of 8 when decrypting with padded cipher"
>>
>> How can we fix this?
>>
>> Thanks,
>>
>> Alec
>>
>> -
>> 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



Wicket 1.5 migration: AbstractCrypt#decryptByteArray(..) throws IllegalBlockSizeException

2012-11-10 Thread Alec Swan
Hello,

After we migrated from 1.4.x to 1.5.x my
CachingSunJceCryptFactory.newCrypt().decryptUrlSafe(encodedStr)
started returning null. In 1.4.x the same encodedStr parameter was
decrypted without problems. We did not change the Java version and are
still on 1.6.20.

I debugged into AbstractCrypt#decryptSafeUrl(..) and found out that
inside of it decryptByteArray(..) call is now throwing the following
exception:
"javax.crypto.IllegalBlockSizeException: Input length must be multiple
of 8 when decrypting with padded cipher"

How can we fix this?

Thanks,

Alec

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




Re: Links in modal dialog are relative to dialog URL and not base page URL

2012-11-06 Thread Alec Swan
To solve the problem I decided to change all my links to use absolute
URLs by overriding Link#getUrl() method as follows:

   @Override
protected CharSequence getURL() {
return
RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(super.getURL().toString()));
}

Please let me know if there is a problem with this approach.

Thanks,

Alec

On Mon, Nov 5, 2012 at 2:09 PM, Alec Swan  wrote:
> Hello,
>
> I have a base page mounted at /app/root URL. This page loads and pops
> up a modal dialog (DIV) which content is loaded from /app/root/dialog
> URL. All links on the dialog are relative to the dialog URL and not
> base page URL. However, the browser resolves relative links against
> base page URL and hence all links are broken.
>
> The modal dialog is shown as follows:
> $("#dialogId").load("/app/root/dialog").modal('show')
>
> How can I fix this?
>
> Thanks,
>
> Alec

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



Links in modal dialog are relative to dialog URL and not base page URL

2012-11-05 Thread Alec Swan
Hello,

I have a base page mounted at /app/root URL. This page loads and pops
up a modal dialog (DIV) which content is loaded from /app/root/dialog
URL. All links on the dialog are relative to the dialog URL and not
base page URL. However, the browser resolves relative links against
base page URL and hence all links are broken.

The modal dialog is shown as follows:
$("#dialogId").load("/app/root/dialog").modal('show')

How can I fix this?

Thanks,

Alec

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



Re: Custom CSS for Feedback message is broken in 1.5

2012-11-05 Thread Alec Swan
Is anybody merging this in 1.5.9?

On Fri, Nov 2, 2012 at 11:37 PM, miteshaegis  wrote:
> Hi,
>
> You can use set of  class and set css on div class easily.
>
> Thanks!
>
>
>
> -
> JBoss Developers  || JBPM Workflow
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Custom-CSS-for-Feedback-message-is-broken-in-1-5-tp4653166p4653593.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



HTML storyboard and "Maybe there are several Ajax event behaviors" warning

2012-11-02 Thread Alec Swan
Hello,

Our designer put together an HTML storyboard where navigation is
implemented with .
However, when we add a Wicket behavior to this button we start
receiving the following warning:

WARN  [http-bio-8080-exec-10] org.apache.wicket.ajax.AjaxEventBehavior
- org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1
{event='onclick'} assigned to [AjaxSubmitContentFormLink [Component id
= saveButton]] is overriding the previous value of the inline
attribute. Maybe there are several Ajax event behaviors on the same
type assigned to this component.

I don't want to break the storyboard and would like Wicket not to log
this warning in case when onclick is defined in markup and overridden
in Java code. How can I do that?

Thanks,

Alec

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



Re: Custom CSS for Feedback message is broken in 1.5

2012-11-02 Thread Alec Swan
I don't see 1.5.9 branch either and I don't see the changes in 1.5.x
branch. Martin, where did you check your changes in?

Thanks,

Alec

On Fri, Nov 2, 2012 at 12:56 PM, Sebastien  wrote:
> Hi Martin,
>
> Tested & approved! Works like a charm...
>
> I tested upon master branch (6.3.0-SNAPSHOT), because I do not see were
> wicket-1.5.9 branch is... But I guess it behaves exactly the same.
> Just a little note; on the version I pulled I still have class="errorlevel"
> in the associated markup (Sven's added a comment in the ticket about this,
> I don't know if you had it)...
>
> Thanks again & best regards,
> Sebastien.
>
> On Fri, Nov 2, 2012 at 6:08 PM, Martin Grigorov wrote:
>
>> Done!
>>
>> Please confirm that this is enough for now.
>>
>> On Fri, Nov 2, 2012 at 7:01 PM, Sebastien  wrote:
>> > Great! Thanks Martin!
>> >
>> > On Fri, Nov 2, 2012 at 5:01 PM, Martin Grigorov > >wrote:
>> >
>> >> I'll take care.
>> >>
>> >> On Fri, Nov 2, 2012 at 5:59 PM, Sebastien  wrote:
>> >> > Hi Alec,
>> >> >
>> >> > If Sven or Martin agree with this solution for 1.5.9 & 6.3.0, I can
>> >> attach
>> >> > the patch(es) to the opened ticket if needed. (but to replace a word
>> by
>> >> > another, I am not sure my support will help that much! :) )
>> >> >
>> >> > I also think that we can keep this AttributeAppender even with the
>> >> changes
>> >> > to be done for wicket7 (with the Martin's suggestion for instance). At
>> >> > least I do not see yet any potential issue / unexpected behavior that
>> can
>> >> > happens, and we keep the advantage it provides...
>> >> >
>> >> > Best regards,
>> >> > Sebastien.
>> >> >
>> >> > On Fri, Nov 2, 2012 at 4:21 PM, Alec Swan  wrote:
>> >> >
>> >> >> Sebastien, thanks for reviewing and approving the proposal. So, what
>> >> >> do we need to do to make it in 1.5.9? Or did you already check it in
>> >> >> there?
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> Alec
>> >> >>
>> >> >> On Thu, Nov 1, 2012 at 6:04 PM, Sebastien  wrote:
>> >> >> > Hi Alec,
>> >> >> >
>> >> >> > Thanks for having taking time to write the code snippet bellow, I
>> >> better
>> >> >> > understand your idea!..
>> >> >> > I did not realized you didn't want to use getCssClass, but I think
>> it
>> >> is
>> >> >> > good solution anyway! It is easy for the user to replace
>> >> >> > message.isInfo() ? ".my-ui-info" : ".my-ui-error"
>> >> >> > by its custom method: getMessageCssClass(message.getLevel()) or
>> >> something
>> >> >> > equivalent as we spoke before, so that's fine for me. Well done!
>> >> >> >
>> >> >> > Thanks again & best regards,
>> >> >> > Sebastien.
>> >> >> >
>> >>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>

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



Re: Custom CSS for Feedback message is broken in 1.5

2012-11-02 Thread Alec Swan
Sebastien, thanks for reviewing and approving the proposal. So, what
do we need to do to make it in 1.5.9? Or did you already check it in
there?

Thanks,

Alec

On Thu, Nov 1, 2012 at 6:04 PM, Sebastien  wrote:
> Hi Alec,
>
> Thanks for having taking time to write the code snippet bellow, I better
> understand your idea!..
> I did not realized you didn't want to use getCssClass, but I think it is
> good solution anyway! It is easy for the user to replace
> message.isInfo() ? ".my-ui-info" : ".my-ui-error"
> by its custom method: getMessageCssClass(message.getLevel()) or something
> equivalent as we spoke before, so that's fine for me. Well done!
>
> Thanks again & best regards,
> Sebastien.
>
>
> On Thu, Nov 1, 2012 at 11:57 PM, Alec Swan  wrote:
>
>> @Sebastien The scenario you described it exactly the scenario I used
>> to start this thread. Please read my original post.
>>
>> So, the solution is to change Wicket code
>> FeedbackPanel.MessageListView#populateItem to use  AttributeAppender
>> instead of AttributeModifier as I suggested in my previous message. In
>> addition, your code should override newMessageDisplayComponent(..) as
>> follows:
>>
>> protected Component newMessageDisplayComponent(String id,
>> FeedbackMessage message) {
>>   Component label = super.newMessageDisplayComponent(id, message);
>>   label.add(new AttributeAppender("class", new
>> Model(message.isInfo() ? ".my-ui-info" : ".my-ui-error"), "
>> "));
>>   return label;
>> }
>>
>> This will set the style you want on  and will leave  unmodified.
>>
>> Why doesn't it work for you?
>>
>> Thanks,
>>
>> Alec
>>
>> On Thu, Nov 1, 2012 at 9:55 AM, Sebastien  wrote:
>> > Hi,
>> >
>> > @Alec, the use case is the following:
>> > Consider you are not the "owner" of the css-class(es). The css provider
>> (a
>> > ui-framework, a designer, ...) will provide one style by message level
>> > (let's say .my-ui-warn, .my-ui-error, .my-ui-info, etc). So you will
>> > override #getCssClass in order to return the corresponding css-class
>> > depending of the level type (supplied as method's argument). But... the
>> > provided class/style is designed to be applied *only* to one element. So,
>> > if the css-class is applied onto both LI and SPAN, there will be a style
>> > overlap which will result to a bad display... As the
>> > message-level-css-class is *always* appended to both elements, there is
>> yet
>> > no other choice (I think) to have our own FeedbackPanel or extending the
>> > existing one with the "hack" I provided earlier...
>> >
>> > @Sven: Thanks for your suggestion! It would result to a different
>> component
>> > but it is certainly more relevant...
>> >
>> > Best regards,
>> > Sebastien.
>> >
>> >
>> > On Thu, Nov 1, 2012 at 4:17 PM, Sven Meier  wrote:
>> >
>> >> If you want to group messages you can easily use multiple feedback
>> panels,
>> >> each filtering by severity.
>> >>
>> >> Sven
>> >>
>> >> Sebastien  schrieb:
>> >>
>> >> >Hi,
>> >> >
>> >> >@Alec, unfortunately I think your workaround does not handle the case
>> we
>> >> do
>> >> >*not* want the message-level-css-class on the SPAN, and that we still
>> want
>> >> >it on the LI...
>> >> >
>> >> >@Sven, well if the refactoring is planned for Wicket 7 (a question will
>> >> >remain about doing something, backward compatible, for current
>> versions),
>> >> >then it changes things...
>> >> >Then, I would maybe have a request about this refactored
>> FeedbackPanel: I
>> >> >would like to be able to have/display messages grouped by levels (so
>> each
>> >> >level is enclosed in its own container). That would simply mean that
>> the
>> >> UL
>> >> >will becomes a repeater. For instance, if this 'grouping option' is not
>> >> >activated, the repeater will iterate only once, with all feedback
>> message
>> >> >of any level type. If it is activated, the repeater will iterate as
>> many
>> >> >times as there is distinct message level types. And, last but not
>> least,
>> >> we
>> >> >should be able to ap

Re: Custom CSS for Feedback message is broken in 1.5

2012-11-01 Thread Alec Swan
@Sebastien The scenario you described it exactly the scenario I used
to start this thread. Please read my original post.

So, the solution is to change Wicket code
FeedbackPanel.MessageListView#populateItem to use  AttributeAppender
instead of AttributeModifier as I suggested in my previous message. In
addition, your code should override newMessageDisplayComponent(..) as
follows:

protected Component newMessageDisplayComponent(String id,
FeedbackMessage message) {
  Component label = super.newMessageDisplayComponent(id, message);
  label.add(new AttributeAppender("class", new
Model(message.isInfo() ? ".my-ui-info" : ".my-ui-error"), "
"));
  return label;
}

This will set the style you want on  and will leave  unmodified.

Why doesn't it work for you?

Thanks,

Alec

On Thu, Nov 1, 2012 at 9:55 AM, Sebastien  wrote:
> Hi,
>
> @Alec, the use case is the following:
> Consider you are not the "owner" of the css-class(es). The css provider (a
> ui-framework, a designer, ...) will provide one style by message level
> (let's say .my-ui-warn, .my-ui-error, .my-ui-info, etc). So you will
> override #getCssClass in order to return the corresponding css-class
> depending of the level type (supplied as method's argument). But... the
> provided class/style is designed to be applied *only* to one element. So,
> if the css-class is applied onto both LI and SPAN, there will be a style
> overlap which will result to a bad display... As the
> message-level-css-class is *always* appended to both elements, there is yet
> no other choice (I think) to have our own FeedbackPanel or extending the
> existing one with the "hack" I provided earlier...
>
> @Sven: Thanks for your suggestion! It would result to a different component
> but it is certainly more relevant...
>
> Best regards,
> Sebastien.
>
>
> On Thu, Nov 1, 2012 at 4:17 PM, Sven Meier  wrote:
>
>> If you want to group messages you can easily use multiple feedback panels,
>> each filtering by severity.
>>
>> Sven
>>
>> Sebastien  schrieb:
>>
>> >Hi,
>> >
>> >@Alec, unfortunately I think your workaround does not handle the case we
>> do
>> >*not* want the message-level-css-class on the SPAN, and that we still want
>> >it on the LI...
>> >
>> >@Sven, well if the refactoring is planned for Wicket 7 (a question will
>> >remain about doing something, backward compatible, for current versions),
>> >then it changes things...
>> >Then, I would maybe have a request about this refactored FeedbackPanel: I
>> >would like to be able to have/display messages grouped by levels (so each
>> >level is enclosed in its own container). That would simply mean that the
>> UL
>> >will becomes a repeater. For instance, if this 'grouping option' is not
>> >activated, the repeater will iterate only once, with all feedback message
>> >of any level type. If it is activated, the repeater will iterate as many
>> >times as there is distinct message level types. And, last but not least,
>> we
>> >should be able to apply the message-level-css-class to this repeater (and
>> >be able to *not* apply it to LI nor SPAN... so the loop is looped*).
>> >
>> >If you, dev-team, think this request is not relevant for wicket-core,
>> >please keep in mind this need while refactoring so you may provide the
>> >necessary/accessible things for the user wishing to *override*
>> >FeedbackPanel to achieve this goal...
>> >
>> >Thanks in advance & best regards,
>> >Sebastien
>> >
>> >(*) hazardous translation from French...
>> >
>> >
>> >On Wed, Oct 31, 2012 at 11:37 PM, Alec Swan  wrote:
>> >
>> >> So, the patch can be applied to 1.5.8 and will replace
>> >> label.add(levelModifier);
>> >> with
>> >> label.add(new AttributeAppender("class", replacementModel))
>> >>
>> >> You may want to add AttributeAppender to  as well.
>> >>
>> >> Alec
>> >>
>> >> On Wed, Oct 31, 2012 at 4:33 PM, Alec Swan  wrote:
>> >> > I suggest that instead of overriding CSS class on the  you
>> >> > APPEND it to existing CSS classes. This will allow the user to specify
>> >> > their own  CSS class in newMessageDisplayComponent(..) AND will
>> >> > support backward compatibility.
>> >> >
>> >> > Sounds like a win-win to me. Thoughts?
>> >> >
>> >> > Thanks,
>> >> >
>> >> > 

Re: Custom CSS for Feedback message is broken in 1.5

2012-11-01 Thread Alec Swan
@Sebastien, my original post in this thread would have been satisfied
with my solution which appends the CSS class instead of replacing it.
And this solution is backward compatible.

If there is a different scenario which required *not* having a
message-level-css-class, maybe we should start a separate email thread
for it. BTW, in case I missed it in this email thread what is that
scenario?

Thanks,

Alec

On Thu, Nov 1, 2012 at 8:38 AM, Sebastien  wrote:
> Hi,
>
> @Alec, unfortunately I think your workaround does not handle the case we do
> *not* want the message-level-css-class on the SPAN, and that we still want
> it on the LI...
>
> @Sven, well if the refactoring is planned for Wicket 7 (a question will
> remain about doing something, backward compatible, for current versions),
> then it changes things...
> Then, I would maybe have a request about this refactored FeedbackPanel: I
> would like to be able to have/display messages grouped by levels (so each
> level is enclosed in its own container). That would simply mean that the UL
> will becomes a repeater. For instance, if this 'grouping option' is not
> activated, the repeater will iterate only once, with all feedback message
> of any level type. If it is activated, the repeater will iterate as many
> times as there is distinct message level types. And, last but not least, we
> should be able to apply the message-level-css-class to this repeater (and
> be able to *not* apply it to LI nor SPAN... so the loop is looped*).
>
> If you, dev-team, think this request is not relevant for wicket-core,
> please keep in mind this need while refactoring so you may provide the
> necessary/accessible things for the user wishing to *override*
> FeedbackPanel to achieve this goal...
>
> Thanks in advance & best regards,
> Sebastien
>
> (*) hazardous translation from French...
>
>
> On Wed, Oct 31, 2012 at 11:37 PM, Alec Swan  wrote:
>
>> So, the patch can be applied to 1.5.8 and will replace
>> label.add(levelModifier);
>> with
>> label.add(new AttributeAppender("class", replacementModel))
>>
>> You may want to add AttributeAppender to  as well.
>>
>> Alec
>>
>> On Wed, Oct 31, 2012 at 4:33 PM, Alec Swan  wrote:
>> > I suggest that instead of overriding CSS class on the  you
>> > APPEND it to existing CSS classes. This will allow the user to specify
>> > their own  CSS class in newMessageDisplayComponent(..) AND will
>> > support backward compatibility.
>> >
>> > Sounds like a win-win to me. Thoughts?
>> >
>> > Thanks,
>> >
>> > Alec
>> >
>> > On Wed, Oct 31, 2012 at 1:17 AM, Sven Meier  wrote:
>> >> Hi,
>> >>
>> >> the CSS class could be changed in Wicket 7 only. Until you've migrated
>> you
>> >> can easily just use your own feedback component.
>> >>
>> >> Best regards
>> >> Sven
>> >>
>> >>
>> >> On 10/30/2012 11:24 PM, Sebastien wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> I also agree with Martin's points. Having no css-class on the span is
>> the
>> >>> best solution from my point of view too.
>> >>> A little concern however. I think this kind of change is not exactly
>> >>> "backward compatible". Sure, it is, for the java side, but I figure
>> that
>> >>> *many* users have wrote their own CSS for feedback panels and this will
>> >>> probably results to bad display with this change. So, I am wondering if
>> >>> this change will be considered as an "API break"? If yes, will you
>> apply
>> >>> it
>> >>> also to 1.5.x (the original demand)? And, if the new version numbering
>> >>> system in place applies to 1.5.x, does that means that it should be
>> 1.6.0?
>> >>> You see what I mean... it could lead to some misunderstanding!..
>> >>>
>> >>> Also I like Sven's suggestion, but I am afraid that it will overlap
>> with
>> >>> #newMessageDisplayComponent(). As ListItem IS-A WebMarkupContainer, we
>> >>> could do any customization from here. But, in this case (there is a new
>> >>> #newMessageItem() method), the span element is not needed anymore and
>> >>> therefore #newMessageDisplayComponent() neither. So, about the API
>> break,
>> >>> we are in situation :)
>> >>>
>> >>> Thanks & best regards,
>> >>> Sebastien.
>> >&

Re: Custom CSS for Feedback message is broken in 1.5

2012-10-31 Thread Alec Swan
So, the patch can be applied to 1.5.8 and will replace
label.add(levelModifier);
with
label.add(new AttributeAppender("class", replacementModel))

You may want to add AttributeAppender to  as well.

Alec

On Wed, Oct 31, 2012 at 4:33 PM, Alec Swan  wrote:
> I suggest that instead of overriding CSS class on the  you
> APPEND it to existing CSS classes. This will allow the user to specify
> their own  CSS class in newMessageDisplayComponent(..) AND will
> support backward compatibility.
>
> Sounds like a win-win to me. Thoughts?
>
> Thanks,
>
> Alec
>
> On Wed, Oct 31, 2012 at 1:17 AM, Sven Meier  wrote:
>> Hi,
>>
>> the CSS class could be changed in Wicket 7 only. Until you've migrated you
>> can easily just use your own feedback component.
>>
>> Best regards
>> Sven
>>
>>
>> On 10/30/2012 11:24 PM, Sebastien wrote:
>>>
>>> Hi,
>>>
>>> I also agree with Martin's points. Having no css-class on the span is the
>>> best solution from my point of view too.
>>> A little concern however. I think this kind of change is not exactly
>>> "backward compatible". Sure, it is, for the java side, but I figure that
>>> *many* users have wrote their own CSS for feedback panels and this will
>>> probably results to bad display with this change. So, I am wondering if
>>> this change will be considered as an "API break"? If yes, will you apply
>>> it
>>> also to 1.5.x (the original demand)? And, if the new version numbering
>>> system in place applies to 1.5.x, does that means that it should be 1.6.0?
>>> You see what I mean... it could lead to some misunderstanding!..
>>>
>>> Also I like Sven's suggestion, but I am afraid that it will overlap with
>>> #newMessageDisplayComponent(). As ListItem IS-A WebMarkupContainer, we
>>> could do any customization from here. But, in this case (there is a new
>>> #newMessageItem() method), the span element is not needed anymore and
>>> therefore #newMessageDisplayComponent() neither. So, about the API break,
>>> we are in situation :)
>>>
>>> Thanks & best regards,
>>> Sebastien.
>>>
>>>
>>> On Mon, Oct 29, 2012 at 6:18 PM, Joachim Schrod  wrote:
>>>
>>>> Hi,
>>>>
>>>> This would change be very well received, from my side. :-) :-)
>>>>
>>>> Cheers,
>>>>  Joachim
>>>>
>>>>
>>>> Martin Grigorov wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> [X] Other suggestion: (please specify)
>>>>>
>>>>> Here is what I think it should be:
>>>>> -  element should have class "feedbackPanel" (this is already the
>>>>
>>>> case)
>>>>>
>>>>> -  element(s) should have class that specifies the feedback
>>>>> message level (currently by default Wicket sets "feedbackPanelLEVEL",
>>>>> but this is configurable with
>>>>>
>>>>
>>>> org.apache.wicket.markup.html.panel.FeedbackPanel#getCSSClass(FeedbackMessage))
>>>>>
>>>>> - the  should not have class at all (currently it has the same
>>>>> class as the  element)
>>>>> - the styling should be done with CSS selectors (e.g.
>>>>> div.feedbackPanel; div.feedbackPanel li.alert-warn; div.feedbackPanel
>>>>> li.alert-warn span; ...)
>>>>> - if custom markup is needed then a custom FeedbackPanel is needed
>>>>> (one that extends from the default FeedbackPanel or a completely new
>>>>> one, it depends on the use case)
>>>>>
>>>>>
>>>>> On Sun, Oct 28, 2012 at 6:03 PM, Sebastien  wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> To sum-up this thread: we have a (not huge, but still) design issue
>>>>>> that
>>>>>> annoys several users. A patch* has been provided but some questions
>>>>>> remains...
>>>>>> Given this, I would suggest a kind-of vote about the several points
>>>>>> discussed earlier, in order to enlighten the dev-team about the
>>>>
>>>> preferred
>>>>>>
>>>>>> choice of their (beloved) users.**
>>>>>>
>>>>>> Here are some possible options:
>>>

Re: Custom CSS for Feedback message is broken in 1.5

2012-10-31 Thread Alec Swan
I suggest that instead of overriding CSS class on the  you
APPEND it to existing CSS classes. This will allow the user to specify
their own  CSS class in newMessageDisplayComponent(..) AND will
support backward compatibility.

Sounds like a win-win to me. Thoughts?

Thanks,

Alec

On Wed, Oct 31, 2012 at 1:17 AM, Sven Meier  wrote:
> Hi,
>
> the CSS class could be changed in Wicket 7 only. Until you've migrated you
> can easily just use your own feedback component.
>
> Best regards
> Sven
>
>
> On 10/30/2012 11:24 PM, Sebastien wrote:
>>
>> Hi,
>>
>> I also agree with Martin's points. Having no css-class on the span is the
>> best solution from my point of view too.
>> A little concern however. I think this kind of change is not exactly
>> "backward compatible". Sure, it is, for the java side, but I figure that
>> *many* users have wrote their own CSS for feedback panels and this will
>> probably results to bad display with this change. So, I am wondering if
>> this change will be considered as an "API break"? If yes, will you apply
>> it
>> also to 1.5.x (the original demand)? And, if the new version numbering
>> system in place applies to 1.5.x, does that means that it should be 1.6.0?
>> You see what I mean... it could lead to some misunderstanding!..
>>
>> Also I like Sven's suggestion, but I am afraid that it will overlap with
>> #newMessageDisplayComponent(). As ListItem IS-A WebMarkupContainer, we
>> could do any customization from here. But, in this case (there is a new
>> #newMessageItem() method), the span element is not needed anymore and
>> therefore #newMessageDisplayComponent() neither. So, about the API break,
>> we are in situation :)
>>
>> Thanks & best regards,
>> Sebastien.
>>
>>
>> On Mon, Oct 29, 2012 at 6:18 PM, Joachim Schrod  wrote:
>>
>>> Hi,
>>>
>>> This would change be very well received, from my side. :-) :-)
>>>
>>> Cheers,
>>>  Joachim
>>>
>>>
>>> Martin Grigorov wrote:

 Hi,

 [X] Other suggestion: (please specify)

 Here is what I think it should be:
 -  element should have class "feedbackPanel" (this is already the
>>>
>>> case)

 -  element(s) should have class that specifies the feedback
 message level (currently by default Wicket sets "feedbackPanelLEVEL",
 but this is configurable with

>>>
>>> org.apache.wicket.markup.html.panel.FeedbackPanel#getCSSClass(FeedbackMessage))

 - the  should not have class at all (currently it has the same
 class as the  element)
 - the styling should be done with CSS selectors (e.g.
 div.feedbackPanel; div.feedbackPanel li.alert-warn; div.feedbackPanel
 li.alert-warn span; ...)
 - if custom markup is needed then a custom FeedbackPanel is needed
 (one that extends from the default FeedbackPanel or a completely new
 one, it depends on the use case)


 On Sun, Oct 28, 2012 at 6:03 PM, Sebastien  wrote:
>
> Hi,
>
> To sum-up this thread: we have a (not huge, but still) design issue
> that
> annoys several users. A patch* has been provided but some questions
> remains...
> Given this, I would suggest a kind-of vote about the several points
> discussed earlier, in order to enlighten the dev-team about the
>>>
>>> preferred
>
> choice of their (beloved) users.**
>
> Here are some possible options:
> [ ] Please apply the patch as-is. It currently provides 2 methods
> (#getListCSSClass and #getLabelCSSClass), #getCSSClass is marked a
> deprecated until marked as private (or removed)
> [ ] Do not apply the patch as-is, #getCSSClass should be kept (not
>>>
>>> marked
>
> as deprecated)
> [ ] Do not apply the patch as-is, I do not agree with the 2 method
>>>
>>> names. I
>
> would have preferred: (please specify)
> [ ] This is not an issue; this does not need to be "corrected"
> [ ] Other suggestion: (please specify)
>
> Thanks in advance for your contribution,
> Sebastien
>
> (*) https://issues.apache.org/jira/browse/WICKET-4831
> (**) Sure, dev-team opinion is also kindly asked! :)



>>>
>>>
>>>  Joachim
>>>
>>> --
>>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>>> Joachim Schrod, Roedermark, Germany
>>> Email: jsch...@acm.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: Custom CSS for Feedback message is broken in 1.5

2012-10-23 Thread Alec Swan
Sebastien, List, ListItem and Label make sense to me and match the
terms used in FeedbackPanel class. However, I try not to get too hung
up on naming for the sake of making progress :)

On Tue, Oct 23, 2012 at 3:39 PM, Sebastien  wrote:
> Alec, you are right, I did thought about that.
>
> My reflection was that getListCSS applies to list *element* (li) and it is
> quite easy to understand that getLabelCSS (which applies to the label)
> stands for the message itself (which is a span element).
>
> But in another hand we can imagine that these naming are related to wicket
> *component* instead; so, it is true that it would technically best to have
> getListItemCSS (applies to ListItem) and getLabelCSS (applies to Label).
> But what if the user overrides #newMessageDisplayComponent and return
> something other than a Label? A Panel for instance? Maybe getLabelCSS
> appears to not be logical anymore in this context: we have a getListItemCSS
> which still applies to a ListItem and a getLabelCSS which applies to... a
> Panel.
>
> In another hand (again), we can also imagine that the HTML markup is
> getting "overridden" (while extending FeedbackPanel), li and span elements
> may have been replaced by other elements (2 divs for instance)... So
> getListCSS may also not be logical in this context, and would have better
> been getContainerCSS or something like that...
>
> Not easy to find right naming; its a kind of Ouroboros* ** discussion in
> this case...
> But at the end, will the user better understand getListCSS or
> getListItemCSS? Also, is getLabelCSS the best? What about getMessageCSS?
>
> That's all open questions... I wish you a good night with that! ;)
> Sebastien
>
> * http://en.wikipedia.org/wiki/Ouroboros
> ** I am pretty sure this term has previously been used in this mailing list
> but I don't remember who... So there is a credit for someone somewhere :)
>
>
> On Tue, Oct 23, 2012 at 9:15 PM, Alec Swan  wrote:
>
>> Technically it should be getListItemCSS, not getListCSS. Or maybe have
>> all three getListCSS, getListItemCSS and getLabelCSS
>>
>> On Mon, Oct 22, 2012 at 12:46 PM, Sebastien  wrote:
>> > Done, https://issues.apache.org/jira/browse/WICKET-4831
>> > Please let me know if your encounter any issue (wrong base code for
>> > instance) or if you have any questions...
>> >
>> > Thanks,
>> > Sebastien.
>> >
>> > On Mon, Oct 22, 2012 at 8:06 PM, Sven Meier  wrote:
>> >
>> >> Please open a Jira issue and provide a patch as you suggested.
>> >>
>> >> Thanks
>> >> Sven
>> >>
>> >>
>> >>
>> >> On 10/21/2012 01:06 AM, Sebastien wrote:
>> >>
>> >>> Sven,
>> >>>
>> >>> If you agree to have two methods: getListCSSClass and getLabelCSSClass
>> >>> (which apply respectively on li and span), and mark getCSSClass as
>> >>> deprecated (until marked as private), then the path is ready for branch
>> >>> wicket-1.5.x. I am waiting for your go-ahead to send the patch
>> somewhere
>> >>> or
>> >>> submit the pull request on github.
>> >>>
>> >>> If you do not agree, please tell me what I can do.
>> >>>
>> >>> Thanks & best regards,
>> >>> Sebastien.
>> >>>
>> >>>
>> >>
>> >>
>> --**--**-
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<
>> 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: Custom CSS for Feedback message is broken in 1.5

2012-10-23 Thread Alec Swan
Technically it should be getListItemCSS, not getListCSS. Or maybe have
all three getListCSS, getListItemCSS and getLabelCSS

On Mon, Oct 22, 2012 at 12:46 PM, Sebastien  wrote:
> Done, https://issues.apache.org/jira/browse/WICKET-4831
> Please let me know if your encounter any issue (wrong base code for
> instance) or if you have any questions...
>
> Thanks,
> Sebastien.
>
> On Mon, Oct 22, 2012 at 8:06 PM, Sven Meier  wrote:
>
>> Please open a Jira issue and provide a patch as you suggested.
>>
>> Thanks
>> Sven
>>
>>
>>
>> On 10/21/2012 01:06 AM, Sebastien wrote:
>>
>>> Sven,
>>>
>>> If you agree to have two methods: getListCSSClass and getLabelCSSClass
>>> (which apply respectively on li and span), and mark getCSSClass as
>>> deprecated (until marked as private), then the path is ready for branch
>>> wicket-1.5.x. I am waiting for your go-ahead to send the patch somewhere
>>> or
>>> submit the pull request on github.
>>>
>>> If you do not agree, please tell me what I can do.
>>>
>>> Thanks & best regards,
>>> Sebastien.
>>>
>>>
>>
>> --**--**-
>> To unsubscribe, e-mail: 
>> users-unsubscribe@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: Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Alec Swan
Because if you use Twitter bootstrap and add "alert alert-info" CSS
classes, then it's not going to look nice if it's applied to  and
.

On Sat, Oct 20, 2012 at 3:05 PM, Sven Meier  wrote:
> I was just going to ask you why you don't overwrite #getCSSClass().
>
> What harm does it if the CSS class is on the  too?
>
> Sven
>
>
> On 10/20/2012 11:01 PM, Alec Swan wrote:
>>
>> Note that I need to set CSS styles on the label () and not the
>> list item () and hence cannot override getCSSClass() because it is
>> applied to both.
>>
>> On Sat, Oct 20, 2012 at 2:58 PM, Alec Swan  wrote:
>>>
>>> Hello,
>>>
>>> This Wiki page explains how to add custom CSS styles to Feedback
>>> messages in 1.4+:
>>> https://cwiki.apache.org/WICKET/css-enabled-feedback-panel.html
>>>
>>> Basically, it suggests that you override
>>> FeedbackPanel#newMessageDisplayComponent(..) method and add the custom
>>> CSS class to the component before returning it.
>>>
>>> However, this approach does not work in 1.5 because
>>> FeedbackPanel.MessageListView#populateItem calls
>>> FeedbackPanel#newMessageDisplayComponent(..) and then immediately adds
>>> an AttributeModifier that replaces CSS class that was set inside
>>> newMessageDisplayComponent().
>>>
>>> Is this a bug or Wiki is wrong?
>>> Is there any workaround without creating a custom FeedbackPanel?
>>>
>>> Thanks,
>>>
>>> Alec
>>
>> -
>> 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: Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Alec Swan
Note that I need to set CSS styles on the label () and not the
list item () and hence cannot override getCSSClass() because it is
applied to both.

On Sat, Oct 20, 2012 at 2:58 PM, Alec Swan  wrote:
> Hello,
>
> This Wiki page explains how to add custom CSS styles to Feedback
> messages in 1.4+:
> https://cwiki.apache.org/WICKET/css-enabled-feedback-panel.html
>
> Basically, it suggests that you override
> FeedbackPanel#newMessageDisplayComponent(..) method and add the custom
> CSS class to the component before returning it.
>
> However, this approach does not work in 1.5 because
> FeedbackPanel.MessageListView#populateItem calls
> FeedbackPanel#newMessageDisplayComponent(..) and then immediately adds
> an AttributeModifier that replaces CSS class that was set inside
> newMessageDisplayComponent().
>
> Is this a bug or Wiki is wrong?
> Is there any workaround without creating a custom FeedbackPanel?
>
> Thanks,
>
> Alec

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



Custom CSS for Feedback message is broken in 1.5

2012-10-20 Thread Alec Swan
Hello,

This Wiki page explains how to add custom CSS styles to Feedback
messages in 1.4+:
https://cwiki.apache.org/WICKET/css-enabled-feedback-panel.html

Basically, it suggests that you override
FeedbackPanel#newMessageDisplayComponent(..) method and add the custom
CSS class to the component before returning it.

However, this approach does not work in 1.5 because
FeedbackPanel.MessageListView#populateItem calls
FeedbackPanel#newMessageDisplayComponent(..) and then immediately adds
an AttributeModifier that replaces CSS class that was set inside
newMessageDisplayComponent().

Is this a bug or Wiki is wrong?
Is there any workaround without creating a custom FeedbackPanel?

Thanks,

Alec

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



Re: HybridUrlCodingStrategy in Wicket 1.5

2012-10-01 Thread Alec Swan
I updated https://cwiki.apache.org/confluence/display/WICKET/Request+mapping
with new information, moved things around and added a ToC. I hope it's
ok.

According to 
org.apache.wicket.request.mapper.parameter.UrlPathPageParametersEncoder
JavaDoc in 1.5 the default url coding strategy in 1.4 was
/param1Name/param1Value/param2Name/param2Value. Was there a reason why
it was changed to encoding parameters in the URL query string?

Thanks,

Alec

On Mon, Oct 1, 2012 at 2:06 AM, Martin Grigorov  wrote:
> Hi,
>
> On Sun, Sep 30, 2012 at 7:42 PM, Alec Swan  wrote:
>> Perfect, thanks! Might be a good idea to put this on
>> https://cwiki.apache.org/WICKET/request-mapping.html page since in 1.5
>> UrlPathPageParametersEncoder a direct replacement of the default url
>> mapping strategy in 1.4.
>
> I'm not sure that IHUCS was the default one in 1.4.
>
> Now is the time to contribute back to the community and add this
> information to the Wiki page.
> It is editable by everyone. You just need to create an account.
>
>>
>> On Sun, Sep 30, 2012 at 1:10 AM, Martin Grigorov  
>> wrote:
>>> It seems you actually used *Indexed*HybridUrlCodingStrategy.
>>>
>>> To have this you need UrlPathPageParametersEncoder. See MountedMapper
>>> constructors.
>>>
>>> On Sat, Sep 29, 2012 at 7:51 PM, Alec Swan  wrote:
>>>> Thanks, but I mentioned above that we have a lot of pages mounted
>>>> which take different parameters. So I need to accomplish this without
>>>> specifying parameter names explicitly.
>>>>
>>>> On Sat, Sep 29, 2012 at 10:44 AM, Carl-Eric Menzel
>>>>  wrote:
>>>>> On Sat, 29 Sep 2012 09:54:27 -0600
>>>>> Alec Swan  wrote:
>>>>>
>>>>>> mountPage("ms", MyPage.class) generates URLs like /lrm/ms?oid=123
>>>>>> What I would like is URLs like /lrm/ms/oid/123
>>>>>>
>>>>>> What's the easiest way to accomplish this?
>>>>>
>>>>> mountPage("ms/oid/${oid}", MyPage.class);
>>>>>
>>>>> The "ms/oid/" is just the string that will be part of the url, the
>>>>> "${oid}" means that whatever is at this point in the path will be
>>>>> available as a PageParameter with the name "oid".
>>>>>
>>>>> More details in the Javadoc of MountedMapper.
>>>>>
>>>>> Carl-Eric
>>>>>
>>>>> -
>>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: HybridUrlCodingStrategy in Wicket 1.5

2012-09-30 Thread Alec Swan
I am wondering why default URL encoding strategy was changed from
indexed to query parameters? What was the reasoning behind this
decision?

Thanks,

Alec

On Sun, Sep 30, 2012 at 10:42 AM, Alec Swan  wrote:
> Perfect, thanks! Might be a good idea to put this on
> https://cwiki.apache.org/WICKET/request-mapping.html page since in 1.5
> UrlPathPageParametersEncoder a direct replacement of the default url
> mapping strategy in 1.4.
>
> On Sun, Sep 30, 2012 at 1:10 AM, Martin Grigorov  wrote:
>> It seems you actually used *Indexed*HybridUrlCodingStrategy.
>>
>> To have this you need UrlPathPageParametersEncoder. See MountedMapper
>> constructors.
>>
>> On Sat, Sep 29, 2012 at 7:51 PM, Alec Swan  wrote:
>>> Thanks, but I mentioned above that we have a lot of pages mounted
>>> which take different parameters. So I need to accomplish this without
>>> specifying parameter names explicitly.
>>>
>>> On Sat, Sep 29, 2012 at 10:44 AM, Carl-Eric Menzel
>>>  wrote:
>>>> On Sat, 29 Sep 2012 09:54:27 -0600
>>>> Alec Swan  wrote:
>>>>
>>>>> mountPage("ms", MyPage.class) generates URLs like /lrm/ms?oid=123
>>>>> What I would like is URLs like /lrm/ms/oid/123
>>>>>
>>>>> What's the easiest way to accomplish this?
>>>>
>>>> mountPage("ms/oid/${oid}", MyPage.class);
>>>>
>>>> The "ms/oid/" is just the string that will be part of the url, the
>>>> "${oid}" means that whatever is at this point in the path will be
>>>> available as a PageParameter with the name "oid".
>>>>
>>>> More details in the Javadoc of MountedMapper.
>>>>
>>>> Carl-Eric
>>>>
>>>> -
>>>> 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
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>

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



Re: HybridUrlCodingStrategy in Wicket 1.5

2012-09-30 Thread Alec Swan
Perfect, thanks! Might be a good idea to put this on
https://cwiki.apache.org/WICKET/request-mapping.html page since in 1.5
UrlPathPageParametersEncoder a direct replacement of the default url
mapping strategy in 1.4.

On Sun, Sep 30, 2012 at 1:10 AM, Martin Grigorov  wrote:
> It seems you actually used *Indexed*HybridUrlCodingStrategy.
>
> To have this you need UrlPathPageParametersEncoder. See MountedMapper
> constructors.
>
> On Sat, Sep 29, 2012 at 7:51 PM, Alec Swan  wrote:
>> Thanks, but I mentioned above that we have a lot of pages mounted
>> which take different parameters. So I need to accomplish this without
>> specifying parameter names explicitly.
>>
>> On Sat, Sep 29, 2012 at 10:44 AM, Carl-Eric Menzel
>>  wrote:
>>> On Sat, 29 Sep 2012 09:54:27 -0600
>>> Alec Swan  wrote:
>>>
>>>> mountPage("ms", MyPage.class) generates URLs like /lrm/ms?oid=123
>>>> What I would like is URLs like /lrm/ms/oid/123
>>>>
>>>> What's the easiest way to accomplish this?
>>>
>>> mountPage("ms/oid/${oid}", MyPage.class);
>>>
>>> The "ms/oid/" is just the string that will be part of the url, the
>>> "${oid}" means that whatever is at this point in the path will be
>>> available as a PageParameter with the name "oid".
>>>
>>> More details in the Javadoc of MountedMapper.
>>>
>>> Carl-Eric
>>>
>>> -
>>> 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
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: HybridUrlCodingStrategy in Wicket 1.5

2012-09-29 Thread Alec Swan
Thanks, but I mentioned above that we have a lot of pages mounted
which take different parameters. So I need to accomplish this without
specifying parameter names explicitly.

On Sat, Sep 29, 2012 at 10:44 AM, Carl-Eric Menzel
 wrote:
> On Sat, 29 Sep 2012 09:54:27 -0600
> Alec Swan  wrote:
>
>> mountPage("ms", MyPage.class) generates URLs like /lrm/ms?oid=123
>> What I would like is URLs like /lrm/ms/oid/123
>>
>> What's the easiest way to accomplish this?
>
> mountPage("ms/oid/${oid}", MyPage.class);
>
> The "ms/oid/" is just the string that will be part of the url, the
> "${oid}" means that whatever is at this point in the path will be
> available as a PageParameter with the name "oid".
>
> More details in the Javadoc of MountedMapper.
>
> Carl-Eric
>
> -
> 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: HybridUrlCodingStrategy in Wicket 1.5

2012-09-29 Thread Alec Swan
mountPage("ms", MyPage.class) generates URLs like /lrm/ms?oid=123
What I would like is URLs like /lrm/ms/oid/123

What's the easiest way to accomplish this?

Thanks,

Alec

On Sat, Sep 29, 2012 at 1:23 AM, Martin Grigorov  wrote:
> Hi,
>
> MountedMapper is the replacement.
> WebApplication#mountPage() uses it.
>
> On Sat, Sep 29, 2012 at 1:51 AM, Alec Swan  wrote:
>> I'd like to clarify that we have a lot of pages mounted with
>> HybridUrlCodingStrategy, so I need to implement it in 1.5 without
>> knowing the names of parameters for each page.
>>
>> Thanks
>>
>> On Fri, Sep 28, 2012 at 4:47 PM, Alec Swan  wrote:
>>> Hello,
>>>
>>> What's the best way to implement HybridUrlCodingStrategy in Wicket 1.5?
>>> Also, is there a Wicket utility method that generates a URL given a
>>> base URL and page parameters?
>>>
>>> Thanks,
>>>
>>> Alec
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> 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: HybridUrlCodingStrategy in Wicket 1.5

2012-09-28 Thread Alec Swan
I'd like to clarify that we have a lot of pages mounted with
HybridUrlCodingStrategy, so I need to implement it in 1.5 without
knowing the names of parameters for each page.

Thanks

On Fri, Sep 28, 2012 at 4:47 PM, Alec Swan  wrote:
> Hello,
>
> What's the best way to implement HybridUrlCodingStrategy in Wicket 1.5?
> Also, is there a Wicket utility method that generates a URL given a
> base URL and page parameters?
>
> Thanks,
>
> Alec

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



Re: Exception handling and testing

2012-09-27 Thread Alec Swan
Thanks, works great.

I just needed to convert IRequestParameters to PageParameters in
RequestHandler#onException() in order to "remember" the tab selection
made by the user throughout login. Is there a convenience method
somewhere in wicket to convert between IRequestParameters and
PageParameters?

Thanks,

Ale

On Thu, Sep 27, 2012 at 1:18 AM, Martin Grigorov  wrote:
> Make the TabbedPanel stateless by using BookmarkablePageLink.
>
> P.S. Please start a new thread when you have new questions.
>
> On Wed, Sep 26, 2012 at 10:56 PM, Alec Swan  wrote:
>> Thanks, that worked as advertised. Now I am wondering if it's possible
>> to get this to work when the user click on a tab in TabbedPanel?
>> RenderPageRequestHandler(new PageProvider(HomePage.class),
>> ALWAYS_REDIRECT) seems to lose the knowledge of the tab selected by
>> the user and redirects the user to the default tab after he logs in on
>> HomePage.
>>
>> Thoughts?
>>
>> Thanks,
>>
>> Alec
>>
>> On Wed, Sep 26, 2012 at 12:52 AM, Martin Grigorov  
>> wrote:
>>> You have to return a IRequestHandler. See RenderPageRequestHandler
>>>
>>> On Wed, Sep 26, 2012 at 1:45 AM, Alec Swan  wrote:
>>>> I am trying to implement Martin's @SubSite annotation approach to
>>>> redirect the user to the sub-site's home page when
>>>> AuthenticationException is thrown in Wicket 1.5. However, apparently I
>>>> cannot throw a 
>>>> RestartResponseAtInterceptPageException(annotation.homePage())
>>>> from AbstractRequestCycleListener#onException. How else can I redirect
>>>> the user to the sub-site login page?
>>>>
>>>> The following RCH causes a 500 HTTP error page to be shown in the
>>>> browser when AuthenticationException is thrown.
>>>>
>>>> public class AuthenticationExceptionRequestCycleHandler extends
>>>> AbstractRequestCycleListener
>>>> {
>>>> @Override
>>>> public IRequestHandler onException(RequestCycle cycle, Exception ex) {
>>>> if (ex instanceof WicketRuntimeException &&
>>>> ex.getCause().getCause() instanceof AuthenticationException) {
>>>> IPageRequestHandler lastHandler =
>>>> PageRequestHandlerTracker.getLastHandler(cycle);
>>>> Class pageClass = lastHandler
>>>> == null ? null : lastHandler.getPageClass();
>>>> if (pageClass != null) {
>>>>     SubSite annotation = 
>>>> pageClass.getAnnotation(SubSite.class);
>>>> if (annotation != null && annotation.homePage() != null) {
>>>> throw new
>>>> RestartResponseAtInterceptPageException(annotation.homePage());
>>>> }
>>>> }
>>>> }
>>>> return super.onException(cycle, ex);
>>>> }
>>>> }
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Fri, Jun 8, 2012 at 2:54 PM, Alec Swan  wrote:
>>>>> I also use this approach, but with authentication exceptions thrown by
>>>>> Wicket it's hard to tell if the user was redirected to Login page
>>>>> because of authentication or some other exceptions.
>>>>>
>>>>> On Fri, Jun 8, 2012 at 1:15 PM, Michal Margiel  
>>>>> wrote:
>>>>>> 2012/6/8 Alec Swan 
>>>>>>
>>>>>>> That's clever. I will give it a try.
>>>>>>>
>>>>>>> What is the recommendation on verifying that an exception was thrown
>>>>>>> during page rendering using Wicket tester? I am not talking just about
>>>>>>> authentication here, but exceptions in general.
>>>>>>>
>>>>>>>
>>>>>> Hello,
>>>>>> Why you want to verify that exception was thrown in WicketTester? IMHO it
>>>>>> is not proper place to check that.
>>>>>> In my code I am verifying expcetions in services tests using
>>>>>> catch-exception library [1].
>>>>>>
>>>>>> And then while testing Page I am mocking my service to throw exception 
>>>>>> and
>>>>>> I am verifying behaviour on exception (e.g. redirecting to login page,
>>>>>> showing error message etc...)
>>>>>>
>>>>>> That makes not

Re: Exception handling and testing

2012-09-26 Thread Alec Swan
Thanks, that worked as advertised. Now I am wondering if it's possible
to get this to work when the user click on a tab in TabbedPanel?
RenderPageRequestHandler(new PageProvider(HomePage.class),
ALWAYS_REDIRECT) seems to lose the knowledge of the tab selected by
the user and redirects the user to the default tab after he logs in on
HomePage.

Thoughts?

Thanks,

Alec

On Wed, Sep 26, 2012 at 12:52 AM, Martin Grigorov  wrote:
> You have to return a IRequestHandler. See RenderPageRequestHandler
>
> On Wed, Sep 26, 2012 at 1:45 AM, Alec Swan  wrote:
>> I am trying to implement Martin's @SubSite annotation approach to
>> redirect the user to the sub-site's home page when
>> AuthenticationException is thrown in Wicket 1.5. However, apparently I
>> cannot throw a RestartResponseAtInterceptPageException(annotation.homePage())
>> from AbstractRequestCycleListener#onException. How else can I redirect
>> the user to the sub-site login page?
>>
>> The following RCH causes a 500 HTTP error page to be shown in the
>> browser when AuthenticationException is thrown.
>>
>> public class AuthenticationExceptionRequestCycleHandler extends
>> AbstractRequestCycleListener
>> {
>> @Override
>> public IRequestHandler onException(RequestCycle cycle, Exception ex) {
>> if (ex instanceof WicketRuntimeException &&
>> ex.getCause().getCause() instanceof AuthenticationException) {
>> IPageRequestHandler lastHandler =
>> PageRequestHandlerTracker.getLastHandler(cycle);
>> Class pageClass = lastHandler
>> == null ? null : lastHandler.getPageClass();
>> if (pageClass != null) {
>> SubSite annotation = pageClass.getAnnotation(SubSite.class);
>> if (annotation != null && annotation.homePage() != null) {
>> throw new
>> RestartResponseAtInterceptPageException(annotation.homePage());
>> }
>> }
>> }
>> return super.onException(cycle, ex);
>> }
>> }
>>
>> Thanks,
>>
>> Alec
>>
>> On Fri, Jun 8, 2012 at 2:54 PM, Alec Swan  wrote:
>>> I also use this approach, but with authentication exceptions thrown by
>>> Wicket it's hard to tell if the user was redirected to Login page
>>> because of authentication or some other exceptions.
>>>
>>> On Fri, Jun 8, 2012 at 1:15 PM, Michal Margiel  
>>> wrote:
>>>> 2012/6/8 Alec Swan 
>>>>
>>>>> That's clever. I will give it a try.
>>>>>
>>>>> What is the recommendation on verifying that an exception was thrown
>>>>> during page rendering using Wicket tester? I am not talking just about
>>>>> authentication here, but exceptions in general.
>>>>>
>>>>>
>>>> Hello,
>>>> Why you want to verify that exception was thrown in WicketTester? IMHO it
>>>> is not proper place to check that.
>>>> In my code I am verifying expcetions in services tests using
>>>> catch-exception library [1].
>>>>
>>>> And then while testing Page I am mocking my service to throw exception and
>>>> I am verifying behaviour on exception (e.g. redirecting to login page,
>>>> showing error message etc...)
>>>>
>>>> That makes not only clearer code but also simplify testing.
>>>> you can see example of services tests in [2] and page tests in [3]
>>>>
>>>> [1] http://code.google.com/p/catch-exception/
>>>> [2]
>>>> https://bitbucket.org/margielm/confitura/src/8599eae2ba00/src/test/java/jelatyna/services/UserServiceImplShould.java
>>>> [3]
>>>> https://bitbucket.org/margielm/confitura/src/8599eae2ba00/src/test/java/jelatyna/pages/admin/login/LoginPageShould.java
>>>> --
>>>> Pozdrawiam/Best regards
>>>> Michał Margiel
>>>>
>>>> http://www.confitura.pl (dawniej Javarsovia)
>>>> http://www.linkedin.com/in/MichalMargiel
>>>> http://www.margiel.eu
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> 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: Exception handling and testing

2012-09-25 Thread Alec Swan
I am trying to implement Martin's @SubSite annotation approach to
redirect the user to the sub-site's home page when
AuthenticationException is thrown in Wicket 1.5. However, apparently I
cannot throw a RestartResponseAtInterceptPageException(annotation.homePage())
from AbstractRequestCycleListener#onException. How else can I redirect
the user to the sub-site login page?

The following RCH causes a 500 HTTP error page to be shown in the
browser when AuthenticationException is thrown.

public class AuthenticationExceptionRequestCycleHandler extends
AbstractRequestCycleListener
{
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex) {
if (ex instanceof WicketRuntimeException &&
ex.getCause().getCause() instanceof AuthenticationException) {
IPageRequestHandler lastHandler =
PageRequestHandlerTracker.getLastHandler(cycle);
Class pageClass = lastHandler
== null ? null : lastHandler.getPageClass();
if (pageClass != null) {
SubSite annotation = pageClass.getAnnotation(SubSite.class);
if (annotation != null && annotation.homePage() != null) {
throw new
RestartResponseAtInterceptPageException(annotation.homePage());
}
}
}
return super.onException(cycle, ex);
}
}

Thanks,

Alec

On Fri, Jun 8, 2012 at 2:54 PM, Alec Swan  wrote:
> I also use this approach, but with authentication exceptions thrown by
> Wicket it's hard to tell if the user was redirected to Login page
> because of authentication or some other exceptions.
>
> On Fri, Jun 8, 2012 at 1:15 PM, Michal Margiel  
> wrote:
>> 2012/6/8 Alec Swan 
>>
>>> That's clever. I will give it a try.
>>>
>>> What is the recommendation on verifying that an exception was thrown
>>> during page rendering using Wicket tester? I am not talking just about
>>> authentication here, but exceptions in general.
>>>
>>>
>> Hello,
>> Why you want to verify that exception was thrown in WicketTester? IMHO it
>> is not proper place to check that.
>> In my code I am verifying expcetions in services tests using
>> catch-exception library [1].
>>
>> And then while testing Page I am mocking my service to throw exception and
>> I am verifying behaviour on exception (e.g. redirecting to login page,
>> showing error message etc...)
>>
>> That makes not only clearer code but also simplify testing.
>> you can see example of services tests in [2] and page tests in [3]
>>
>> [1] http://code.google.com/p/catch-exception/
>> [2]
>> https://bitbucket.org/margielm/confitura/src/8599eae2ba00/src/test/java/jelatyna/services/UserServiceImplShould.java
>> [3]
>> https://bitbucket.org/margielm/confitura/src/8599eae2ba00/src/test/java/jelatyna/pages/admin/login/LoginPageShould.java
>> --
>> Pozdrawiam/Best regards
>> Michał Margiel
>>
>> http://www.confitura.pl (dawniej Javarsovia)
>> http://www.linkedin.com/in/MichalMargiel
>> http://www.margiel.eu

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



Re: Wicket 1.5 migration questions

2012-09-13 Thread Alec Swan
Martin, I tried and came back :) Could you clarify how you suggest
response.renderCSSReference to pass parameters which are then
retrieved in ResourceReference#getName()

On Wed, Sep 12, 2012 at 4:26 PM, Alec Swan  wrote:
>> Maybe you could simply use
>> response.renderCSSReference(getRequest().getContextPath() + 
>> "/global/css/styles.css");
>> or is there a problem with it?
> That didn't fix request.getUrl().toString() returning an empty string
> when called from ResourceReference.getExtension()

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



Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
> Maybe you could simply use
> response.renderCSSReference(getRequest().getContextPath() + 
> "/global/css/styles.css");
> or is there a problem with it?
That didn't fix request.getUrl().toString() returning an empty string
when called from ResourceReference.getExtension()

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



Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
Thanks, Christoph.

I tested your implementation and was able to pull
global/css/styles.css from the browser.

However, the following code threw an exception:
response.renderCSSReference(new
MyPackageResourceReference(MyResources.class, "css/styles.css"),
"screen");

I also tried:
response.renderCSSReference(new
MyPackageResourceReference(MyResources.class,
"global/css/styles.css"), "screen");

In fact request.getUrl().toString() inside of getName() returns an
empty string when called from ResourceReference.getExtension().

Alec

On Wed, Sep 12, 2012 at 1:56 PM, Christoph Leiter
 wrote:
> On 12.09.2012 21:38, Alec Swan wrote:
>>>
>>> PackageResourceReference IS-A ResourceReference and neither has a no-arg
>>> constructor.
>>
>> My point exactly. That's why I can't just do mountResource("/global",
>> new MyRR()) as Martin suggested.
>
>
> My quick try:
>
> public class MyPackageResourceReference extends PackageResourceReference {
>
> private final String prefix;
>
> public MyPackageResourceReference(Class scope, String prefix) {
> super(scope, "dummy");
> this.prefix = prefix;
> }
>
> @Override
> public String getName() {
> Request request = RequestCycle.get().getRequest();
> String url = request.getUrl().toString();
> if (!url.startsWith(prefix)) {
> throw new IllegalStateException();
> }
> return url.substring(prefix.length());
> }
>
> }
>
> Use it like:
> mountResource("/global", new MyPackageResourceReference(MyResources.class,
> "global/"));
>
> It needs to know where it is mounted so it can remove the prefix. Maybe
> there's a more elegant way around this but it works.
>
>
> Christoph
>
>
> -
> 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 1.5 migration questions

2012-09-12 Thread Alec Swan
> PackageResourceReference IS-A ResourceReference and neither has a no-arg 
> constructor.
My point exactly. That's why I can't just do mountResource("/global",
new MyRR()) as Martin suggested.

> To see examples of how to implement your own PackageResourceReference take a
> look at its children such as CssResourceReference for example and how it
> initialized itself via the #getResource() method.
Yes, I already looked at samples and
PackageResourceReference#getResource implementation. Believe me I am
not a big fan of typing emails :)

I understand what Martin is suggesting but I don't see how I can call
mountResource("/global", new MyRR()) with no-arg MyRR constructor.
Moreover, I don't understand how or where to pass request parameters
so that they can be retrieved in my implementation of
ResourceReference#getName().

In 1.4 it was all straightforward:
Application.getSharedResources().putClassAlias(GlobalResourceScope.class,
"global")

And then different callers can invoke any of the following and have
all JavaScript URLs prefixed with global/.
request.renderJavaScript(new
GlobalJavascriptResourceReference(GlobalResourceScope.class,
"js/common.js"));
request.renderJavaScript(new
GlobalJavascriptResourceReference(GlobalResourceScope.class,
"js/events.js"));
request.renderJavaScript(new
GlobalJavascriptResourceReference(GlobalResourceScope.class,
"js/debug.js"));

Sorry for being so dense on this one.

Thanks,

Alec

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



Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
I tried Martin's approach but it didn't work because
RequestCycle.get().getRequest().getRequestParameters() is empty when
accessed from inside getName(). Maybe I am doing it wrong, so here are
some questions:
1. PackageResourceReference does not have a no-arg constructor, so
what parameter should I pass from MyPackageResourceReference() to
super(..)?
2. How are the callers supposed to use MyPackageResourceReference if
its constructor does not take parameters? In the past they would call
request.renderJavaScript(new
MyPackageResourceReference("relative/path/file.js")), but you suggest
that constructor is not taking any parameters.

Thanks,

Alec


On Wed, Sep 12, 2012 at 11:56 AM, Paul Bors  wrote:
> Hey Alec,
>
> I think Martin was referring to his earlier reply on Sep 06, 2012; 2:02pm 
> from the thread when he asked you to try and extend PackageResourceReference 
> and then mount your resources as:
> mountResource("/global", new MyPackageResourceReference())
>
> Give that a try and let us know how it works out :)
>
>  ~ Thank you,
>Paul Bors
>
> PS: Martin would know better, he's a developer on Wicket's team (you can tell 
> from his e-mail address).
> I'm just another fellow Wicket-er.
>
> -Original Message-
> From: Martin Grigorov [mailto:mgrigo...@apache.org]
> Sent: Wednesday, September 12, 2012 11:04 AM
> To: users@wicket.apache.org
> Subject: Re: Wicket 1.5 migration questions
>
> Hi Alec,
>
> See my previous response. Try it and then come back.
>
> On Wed, Sep 12, 2012 at 5:43 PM, Alec Swan  wrote:
>> Paul, I looked at IResource and ResourceReference classes but still
>> can't figure out how to implement an alternative to putClassAlias.
>>
>> In 1.4 you could do putClassAlias(GlobalResourceScope.class, "global")
>> and after that all new ResourceReference(GlobalResourceScope.class,
>> "relative/path/file.js") would automatically be accessible from
>> http://../global/relative/path/file.js. So, I could easily call
>> response.renderJavaScript(new
>> JavaScriptReference(GlobalResourceScope.class,
>> "relative/path/file.js")) anywhere in the code without mounting
>> relative/path/file.js explicitly in Application#init.
>>
>> In 1.5 I have three options: mountResource, mountPackage and
>> mount(IRequestMapper).
>>
>> mountResource requires me to mount each individual resource file in
>> Application, which is not what I want because we have a lot of
>> resource files and we add them often.
>> mountPackage works with pages only, but reflects the concept that I
>> need to implement for resource files.
>> mount(IRequestMapper) - I think I should be able to use this method to
>> implement what I want. I noticed that there are a few IRequestMapper
>> implementations, which one should I extend?
>>
>> Thanks,
>>
>> Alec
>>
>> On Tue, Sep 11, 2012 at 2:32 PM, Paul Bors  wrote:
>>> I never said that, I just gave you an alternate way of achieving the
>>> same thing :)
>>>
>>> I'm not familiar nor did I ever use the
>>> SharedResources#putClassAlias() method, but given the API for
>>> SharedResources it seems to have been moved or removed.
>>>
>>> Wicket 1.4.x (has it at):
>>> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/SharedResource
>>> s.html# putClassAlias(java.lang.Class, java.lang.String)
>>>
>>> Wicket 1.5.x (does not list it, at least not in the same class name):
>>> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/SharedResource
>>> s.html
>>>
>>> If adding the resources to the root of the war works, why bother?
>>> Unless you're packaging a reusable component or you use dynamic
>>> resources, but having a static URL might indicate otherwise.
>>>
>>> Take a look at IResource and the many different implementations of it
>>> and see which one can help you most, or implement your own either
>>> from scratch or extending an existing one :)
>>> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resour
>>> ce/IRes
>>> ource.html
>>>
>>> ~ Thank you,
>>>   Paul Bors
>>>
>>> -Original Message-
>>> From: Alec Swan [mailto:alecs...@gmail.com]
>>> Sent: Tuesday, September 11, 2012 11:42 AM
>>> To: users@wicket.apache.org
>>> Subject: Re: Wicket 1.5 migration questions
>>>
>>>> I take it by global you mean http://myServer:###/myWebApp/global?
>>> Yes.
>&g

Re: Wicket 1.5 migration questions

2012-09-12 Thread Alec Swan
Paul, I looked at IResource and ResourceReference classes but still
can't figure out how to implement an alternative to putClassAlias.

In 1.4 you could do putClassAlias(GlobalResourceScope.class, "global")
and after that all new ResourceReference(GlobalResourceScope.class,
"relative/path/file.js") would automatically be accessible from
http://../global/relative/path/file.js. So, I could easily call
response.renderJavaScript(new
JavaScriptReference(GlobalResourceScope.class,
"relative/path/file.js")) anywhere in the code without mounting
relative/path/file.js explicitly in Application#init.

In 1.5 I have three options: mountResource, mountPackage and
mount(IRequestMapper).

mountResource requires me to mount each individual resource file in
Application, which is not what I want because we have a lot of
resource files and we add them often.
mountPackage works with pages only, but reflects the concept that I
need to implement for resource files.
mount(IRequestMapper) - I think I should be able to use this method to
implement what I want. I noticed that there are a few IRequestMapper
implementations, which one should I extend?

Thanks,

Alec

On Tue, Sep 11, 2012 at 2:32 PM, Paul Bors  wrote:
> I never said that, I just gave you an alternate way of achieving the same
> thing :)
>
> I'm not familiar nor did I ever use the SharedResources#putClassAlias()
> method, but given the API for SharedResources it seems to have been moved or
> removed.
>
> Wicket 1.4.x (has it at):
> http://wicket.apache.org/apidocs/1.4/org/apache/wicket/SharedResources.html#
> putClassAlias(java.lang.Class, java.lang.String)
>
> Wicket 1.5.x (does not list it, at least not in the same class name):
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/SharedResources.html
>
> If adding the resources to the root of the war works, why bother?
> Unless you're packaging a reusable component or you use dynamic resources,
> but having a static URL might indicate otherwise.
>
> Take a look at IResource and the many different implementations of it and
> see which one can help you most, or implement your own either from scratch
> or extending an existing one :)
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/resource/IRes
> ource.html
>
> ~ Thank you,
>   Paul Bors
>
> -Original Message-
> From: Alec Swan [mailto:alecs...@gmail.com]
> Sent: Tuesday, September 11, 2012 11:42 AM
> To: users@wicket.apache.org
> Subject: Re: Wicket 1.5 migration questions
>
>> I take it by global you mean http://myServer:###/myWebApp/global?
> Yes.
>
>> If so, why don't you just add the folder to the root of your war?
> Good point, I could do that, but I'd rather keep my current folder
> structure.
>
> So, does it mean that putClassAlias functionality is gone in 1.5?
>
> Thanks,
>
> Alec
>
> -
> 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: Wicket 1.5 migration questions

2012-09-11 Thread Alec Swan
> I take it by global you mean http://myServer:###/myWebApp/global?
Yes.

> If so, why don't you just add the folder to the root of your war?
Good point, I could do that, but I'd rather keep my current folder structure.

So, does it mean that putClassAlias functionality is gone in 1.5?

Thanks,

Alec

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



Re: Wicket 1.5 migration questions

2012-09-10 Thread Alec Swan
Any update on this? How can I mount CSS and JS resources under
/global/ without having to do a mountResource() for every such file?

Thanks,

Alec

On Thu, Sep 6, 2012 at 12:07 PM, Alec Swan  wrote:
> But I want JavaScript files to be compresses by
> JavaScriptResourceReference and CSS be served as
> PackageResourceReference. How do I mount them both under /global URL
> suffix?
>
> On Thu, Sep 6, 2012 at 12:02 PM, Martin Grigorov  wrote:
>> extend PackageResourceReference and override its #getName() to read
>> the name from the request path/parameters
>> mountResource("/global", new MyPRR())
>>
>> On Thu, Sep 6, 2012 at 7:57 PM, Alec Swan  wrote:
>>> In 1.4 I had the following classes in com.myco.app.res package:
>>>
>>> GlobalJavascriptResourceReference extends JavaScriptResourceReference
>>> GlobalCompressedResourceReference extends PackageResourceReference
>>> GlobalResourceScope
>>>
>>> And Application had the following code:
>>> getSharedResources().putClassAlias(GlobalResourceScope.class, "global")
>>>
>>> The caller would add resources as follows:
>>> new GlobalJavascriptResourceReference(GlobalResourceScope.class,
>>> "js/common.js");
>>> new GlobalCompressedResourceReference(GlobalResourceScope.class,
>>> "css/styles.css");
>>>
>>> How should I port this to 1.5 so that I can still access
>>> http://../global/js/common.js and http://../global/js/styles.css?
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> On Tue, Sep 4, 2012 at 5:10 PM, Martin Grigorov  
>>> wrote:
>>>> On Tue, Sep 4, 2012 at 11:17 PM, Alec Swan  wrote:
>>>>> Well, mountPackage did not work for me either.
>>>>>
>>>>> Basically, what I want to do is access ALL resources in
>>>>> com.myco.app.res package with "global" URL prefix. For example, access
>>>>> a JavaScript file as global/events.js instead of
>>>>> ../wicket/resource/com.myco.app.res.GlobalResourceScope/events.js URL.
>>>>> In 1.4 it was simple with
>>>>> putClassAlias(com.myco.app.res.GlobalResourceScope, "global").
>>>>>
>>>>> How can I do this with 1.5?
>>>>
>>>> Why #mountResource() didn't work for you ?
>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>> On Tue, Sep 4, 2012 at 10:59 AM, Alec Swan  wrote:
>>>>>> Tom,
>>>>>>
>>>>>> I have com.myco.app.res.GlobalResourceScope.class and events.js in the
>>>>>> same package. So, putClassAlias(GlobalResourceScope.class, "global")
>>>>>> in 1.4 would allow me to access http://../app/global/events.js in the
>>>>>> browser.
>>>>>>
>>>>>> It seems like in 1.5 this is similar to mountPackage(String, Class>>>>> extends Page>) which means I have to change GlobalResourceScope class
>>>>>> to extend Page, right? Why does it need to be a Page?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Alec
>>>>>>
>>>>>> On Tue, Sep 4, 2012 at 9:42 AM, Thomas Götz  wrote:
>>>>>>> I didn't get your usecase exactly yet, but maybe this will help you:
>>>>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
>>>>>>>
>>>>>>> Cheers,
>>>>>>>-Tom
>>>>>>>
>>>>>>>
>>>>>>> On 04.09.2012, at 17:33, Alec Swan  wrote:
>>>>>>>
>>>>>>>> I saw the link explaining how to migrate
>>>>>>>> "SharedResources#putClassAlias(GlobalResourceScope.class, "global")"
>>>>>>>> before but was found it confusing because "global" and "images"
>>>>>>>> aliases 1.4 version were replaced with "imgres" in 1.5 example.
>>>>>>>>
>>>>>>>> All I need to do is use "global" in place of GlobalResourceScope.class
>>>>>>>> in the URLs. How do I do this in 1.5?
>>>>>>>
>>>>>>>
>>>>>>> -
>>>>>>> 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
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Martin Grigorov
>>>> jWeekend
>>>> Training, Consulting, Development
>>>> http://jWeekend.com
>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>

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



Re: Issues with default type conversion in 1.5

2012-09-09 Thread Alec Swan
Perfect, thanks for your help!

On Sun, Sep 9, 2012 at 3:13 PM, Sven Meier  wrote:
> Sorry, my statement was wrong:
> If you register your converter for Object and Serializable, everything
> should be fine.
>
> Sven
>
>
> On 09/09/2012 07:21 PM, Alec Swan wrote:
>>
>> In which case can it cause a ClassCastException?
>>
>> On Sun, Sep 9, 2012 at 6:25 AM, Sven Meier  wrote:
>>>>
>>>> public Object convertToObject(String value, Locale locale) { return
>>>> value;
>>>> }
>>>
>>> That might fail badly causing a ClassCastException but as long as it
>>> works
>>> for you ;).
>>>
>>> Thanks for creating the issue.
>>> Sven
>>>
>>>
>>>
>>> On 09/09/2012 09:22 AM, Alec Swan wrote:
>>>>
>>>> Here is a new JIRA https://issues.apache.org/jira/browse/WICKET-4755
>>>>
>>>> I added the following code in my application class to implement what
>>>> you recommended as a fix. Maybe this will help other people who run
>>>> into this problem. Does this look good to you?
>>>>
>>>>   @Override
>>>>   protected IConverterLocator newConverterLocator() {
>>>>   ConverterLocator locator = (ConverterLocator)
>>>> super.newConverterLocator();
>>>>   locator.set(Object.class, new BasicConverter());
>>>>   locator.set(Serializable.class, new BasicConverter());
>>>>   return locator;
>>>>   }
>>>>
>>>>   private static class BasicConverter implements IConverter
>>>>   {
>>>>   @Override
>>>>   public Object convertToObject(String value, Locale locale) {
>>>>   return value;
>>>>   }
>>>>
>>>>   @Override
>>>>   public String convertToString(Object value, Locale locale) {
>>>>   return value == null ? null : value.toString();
>>>>   }
>>>>   }
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Sat, Sep 8, 2012 at 3:47 PM, Sven Meier  wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Objects#convertValue()'s javadoc states that it returns null, if the
>>>>> value
>>>>> can not be converted, thus your proposed change isn't valid for most
>>>>> cases.
>>>>>
>>>>> You could easily fix this issue in your application by registering a
>>>>> custom
>>>>> converter for Serializable.
>>>>>
>>>>> Since Objects#convertValue() does more actually than "convert[ing]
>>>>> numerically" (as stated in the javadoc, it handles booleans and Strings
>>>>> too), I think the method could be improved, e.g by adding another
>>>>> if-statement to it:
>>>>>
>>>>>   if (toType.isInstance(value))
>>>>>   {
>>>>>   result = toType.cast(value);
>>>>>   }
>>>>>
>>>>> Please open an issue in Jira.
>>>>>
>>>>> Sven
>>>>>
>>>>>
>>>>>
>>>>> On 09/08/2012 09:11 PM, Alec Swan wrote:
>>>>>>
>>>>>> An easy fix for this bug is to change the first line in
>>>>>> org.apache.wicket.util.lang.Objects#convertValue from
>>>>>> Object result = null;
>>>>>> to
>>>>>> Object result = value;
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Alec
>>>>>>
>>>>>> On Sat, Sep 8, 2012 at 1:02 PM, Alec Swan  wrote:
>>>>>>>
>>>>>>> I attached a quickstart with a test in
>>>>>>> TestHomePage#formSubmitsSuccessfully.
>>>>>>>
>>>>>>> The test throws "'NEW VALUE' is not a valid Serializable" error when
>>>>>>> "NEW VALUE" string in "value" textField is submitted as a part of
>>>>>>> myForm ajax submission.
>>>>>>>
>>>>>>> This bug should have a high priority in 1.5 because this used to work
>>>>>>> in 1.4 and there is no clear way

Re: Setup Wicket in Eclipse without need to re-initialize the whole servlet container

2012-09-09 Thread Alec Swan
I had pretty good luck with JRebel. In addition I use
RemoteSyncronizer IntelliJ plugin to automatically copy HTML/JS/CSS
files from my source tree to webapp deployment dir.

Alec

On Sun, Sep 9, 2012 at 11:36 AM, Michael Mosmann  wrote:
> I have used run-jetty-run as eclipse plugin... If this is not enough, you 
> should use jrebel.
>
> Michael mosmann
>
>
>
> "seba.wag...@gmail.com"  schrieb:
>
>>Hi,
>>
>>we have set up Wicket in OpenMeetings and it is working fine!
>>
>>However the development cycle is pretty long:
>>Every change requires us to recompile and restart the servlet
>>container.
>>As we use Wicket + Spring + openJPA a restart takes around 20 seconds
>>+ compilations time, it takes around 30 seconds in total.
>>When working with UI components you regularly sit on your desk and
>>wait for this cycle to complete ;)
>>
>>Is there a way to develop and test Wicket more agile?
>>Is there some "Hot-plug" mechanism that does not require to reload the
>>whole servlet container with every change?
>>
>>Thanks!
>>Sebastian
>>
>>--
>>Sebastian Wagner
>>https://twitter.com/#!/dead_lock
>>http://www.webbase-design.de
>>http://www.wagner-sebastian.com
>>seba.wag...@gmail.com
>>
>>-
>>To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>For additional commands, e-mail: users-h...@wicket.apache.org
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

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



Re: Issues with default type conversion in 1.5

2012-09-09 Thread Alec Swan
In which case can it cause a ClassCastException?

On Sun, Sep 9, 2012 at 6:25 AM, Sven Meier  wrote:
>> public Object convertToObject(String value, Locale locale) { return value;
>> }
>
> That might fail badly causing a ClassCastException but as long as it works
> for you ;).
>
> Thanks for creating the issue.
> Sven
>
>
>
> On 09/09/2012 09:22 AM, Alec Swan wrote:
>>
>> Here is a new JIRA https://issues.apache.org/jira/browse/WICKET-4755
>>
>> I added the following code in my application class to implement what
>> you recommended as a fix. Maybe this will help other people who run
>> into this problem. Does this look good to you?
>>
>>  @Override
>>  protected IConverterLocator newConverterLocator() {
>>  ConverterLocator locator = (ConverterLocator)
>> super.newConverterLocator();
>>  locator.set(Object.class, new BasicConverter());
>>  locator.set(Serializable.class, new BasicConverter());
>>  return locator;
>>  }
>>
>>  private static class BasicConverter implements IConverter
>>  {
>>  @Override
>>  public Object convertToObject(String value, Locale locale) {
>>  return value;
>>  }
>>
>>  @Override
>>  public String convertToString(Object value, Locale locale) {
>>  return value == null ? null : value.toString();
>>  }
>>  }
>>
>>
>> Thanks,
>>
>> Alec
>>
>> On Sat, Sep 8, 2012 at 3:47 PM, Sven Meier  wrote:
>>>
>>> Hi,
>>>
>>> Objects#convertValue()'s javadoc states that it returns null, if the
>>> value
>>> can not be converted, thus your proposed change isn't valid for most
>>> cases.
>>>
>>> You could easily fix this issue in your application by registering a
>>> custom
>>> converter for Serializable.
>>>
>>> Since Objects#convertValue() does more actually than "convert[ing]
>>> numerically" (as stated in the javadoc, it handles booleans and Strings
>>> too), I think the method could be improved, e.g by adding another
>>> if-statement to it:
>>>
>>>  if (toType.isInstance(value))
>>>  {
>>>  result = toType.cast(value);
>>>  }
>>>
>>> Please open an issue in Jira.
>>>
>>> Sven
>>>
>>>
>>>
>>> On 09/08/2012 09:11 PM, Alec Swan wrote:
>>>>
>>>> An easy fix for this bug is to change the first line in
>>>> org.apache.wicket.util.lang.Objects#convertValue from
>>>> Object result = null;
>>>> to
>>>> Object result = value;
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Sat, Sep 8, 2012 at 1:02 PM, Alec Swan  wrote:
>>>>>
>>>>> I attached a quickstart with a test in
>>>>> TestHomePage#formSubmitsSuccessfully.
>>>>>
>>>>> The test throws "'NEW VALUE' is not a valid Serializable" error when
>>>>> "NEW VALUE" string in "value" textField is submitted as a part of
>>>>> myForm ajax submission.
>>>>>
>>>>> This bug should have a high priority in 1.5 because this used to work
>>>>> in 1.4 and there is no clear way to track down all places where this
>>>>> needs to be fixed in the existing code base.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>> On Sat, Sep 8, 2012 at 12:16 AM, Paul Bors  wrote:
>>>>>>
>>>>>> Can you please put together a quick start for us?
>>>>>>
>>>>>> ~ Thank you,
>>>>>>  Paul C Bors
>>>>>>
>>>>>> On Sep 7, 2012, at 14:39, Alec Swan  wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I decided to extract this issue into a separate thread.
>>>>>>>
>>>>>>> I keep running into issues with default type converters in 1.5. I
>>>>>>> also
>>>>>>> think I found a bug in
>>>>>>> org.apache.wicket.util.lang.Objects#convertValue. A call to
>>>>>>> convertValue(nonNullNonArrayValue, Object.class) will always return
>>>

Re: Issues with default type conversion in 1.5

2012-09-09 Thread Alec Swan
Here is a new JIRA https://issues.apache.org/jira/browse/WICKET-4755

I added the following code in my application class to implement what
you recommended as a fix. Maybe this will help other people who run
into this problem. Does this look good to you?

@Override
protected IConverterLocator newConverterLocator() {
ConverterLocator locator = (ConverterLocator)
super.newConverterLocator();
locator.set(Object.class, new BasicConverter());
locator.set(Serializable.class, new BasicConverter());
return locator;
}

private static class BasicConverter implements IConverter
{
@Override
public Object convertToObject(String value, Locale locale) {
return value;
}

@Override
public String convertToString(Object value, Locale locale) {
return value == null ? null : value.toString();
}
}


Thanks,

Alec

On Sat, Sep 8, 2012 at 3:47 PM, Sven Meier  wrote:
> Hi,
>
> Objects#convertValue()'s javadoc states that it returns null, if the value
> can not be converted, thus your proposed change isn't valid for most cases.
>
> You could easily fix this issue in your application by registering a custom
> converter for Serializable.
>
> Since Objects#convertValue() does more actually than "convert[ing]
> numerically" (as stated in the javadoc, it handles booleans and Strings
> too), I think the method could be improved, e.g by adding another
> if-statement to it:
>
> if (toType.isInstance(value))
> {
> result = toType.cast(value);
> }
>
> Please open an issue in Jira.
>
> Sven
>
>
>
> On 09/08/2012 09:11 PM, Alec Swan wrote:
>>
>> An easy fix for this bug is to change the first line in
>> org.apache.wicket.util.lang.Objects#convertValue from
>> Object result = null;
>> to
>> Object result = value;
>>
>> Thanks,
>>
>> Alec
>>
>> On Sat, Sep 8, 2012 at 1:02 PM, Alec Swan  wrote:
>>>
>>> I attached a quickstart with a test in
>>> TestHomePage#formSubmitsSuccessfully.
>>>
>>> The test throws "'NEW VALUE' is not a valid Serializable" error when
>>> "NEW VALUE" string in "value" textField is submitted as a part of
>>> myForm ajax submission.
>>>
>>> This bug should have a high priority in 1.5 because this used to work
>>> in 1.4 and there is no clear way to track down all places where this
>>> needs to be fixed in the existing code base.
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> On Sat, Sep 8, 2012 at 12:16 AM, Paul Bors  wrote:
>>>>
>>>> Can you please put together a quick start for us?
>>>>
>>>> ~ Thank you,
>>>> Paul C Bors
>>>>
>>>> On Sep 7, 2012, at 14:39, Alec Swan  wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I decided to extract this issue into a separate thread.
>>>>>
>>>>> I keep running into issues with default type converters in 1.5. I also
>>>>> think I found a bug in
>>>>> org.apache.wicket.util.lang.Objects#convertValue. A call to
>>>>> convertValue(nonNullNonArrayValue, Object.class) will always return
>>>>> null if nonNullNonArrayValue is a value that is not null and not an
>>>>> array! Shouldn't it always return the first parameter when the second
>>>>> parameter is Object.class?
>>>>>
>>>>> Is this a legitimate bug?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>> -
>>>>> 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: Issues with default type conversion in 1.5

2012-09-08 Thread Alec Swan
An easy fix for this bug is to change the first line in
org.apache.wicket.util.lang.Objects#convertValue from
Object result = null;
to
Object result = value;

Thanks,

Alec

On Sat, Sep 8, 2012 at 1:02 PM, Alec Swan  wrote:
> I attached a quickstart with a test in TestHomePage#formSubmitsSuccessfully.
>
> The test throws "'NEW VALUE' is not a valid Serializable" error when
> "NEW VALUE" string in "value" textField is submitted as a part of
> myForm ajax submission.
>
> This bug should have a high priority in 1.5 because this used to work
> in 1.4 and there is no clear way to track down all places where this
> needs to be fixed in the existing code base.
>
> Thanks,
>
> Alec
>
> On Sat, Sep 8, 2012 at 12:16 AM, Paul Bors  wrote:
>> Can you please put together a quick start for us?
>>
>> ~ Thank you,
>>Paul C Bors
>>
>> On Sep 7, 2012, at 14:39, Alec Swan  wrote:
>>
>>> Hello,
>>>
>>> I decided to extract this issue into a separate thread.
>>>
>>> I keep running into issues with default type converters in 1.5. I also
>>> think I found a bug in
>>> org.apache.wicket.util.lang.Objects#convertValue. A call to
>>> convertValue(nonNullNonArrayValue, Object.class) will always return
>>> null if nonNullNonArrayValue is a value that is not null and not an
>>> array! Shouldn't it always return the first parameter when the second
>>> parameter is Object.class?
>>>
>>> Is this a legitimate bug?
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> -
>>> 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: Migration to 1.5: 'X' is not a valid Serializable

2012-09-07 Thread Alec Swan
> As you must have figured it out by now if you do not specify a type for the
> form field then Wicket converts the input via
> FormComponet#convertValue(getInputAsArray()) which is what your code hits
> and the type passed to it is not Object.class but rather String[].
I just opened a new thread which describes the bug in
Objects#convertValue which describes the problem.

> If you use generics or specify the type then Wicket knows what IConverter to
> use.
I keep getting hung up on what you mean by "if you use generics ..
then Wicket knows what IConverter to use". Can you explain this? Maybe
give an example?

> In one of your replies you referred to
> "EditableLabel(..).setType(String.class)" and I take it EditableLabel is
> nothing but a compound FormComponent which would explain why it works for
> you when you call #setType().
Correct.

> Personally I upgraded from 1.3.7 to 1.5.8 and even though I'm not done
> refactoring the entire webapp, I haven't yet run into the problem you first
> described. Perhaps you should create a quick start so that we can all
> reproduce your problem on our own to better help you?
I will create a quickstart if it turns out that the problem I
described in Objects#convertValue is not a bug.

Thanks,

Alec

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



Issues with default type conversion in 1.5

2012-09-07 Thread Alec Swan
Hello,

I decided to extract this issue into a separate thread.

I keep running into issues with default type converters in 1.5. I also
think I found a bug in
org.apache.wicket.util.lang.Objects#convertValue. A call to
convertValue(nonNullNonArrayValue, Object.class) will always return
null if nonNullNonArrayValue is a value that is not null and not an
array! Shouldn't it always return the first parameter when the second
parameter is Object.class?

Is this a legitimate bug?

Thanks,

Alec

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



Re: Migration to 1.5: 'X' is not a valid Serializable

2012-09-07 Thread Alec Swan
> // Via generics
Paul, I am not seeing this comment in the actual code. I am assuming
that you added this comment to clarify something for me, but I am not
getting it.

> Thus if you use generics your problem would most likely go away
Are you saying that Wicket has a different code path for models
defined as new Model(x) and new Model(x)? It's impossible
because  information is lost at runtime.

> , otherwise you would have to suffer a bit and you should porb call setType() 
> so Wicket
> would know what implementation of IConverter to use.
Default type converters worked well in 1.4 and in 1.5 require
setType() in some situations. How can I track down all the components
in my code that require setType() 1.5?

Thanks,

Alec

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



Re: Migration to 1.5: 'X' is not a valid Serializable

2012-09-06 Thread Alec Swan
> Besides calling #setType() do you actually use generics with your models and
> components?
Sorry, don't quite understand the question. I am not calling setType()
hence the problems with type detection in Wicket. Why is it important
if I use generics if they are only compile-time syntactic sugar?

> See also:
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/html/form/Form
> Component.html#setType(java.lang.Class)
I don't call setType() and the type passed to Objects#convertValue is
Object.class, not String.class, as you would assume from  the JavaDoc
that String.class would be used.

> And the model changes done in 1.4:
> https://cwiki.apache.org/WICKET/migrating-to-wicket-14.html#MigratingtoWicke
> t1.4-Modelchanges
I am migrating from 1.4, so I was using information from this link.

Thanks,

Alec

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



Re: Migration to 1.5: 'X' is not a valid Serializable

2012-09-06 Thread Alec Swan
The fix for this is the same as for the "X is not a valid
Serializable", specifically: new
EditableLabel(..).setType(String.class)

Is there anybody who thinks that requiring setType(..) call on all
components which models don't resolve to a supported type is huge
problem?

Can this be fixed in 1.5.9?


Alec

On Thu, Sep 6, 2012 at 2:41 PM, Alec Swan  wrote:
> I just ran into another problem with type resolution. In fact, it
> looks like a bug in org.apache.wicket.util.lang.Objects#convertValue.
> The call convertValue(nonNullNonArrayValue, Object.class) will always
> return null if nonNullNonArrayValue is a value that is not null and
> not an array!
>
> Is that a legitimate bug?
>
> Thanks,
>
> Alec
>
> On Wed, Sep 5, 2012 at 1:12 AM, dpmihai  wrote:
>> see this:
>> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-td4585991.html#a4586026
>>
>>
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Migration-to-1-5-X-is-not-a-valid-Serializable-tp4651757p4651764.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>

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



Re: Migration to 1.5: 'X' is not a valid Serializable

2012-09-06 Thread Alec Swan
I just ran into another problem with type resolution. In fact, it
looks like a bug in org.apache.wicket.util.lang.Objects#convertValue.
The call convertValue(nonNullNonArrayValue, Object.class) will always
return null if nonNullNonArrayValue is a value that is not null and
not an array!

Is that a legitimate bug?

Thanks,

Alec

On Wed, Sep 5, 2012 at 1:12 AM, dpmihai  wrote:
> see this:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-ListMultipleChoice-add-Serializable-values-td4585991.html#a4586026
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Migration-to-1-5-X-is-not-a-valid-Serializable-tp4651757p4651764.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Wicket 1.5 migration questions

2012-09-06 Thread Alec Swan
But I want JavaScript files to be compresses by
JavaScriptResourceReference and CSS be served as
PackageResourceReference. How do I mount them both under /global URL
suffix?

On Thu, Sep 6, 2012 at 12:02 PM, Martin Grigorov  wrote:
> extend PackageResourceReference and override its #getName() to read
> the name from the request path/parameters
> mountResource("/global", new MyPRR())
>
> On Thu, Sep 6, 2012 at 7:57 PM, Alec Swan  wrote:
>> In 1.4 I had the following classes in com.myco.app.res package:
>>
>> GlobalJavascriptResourceReference extends JavaScriptResourceReference
>> GlobalCompressedResourceReference extends PackageResourceReference
>> GlobalResourceScope
>>
>> And Application had the following code:
>> getSharedResources().putClassAlias(GlobalResourceScope.class, "global")
>>
>> The caller would add resources as follows:
>> new GlobalJavascriptResourceReference(GlobalResourceScope.class,
>> "js/common.js");
>> new GlobalCompressedResourceReference(GlobalResourceScope.class,
>> "css/styles.css");
>>
>> How should I port this to 1.5 so that I can still access
>> http://../global/js/common.js and http://../global/js/styles.css?
>>
>> Thanks,
>>
>> Alec
>>
>> On Tue, Sep 4, 2012 at 5:10 PM, Martin Grigorov  wrote:
>>> On Tue, Sep 4, 2012 at 11:17 PM, Alec Swan  wrote:
>>>> Well, mountPackage did not work for me either.
>>>>
>>>> Basically, what I want to do is access ALL resources in
>>>> com.myco.app.res package with "global" URL prefix. For example, access
>>>> a JavaScript file as global/events.js instead of
>>>> ../wicket/resource/com.myco.app.res.GlobalResourceScope/events.js URL.
>>>> In 1.4 it was simple with
>>>> putClassAlias(com.myco.app.res.GlobalResourceScope, "global").
>>>>
>>>> How can I do this with 1.5?
>>>
>>> Why #mountResource() didn't work for you ?
>>>
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Tue, Sep 4, 2012 at 10:59 AM, Alec Swan  wrote:
>>>>> Tom,
>>>>>
>>>>> I have com.myco.app.res.GlobalResourceScope.class and events.js in the
>>>>> same package. So, putClassAlias(GlobalResourceScope.class, "global")
>>>>> in 1.4 would allow me to access http://../app/global/events.js in the
>>>>> browser.
>>>>>
>>>>> It seems like in 1.5 this is similar to mountPackage(String, Class>>>> extends Page>) which means I have to change GlobalResourceScope class
>>>>> to extend Page, right? Why does it need to be a Page?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>> On Tue, Sep 4, 2012 at 9:42 AM, Thomas Götz  wrote:
>>>>>> I didn't get your usecase exactly yet, but maybe this will help you:
>>>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
>>>>>>
>>>>>> Cheers,
>>>>>>-Tom
>>>>>>
>>>>>>
>>>>>> On 04.09.2012, at 17:33, Alec Swan  wrote:
>>>>>>
>>>>>>> I saw the link explaining how to migrate
>>>>>>> "SharedResources#putClassAlias(GlobalResourceScope.class, "global")"
>>>>>>> before but was found it confusing because "global" and "images"
>>>>>>> aliases 1.4 version were replaced with "imgres" in 1.5 example.
>>>>>>>
>>>>>>> All I need to do is use "global" in place of GlobalResourceScope.class
>>>>>>> in the URLs. How do I do this in 1.5?
>>>>>>
>>>>>>
>>>>>> -
>>>>>> 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
>>>>
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Wicket 1.5 migration questions

2012-09-06 Thread Alec Swan
In 1.4 I had the following classes in com.myco.app.res package:

GlobalJavascriptResourceReference extends JavaScriptResourceReference
GlobalCompressedResourceReference extends PackageResourceReference
GlobalResourceScope

And Application had the following code:
getSharedResources().putClassAlias(GlobalResourceScope.class, "global")

The caller would add resources as follows:
new GlobalJavascriptResourceReference(GlobalResourceScope.class,
"js/common.js");
new GlobalCompressedResourceReference(GlobalResourceScope.class,
"css/styles.css");

How should I port this to 1.5 so that I can still access
http://../global/js/common.js and http://../global/js/styles.css?

Thanks,

Alec

On Tue, Sep 4, 2012 at 5:10 PM, Martin Grigorov  wrote:
> On Tue, Sep 4, 2012 at 11:17 PM, Alec Swan  wrote:
>> Well, mountPackage did not work for me either.
>>
>> Basically, what I want to do is access ALL resources in
>> com.myco.app.res package with "global" URL prefix. For example, access
>> a JavaScript file as global/events.js instead of
>> ../wicket/resource/com.myco.app.res.GlobalResourceScope/events.js URL.
>> In 1.4 it was simple with
>> putClassAlias(com.myco.app.res.GlobalResourceScope, "global").
>>
>> How can I do this with 1.5?
>
> Why #mountResource() didn't work for you ?
>
>>
>> Thanks,
>>
>> Alec
>>
>> On Tue, Sep 4, 2012 at 10:59 AM, Alec Swan  wrote:
>>> Tom,
>>>
>>> I have com.myco.app.res.GlobalResourceScope.class and events.js in the
>>> same package. So, putClassAlias(GlobalResourceScope.class, "global")
>>> in 1.4 would allow me to access http://../app/global/events.js in the
>>> browser.
>>>
>>> It seems like in 1.5 this is similar to mountPackage(String, Class>> extends Page>) which means I have to change GlobalResourceScope class
>>> to extend Page, right? Why does it need to be a Page?
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> On Tue, Sep 4, 2012 at 9:42 AM, Thomas Götz  wrote:
>>>> I didn't get your usecase exactly yet, but maybe this will help you:
>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
>>>>
>>>> Cheers,
>>>>-Tom
>>>>
>>>>
>>>> On 04.09.2012, at 17:33, Alec Swan  wrote:
>>>>
>>>>> I saw the link explaining how to migrate
>>>>> "SharedResources#putClassAlias(GlobalResourceScope.class, "global")"
>>>>> before but was found it confusing because "global" and "images"
>>>>> aliases 1.4 version were replaced with "imgres" in 1.5 example.
>>>>>
>>>>> All I need to do is use "global" in place of GlobalResourceScope.class
>>>>> in the URLs. How do I do this in 1.5?
>>>>
>>>>
>>>> -
>>>> 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
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Migration to 1.5: 'X' is not a valid Serializable

2012-09-04 Thread Alec Swan
Hello,

I ran into another problem while migrating to 1.5. I have a form with
a TextField(new PropertyModel(obj, "value")). The test
that fills and submitts the form in 1.4 worked just fine. In 1.5 I get
an error "'X' is not a valid Serializable" where 'X' is what's
returned from obj.getValue() method.

The problem is that in 1.5 Wicket uses static type analysis based on
getValue() return type, which in my case is Serializable. This check
is done in 
org.apache.wicket.markup.html.form.AbstractTextComponent#getModelType.

This is a pretty bad change because now every Component that used to
work with Serializable models now require the user to set the type
explicitly! Is there a way to fix this without having to change all
such components?

Thanks,

Alec

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



Re: Wicket 1.5 migration questions

2012-09-04 Thread Alec Swan
Well, mountPackage did not work for me either.

Basically, what I want to do is access ALL resources in
com.myco.app.res package with "global" URL prefix. For example, access
a JavaScript file as global/events.js instead of
../wicket/resource/com.myco.app.res.GlobalResourceScope/events.js URL.
In 1.4 it was simple with
putClassAlias(com.myco.app.res.GlobalResourceScope, "global").

How can I do this with 1.5?

Thanks,

Alec

On Tue, Sep 4, 2012 at 10:59 AM, Alec Swan  wrote:
> Tom,
>
> I have com.myco.app.res.GlobalResourceScope.class and events.js in the
> same package. So, putClassAlias(GlobalResourceScope.class, "global")
> in 1.4 would allow me to access http://../app/global/events.js in the
> browser.
>
> It seems like in 1.5 this is similar to mountPackage(String, Class extends Page>) which means I have to change GlobalResourceScope class
> to extend Page, right? Why does it need to be a Page?
>
> Thanks,
>
> Alec
>
> On Tue, Sep 4, 2012 at 9:42 AM, Thomas Götz  wrote:
>> I didn't get your usecase exactly yet, but maybe this will help you:
>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
>>
>> Cheers,
>>-Tom
>>
>>
>> On 04.09.2012, at 17:33, Alec Swan  wrote:
>>
>>> I saw the link explaining how to migrate
>>> "SharedResources#putClassAlias(GlobalResourceScope.class, "global")"
>>> before but was found it confusing because "global" and "images"
>>> aliases 1.4 version were replaced with "imgres" in 1.5 example.
>>>
>>> All I need to do is use "global" in place of GlobalResourceScope.class
>>> in the URLs. How do I do this in 1.5?
>>
>>
>> -
>> 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: Migration to 1.5: BaseWicketTester#startPanel

2012-09-04 Thread Alec Swan
Thanks for the info. I hope there are plans to clean up WicketTester
because the simplicity of testing Wicket components that it provides
is a very important Wicket feature.

Alec

On Tue, Sep 4, 2012 at 1:46 PM, Igor Vaynberg  wrote:
> we migrated from 1.4.x to 1.5.x. but, we use selenium to test ui
> instead of wicket tester :)
>
> -igor
>
> On Tue, Sep 4, 2012 at 12:07 PM, Alec Swan  wrote:
>> This makes me wonder how many big apps actually migrated from 1.4 to
>> 1.5 (instead of starting from scratch) if this problem has never been
>> discovered. I also noticed that getComponentFromLastRenderedPage
>> assumes that the id of the instantiated component is different from
>> the id of it's first child (if (path.startsWith(componentIdPageId) ==
>> false { path = componentIdPageId + path;} ) This feels kludgy.
>>
>> I will follow your recommendation but I think this code should be refactored.
>>
>> Thanks,
>>
>> Alec
>>
>>
>> On Tue, Sep 4, 2012 at 12:25 PM, Martin Grigorov  
>> wrote:
>>> Hi,
>>>
>>> Even if there is a place for improvement it is too late now.
>>> There are many apps in production with 1.5 at that time and this
>>> change will break them.
>>> You can extend WicketTester and override the problematic method to
>>> behave as you need it.
>>>
>>> On Tue, Sep 4, 2012 at 8:11 PM, Alec Swan  wrote:
>>>> Hello,
>>>>
>>>> Now that most of my production code is migrated to 1.5 I started
>>>> migrating my tests. The first problem I ran into is with
>>>> BaseWicketTester#startPanel and
>>>> BaseWicketTester#getComponentFromLastRenderedPage.
>>>>
>>>> In 1.4 I could use startPanel and then find components with
>>>> getComponentFromLastRenderedPage using paths relative to the panel. In
>>>> 1.5 I need to prefix those paths with "panel:". Adding this prefix in
>>>> hundreds of tests is overwhelming.
>>>>
>>>> BaseWicketTester#startComponentInPage(Class) JavaDoc says that it can
>>>> use RELATIVE paths to look up components, but this is not the case for
>>>> BaseWicketTester#startComponentInPage(Component)! That's because the
>>>> method with Class parameter sets ComponentInPage#isInstantiated flag
>>>> which is then checked in getComponentFromLastRenderedPage. I think all
>>>> overloaded startComponentInPage methods should do that.
>>>>
>>>> Is this a bug?
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com
>>>
>>> -
>>> 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: Migration to 1.5: BaseWicketTester#startPanel

2012-09-04 Thread Alec Swan
This makes me wonder how many big apps actually migrated from 1.4 to
1.5 (instead of starting from scratch) if this problem has never been
discovered. I also noticed that getComponentFromLastRenderedPage
assumes that the id of the instantiated component is different from
the id of it's first child (if (path.startsWith(componentIdPageId) ==
false { path = componentIdPageId + path;} ) This feels kludgy.

I will follow your recommendation but I think this code should be refactored.

Thanks,

Alec


On Tue, Sep 4, 2012 at 12:25 PM, Martin Grigorov  wrote:
> Hi,
>
> Even if there is a place for improvement it is too late now.
> There are many apps in production with 1.5 at that time and this
> change will break them.
> You can extend WicketTester and override the problematic method to
> behave as you need it.
>
> On Tue, Sep 4, 2012 at 8:11 PM, Alec Swan  wrote:
>> Hello,
>>
>> Now that most of my production code is migrated to 1.5 I started
>> migrating my tests. The first problem I ran into is with
>> BaseWicketTester#startPanel and
>> BaseWicketTester#getComponentFromLastRenderedPage.
>>
>> In 1.4 I could use startPanel and then find components with
>> getComponentFromLastRenderedPage using paths relative to the panel. In
>> 1.5 I need to prefix those paths with "panel:". Adding this prefix in
>> hundreds of tests is overwhelming.
>>
>> BaseWicketTester#startComponentInPage(Class) JavaDoc says that it can
>> use RELATIVE paths to look up components, but this is not the case for
>> BaseWicketTester#startComponentInPage(Component)! That's because the
>> method with Class parameter sets ComponentInPage#isInstantiated flag
>> which is then checked in getComponentFromLastRenderedPage. I think all
>> overloaded startComponentInPage methods should do that.
>>
>> Is this a bug?
>>
>> Thanks,
>>
>> Alec
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> 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



Migration to 1.5: BaseWicketTester#startPanel

2012-09-04 Thread Alec Swan
Hello,

Now that most of my production code is migrated to 1.5 I started
migrating my tests. The first problem I ran into is with
BaseWicketTester#startPanel and
BaseWicketTester#getComponentFromLastRenderedPage.

In 1.4 I could use startPanel and then find components with
getComponentFromLastRenderedPage using paths relative to the panel. In
1.5 I need to prefix those paths with "panel:". Adding this prefix in
hundreds of tests is overwhelming.

BaseWicketTester#startComponentInPage(Class) JavaDoc says that it can
use RELATIVE paths to look up components, but this is not the case for
BaseWicketTester#startComponentInPage(Component)! That's because the
method with Class parameter sets ComponentInPage#isInstantiated flag
which is then checked in getComponentFromLastRenderedPage. I think all
overloaded startComponentInPage methods should do that.

Is this a bug?

Thanks,

Alec

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



Re: Wicket 1.5 migration questions

2012-09-04 Thread Alec Swan
Tom,

I have com.myco.app.res.GlobalResourceScope.class and events.js in the
same package. So, putClassAlias(GlobalResourceScope.class, "global")
in 1.4 would allow me to access http://../app/global/events.js in the
browser.

It seems like in 1.5 this is similar to mountPackage(String, Class) which means I have to change GlobalResourceScope class
to extend Page, right? Why does it need to be a Page?

Thanks,

Alec

On Tue, Sep 4, 2012 at 9:42 AM, Thomas Götz  wrote:
> I didn't get your usecase exactly yet, but maybe this will help you:
> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
>
> Cheers,
>-Tom
>
>
> On 04.09.2012, at 17:33, Alec Swan  wrote:
>
>> I saw the link explaining how to migrate
>> "SharedResources#putClassAlias(GlobalResourceScope.class, "global")"
>> before but was found it confusing because "global" and "images"
>> aliases 1.4 version were replaced with "imgres" in 1.5 example.
>>
>> All I need to do is use "global" in place of GlobalResourceScope.class
>> in the URLs. How do I do this in 1.5?
>
>
> -
> 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: Back button doesn't work with AjaxTabbedPanel

2012-09-04 Thread Alec Swan
So, my conclusion from this discussion is that TabbedPanel should be
used instead of AjaxTabbedPanel if browser Back button needs to be
supported with a menu.

Thanks,

Alec

On Tue, Sep 4, 2012 at 9:48 AM, Paul Bors  wrote:
> You must be talking about the browser's navigation Back button.
> I through you had your own HTML button there for a second.
>
> In that case you're relying on Wicket to handle it and on its page map
> mechanism.
> As explained earlier, an entry is not pushed for Ajax responses unless you
> manually do so and you'd most likely have to use page constructors with
> mapped arguments so that you can grab the tab number from the URL.
>
> See how the page maps work:
> https://cwiki.apache.org/WICKET/page-maps.html
>
> And the JavaDoc on PageParameters:
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/request/mapper/parame
> ter/PageParameters.html
>
> Not sure if you really want to go to this extreme, but feel free to do so if
> you must.
>
> ~ Thank you,
>   Paul Bors
>
> -Original Message-
> From: Alec Swan [mailto:alecs...@gmail.com]
> Sent: Saturday, September 01, 2012 12:05 PM
> To: users@wicket.apache.org
> Subject: Re: Back button doesn't work with AjaxTabbedPanel
>
> How do I know when the back button is pressed?
>
> On Fri, Aug 31, 2012 at 6:48 PM, Paul Bors  wrote:
>> Can't you just keep a reference to the backPage and then simply call
>> setResponsePage(backPage)?
>>
>> ~ Thank you,
>>   Paul Bors
>>
>> -Original Message-
>> From: Alec Swan [mailto:alecs...@gmail.com]
>> Sent: Friday, August 31, 2012 7:07 PM
>> To: users@wicket.apache.org
>> Subject: Re: Back button doesn't work with AjaxTabbedPanel
>>
>> So, is there an easy way to support Back button with AjaxTabbedPanel?
>>
>> On Thu, Aug 30, 2012 at 1:04 PM, Alec Swan  wrote:
>>> Well, I have other ajax interactions and I thought if I could fix
>>> Back button for AjaxTabbedPanel I'd be able to fix it for other ajax
>>> interactions.
>>>
>>> On Thu, Aug 30, 2012 at 12:51 PM, Sven Meier  wrote:
>>>> Silly question: Why don't you use a non-Ajax Tabbedpanel?
>>>>
>>>> Sven
>>>>
>>>>
>>>> On 08/30/2012 08:45 PM, Alec Swan wrote:
>>>>>
>>>>> What can I do to allow user to go back to the previously selected
>>>>> tab with a Back button? I tried the following approach but it
>>>>> doesn't seem to work:
>>>>> http://grepcode.com/file/repo1.maven.org/maven2/org.wicketstuff/jqu
>>>>> e
>>>>> ry-examples/1.4.7/org/wicketstuff/jquery/ajaxbackbutton/Page4AjaxBa
>>>>> c
>>>>> kButton.java
>>>>>
>>>>> On Thu, Aug 30, 2012 at 12:36 PM, Sven Meier  wrote:
>>>>>>
>>>>>> Swapping components via Ajax will not change the browser's page
>> history.
>>>>>> Thus the Back button works as expected - it takes you to the
>>>>>> previous url.
>>>>>>
>>>>>> Sven
>>>>>>
>>>>>>
>>>>>> On 08/30/2012 07:55 PM, Alec Swan wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I am using AjaxTabbedPanel to implement an ajax-swappable menu on
>>>>>>> the Main page which is mounted with mountBookmarkablePage. For
>>>>>>> some reason the Back button in the browser  does not take the
>>>>>>> user to the previously selected tab. It takes them out to the
>>>>>>> page which was shown before user saw Main page for the first time.
>>>>>>>
>>>>>>> Should I be expecting the Back button to work on AjaxTabbedPanel?
>>>>>>> If so, why wouldn't it be working?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Alec
>>>>>>>
>>>>>>> -
>>>>>>> -
>>>>>>> --- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> -
>>>>>> -

Re: Wicket 1.5 migration questions

2012-09-04 Thread Alec Swan
Thanks, Tom.

I saw the link explaining how to migrate
"SharedResources#putClassAlias(GlobalResourceScope.class, "global")"
before but was found it confusing because "global" and "images"
aliases 1.4 version were replaced with "imgres" in 1.5 example.

All I need to do is use "global" in place of GlobalResourceScope.class
in the URLs. How do I do this in 1.5?

Thanks,

Alec

On Tue, Sep 4, 2012 at 9:07 AM, Thomas Götz  wrote:
> Please see my inline comments.
>
> Cheers,
>-Tom
>
>
>
>>> On 04.09.2012, at 02:36, Alec Swan  wrote:
>>>>
>>>> * How to implement HybridUrlCodingStrategy in 1.5?
>
> Please have a look at 
> http://wicketinaction.com/2011/07/wicket-1-5-mounting-pages/
>
>
>>>> * I saw a ticket related to putClassAlias, but I couldn't figure out
>>>> how to port this one line to 1.5:
>>>>   getSharedResources().putClassAlias(GlobalResourceScope.class, "global");
>
> Please have a look at 
> http://alexandros-karypidis.blogspot.de/2011/01/migrating-from-wicket-14-to-15.html
>
>
>>>> * How do I modify the following line to use HTTP in DEVELOPMENT mode?
>>>>   setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
>>>> HttpsConfig(80, 443)));
>
> if (Application.get().getConfigurationType() != 
> RuntimeConfigurationType.DEVELOPMENT) {
> setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new 
> HttpsConfig(80, 443)));
> }
>
>
>>>> * WicketTester#setupRequestAndResponse() - what should be used instead?
>
> Nothing, simply do:
> WicketTester tester = new WicketTester(new MyApplication());
>
>
>>>> * How do I integrate WicketTester and Spring? I used the following
>>>> code in 1.4.x:
>>>>InjectorHolder.setInjector(new AnnotSpringInjector(new
>>>> MockContextLocator(myAppContext)));
>>>>InjectorHolder.getInjector().inject(this);
>
> See 1.5 Migration guide, chapter "Wicket-IOC changes":
>
> "InjectorHolder.getInjector().inject(Object object) is replaced with 
> org.apache.wicket.injection.Injector.get().inject(Object object).
> This is valid for both Wicket-Spring and Wicket-Guice."
>
>
>
> -
> 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 1.5 migration questions

2012-09-04 Thread Alec Swan
I used that migration guide during the migration but none of the
questions in my original post were answered there.

Alec

On Tue, Sep 4, 2012 at 12:44 AM, Thomas Götz  wrote:
> Take a look at the migration guide, this will answer some (if not all) of 
> your questions:
> https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
>
>-Tom
>
> On 04.09.2012, at 02:36, Alec Swan  wrote:
>
>> Hello,
>>
>> I finally decided to bite the bullet and migrate to Wicket 1.5. It
>> turned out a lot harder than I expected. Here are some of the issues I
>> ran into:
>>
>> * How to implement HybridUrlCodingStrategy in 1.5?
>>
>> * I saw a ticket related to putClassAlias, but I couldn't figure out
>> how to port this one line to 1.5:
>>getSharedResources().putClassAlias(GlobalResourceScope.class, "global");
>>
>> * How do I modify the following line to use HTTP in DEVELOPMENT mode?
>>setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
>> HttpsConfig(80, 443)));
>>
>> * WicketTester#setupRequestAndResponse() - what should be used instead?
>>
>> * How do I integrate WicketTester and Spring? I used the following
>> code in 1.4.x:
>> InjectorHolder.setInjector(new AnnotSpringInjector(new
>> MockContextLocator(myAppContext)));
>> InjectorHolder.getInjector().inject(this);
>>
>> Thanks,
>>
>> Alec
>
>
> -
> 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



Wicket 1.5 migration questions

2012-09-03 Thread Alec Swan
Hello,

I finally decided to bite the bullet and migrate to Wicket 1.5. It
turned out a lot harder than I expected. Here are some of the issues I
ran into:

* How to implement HybridUrlCodingStrategy in 1.5?

* I saw a ticket related to putClassAlias, but I couldn't figure out
how to port this one line to 1.5:
getSharedResources().putClassAlias(GlobalResourceScope.class, "global");

* How do I modify the following line to use HTTP in DEVELOPMENT mode?
setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
HttpsConfig(80, 443)));

* WicketTester#setupRequestAndResponse() - what should be used instead?

* How do I integrate WicketTester and Spring? I used the following
code in 1.4.x:
 InjectorHolder.setInjector(new AnnotSpringInjector(new
MockContextLocator(myAppContext)));
 InjectorHolder.getInjector().inject(this);

Thanks,

Alec

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



Re: Back button doesn't work with AjaxTabbedPanel

2012-09-01 Thread Alec Swan
How do I know when the back button is pressed?

On Fri, Aug 31, 2012 at 6:48 PM, Paul Bors  wrote:
> Can't you just keep a reference to the backPage and then simply call
> setResponsePage(backPage)?
>
> ~ Thank you,
>   Paul Bors
>
> -Original Message-
> From: Alec Swan [mailto:alecs...@gmail.com]
> Sent: Friday, August 31, 2012 7:07 PM
> To: users@wicket.apache.org
> Subject: Re: Back button doesn't work with AjaxTabbedPanel
>
> So, is there an easy way to support Back button with AjaxTabbedPanel?
>
> On Thu, Aug 30, 2012 at 1:04 PM, Alec Swan  wrote:
>> Well, I have other ajax interactions and I thought if I could fix Back
>> button for AjaxTabbedPanel I'd be able to fix it for other ajax
>> interactions.
>>
>> On Thu, Aug 30, 2012 at 12:51 PM, Sven Meier  wrote:
>>> Silly question: Why don't you use a non-Ajax Tabbedpanel?
>>>
>>> Sven
>>>
>>>
>>> On 08/30/2012 08:45 PM, Alec Swan wrote:
>>>>
>>>> What can I do to allow user to go back to the previously selected
>>>> tab with a Back button? I tried the following approach but it
>>>> doesn't seem to work:
>>>> http://grepcode.com/file/repo1.maven.org/maven2/org.wicketstuff/jque
>>>> ry-examples/1.4.7/org/wicketstuff/jquery/ajaxbackbutton/Page4AjaxBac
>>>> kButton.java
>>>>
>>>> On Thu, Aug 30, 2012 at 12:36 PM, Sven Meier  wrote:
>>>>>
>>>>> Swapping components via Ajax will not change the browser's page
> history.
>>>>> Thus the Back button works as expected - it takes you to the
>>>>> previous url.
>>>>>
>>>>> Sven
>>>>>
>>>>>
>>>>> On 08/30/2012 07:55 PM, Alec Swan wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I am using AjaxTabbedPanel to implement an ajax-swappable menu on
>>>>>> the Main page which is mounted with mountBookmarkablePage. For
>>>>>> some reason the Back button in the browser  does not take the user
>>>>>> to the previously selected tab. It takes them out to the page
>>>>>> which was shown before user saw Main page for the first time.
>>>>>>
>>>>>> Should I be expecting the Back button to work on AjaxTabbedPanel?
>>>>>> If so, why wouldn't it be working?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Alec
>>>>>>
>>>>>> --
>>>>>> --- 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: Back button doesn't work with AjaxTabbedPanel

2012-08-31 Thread Alec Swan
So, is there an easy way to support Back button with AjaxTabbedPanel?

On Thu, Aug 30, 2012 at 1:04 PM, Alec Swan  wrote:
> Well, I have other ajax interactions and I thought if I could fix Back
> button for AjaxTabbedPanel I'd be able to fix it for other ajax
> interactions.
>
> On Thu, Aug 30, 2012 at 12:51 PM, Sven Meier  wrote:
>> Silly question: Why don't you use a non-Ajax Tabbedpanel?
>>
>> Sven
>>
>>
>> On 08/30/2012 08:45 PM, Alec Swan wrote:
>>>
>>> What can I do to allow user to go back to the previously selected tab
>>> with a Back button? I tried the following approach but it doesn't seem
>>> to work:
>>> http://grepcode.com/file/repo1.maven.org/maven2/org.wicketstuff/jquery-examples/1.4.7/org/wicketstuff/jquery/ajaxbackbutton/Page4AjaxBackButton.java
>>>
>>> On Thu, Aug 30, 2012 at 12:36 PM, Sven Meier  wrote:
>>>>
>>>> Swapping components via Ajax will not change the browser's page history.
>>>> Thus the Back button works as expected - it takes you to the previous
>>>> url.
>>>>
>>>> Sven
>>>>
>>>>
>>>> On 08/30/2012 07:55 PM, Alec Swan wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> I am using AjaxTabbedPanel to implement an ajax-swappable menu on the
>>>>> Main page which is mounted with mountBookmarkablePage. For some reason
>>>>> the Back button in the browser  does not take the user to the
>>>>> previously selected tab. It takes them out to the page which was shown
>>>>> before user saw Main page for the first time.
>>>>>
>>>>> Should I be expecting the Back button to work on AjaxTabbedPanel? If
>>>>> so, why wouldn't it be working?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>> -
>>>>> 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: Back button doesn't work with AjaxTabbedPanel

2012-08-30 Thread Alec Swan
Well, I have other ajax interactions and I thought if I could fix Back
button for AjaxTabbedPanel I'd be able to fix it for other ajax
interactions.

On Thu, Aug 30, 2012 at 12:51 PM, Sven Meier  wrote:
> Silly question: Why don't you use a non-Ajax Tabbedpanel?
>
> Sven
>
>
> On 08/30/2012 08:45 PM, Alec Swan wrote:
>>
>> What can I do to allow user to go back to the previously selected tab
>> with a Back button? I tried the following approach but it doesn't seem
>> to work:
>> http://grepcode.com/file/repo1.maven.org/maven2/org.wicketstuff/jquery-examples/1.4.7/org/wicketstuff/jquery/ajaxbackbutton/Page4AjaxBackButton.java
>>
>> On Thu, Aug 30, 2012 at 12:36 PM, Sven Meier  wrote:
>>>
>>> Swapping components via Ajax will not change the browser's page history.
>>> Thus the Back button works as expected - it takes you to the previous
>>> url.
>>>
>>> Sven
>>>
>>>
>>> On 08/30/2012 07:55 PM, Alec Swan wrote:
>>>>
>>>> Hello,
>>>>
>>>> I am using AjaxTabbedPanel to implement an ajax-swappable menu on the
>>>> Main page which is mounted with mountBookmarkablePage. For some reason
>>>> the Back button in the browser  does not take the user to the
>>>> previously selected tab. It takes them out to the page which was shown
>>>> before user saw Main page for the first time.
>>>>
>>>> Should I be expecting the Back button to work on AjaxTabbedPanel? If
>>>> so, why wouldn't it be working?
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> -
>>>> 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: Back button doesn't work with AjaxTabbedPanel

2012-08-30 Thread Alec Swan
What can I do to allow user to go back to the previously selected tab
with a Back button? I tried the following approach but it doesn't seem
to work: 
http://grepcode.com/file/repo1.maven.org/maven2/org.wicketstuff/jquery-examples/1.4.7/org/wicketstuff/jquery/ajaxbackbutton/Page4AjaxBackButton.java

On Thu, Aug 30, 2012 at 12:36 PM, Sven Meier  wrote:
> Swapping components via Ajax will not change the browser's page history.
> Thus the Back button works as expected - it takes you to the previous url.
>
> Sven
>
>
> On 08/30/2012 07:55 PM, Alec Swan wrote:
>>
>> Hello,
>>
>> I am using AjaxTabbedPanel to implement an ajax-swappable menu on the
>> Main page which is mounted with mountBookmarkablePage. For some reason
>> the Back button in the browser  does not take the user to the
>> previously selected tab. It takes them out to the page which was shown
>> before user saw Main page for the first time.
>>
>> Should I be expecting the Back button to work on AjaxTabbedPanel? If
>> so, why wouldn't it be working?
>>
>> Thanks,
>>
>> Alec
>>
>> -
>> 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



Back button doesn't work with AjaxTabbedPanel

2012-08-30 Thread Alec Swan
Hello,

I am using AjaxTabbedPanel to implement an ajax-swappable menu on the
Main page which is mounted with mountBookmarkablePage. For some reason
the Back button in the browser  does not take the user to the
previously selected tab. It takes them out to the page which was shown
before user saw Main page for the first time.

Should I be expecting the Back button to work on AjaxTabbedPanel? If
so, why wouldn't it be working?

Thanks,

Alec

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



Re: ajax and browser back button in wicket 6

2012-08-29 Thread Alec Swan
I found the following class which adds back button support to AJAX
components: 
http://grepcode.com/file/repo1.maven.org/maven2/org.wicketstuff/jquery-examples/1.4.7/org/wicketstuff/jquery/ajaxbackbutton/Page4AjaxBackButton.java

Is this the recommended solution for 1.4.x? What are other alternatives?

Thanks,

Alec

On Tue, Jul 24, 2012 at 8:37 AM, Martin Grigorov  wrote:
> Hi Steve,
>
> There is nothing new about this in Wicket 6.
> It is as in Wicket 1.5 - back button is not supported out of the box for Ajax.
>
> On Tue, Jul 24, 2012 at 4:48 PM, Steve Lowery
>  wrote:
>> I did a search in the user list and found several references of various
>> ways to solve the back button using ajax problem, but most were a few years
>> old.  I was wondering if wicket 6 does can do this out of the box now.  One
>> of the stated goals on the wicket site is that it will "Fully solve back
>> button problem".  Does this hold true for ajax requests or just plain http
>> requests (or both)?
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Best practices for passing configurations, such as Facebook app_id, to JavaScript

2012-08-29 Thread Alec Swan
I implemented the solution proposed by Fergal, but I think I will redo
it with Pointbreak's approach which seems to be cleaner.

Thanks!

Alec

On Wed, Aug 29, 2012 at 7:20 AM, Pointbreak
 wrote:
> I would use PackageTextTemplate to render the javascript, e.g. put your
> javascript in MyPage.js along with the other templates, and use
> ${facebookId} for the id, then add this to your class:
>
> @Override public void renderHead(IHeaderResponse response) {
> super.renderHead(response);
> PackageTextTemplate javascript = new
> PackageTextTemplate(MyPage.class, MyPage.class.getSimpleName() +
> ".js");
> Map vars = new HashMap();
> vars.put("facebookId", facebookId);
> response.renderOnDomReadyJavaScript(javascript.asString(vars));
> }
>
> On Wed, Aug 29, 2012, at 15:09, Fergal Keating wrote:
>> *HTML*
>> *
>> *
>>
>> /* script will be
>> rendered here */
>>
>> *JAVA*
>>
>> String FacbookJS = " var facebookID = \"" +
>> this.getfacebookID(CurrentDomain) + "\"); ";
>> Label FacebookLabel = new Label("Facebookjs", FacbookJS );
>>
>> addOrReplace( FacebookLabel.setEscapeModelStrings(false));
>>
>> On 27 August 2012 15:33, Alec Swan  wrote:
>>
>> > Hello,
>> >
>> > We deploy our web app on different domains which means that JavaScript
>> > Facebook integration needs to use different app_id values. I am
>> > planning to store these values in a configuration file and wonder how
>> > to expose them to JavaScript. I would also like to write a unit test
>> > that verifies that settings were passed correctly.
>> >
>> > I could use a HeaderContributor to inject raw JavaScript, but this
>> > doesn't seem to be very unit-testable. I could create a  which
>> > attributes/elements contain the settings, which seems to be more
>> > unit-testable.
>> >
>> > Thoughts?
>> >
>> > Thanks,
>> >
>> > Alec
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>>
>> --
>> Fergal Keating
>> IT Senior Engineer
>> ---
>> e. fergal.keat...@directski.com
>> p. NA
>> w. www.directski.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Best practices for passing configurations, such as Facebook app_id, to JavaScript

2012-08-27 Thread Alec Swan
Hello,

We deploy our web app on different domains which means that JavaScript
Facebook integration needs to use different app_id values. I am
planning to store these values in a configuration file and wonder how
to expose them to JavaScript. I would also like to write a unit test
that verifies that settings were passed correctly.

I could use a HeaderContributor to inject raw JavaScript, but this
doesn't seem to be very unit-testable. I could create a  which
attributes/elements contain the settings, which seems to be more
unit-testable.

Thoughts?

Thanks,

Alec

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



Wicket Ant/Ivy template project

2012-08-23 Thread Alec Swan
Hello,

I noticed a couple of Maven projects that can be used as templates for
creating Wicket/Spring/Hibernate webapps. I was surprised that I
wasn't able to find an Ant/Ivy project for this tech stack given that
Wicket, Ant and Ivy are all Apache projects.

Does anybody have an Ant/Ivy template for projects that use
Wicket/Spring/Hibernate or a subset of them?

Thanks,

Alec

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



Re: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
Thanks, Martin. I ended up using WebApplication#newAjaxRequestTarget()
approach because AjaxFeedbackPanelUpdater approach requires me to know
all forms that can be displayed in the page ahead of time and modify
their onSubmit code.

On Mon, Aug 20, 2012 at 3:01 PM, Martin Grigorov  wrote:
> https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
> is all you need.
>
> in your AjaxButton#onSubmit(ART target) {
>   target.addListener(new AjaxFeedbackPanelUpdater());
> }
>
> Or override WebApplication#newAjaxRequestTarget() and add it for each
> and every ART.
>
> On Mon, Aug 20, 2012 at 11:56 PM, Alec Swan  wrote:
>> IRequestCycleListener was added in 1.5.x. Is there anything else I can
>> do in 1.4.x?
>>
>> On Mon, Aug 20, 2012 at 12:15 PM, Bertrand Guay-Paquet
>>  wrote:
>>> Hi,
>>>
>>> I haven't used 1.4 much so I'm not sure it exists there. Maybe you could add
>>> a IRequestCycleListener to your app via getRequestCycleListeners() which
>>> adds the feedback panel in onRequestHandlerResolved? In that method, check
>>> if the handler type is an AjaxRequestTarget and add your feedback panel to
>>> it.
>>>
>>>
>>> On 20/08/2012 11:45 AM, Alec Swan wrote:
>>>>
>>>> It seems that I cannot access ART from the component that is not
>>>> updated by that ART because that component is not rendered during the
>>>> lifecycle of that ART.
>>>>
>>>> Here is the problem description:
>>>>
>>>> 1. A page is rendered with a feedback panel and a form
>>>> 2. The form is later submitted via AJAX and does not add any components to
>>>> ART
>>>>
>>>> How in step 1 can I make sure that feedback panel is updated when form
>>>> is submitted in step 2?
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy 
>>>> wrote:
>>>>>
>>>>> You can access current ART associated with request by calling static
>>>>> AjaxRequestTarget.get()
>>>>>
>>>>> Tibor
>>>>>
>>>>> On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan  wrote:
>>>>>>
>>>>>> Thoughts, anybody?
>>>>>>
>>>>>> On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan  wrote:
>>>>>>>
>>>>>>> The main problem I am facing is that in Wicket 1.4.x I can't figure
>>>>>>> out how to access ART from the component that was not added to this
>>>>>>> ART, e.g. during ajax form submission.
>>>>>>>
>>>>>>> I tried to add AjaxFormSubmitBehavior to every Form child of the page
>>>>>>> but that overrode those form ajax-submit functionality and basically
>>>>>>> broke them all. Now I am thinking about adding an onclick behavior
>>>>>>> which will add my component to ART to every AjaxSubmitLink child of
>>>>>>> the page. But this seems to be pretty ugly.
>>>>>>>
>>>>>>> Thoughts?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Ale
>>>>>>>
>>>>>>> On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan  wrote:
>>>>>>>>
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> Thank you for the link. I used your code to register an
>>>>>>>> ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
>>>>>>>> created, but it does not get called when the form is submitted and
>>>>>>>> hence it never adds the FeedbackPanel to ART of form submission.
>>>>>>>>
>>>>>>>> Where should I add this listener?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Alec
>>>>>>>>
>>>>>>>> On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
>>>>>>>>  wrote:
>>>>>>>>>
>>>>>>>>> Hello Alec,
>>>>>>>>> Could you take a look on this:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> https://

Re: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
IRequestCycleListener was added in 1.5.x. Is there anything else I can
do in 1.4.x?

On Mon, Aug 20, 2012 at 12:15 PM, Bertrand Guay-Paquet
 wrote:
> Hi,
>
> I haven't used 1.4 much so I'm not sure it exists there. Maybe you could add
> a IRequestCycleListener to your app via getRequestCycleListeners() which
> adds the feedback panel in onRequestHandlerResolved? In that method, check
> if the handler type is an AjaxRequestTarget and add your feedback panel to
> it.
>
>
> On 20/08/2012 11:45 AM, Alec Swan wrote:
>>
>> It seems that I cannot access ART from the component that is not
>> updated by that ART because that component is not rendered during the
>> lifecycle of that ART.
>>
>> Here is the problem description:
>>
>> 1. A page is rendered with a feedback panel and a form
>> 2. The form is later submitted via AJAX and does not add any components to
>> ART
>>
>> How in step 1 can I make sure that feedback panel is updated when form
>> is submitted in step 2?
>>
>> Thanks,
>>
>> Alec
>>
>> On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy 
>> wrote:
>>>
>>> You can access current ART associated with request by calling static
>>> AjaxRequestTarget.get()
>>>
>>> Tibor
>>>
>>> On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan  wrote:
>>>>
>>>> Thoughts, anybody?
>>>>
>>>> On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan  wrote:
>>>>>
>>>>> The main problem I am facing is that in Wicket 1.4.x I can't figure
>>>>> out how to access ART from the component that was not added to this
>>>>> ART, e.g. during ajax form submission.
>>>>>
>>>>> I tried to add AjaxFormSubmitBehavior to every Form child of the page
>>>>> but that overrode those form ajax-submit functionality and basically
>>>>> broke them all. Now I am thinking about adding an onclick behavior
>>>>> which will add my component to ART to every AjaxSubmitLink child of
>>>>> the page. But this seems to be pretty ugly.
>>>>>
>>>>> Thoughts?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Ale
>>>>>
>>>>> On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan  wrote:
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> Thank you for the link. I used your code to register an
>>>>>> ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
>>>>>> created, but it does not get called when the form is submitted and
>>>>>> hence it never adds the FeedbackPanel to ART of form submission.
>>>>>>
>>>>>> Where should I add this listener?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Alec
>>>>>>
>>>>>> On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
>>>>>>  wrote:
>>>>>>>
>>>>>>> Hello Alec,
>>>>>>> Could you take a look on this:
>>>>>>>
>>>>>>>
>>>>>>> https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.html
>>>>>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>>>>>
>>>>>>> -
>>>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>>>
>>>> -
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>> -
>>> 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: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
It seems that I cannot access ART from the component that is not
updated by that ART because that component is not rendered during the
lifecycle of that ART.

Here is the problem description:

1. A page is rendered with a feedback panel and a form
2. The form is later submitted via AJAX and does not add any components to ART

How in step 1 can I make sure that feedback panel is updated when form
is submitted in step 2?

Thanks,

Alec

On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy  wrote:
> You can access current ART associated with request by calling static
> AjaxRequestTarget.get()
>
> Tibor
>
> On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan  wrote:
>> Thoughts, anybody?
>>
>> On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan  wrote:
>>> The main problem I am facing is that in Wicket 1.4.x I can't figure
>>> out how to access ART from the component that was not added to this
>>> ART, e.g. during ajax form submission.
>>>
>>> I tried to add AjaxFormSubmitBehavior to every Form child of the page
>>> but that overrode those form ajax-submit functionality and basically
>>> broke them all. Now I am thinking about adding an onclick behavior
>>> which will add my component to ART to every AjaxSubmitLink child of
>>> the page. But this seems to be pretty ugly.
>>>
>>> Thoughts?
>>>
>>> Thanks,
>>>
>>> Ale
>>>
>>> On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan  wrote:
>>>> Hello,
>>>>
>>>> Thank you for the link. I used your code to register an
>>>> ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
>>>> created, but it does not get called when the form is submitted and
>>>> hence it never adds the FeedbackPanel to ART of form submission.
>>>>
>>>> Where should I add this listener?
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
>>>>  wrote:
>>>>> Hello Alec,
>>>>> Could you take a look on this:
>>>>>
>>>>> https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: 
>>>>> http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.html
>>>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
> -
> 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: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Alec Swan
Thoughts, anybody?

On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan  wrote:
> The main problem I am facing is that in Wicket 1.4.x I can't figure
> out how to access ART from the component that was not added to this
> ART, e.g. during ajax form submission.
>
> I tried to add AjaxFormSubmitBehavior to every Form child of the page
> but that overrode those form ajax-submit functionality and basically
> broke them all. Now I am thinking about adding an onclick behavior
> which will add my component to ART to every AjaxSubmitLink child of
> the page. But this seems to be pretty ugly.
>
> Thoughts?
>
> Thanks,
>
> Ale
>
> On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan  wrote:
>> Hello,
>>
>> Thank you for the link. I used your code to register an
>> ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
>> created, but it does not get called when the form is submitted and
>> hence it never adds the FeedbackPanel to ART of form submission.
>>
>> Where should I add this listener?
>>
>> Thanks,
>>
>> Alec
>>
>> On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
>>  wrote:
>>> Hello Alec,
>>> Could you take a look on this:
>>>
>>> https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
>>>
>>>
>>>
>>> --
>>> View this message in context: 
>>> http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.html
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>

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



Re: Add page feedback to every AjaxRequestTarget

2012-08-19 Thread Alec Swan
The main problem I am facing is that in Wicket 1.4.x I can't figure
out how to access ART from the component that was not added to this
ART, e.g. during ajax form submission.

I tried to add AjaxFormSubmitBehavior to every Form child of the page
but that overrode those form ajax-submit functionality and basically
broke them all. Now I am thinking about adding an onclick behavior
which will add my component to ART to every AjaxSubmitLink child of
the page. But this seems to be pretty ugly.

Thoughts?

Thanks,

Ale

On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan  wrote:
> Hello,
>
> Thank you for the link. I used your code to register an
> ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
> created, but it does not get called when the form is submitted and
> hence it never adds the FeedbackPanel to ART of form submission.
>
> Where should I add this listener?
>
> Thanks,
>
> Alec
>
> On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
>  wrote:
>> Hello Alec,
>> Could you take a look on this:
>>
>> https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
>>
>>
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>

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



Re: Add page feedback to every AjaxRequestTarget

2012-08-17 Thread Alec Swan
Hello,

Thank you for the link. I used your code to register an
ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
created, but it does not get called when the form is submitted and
hence it never adds the FeedbackPanel to ART of form submission.

Where should I add this listener?

Thanks,

Alec

On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
 wrote:
> Hello Alec,
> Could you take a look on this:
>
> https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Add page feedback to every AjaxRequestTarget

2012-08-15 Thread Alec Swan
Bertrand, that's exactly what I want! Except I am using Wicket 1.4.x :(

Is there a way to implement this in Wicket 1.4.x?

Thanks,

Alec

On Wed, Aug 15, 2012 at 3:02 PM, Bertrand Guay-Paquet
 wrote:
> Hi Alec,
>
> Have a look at this:
> https://cwiki.apache.org/WICKET/migration-to-wicket-15.html#MigrationtoWicket1.5-Defaultajaxevent
>
> I think it does what you need.
>
>
> On 15/08/2012 3:59 PM, Alec Swan wrote:
>>
>> Hello,
>>
>> I have a FeedbackPanel on a page. The page can contain different kinds
>> of forms depending on the end-user preference. Some of those forms are
>> submitted via AJAX and may or may not add any components to
>> AjaxRequestTarget.
>>
>> How can I add the page's FeedbackPanel to AjaxRequestTarget of the
>> forms submitted via ajax? I think the solution should involve
>> page.visitChildren(Form.class, new IVisitor()) and somehow
>> adding page FeedbackPanel to ART in IVisitor#component(Form) method,
>> but I can't figure out how to do that. Or maybe the code should visit
>> AjaxSubmitLink children and do something there.
>>
>> Thanks,
>>
>> Alec
>>
>> -
>> 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



Add page feedback to every AjaxRequestTarget

2012-08-15 Thread Alec Swan
Hello,

I have a FeedbackPanel on a page. The page can contain different kinds
of forms depending on the end-user preference. Some of those forms are
submitted via AJAX and may or may not add any components to
AjaxRequestTarget.

How can I add the page's FeedbackPanel to AjaxRequestTarget of the
forms submitted via ajax? I think the solution should involve
page.visitChildren(Form.class, new IVisitor()) and somehow
adding page FeedbackPanel to ART in IVisitor#component(Form) method,
but I can't figure out how to do that. Or maybe the code should visit
AjaxSubmitLink children and do something there.

Thanks,

Alec

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



Re: How to display a grid with empty cells

2012-08-09 Thread Alec Swan
I tried returning nulls for blank items from data provider but as you
said it feels like a hack because now my  GridView#populateItem()
needs to handle items with null model objects.

The way GridView behaves is confusing because it displays the entire
row of cells (some potentially blank) if the row has at least one
item. If the row has no items, then the row is not displayed. So,
GridView pads every row with empty cells but doesn't do this for every
column.

Should this be filed as a bug?

On Wed, Aug 8, 2012 at 9:37 PM, Bertrand Guay-Paquet
 wrote:
> Hi,
>
> I haven't used the GridView directly so I can't help you with it
> specifically. However, have you considered modifying your provider to always
> return 9 records with some having an empty placeholder? It's definitely a
> "hack", but it may be worth a try.
>
> Bertrand
>
>
> On 08/08/2012 10:56 PM, Alec Swan wrote:
>>
>> Hello,
>>
>> I am using Wicket 1.4.17 and need to display a 3x3 table with all of
>> its cells, some of which may not have a model and hence blank. So, if
>> my DataProvider returns 0 elements than I want all 9 cells to be shown
>> as blank.
>>
>> I started using GridView and overrode its populateEmptyItem() method
>> to display empty cells. However, contrary to its JavaDoc "Add
>> component to an Item for which there is no model anymore and is shown
>> in a cell" this method is not being called unless a row has at least
>> one item (see GrdiView#addItems()).
>>
>> What would the easiest way to accomplish what I need without copying
>> the entire code from GridView class? Any other component that can do
>> that?
>>
>> Thanks,
>>
>> Alec
>>
>> -
>> 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



How to display a grid with empty cells

2012-08-08 Thread Alec Swan
Hello,

I am using Wicket 1.4.17 and need to display a 3x3 table with all of
its cells, some of which may not have a model and hence blank. So, if
my DataProvider returns 0 elements than I want all 9 cells to be shown
as blank.

I started using GridView and overrode its populateEmptyItem() method
to display empty cells. However, contrary to its JavaDoc "Add
component to an Item for which there is no model anymore and is shown
in a cell" this method is not being called unless a row has at least
one item (see GrdiView#addItems()).

What would the easiest way to accomplish what I need without copying
the entire code from GridView class? Any other component that can do
that?

Thanks,

Alec

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



Re: Where to add javascript in html pages which follow inheritance relationship.

2012-07-31 Thread Alec Swan
Try the following and let us know what happens when Page 2 is rendered
by Wicket.

Page1:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
 alert("Hello!"); 

  



Page2:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>





On Tue, Jul 31, 2012 at 10:38 AM, kshitiz  wrote:
> Please help me out here...for a child page..how would I add javascript in its
> head. I have tried out wicket:head with head tag in base page but it is not
> working out...
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Where-to-add-javascript-in-html-pages-which-follow-inheritance-relationship-tp4650855p4650903.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Next database key pre-filled in form and associated with PropertyModel returns null

2012-07-17 Thread Alec Swan
How do you determine which next key is available? If two users open
the form at the same time will they see the same key? If so, then you
need to handle errors from concurrent form submissions with the same
key. Which means for one of these concurrent requests you will have to
issue a different key and show it to the user after the form was
submitted. So, why not show the key after form submission all the
time?

On Sat, Jul 14, 2012 at 1:03 AM, Ian  wrote:
> G'day
>
> Short form: how do I pre-fill a form field with the dynamic value of the
> next free database key
>
> Long form:
>
> I'd like to pre-fill a form field with the value of the next free database
> key. I can do this by associating the form input field with a static model
> of a string value and replacing the field in the form each time the next key
> value changes. Works, but hardly elegant.
>
> So I've associated the input field with a (dynamic) property model. Because
> the next key value isn't a database field I've created a new class (called
> State) with a field for the next free database key. The property model I've
> associated with the form field points to that attribute of State. As each
> new database row is created I manually update the value of the next free key
> in State. This value then finds its way into the form when it is next
> displayed. So far so good. Each time the form is displayed I can see the
> correct next free key value pre-filled into the form as expected.
>
> But when the form is submitted and I do a getModelObject() on the form the
> gotten object has null in the field that should contain the next free
> database key. All the other fields are correctly received from the form.
> (This is true more generally - in more complex forms all the form fields
> that are not associated with State are correctly received from the form. All
> those that are associated with State are null.)
>
> What is weird is that if I do:
>
> Account account = getModelObject(); // returns null in field accountNumber
> which is associated with State
> account.setAccountnumber(Integer.parseInt(accountNumber.getInput())); //
> Gets and sets the pre-filled value
>
> then I get the desired result i.e. field accountNumber of account is set to
> the pre-filled value.
>
> So there is no doubt that form field has the desired value - I can see it,
> and getInput() gets it. But getModelObject() (which I would be expecting to
> call getInput() under the covers) doesn't get the pre-filled value.
>
> I suspect this is a question of understanding about models in general. (I've
> looked at whether I should add my PropertyModel in some way to the
> LoadableDetachableModel that is associated with the form but the water got
> rather deep rather quickly.)
>
> Any enlightenment appreciated.
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Next-database-key-pre-filled-in-form-and-associated-with-PropertyModel-returns-null-tp4650518.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Understanding Wicket redirect behavior

2012-07-17 Thread Alec Swan
Anybody?

On Sat, Jul 14, 2012 at 5:24 PM, Alec Swan  wrote:
> Is there a way in 1.4.x to avoid a 302 redirect to /lrm/ms/oid/123.0
> when the user opens /lrm/ms/oid/123?
>
> Thanks,
>
> Alec
>
> On Sat, Jul 14, 2012 at 5:09 PM, Alec Swan  wrote:
>> Michael,
>>
>> I integrated DisabledJSessionIDinUrlFilter code that you sent me and I
>> still get a 302 redirect. The filter behaves the same as
>> COOKIE Tomcat 7 configuration.
>>
>> In other words /lrm/ms/oid/123 is still redirected with 302 code to
>> /lrm/ms/oid/../../ms/oid/123.0. Note that I no longer have jsessionid
>> at the end of the URL.
>>
>> I think the core problem is that my page is versionable and therefore
>> Wicket created the first version of the page and does a 302 redirect
>> to it.
>>
>> Still struggling with this.
>>
>> Alec
>>
>>
>> On Sat, Jul 14, 2012 at 3:48 PM, Michael Mosmann  wrote:
>>> Hi Alec,
>>>
>>> Ok.. so far for now:
>>> - with wicket 1.4 removing the jessionID from URL should do the trick.
>>> And AFAIK wicket 1.4 should not do any redirect after this.
>>> - with wicket 1.5 the jsessionID is gone, BUT wicket 1.5 will do some
>>> redirect from path/yourPage  to path/yourPage?0 (0 or other - wicket
>>> page version)
>>>
>>> Michael
>>>
>>> Am Samstag, den 14.07.2012, 14:47 -0600 schrieb Alec Swan:
>>>> Thanks Michael. I read the first link before and the only thing that I
>>>> didn't do (and probable cannot do) is make my pages stateless.
>>>>
>>>> As far as the second link to DisabledJSessionIDinUrlFilter.java,
>>>> doesn't it just strip off JSESSIONID from the URL? Is there something
>>>> that I missed?
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Sat, Jul 14, 2012 at 2:38 PM, Michael Mosmann  
>>>> wrote:
>>>> > Maybe this will help
>>>> >
>>>> > https://cwiki.apache.org/WICKET/seo-search-engine-optimization.html
>>>> >
>>>> > Or try this one:
>>>> >
>>>> > https://github.com/michaelmosmann/wicket-praxis/blob/master/de.wicketpraxis--pom/webapp/src/main/java/de/wicketpraxis/web/thema/howto/servletfilter/DisabledJSessionIDinUrlFilter.java
>>>> >
>>>> > Michael mosmann
>>>> >
>>>> > --
>>>> > Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail 
>>>> > gesendet.
>>>> >
>>>> >
>>>> >
>>>> > Alec Swan  schrieb:
>>>> >
>>>> > Thanks Josh, I upgraded to Tomcat7 and was able to disable cookies as
>>>> > you suggested. It worked! This, however does not help me change 302
>>>> > redirect to 200.
>>>> >
>>>> > Is there any way I can make /lrm/ms/oid/123 return 200 just like
>>>> > /lrm/network as explained in my original post?
>>>> >
>>>> > Thanks,
>>>> >
>>>> > Alec
>>>> >
>>>> >
>>>> > On Sat, Jul 14, 2012 at 12:36 PM, Josh Kamau  
>>>> > wrote:
>>>> >> I read somewhere that :
>>>> >>
>>>> >> When its first time you are accessing a page, tomcat doesnt know if 
>>>> >> cookies
>>>> >> are supported.. so to be safe, it will embed the session id in the url. 
>>>> >> IF
>>>> >> you then access another page, this time round tomcat knows what kind of
>>>> >> browser its dealing with ... and if cookies are supported, it wont embed
>>>> >> the session id in the url but will put it in a cookie..
>>>> >>
>>>> >> Now to tell tomcat to always use the cookies , you add
>>>> >>
>>>> >> 
>>>> >> COOKIE
>>>> >> 
>>>> >>
>>>> >>
>>>> >> In your web.xml file..
>>>> >>
>>>> >> Cheers
>>>> >> Josh
>>>> >>
>>>> >> On Sat, Jul 14, 2012 at 8:30 PM, Alec Swan  wrote:
>>>> >>
>>>> >>> Hello,
>>>> >>>
>>>> >>> While working on my previous problem I found out that when I do a GET
>>>> >>> to one of my bookmarkable pages, e.g. /lrm/ms/oid/123, I get a 

Re: Understanding Wicket redirect behavior

2012-07-14 Thread Alec Swan
Is there a way in 1.4.x to avoid a 302 redirect to /lrm/ms/oid/123.0
when the user opens /lrm/ms/oid/123?

Thanks,

Alec

On Sat, Jul 14, 2012 at 5:09 PM, Alec Swan  wrote:
> Michael,
>
> I integrated DisabledJSessionIDinUrlFilter code that you sent me and I
> still get a 302 redirect. The filter behaves the same as
> COOKIE Tomcat 7 configuration.
>
> In other words /lrm/ms/oid/123 is still redirected with 302 code to
> /lrm/ms/oid/../../ms/oid/123.0. Note that I no longer have jsessionid
> at the end of the URL.
>
> I think the core problem is that my page is versionable and therefore
> Wicket created the first version of the page and does a 302 redirect
> to it.
>
> Still struggling with this.
>
> Alec
>
>
> On Sat, Jul 14, 2012 at 3:48 PM, Michael Mosmann  wrote:
>> Hi Alec,
>>
>> Ok.. so far for now:
>> - with wicket 1.4 removing the jessionID from URL should do the trick.
>> And AFAIK wicket 1.4 should not do any redirect after this.
>> - with wicket 1.5 the jsessionID is gone, BUT wicket 1.5 will do some
>> redirect from path/yourPage  to path/yourPage?0 (0 or other - wicket
>> page version)
>>
>> Michael
>>
>> Am Samstag, den 14.07.2012, 14:47 -0600 schrieb Alec Swan:
>>> Thanks Michael. I read the first link before and the only thing that I
>>> didn't do (and probable cannot do) is make my pages stateless.
>>>
>>> As far as the second link to DisabledJSessionIDinUrlFilter.java,
>>> doesn't it just strip off JSESSIONID from the URL? Is there something
>>> that I missed?
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> On Sat, Jul 14, 2012 at 2:38 PM, Michael Mosmann  wrote:
>>> > Maybe this will help
>>> >
>>> > https://cwiki.apache.org/WICKET/seo-search-engine-optimization.html
>>> >
>>> > Or try this one:
>>> >
>>> > https://github.com/michaelmosmann/wicket-praxis/blob/master/de.wicketpraxis--pom/webapp/src/main/java/de/wicketpraxis/web/thema/howto/servletfilter/DisabledJSessionIDinUrlFilter.java
>>> >
>>> > Michael mosmann
>>> >
>>> > --
>>> > Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail 
>>> > gesendet.
>>> >
>>> >
>>> >
>>> > Alec Swan  schrieb:
>>> >
>>> > Thanks Josh, I upgraded to Tomcat7 and was able to disable cookies as
>>> > you suggested. It worked! This, however does not help me change 302
>>> > redirect to 200.
>>> >
>>> > Is there any way I can make /lrm/ms/oid/123 return 200 just like
>>> > /lrm/network as explained in my original post?
>>> >
>>> > Thanks,
>>> >
>>> > Alec
>>> >
>>> >
>>> > On Sat, Jul 14, 2012 at 12:36 PM, Josh Kamau  
>>> > wrote:
>>> >> I read somewhere that :
>>> >>
>>> >> When its first time you are accessing a page, tomcat doesnt know if 
>>> >> cookies
>>> >> are supported.. so to be safe, it will embed the session id in the url. 
>>> >> IF
>>> >> you then access another page, this time round tomcat knows what kind of
>>> >> browser its dealing with ... and if cookies are supported, it wont embed
>>> >> the session id in the url but will put it in a cookie..
>>> >>
>>> >> Now to tell tomcat to always use the cookies , you add
>>> >>
>>> >> 
>>> >> COOKIE
>>> >> 
>>> >>
>>> >>
>>> >> In your web.xml file..
>>> >>
>>> >> Cheers
>>> >> Josh
>>> >>
>>> >> On Sat, Jul 14, 2012 at 8:30 PM, Alec Swan  wrote:
>>> >>
>>> >>> Hello,
>>> >>>
>>> >>> While working on my previous problem I found out that when I do a GET
>>> >>> to one of my bookmarkable pages, e.g. /lrm/ms/oid/123, I get a 302
>>> >>> redirect to /lrm/ms/oid/../../ms/oid/123.0;jsessionid=xxx. However,
>>> >>> when I do a GET to /lrm/network I get a 200 response and jsessionid is
>>> >>> set as a cookie in the response.
>>> >>>
>>> >>> /lrm/network is explicitly mounted as mountBookmarkablePage in
>>> >>> Application.init(). We are using Tomcat 6.0 and Wicket 1.4.17.
>>> >>>
>>> >>> How can I make /

Re: Understanding Wicket redirect behavior

2012-07-14 Thread Alec Swan
Michael,

I integrated DisabledJSessionIDinUrlFilter code that you sent me and I
still get a 302 redirect. The filter behaves the same as
COOKIE Tomcat 7 configuration.

In other words /lrm/ms/oid/123 is still redirected with 302 code to
/lrm/ms/oid/../../ms/oid/123.0. Note that I no longer have jsessionid
at the end of the URL.

I think the core problem is that my page is versionable and therefore
Wicket created the first version of the page and does a 302 redirect
to it.

Still struggling with this.

Alec


On Sat, Jul 14, 2012 at 3:48 PM, Michael Mosmann  wrote:
> Hi Alec,
>
> Ok.. so far for now:
> - with wicket 1.4 removing the jessionID from URL should do the trick.
> And AFAIK wicket 1.4 should not do any redirect after this.
> - with wicket 1.5 the jsessionID is gone, BUT wicket 1.5 will do some
> redirect from path/yourPage  to path/yourPage?0 (0 or other - wicket
> page version)
>
> Michael
>
> Am Samstag, den 14.07.2012, 14:47 -0600 schrieb Alec Swan:
>> Thanks Michael. I read the first link before and the only thing that I
>> didn't do (and probable cannot do) is make my pages stateless.
>>
>> As far as the second link to DisabledJSessionIDinUrlFilter.java,
>> doesn't it just strip off JSESSIONID from the URL? Is there something
>> that I missed?
>>
>> Thanks,
>>
>> Alec
>>
>> On Sat, Jul 14, 2012 at 2:38 PM, Michael Mosmann  wrote:
>> > Maybe this will help
>> >
>> > https://cwiki.apache.org/WICKET/seo-search-engine-optimization.html
>> >
>> > Or try this one:
>> >
>> > https://github.com/michaelmosmann/wicket-praxis/blob/master/de.wicketpraxis--pom/webapp/src/main/java/de/wicketpraxis/web/thema/howto/servletfilter/DisabledJSessionIDinUrlFilter.java
>> >
>> > Michael mosmann
>> >
>> > --
>> > Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail 
>> > gesendet.
>> >
>> >
>> >
>> > Alec Swan  schrieb:
>> >
>> > Thanks Josh, I upgraded to Tomcat7 and was able to disable cookies as
>> > you suggested. It worked! This, however does not help me change 302
>> > redirect to 200.
>> >
>> > Is there any way I can make /lrm/ms/oid/123 return 200 just like
>> > /lrm/network as explained in my original post?
>> >
>> > Thanks,
>> >
>> > Alec
>> >
>> >
>> > On Sat, Jul 14, 2012 at 12:36 PM, Josh Kamau  wrote:
>> >> I read somewhere that :
>> >>
>> >> When its first time you are accessing a page, tomcat doesnt know if 
>> >> cookies
>> >> are supported.. so to be safe, it will embed the session id in the url. IF
>> >> you then access another page, this time round tomcat knows what kind of
>> >> browser its dealing with ... and if cookies are supported, it wont embed
>> >> the session id in the url but will put it in a cookie..
>> >>
>> >> Now to tell tomcat to always use the cookies , you add
>> >>
>> >> 
>> >> COOKIE
>> >> 
>> >>
>> >>
>> >> In your web.xml file..
>> >>
>> >> Cheers
>> >> Josh
>> >>
>> >> On Sat, Jul 14, 2012 at 8:30 PM, Alec Swan  wrote:
>> >>
>> >>> Hello,
>> >>>
>> >>> While working on my previous problem I found out that when I do a GET
>> >>> to one of my bookmarkable pages, e.g. /lrm/ms/oid/123, I get a 302
>> >>> redirect to /lrm/ms/oid/../../ms/oid/123.0;jsessionid=xxx. However,
>> >>> when I do a GET to /lrm/network I get a 200 response and jsessionid is
>> >>> set as a cookie in the response.
>> >>>
>> >>> /lrm/network is explicitly mounted as mountBookmarkablePage in
>> >>> Application.init(). We are using Tomcat 6.0 and Wicket 1.4.17.
>> >>>
>> >>> How can I make /lrm/ms/oid/123 return 200 just like /lrm/network?
>> >>> Should we somehow mountBookmarkablePage each such page which we have
>> >>> thousands of? Will upgrading to Wicket 1.5 help achieve this behavior?
>> >>>
>> >>> Thanks,
>> >>>
>> >>> Alec
>> >>>
>> >>>_
>> >
>> >>> 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: Understanding Wicket redirect behavior

2012-07-14 Thread Alec Swan
Thanks Michael. I read the first link before and the only thing that I
didn't do (and probable cannot do) is make my pages stateless.

As far as the second link to DisabledJSessionIDinUrlFilter.java,
doesn't it just strip off JSESSIONID from the URL? Is there something
that I missed?

Thanks,

Alec

On Sat, Jul 14, 2012 at 2:38 PM, Michael Mosmann  wrote:
> Maybe this will help
>
> https://cwiki.apache.org/WICKET/seo-search-engine-optimization.html
>
> Or try this one:
>
> https://github.com/michaelmosmann/wicket-praxis/blob/master/de.wicketpraxis--pom/webapp/src/main/java/de/wicketpraxis/web/thema/howto/servletfilter/DisabledJSessionIDinUrlFilter.java
>
> Michael mosmann
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
>
>
>
> Alec Swan  schrieb:
>
> Thanks Josh, I upgraded to Tomcat7 and was able to disable cookies as
> you suggested. It worked! This, however does not help me change 302
> redirect to 200.
>
> Is there any way I can make /lrm/ms/oid/123 return 200 just like
> /lrm/network as explained in my original post?
>
> Thanks,
>
> Alec
>
>
> On Sat, Jul 14, 2012 at 12:36 PM, Josh Kamau  wrote:
>> I read somewhere that :
>>
>> When its first time you are accessing a page, tomcat doesnt know if cookies
>> are supported.. so to be safe, it will embed the session id in the url. IF
>> you then access another page, this time round tomcat knows what kind of
>> browser its dealing with ... and if cookies are supported, it wont embed
>> the session id in the url but will put it in a cookie..
>>
>> Now to tell tomcat to always use the cookies , you add
>>
>> 
>> COOKIE
>> 
>>
>>
>> In your web.xml file..
>>
>> Cheers
>> Josh
>>
>> On Sat, Jul 14, 2012 at 8:30 PM, Alec Swan  wrote:
>>
>>> Hello,
>>>
>>> While working on my previous problem I found out that when I do a GET
>>> to one of my bookmarkable pages, e.g. /lrm/ms/oid/123, I get a 302
>>> redirect to /lrm/ms/oid/../../ms/oid/123.0;jsessionid=xxx. However,
>>> when I do a GET to /lrm/network I get a 200 response and jsessionid is
>>> set as a cookie in the response.
>>>
>>> /lrm/network is explicitly mounted as mountBookmarkablePage in
>>> Application.init(). We are using Tomcat 6.0 and Wicket 1.4.17.
>>>
>>> How can I make /lrm/ms/oid/123 return 200 just like /lrm/network?
>>> Should we somehow mountBookmarkablePage each such page which we have
>>> thousands of? Will upgrading to Wicket 1.5 help achieve this behavior?
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>>_
>
>>> 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: Understanding Wicket redirect behavior

2012-07-14 Thread Alec Swan
Thanks Josh, I upgraded to Tomcat7 and was able to disable cookies as
you suggested. It worked! This, however does not help me change 302
redirect to 200.

Is there any way I can make /lrm/ms/oid/123 return 200 just like
/lrm/network as explained in my original post?

Thanks,

Alec


On Sat, Jul 14, 2012 at 12:36 PM, Josh Kamau  wrote:
> I read somewhere that :
>
> When its first time you are accessing a page, tomcat doesnt know if cookies
> are supported.. so to be safe, it will embed the session id in the url. IF
> you then access another page, this time round tomcat knows what kind of
> browser its dealing with ... and if cookies are supported, it wont embed
> the session id in the url but will put it in a cookie..
>
> Now to tell tomcat to always use the cookies , you add
>
> 
>  COOKIE
>  
>
>
> In your web.xml file..
>
> Cheers
> Josh
>
> On Sat, Jul 14, 2012 at 8:30 PM, Alec Swan  wrote:
>
>> Hello,
>>
>> While working on my previous problem I found out that when I do a GET
>> to one of my bookmarkable pages, e.g. /lrm/ms/oid/123, I get a 302
>> redirect to /lrm/ms/oid/../../ms/oid/123.0;jsessionid=xxx. However,
>> when I do a GET to /lrm/network I get a 200 response and jsessionid is
>> set as a cookie in the response.
>>
>> /lrm/network is explicitly mounted as mountBookmarkablePage in
>> Application.init(). We are using Tomcat 6.0 and Wicket 1.4.17.
>>
>> How can I make /lrm/ms/oid/123 return 200 just like /lrm/network?
>> Should we somehow mountBookmarkablePage each such page which we have
>> thousands of? Will upgrading to Wicket 1.5 help achieve this behavior?
>>
>> Thanks,
>>
>> Alec
>>
>> -
>> 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



Understanding Wicket redirect behavior

2012-07-14 Thread Alec Swan
Hello,

While working on my previous problem I found out that when I do a GET
to one of my bookmarkable pages, e.g. /lrm/ms/oid/123, I get a 302
redirect to /lrm/ms/oid/../../ms/oid/123.0;jsessionid=xxx. However,
when I do a GET to /lrm/network I get a 200 response and jsessionid is
set as a cookie in the response.

/lrm/network is explicitly mounted as mountBookmarkablePage in
Application.init(). We are using Tomcat 6.0 and Wicket 1.4.17.

How can I make /lrm/ms/oid/123 return 200 just like /lrm/network?
Should we somehow mountBookmarkablePage each such page which we have
thousands of? Will upgrading to Wicket 1.5 help achieve this behavior?

Thanks,

Alec

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



Re: Anybody is having problems with Wicket and Facebook Like button?

2012-07-12 Thread Alec Swan
Is there a way to have a GET to /lrm/ms/oid/74989 to be redirected to
/lrm/ms/oid/74989.0;jsessionid=xxx instead of
/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=xxx? Where is this ../../
coming from?

I am on Wicket 1.4.17 and /lrm/ms is mounted to a Wicket page.

Thanks

On Thu, Jul 12, 2012 at 8:18 AM, Alec Swan  wrote:
> I used Apache httpd.conf to rewrite our URLs to exclude jsessionids,
> but this did not fix the problem with Facebook Like button. Now I am
> wondering if the problem is related to Wicket inserting ../../ in the
> middle of the URL when Tomcat redirects sessionless user to the URL
> with jsessionid as in the following:
> "The page at 
> http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1FBAE4A7B21CA0FC7B8B10BB21EF1
> could not be reached."
>
> I reviewed several web sites on
> https://cwiki.apache.org/WICKET/websites-based-on-wicket.html but
> didn't find any that have a Like button that allows the user to like a
> Wicket-generated page.
>
> Can anybody send me a link to a page with a Like button pointing to a
> Wicket-generated page? I'd really like to see what's the difference
> between that and what we are doing.
>
> Thanks!
>
> On Thu, Jul 5, 2012 at 9:58 PM, Dale Ogilvie  wrote:
>> Alec, If you are running in Tomcat 7 you can add this to your web.xml to
>> turn off tomcat JSESSIONID in urls. Tomcat puts a jsessionid on all urls
>> until it receives a session cookie from the client, to cope with
>> cookieless clients.
>>
>> 
>> COOKIE
>> 
>>
>> This is part of the servlet 3.0 spec.
>>
>> http://www.w3.org/2001/XMLSchema-instance";
>> xmlns="http://java.sun.com/xml/ns/javaee";
>> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; id="WebApp_ID"
>> version="3.0">
>>
>>
>> -Original Message-
>> From: Alec Swan [mailto:alecs...@gmail.com]
>> Sent: Friday, 6 July 2012 6:47 a.m.
>> To: users@wicket.apache.org
>> Subject: Re: Anybody is having problems with Wicket and Facebook Like
>> button?
>>
>> Sorry for pushing this again, but this is a huge issue for us. Is
>> anybody having problems with Facebook Like button?
>>
>> On Tue, Jul 3, 2012 at 3:34 PM, Alec Swan  wrote:
>>> Hello,
>>>
>>> We started receiving complaints from users saying that Facebook Like
>>> buttons don't work on our web site anymore. I don't know what happened
>>
>>> on the Facebook side but now we are seeing the following errors when
>>> user clicks Like button, e.g. on
>>> http://galecsy.com:88/lrm/ms/oid/74989:
>>>
>>> The page at
>>> http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1F
>>> BAE4A7B21CA0FC7B8B10BB21EF1
>>> could not be reached.
>>>
>>> I read "SEO - Search Engine Optimization" and overwrote newWebResponse
>>
>>> to remove JSESSIONID, however it looks like JSESSIONID is still being
>>> added somewhere, probably Tomcat.
>>>
>>> I know this is not directly related to Wicket, but I am wondering how
>>> other Wicket users handled interaction with Facebook Like button.
>>>
>>> Thanks
>>
>> -
>> 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: Anybody is having problems with Wicket and Facebook Like button?

2012-07-12 Thread Alec Swan
I used Apache httpd.conf to rewrite our URLs to exclude jsessionids,
but this did not fix the problem with Facebook Like button. Now I am
wondering if the problem is related to Wicket inserting ../../ in the
middle of the URL when Tomcat redirects sessionless user to the URL
with jsessionid as in the following:
"The page at 
http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1FBAE4A7B21CA0FC7B8B10BB21EF1
could not be reached."

I reviewed several web sites on
https://cwiki.apache.org/WICKET/websites-based-on-wicket.html but
didn't find any that have a Like button that allows the user to like a
Wicket-generated page.

Can anybody send me a link to a page with a Like button pointing to a
Wicket-generated page? I'd really like to see what's the difference
between that and what we are doing.

Thanks!

On Thu, Jul 5, 2012 at 9:58 PM, Dale Ogilvie  wrote:
> Alec, If you are running in Tomcat 7 you can add this to your web.xml to
> turn off tomcat JSESSIONID in urls. Tomcat puts a jsessionid on all urls
> until it receives a session cookie from the client, to cope with
> cookieless clients.
>
> 
> COOKIE
> 
>
> This is part of the servlet 3.0 spec.
>
> http://www.w3.org/2001/XMLSchema-instance";
> xmlns="http://java.sun.com/xml/ns/javaee";
> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; id="WebApp_ID"
> version="3.0">
>
>
> -Original Message-
> From: Alec Swan [mailto:alecs...@gmail.com]
> Sent: Friday, 6 July 2012 6:47 a.m.
> To: users@wicket.apache.org
> Subject: Re: Anybody is having problems with Wicket and Facebook Like
> button?
>
> Sorry for pushing this again, but this is a huge issue for us. Is
> anybody having problems with Facebook Like button?
>
> On Tue, Jul 3, 2012 at 3:34 PM, Alec Swan  wrote:
>> Hello,
>>
>> We started receiving complaints from users saying that Facebook Like
>> buttons don't work on our web site anymore. I don't know what happened
>
>> on the Facebook side but now we are seeing the following errors when
>> user clicks Like button, e.g. on
>> http://galecsy.com:88/lrm/ms/oid/74989:
>>
>> The page at
>> http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1F
>> BAE4A7B21CA0FC7B8B10BB21EF1
>> could not be reached.
>>
>> I read "SEO - Search Engine Optimization" and overwrote newWebResponse
>
>> to remove JSESSIONID, however it looks like JSESSIONID is still being
>> added somewhere, probably Tomcat.
>>
>> I know this is not directly related to Wicket, but I am wondering how
>> other Wicket users handled interaction with Facebook Like button.
>>
>> Thanks
>
> -
> 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: Anybody is having problems with Wicket and Facebook Like button?

2012-07-05 Thread Alec Swan
Sorry for pushing this again, but this is a huge issue for us. Is
anybody having problems with Facebook Like button?

On Tue, Jul 3, 2012 at 3:34 PM, Alec Swan  wrote:
> Hello,
>
> We started receiving complaints from users saying that Facebook Like
> buttons don't work on our web site anymore. I don't know what happened
> on the Facebook side but now we are seeing the following errors when
> user clicks Like button, e.g. on
> http://galecsy.com:88/lrm/ms/oid/74989:
>
> The page at 
> http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1FBAE4A7B21CA0FC7B8B10BB21EF1
> could not be reached.
>
> I read "SEO - Search Engine Optimization" and overwrote newWebResponse
> to remove JSESSIONID, however it looks like JSESSIONID is still being
> added somewhere, probably Tomcat.
>
> I know this is not directly related to Wicket, but I am wondering how
> other Wicket users handled interaction with Facebook Like button.
>
> Thanks

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



Anybody is having problems with Wicket and Facebook Like button?

2012-07-03 Thread Alec Swan
Hello,

We started receiving complaints from users saying that Facebook Like
buttons don't work on our web site anymore. I don't know what happened
on the Facebook side but now we are seeing the following errors when
user clicks Like button, e.g. on
http://galecsy.com:88/lrm/ms/oid/74989:

The page at 
http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1FBAE4A7B21CA0FC7B8B10BB21EF1
could not be reached.

I read "SEO - Search Engine Optimization" and overwrote newWebResponse
to remove JSESSIONID, however it looks like JSESSIONID is still being
added somewhere, probably Tomcat.

I know this is not directly related to Wicket, but I am wondering how
other Wicket users handled interaction with Facebook Like button.

Thanks

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



Re: Verifying image HREF with Wicket tester

2012-06-20 Thread Alec Swan
So, this is a bug, right?

On Wed, Jun 20, 2012 at 2:36 AM, Martin Grigorov  wrote:
> On Wed, Jun 20, 2012 at 11:34 AM, Carl-Eric Menzel
>  wrote:
>> On Tue, 19 Jun 2012 15:21:17 -0600
>> Alec Swan  wrote:
>>
>>> I had to make sure that my  element had a closing 
>>>
>>> The problem is that
>>> org.apache.wicket.util.tester.TagTester#createTagByAttribute requires
>>> the  element to be closed, i.e.  or . Otherwise
>>> closeTag variable is never set and the loop does not exit.
>>>
>>> Seems like a bug to me, isn't it?
>>
>> A lone open  tag wouldn't be valid XHTML. Does our HTML5 support
>> include support for non-wellformed documents?
>
> Yes.
>
>>
>> Carl-Eric
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> 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



  1   2   3   4   >