Re: Wicket links does not work in Firefox/IE?

2010-07-04 Thread Duy Do
I still can not solve this issue, do you have any solution?

Duy

On Fri, Jul 2, 2010 at 6:28 PM, Duy Do doquoc...@gmail.com wrote:

 Hi all,

 I built a web app with Wicket and it works fine in Chrome, Safari but it
 does not work in Firefox and IE.
 In Firefox/IE after clicking on links of navigation, the corresponding page
 does not display but if I click refresh ( or F5) it is OK.

 Could you give me a solution to get rid of this problem?

 Thanks and regards,
 Duy





Re: Wicket links does not work in Firefox/IE?

2010-07-04 Thread Martijn Dashorst
Unless you provide some code we can't help you. We all have
applications deployed towards millions of users using Wicket, and yet
they all work fine in all browsers.

Martijn

On Sun, Jul 4, 2010 at 11:34 AM, Duy Do doquoc...@gmail.com wrote:
 I still can not solve this issue, do you have any solution?

 Duy

 On Fri, Jul 2, 2010 at 6:28 PM, Duy Do doquoc...@gmail.com wrote:

 Hi all,

 I built a web app with Wicket and it works fine in Chrome, Safari but it
 does not work in Firefox and IE.
 In Firefox/IE after clicking on links of navigation, the corresponding page
 does not display but if I click refresh ( or F5) it is OK.

 Could you give me a solution to get rid of this problem?

 Thanks and regards,
 Duy







-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

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



Re: Correct way of setting charset

2010-07-04 Thread Antoine van Wel
Maybe this is what you need, in your WebApplication's init method :

getMarkupSettings().setDefaultMarkupEncoding(UTF-8);




On Fri, Jul 2, 2010 at 9:29 AM, Sigmar Muuga meedi...@gmail.com wrote:

 Hello,
 what is the correct way of setting my pages charset?

 I did something like this and it didnt have any effect:
 @Override
 protected void configureResponse() {
 super.configureResponse();
 final String encoding = text/ + getMarkupType() + ; charset=UTF-8;
 getResponse().setContentType(encoding);
 }

 I want to set everything in UTF-8.

 Also, when I did something like this(like it is said in docs, I got error:
 final String encoding = text/ + getMarkupType() + ; charset= +
 CharSetUtil.getEncoding(getRequestCycle());
 getResponse().setContentType(encoding);

 And the error:
 java.lang.IndexOutOfBoundsException: Index: 4, Size: 0
 at java.util.ArrayList.add(ArrayList.java:367)
 at

 org.apache.wicket.extensions.util.encoding.CharSetMap.init(CharSetMap.java:238)
 at

 org.apache.wicket.extensions.util.encoding.CharSetUtil.initialize(CharSetUtil.java:72)
 at

 org.apache.wicket.extensions.util.encoding.CharSetUtil.getEncoding(CharSetUtil.java:102)


 Sigmar



Re: Ajax channel busy

2010-07-04 Thread nino martinez wael
Yeah it does seems as a problem.. what if you try putting in dummy functions
with alerts in them?

2010/7/3 David Leangen wic...@leangen.net


 Ok, thanks,

 So, if it should be ok, I wonder why after the first execution, I only get

 INFO: Channel busy - postponing...

 So I can't use my component more than once...






 On Jul 3, 2010, at 10:36 PM, nino martinez wael wrote:

  Should be ok I guess, heres the definition of it, ..:

 function wicketAjaxGet(url, successHandler, failureHandler, precondition)




 2010/7/3 David Leangen wic...@leangen.net


 I should add that in my onCloseHandler, I have this in my js:

  $('#popup #popup-close-link').click(function (e)
  {
  e.preventDefault();
  $('#popup-mask, #popup-window').hide();
  if( url !=  )
  wicketAjaxGet(url, null, null, null);
  });

 As far as I can tell, this seems to be the correct use of
 wicketAjaxGet...


 Cheers,
 =David




 On Jul 3, 2010, at 4:22 PM, David Leangen wrote:


  Hello, Wicketeers,

 I have a link that is supposed to call a JQuery component called
 popup.

 final AjaxLinkVoid popupLink = new AjaxLinkVoid( link.popup )
 {
   @Override
   public void onClick( AjaxRequestTarget target )
   {
   target.addComponent( popup );
   final StringBuilder s = new StringBuilder();
   s.append( $.fn.popup({ )
   .append( url: \ ).append( onCloseBehavior.getCallbackUrl()
 ).append( \ )
   .append( }); );
   target.appendJavascript( s.toString() );
   }
 };

 Works just fine the first time, but each subsequent call, I can see the
 following message in the Ajax Debug Window:

 INFO: Channel busy - postponing...


 Other than the link above, nothing else is going on!

 Do I need to somehow close the channel, or something?


 Thanks!
 =David


 -
 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




Page maps problem

2010-07-04 Thread Branislav Kalas

Hi,
sorry for my terrible english.I am trying to achieve this:
I have webapp where i want to allow users open some links in new window. 
I want to create new page maps for those windows (cause i think , it's 
correct (page expired problem)).
In some pages i use pickers that opens modal windows (and this modal 
windows runs also in new page maps).

I have default setting of maximum page maps (which is 6)
Wicket version  is 1.4.1 (maybe i can upgrade if it solves the problem)
My problem is that when i open link in new window and open modal window 
in old page for 5 times, new window returns to login page (which is IMHO 
caused by its removed page map from session).
I tried to delete page map of modal window when it is closed but without 
success.


I got this in init method of application class:
getPageSettings().setAutomaticMultiWindowSupport(true);

I got this in modal window close events :
  modal.setWindowClosedCallback(new 
ModalWindow.WindowClosedCallback() {

public void onClose(AjaxRequestTarget target) {
target.addComponent(ProductPicker.this);
Session.get().removePageMap(modal.getPage().getPageMap());

}
});
modal.setCloseButtonCallback(new 
ModalWindow.CloseButtonCallback() {

public boolean onCloseButtonClicked(AjaxRequestTarget target) {
target.addComponent(ProductPicker.this);
Session.get().removePageMap(modal.getPage().getPageMap());
return true;
}
});
This is how i am creating modal window:
modal.setCookieName(modal);
modal.setHeightUnit(px);
modal.setWidthUnit(px);
modal.setInitialWidth(900);
modal.setInitialHeight(800);
modal.setTitle(new 
StringResourceModel(productPickerModal.label, this, null));

modal.setVersioned(false);

And this are links that opens in new pages (tabs) :
  //java part
  Link newWindowMenuItemLink = new Link(newWindowMenuItemLink) {
@Override
public void onClick() {

setResponsePage(lItem.getPageClass().newInstance());

}
  //html part
a class=swap wicket:id=newWindowMenuItemLink href=# 
target=_blankspan class=altClick;/span/a


Can you pls give me any hint what could be possibly wrong,or how can i 
delete modal window page map when it is closed?


Ideally i would like also remove page maps when user closes browser window.

Thanks.


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



RE: Modal dialog with two forms on separate tabbed panels intermittently not working

2010-07-04 Thread Chris Colman

I found something strange in my code where setMarkupId was being called
but I couldn't see a reason for it. I've removed that code and haven't
seen the problem occur since so I'm keeping my fingers crossed that this
was the cause.

Regards,
Chris

-Original Message-
From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
Sent: Sunday, 4 July 2010 10:25 AM
To: users@wicket.apache.org
Subject: Modal dialog with two forms on separate tabbed panels
intermittently not working

We have an authentication modal window that contains a tabbed panel
with
two tabs, each with their own form: one for log on and one for
registering. The user can switch between the tabs and proceed with the
one that is appropriate to them.

This works fine for most of the time however there is an intermittent
problem whereby it appears as though the normal transferring of field
data to the model does not occur - whether field values satisfy the
verification process or not.

The verification error message that displays indicates that wicket
thinks that all fields were left completely blank - when they were
filled in.

Anyone else seen this issue?

I can't work out steps to reproduce the problem reliably but it seems
more likely to occur if I toggle between the log on/sign up tabs a few
times before entering data and submitting one of the forms.

A couple of users have also complained that they can't log into our
application which would indicate that intermittently users are also
seeing the problem.

Happens on both FF 3.6.6 and IE 8

-
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: 3.5 Hibernate 1.1 tutorial wicketized/eclipseized

2010-07-04 Thread David Brown
Hello, I put the hib-tut.zip file in my gmail uploaded files in a
directory called uploads. I don't know what u need to do to get to my
uploaded files on gmail. :-David.

On Sat, 2010-07-03 at 10:29 -0700, rmh1981 wrote:
 
 David Brown wrote:
  i have a wicketized/eclipseized hibernate 1.1 tutorial that should work
  out-of-the-box albeit for mysql only. Where to upload the project? Or, I
  can put it on my blog for download? 
  
 
 
 I have been looking for a tutorial with hibernate and wicket so that would
 be great - if you could post the link that would be appreciated.



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



Re: Wicket links does not work in Firefox/IE?

2010-07-04 Thread Duy Do
Thanks a lot for your reply, Martijn.

I use Wicket in normal way but it seems that I had some problems.

*This is code for rendering view,the navigation (IndexPanel) included:*

public class ViewWidgetPanel extends CardWidgetPanelWidgetBuilder?, View
 implements ViewWidgetBuilderPanel {

 private ListViewPresentationElement indexPanel;

 private ListChapterWidgetBuilder? chapterWidgets = new
 ArrayListChapterWidgetBuilder?();

 public ViewWidgetPanel(String id) {
 super(id);
 }

 @SuppressWarnings(serial)
 @Override
 protected void doInit() {

 super.doInit();
 indexPanel = new ListViewPresentationElement(index,
 new ModelArrayListPresentationElement(
 new ArrayListPresentationElement())) {

 @Override
 protected void populateItem(final ListItemPresentationElement item) {

 item.add(new LabelledIconLink(chapterReference) {

 ListItemPresentationElement thisItem = item;

 @Override
 protected LinkVoid createLink(String linkId) {
 return new LinkVoid(linkId) {
 @Override
 public void onClick() {
 select(thisItem.getModel().getObject());
 }
 };
 }

 @Override
 protected Label createLabel(String labelId) {

 return new Label(labelId, item.getModel().getObject()
 .getLabel(getLocale()));
 }
 });

 }
 };

 add(indexPanel);

 }

 protected void select(PresentationElement chapter) {

 ChapterWidgetBuilder? chapterWidgetBuilder = WidgetBuilder.Utils
 .findByPresentationModel(chapterWidgets, chapter);

 addOrReplaceContent((Component) chapterWidgetBuilder
 .getNativeToolkitObject());

 }

 @Override
 public void addChild(ChapterWidgetBuilder? contentType) {

 indexPanel.getModel().getObject().add(
 contentType.getPresentationElement());

 chapterWidgets.add(contentType);

 if (chapterWidgets.size() == 1) {
 select(contentType.getPresentationElement());
 }
 }


}

*And this is CardWidgetPanel, super class of ViewWidgetPanel:*

public class CardWidgetPanelT_ContentType extends WidgetBuilder?, T_PE
 extends PresentationElement
 extends BasicWicketWidgetPanelT_ContentType, T_PE {

 public static final String CONTENT_ID = content;

 public CardWidgetPanel(String id) {
 super(id);
 }

 @Override
 protected void doInit() {
 add(createEmptyContent());
 }

 protected Panel createEmptyContent() {
 return new EmptyPanel(CONTENT_ID);
 }

 protected void addOrReplaceContent(Component c) {

 if (!c.getId().equals(CONTENT_ID)) {
 throw new IllegalArgumentException(
 Id of child must be 'content'. It was ' + c.getId() +
 ');
 }
 Component currentComponent = get(CONTENT_ID);

 if (currentComponent == null) {
 add(c);
 } else {
 currentComponent.replaceWith(c);
 }
 }

 }



Do you have any suggestion?

Thanks,
Duy

On Sun, Jul 4, 2010 at 2:43 AM, Martijn Dashorst martijn.dasho...@gmail.com
wrote:

 Unless you provide some code we can't help you. We all have
 applications deployed towards millions of users using Wicket, and yet
 they all work fine in all browsers.

 Martijn

 On Sun, Jul 4, 2010 at 11:34 AM, Duy Do doquoc...@gmail.com wrote:
  I still can not solve this issue, do you have any solution?
 
  Duy
 
  On Fri, Jul 2, 2010 at 6:28 PM, Duy Do doquoc...@gmail.com wrote:
 
  Hi all,
 
  I built a web app with Wicket and it works fine in Chrome, Safari but
it
  does not work in Firefox and IE.
  In Firefox/IE after clicking on links of navigation, the corresponding
page
  does not display but if I click refresh ( or F5) it is OK.
 
  Could you give me a solution to get rid of this problem?
 
  Thanks and regards,
  Duy
 
 
 
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.4 increases type safety for web applications
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.8

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



Re: Ajax channel busy

2010-07-04 Thread David Leangen

Ok, this is fun. It was due to an error in my script.

I've been doing Java for so many years that I forgot how to use a dynamic 
language. I guess I'm too used to having the compiler tell me how much of an 
idiot I am so I have less pain at runtime. ;-)


BTW, for you experts in js, is there any kind of compiler or validator or 
something that you use to help locate errors? Or do you just play around with 
things at runtime? Or are you just smarter than me and don't make so many typos?


Cheers,
=David


On Jul 5, 2010, at 3:19 AM, nino martinez wael wrote:

 Yeah it does seems as a problem.. what if you try putting in dummy functions
 with alerts in them?
 
 2010/7/3 David Leangen wic...@leangen.net
 
 
 Ok, thanks,
 
 So, if it should be ok, I wonder why after the first execution, I only get
 
 INFO: Channel busy - postponing...
 
 So I can't use my component more than once...
 
 
 
 
 
 
 On Jul 3, 2010, at 10:36 PM, nino martinez wael wrote:
 
 Should be ok I guess, heres the definition of it, ..:
 
 function wicketAjaxGet(url, successHandler, failureHandler, precondition)
 
 
 
 
 2010/7/3 David Leangen wic...@leangen.net
 
 
 I should add that in my onCloseHandler, I have this in my js:
 
 $('#popup #popup-close-link').click(function (e)
 {
 e.preventDefault();
 $('#popup-mask, #popup-window').hide();
 if( url !=  )
 wicketAjaxGet(url, null, null, null);
 });
 
 As far as I can tell, this seems to be the correct use of
 wicketAjaxGet...
 
 
 Cheers,
 =David
 
 
 
 
 On Jul 3, 2010, at 4:22 PM, David Leangen wrote:
 
 
 Hello, Wicketeers,
 
 I have a link that is supposed to call a JQuery component called
 popup.
 
 final AjaxLinkVoid popupLink = new AjaxLinkVoid( link.popup )
 {
  @Override
  public void onClick( AjaxRequestTarget target )
  {
  target.addComponent( popup );
  final StringBuilder s = new StringBuilder();
  s.append( $.fn.popup({ )
  .append( url: \ ).append( onCloseBehavior.getCallbackUrl()
 ).append( \ )
  .append( }); );
  target.appendJavascript( s.toString() );
  }
 };
 
 Works just fine the first time, but each subsequent call, I can see the
 following message in the Ajax Debug Window:
 
 INFO: Channel busy - postponing...
 
 
 Other than the link above, nothing else is going on!
 
 Do I need to somehow close the channel, or something?
 
 
 Thanks!
 =David
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


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



Re: How to override container markup package loaction?

2010-07-04 Thread Arjun Dhar

Ernest, Igor -- thanks!

I had gone to that wiki earlier; I only focussed on the section that talked
about Wicket 1.3 (which only allows to change location in Classpath) so I
missed the point. I saw 1.2 and modified the code to pick up any file from
the ServletContext; and it works with the code as follows:


public ResourceStreamLocator getFileResourceStreamLocator(final
ServletContext sc) {
final IResourceStreamLocator defaultLocator =
super.getResourceSettings().getResourceStreamLocator();
return new ResourceStreamLocator(){
@Override
public IResourceStream locate(final Class? clazz, final String
path) { 
String fullPath = /html + path.replaceFirst(Your 
base package
name for WebPage components, ); //TODO: Cleanup!
log.debug([getFileResourceStreamLocator.locate] fullPath =
 + fullPath);
try {
final URL url = sc.getResource(fullPath);

if (url != null) {
return new UrlResourceStream(url);
}

} catch(MalformedURLException e) { }

return defaultLocator.locate(clazz, path); //Use default
locator
}
};
}


I also had a typo in the package name of my templates :) :p
(I'm using Markup inheritance; so my templates are put in another package.
Due to the typo of that package name, Wicket was unable to locate the
templates and causing issues).

All fixed. Thanks to your posts I went back and realized my mistakes.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-override-container-markup-package-loaction-tp2274647p2278053.html
Sent from the Wicket - User 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



Single inheritence in parts

2010-07-04 Thread Arjun Dhar

Hi,
 all the examples etc suggest that Single inheritence is possible but I cant
break it up. The break up is essential when you want to merge common parts
of your MARKUP with multiple specific parts of the Child page.

Example:


HTML
HEADtitleBASE TEMPLATE / PARENT PAGE/title/HEAD

BODY
wicket:child /
br /
h2Some other Html common/h2
wicket:child /
/BODY
/HTML


---

HTML
HEADtitleCHILD PAGE 1/title/HEAD

BODY
wicket:extend
Part 1 specific to Child Page
/wicket:extend
Any HTML here can be ignored as conceptually anyway what appears in
extend is what should be rendered from a child page.
wicket:extend
Part 2 Specific to Child Page (will appear after common
HTML in parent page)
/wicket:extend
/BODY
/HTML


I tried this, only the first part renders. I'm wondering if we can add such
capability. Conceptually I don't see why not. If already possible do let me
know or consider as a feature request?!

-Thanks Arjun
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Single-inheritence-in-parts-tp2278064p2278064.html
Sent from the Wicket - User mailing list archive at Nabble.com.

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



Re: Correct way of setting charset

2010-07-04 Thread Sigmar Muuga
Don't know that if is it the most correct way or not, but it works. My
dotted letters are now working.
But this option applies only to markup? What about other content(like JSON)?

Sigmar

On Sun, Jul 4, 2010 at 7:31 PM, Antoine van Wel
antoine.van@gmail.comwrote:

 Maybe this is what you need, in your WebApplication's init method :

 getMarkupSettings().setDefaultMarkupEncoding(UTF-8);




 On Fri, Jul 2, 2010 at 9:29 AM, Sigmar Muuga meedi...@gmail.com wrote:

  Hello,
  what is the correct way of setting my pages charset?
 
  I did something like this and it didnt have any effect:
  @Override
  protected void configureResponse() {
  super.configureResponse();
  final String encoding = text/ + getMarkupType() + ; charset=UTF-8;
  getResponse().setContentType(encoding);
  }
 
  I want to set everything in UTF-8.
 
  Also, when I did something like this(like it is said in docs, I got
 error:
  final String encoding = text/ + getMarkupType() + ; charset= +
  CharSetUtil.getEncoding(getRequestCycle());
  getResponse().setContentType(encoding);
 
  And the error:
  java.lang.IndexOutOfBoundsException: Index: 4, Size: 0
  at java.util.ArrayList.add(ArrayList.java:367)
  at
 
 
 org.apache.wicket.extensions.util.encoding.CharSetMap.init(CharSetMap.java:238)
  at
 
 
 org.apache.wicket.extensions.util.encoding.CharSetUtil.initialize(CharSetUtil.java:72)
  at
 
 
 org.apache.wicket.extensions.util.encoding.CharSetUtil.getEncoding(CharSetUtil.java:102)
 
 
  Sigmar