Re: Wicket 1.5.4 - Application crashing on German umlaut characters

2012-02-23 Thread Gregor Kaczor

I had similar problems without that Exception.

Have you added

URIEncoding="UTF-8"

to your connector?

See 
http://struts.apache.org/2.0.6/docs/how-to-support-utf-8-uriencoding-with-tomcat.html


On 02/23/2012 09:07 AM, Martin Grigorov wrote:

Hi,

Create a quickstart and attach it to a ticket.
Thanks!

On Thu, Feb 23, 2012 at 5:26 AM, toytown  wrote:

Wicket : 1.5.4
Tomcat : 6.0.28 to 6.0.35
JDK - 1.6
  I have a simple search application where I could enter search parameters
like city name in a input textbox component. I am using displaying the
results in a separate page by passing search criteria  as pageparameters.

searchForm.add(new Button("submitSearch") {

@Override
public void onSubmit() {
PageParameters params =  new PageParameters();
params.set("city", req.getCity());
setResponsePage(SearchResultPage.class, params);
}

});

If a pass normal String like 'Munich' without umlauts everything works ok
  The url is like http://localhost:8080/ecom/home/results?city=Munich  which
is ok and working fine

If I pass the city name with umlaut like 'München' then, I get url like
http://localhost:8080/ecom/home/results?city=München&city=München&city=München&city=München&city=München&city=München&city=MÃÃ

and EXCEPTION  trace in my log file looks like

05:18:28,092 DEBUG pache.wicket.page.PageAccessSynchronizer: 219 -
'http-8080-1' notifying blocked threads
23.02.2012 05:18:28 org.apache.coyote.http11.Http11Processor process
SCHWERWIEGEND: Error processing request
java.lang.ArrayIndexOutOfBoundsException: 8192
at
org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:730)
at
org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:641)
at
org.apache.coyote.http11.InternalOutputBuffer.sendHeader(InternalOutputBuffer.java:514)
at
org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1637)
at
org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:956)
at org.apache.coyote.Response.action(Response.java:183)
at org.apache.coyote.Response.sendHeaders(Response.java:379)
at
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:314)
at 
org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:274)
at 
org.apache.catalina.connector.Response.finishResponse(Response.java:493)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:317)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
23.02.2012 05:18:28 org.apache.coyote.http11.Http11Processor process


   There itself is no RuntimeException thrown from wicket but somehow it
generates some strange url which causes ArrayIndexOutofBoundException.

Is this a bug in Wicket or that my preassumption was wrong that
pageparameters should be encoded by Wicket when displayed in the url ? What
is the wa to get around this problem ?

Thanks in advance.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-4-Application-crashing-on-German-umlaut-characters-tp4412794p4412794.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







--
How to find files on the Internet? FindFiles.net !


Update ajax target on onmouseover, but just once

2011-12-13 Thread Gregor Kaczor

Hi!

I have a link of which I show only the file name, the href attribute is 
empty.


On an onmouseover event I would like to update the link via ajax to show 
it completely with href attribute.


To avoid unnecessary load on the server this should happen just once per 
link on the page.


If the page gets reloaded the link will be again shown only by name with 
emptry href -attribute.


Any ideas?

Gregor
--
How to find files on the Internet? FindFiles.net !


Update Component on TextField Entry

2011-11-17 Thread Gregor Kaczor

Hi!

I need a hint how to solve the following problem.

I have a RepeaterView displaying a list of static links. Below there is 
a text field. As soon as  something is entered in that textfield (not 
whitespace) I would like to replace those links with a list of 
completely different links containing a parameter with content from the 
text field.


Both link lists have the same number of items.

I was thinking to use AutoCompleteTextField to do that, but how do I 
replace those links from  protected Iterator getChoices(String input) ?


Kind Regards

Gregor

--
How to find files on the Internet? FindFiles.net !


Re: Basic l10n / i18n question: must page be re-rendered?

2011-08-23 Thread Gregor Kaczor
I have exactly the same problem, though i use an xml file for the 
translations. Any help out there?


On 08/23/2011 02:09 PM, Alexandros Karypidis wrote:

Hello,

I have written a locale selector by extending DropDownChoice (you can 
see the essential stuff of the implementation below). The problem is 
that when the user changes the locale, the page needs to be 
re-rendered using the newly selected locale. This does NOT happen. 
Instead, only the "" input box seems to be refreshed to use 
the new locale, whereas the rest of the page content is still rendered 
using the previously selected locale. However, the locale has been 
changed in the Session which can be seen when the user navigates to 
another page (e.g. by clicking on a link), as the new page is rendered 
using the newly-selected locale.


So, how can I force the current page to be re-rendered?

Implementation of my locale selector is as follows:

Markup: 
Component code:
public class LocaleDropDown extends DropDownChoice {
//...
public LocaleDropDown(final String id, final List choices) {
// ...
setModel(new IModel() {
public Locale getObject() {
return getSession().getLocale();
}
@Override
public void setObject(Locale locale) {
getSession().setLocale(locale);
// need something here to tell wicket to refresh the 
entire page?

}
});
// ...
}

@Override
protected boolean wantOnSelectionChangedNotifications() {
// post an event when user changes the selected value in the 
drop-down box

return true;
}
}

-- Kind regards, Alex

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




--
How to find files on the Internet? FindFiles.net !


Re: Opening Wicket Page in New Browser Tab/Window

2011-08-18 Thread Gregor Kaczor

Some months ago I had the same/similar problem.

You have to add the attribute by overriding onComponentTag(ComponentTag 
tag). As far as I remember you should use the usual 
org.apache.wicket.markup.html.form.Button with it, AjaxButton won't work.


Form form = new Form("ConvertForm") {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("target", "_blank");
}
};
--
How to find files on the Internet? FindFiles.net !

On 08/18/2011 02:30 PM, aksarben wrote:

How can I make a Wicket page open in a new browser tab/window? I'm not
talking about a popup, but a standard window. I have an app that needs to
open a GIS map viewer in a separate window, based on the user's current
context. The map viewer requires that I submit a form with GPS coordinates,
so I need Wicket to render some simple HTML with the coordinates in hidden
form fields, then submit the form to the map viewer URL as soon as the page
renders. This part is no problem. The problem is that Wicket renders the
HTML in the wrong window.

Currently, I'm using code to generate the link to invoke the map viewer:

*final MenuItem mapMenu = new EnmMenuItem("Map") {
private static final long serialVersionUID = 1L;

@Override protected AbstractLink newLink(final String componentId) {
final SubmitLink link = new SubmitLink(componentId, form) {
private static final long serialVersionUID = 1L;
@Override public void onSubmit() {
selectMapMenu();
}
};
link.setDefaultFormProcessing(false);
link.setEnabled(true);
link.setRenderBodyOnly(false);
link.add(new SimpleAttributeModifier("target", "_blank"));

return link;
}
};*

When the menu item is chosen, the following is invoked:

*@Override protected void selectMapMenu() {
for (final TrackSummary summary : grid.getSelectedItems()) {
try {
setResponsePage(new TrackMapRequestPage(summary.getSystemNumber()));
}
catch (final UnauthorizedPageError ex) {
error(ex.getMessage());
}
}
}*

Despite setting the link target to "_blank", the TrackMapRequestPage opens
in the SAME window as the application. How can I make it open in a DIFFERENT
window so both windows are visible at the same time? My design specs says
the new window shouldn't be a popup.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Opening-Wicket-Page-in-New-Browser-Tab-Window-tp3752465p3752465.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







Open new Tab via form target

2011-06-25 Thread Gregor Kaczor

Hi!

I have a problem with opening a new tab via a form.

I am using Wicket 1.4.17 on Ubuntu 11.04 with java 1.6.0_24-b07 and 
Tomcat 7.0.12


On a page I have a Download Button in a form with a Link to a file or an 
image.

After clicking on that button a new Tab should be opened with that link.

Unfortunatelly the file opens in the working tab. Adding target="_blank" 
to the form or the submit button does not change that behaviour.


Just for fun i removed the wicket-ajax.js from the html file and opening 
a new tab via a form WORKED!


Here is my code. What do I have to do to open a new tab when the 
AjaxFallbackButton is clicked?



Form form = new Form("downloadForm"){
@Override
protected void onComponentTag(ComponentTag tag) {
// TODO Auto-generated method stub
super.onComponentTag(tag);
tag.put("target","_blank");
}
};
final Model buttonLabelModel = new 
Model("DOWNLOAD");


final Label label = new Label("downloadButtonLabel", 
buttonLabelModel);

label.setOutputMarkupId(true);
label.setOutputMarkupPlaceholderTag(true);

final AjaxFallbackButton a = new 
AjaxFallbackButton("downloadButton",

form) {

private static final long serialVersionUID = 
5109029782741176146L;


@Override
protected void onSubmit(AjaxRequestTarget target, Form 
form) {


String url = 
solrDocument.getFieldValue("idadr").toString();
System.out.println(queryResultLine.toString() + "\tDL: 
" + url

+ "\tPosition: " + positionCounter);

getRequestCycle().setRequestTarget(
new RedirectRequestTarget(url));

}
};

a.add(label);
form.add(a);



"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

...



...


I am aware of the fact, that i am adding target=_blank twice over the 
onComponent methid and in the html. I tested combinations without results.


Kind Regards

Greg


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