IComponentResolver and ajax components

2012-09-08 Thread hok
Hello, 
I'm using custom IComponentResolver for inserting widgets in the markup.
In this way I can create markup templates, which can be populated with
components. However, as far as I have read, the components that are inserted
via IComponentResolver are not serialized as part of the page, so if they
have some state associated with them (e.g. ajax, stateful form) this
functionality doesn't work. Is it possible that these remain part of the
page? Thanks in advance.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IComponentResolver-and-ajax-components-tp4651869.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Wicket 1.5 and panel with different markup location

2012-09-07 Thread hok
Hello,
In my application I need a specific Panel, which retrieves it's markup file
from location outside the package. This rule applies only for this specific
panel (the other components in the application are using the standard markup
sourcing mechanism). Could you give me an example on how to specify a
different path for the markup file, while still using the caching provided
by MarkupFactory. I've tried overriding
MarkupContainer.getAssociatedMarkup(), but I receive an exception
org.apache.wicket.markup.MarkupNotFoundException: Expected to find
wicket:panel in associated markup file. Thanks in advance.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-and-panel-with-different-markup-location-tp4651853.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



URLs with page id and Component.isVersioned

2011-11-20 Thread hok
Hello,
this issue has been discussed previously
(http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-td3816663.html).
If it is safe for a page not to keep it's versions (for exapmle if the whole
state is in the page paramgers) the page id in the url is not needed
anymore. Also, as discussed, this will be good for SEO and for Google
Analytics.
Is it possible for the page URLs not to include page id if a
Page.isVersioned() returns false? As far as I can understand, currently, if
this method returns false a new page will be created every time (even if
back button is pressed). This will give an easy way for removing page ids
from the URL when they are not needed. Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/URLs-with-page-id-and-Component-isVersioned-tp4089805p4089805.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



private Logger log property in WebPage and Component

2011-10-14 Thread hok
Hello,
the Component and WebPage classes have a private property /log/. Sometimes
in Pages and Components there is a need for logging, but in this case the
user have to instantiate separate logger, since the existing is not
accessible. Do you think it's possible to make the logger protected, or
provide a getter? Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/private-Logger-log-property-in-WebPage-and-Component-tp3904720p3904720.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



Stateful pages without page Id in the url

2011-09-15 Thread hok
Hello,
I have an application where all the pages are stateful (have ajax components
in them). However, most of the pages are also bookmarkable and can be fully
restored via the PageParameters. In addition to this, some of pages with
input forms contain unmanaged hibernate entities (unmanaged, because they
can be modified via ajax) and I would prefer to refresh every time the page
is requested from the server, instead of retrieving the page from the page
store. When wicket 1.5 was released I created the following class:

public class NoPageIdMountedMapper extends MountedMapper {

...

@Override
protected void encodePageComponentInfo(Url url, PageComponentInfo info)
{
super.encodePageComponentInfo(url, null);
}
}

which removed the page Id from the url and this didn't result in any other
change in the behavior. However in the latest wicket revisions (currently in
1.5-SNAPSHOT) this technique doesn't work anymore - the ajax in the pages
using NoPageIdMountedMapper is not working, because the ajax request url
doesn't contain the page id anymore. 

Is it still possible to have stateful pages without having the page id in
the url? Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3816663.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



Re: Stateful pages without page Id in the url

2011-09-15 Thread hok
Thanks for the fast response. In my case though, I have pages that are
defined by their page parameters, so even if the page is expired, pressing
F5 would reload the same page from the server (and it's not important if the
state is lost). However if I'm using the aforementioned
NoPageIdMountedMapper the ajax in the page is not working. So is there
another way besides this for achieving stateful page without page id in the
url?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3816779.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



Re: Stateful pages without page Id in the url

2011-09-15 Thread hok
Thanks Martin,
your solution seems to work. There are two cases where I need stateful pages
without page id. 
The first one is for purely aesthetic reasons and concerns bookmarkable
pages which can be opened with page parameters.
The second is a bit more important. I have a user profile page, where a user
can edit it's profile. This is a (relatively) complex form and, for example,
each user can add/remove contacts from a list (via ajax) and after this to
submit the form and the changes go to the database. Because of the ajax
lists I'm unable to use LoadableDetachableModel for the User object (which
is hibernate entity) and I'm using a regular Model. In this case, if the
page has id the user can make some changes to the profile and then to save
them. However, he can also return to an earlier version of the same page,
which also contains the same unmananged user object, but with older state
and not synchronized with the database (because of the newer changes).
This is a case I'm trying to avoid and by making the page not cache-able and
removing the id I can guarantee that whenever the user opens this page it'll
always be instantiated again with the correct state of the entity. In this
case though, the back functionality provided by the page id's is lost. Do
you know of a more elegant solution to the problem of having forms,
containing ajax lists? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Stateful-pages-without-page-Id-in-the-url-tp3816663p3817023.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



Re: WicketSessionFilter and ignorePaths in WicketFilter

2011-06-03 Thread hok
Hello,
after some investigation I reached to the following:
when a wicket session is created it is added as attribute to the
HttpSession:
HttpSessionStore.bind(), and inside it

setAttribute(request, getSessionAttribute(), newSession);

If we assume that inside web.xml the WicketFilter name is WICKET_FILTER,
the getSessionAttribute() method returns sessionWICKET_FILTER. Then,
inside 
setAttribute(request, getSessionAttribute(), newSession);
the attribute name, by which the wicket session will be stored in the
HttpSession is formed as
String attributeName = getSessionAttributePrefix(request) + name;, where
name is sessionWICKET_FILTER and getSessionAttributePrefix(request)
returns wicket:WICKET_FILTER:
As a result of all this the wicket session is stored in HttpSession with
attribute named 
wicket:WICKET_FILTER:sessionWICKET_FILTER

On the other hand when the WicketSessionFilter is asked for the session, it
forms it's own attribute value of the stored session:
Inside WicketSessionFilter.getSession() (line 208):
sessionKey = application.getSessionAttributePrefix(null, filterName) +
Session.SESSION_ATTRIBUTE_NAME;, where
application.getSessionAttributePrefix(null, filterName) returns
wicket:WICKET_FILTER: and Session.SESSION_ATTRIBUTE_NAME is session. As
a result WicketSessionFilter tries to get the session with attribute named
wicket:WICKET_FILTER:session

The attribute names from HttpSessionStore
(wicket:WICKET_FILTER:sessionWICKET_FILTER) and
WicketSessionFilter(wicket:WICKET_FILTER:session) are different and the
session cannot be retrieved.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570577.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



Re: WicketSessionFilter and ignorePaths in WicketFilter

2011-06-03 Thread hok
Yes, it's wicket 1.5
https://issues.apache.org/jira/browse/WICKET-3769
https://issues.apache.org/jira/browse/WICKET-3769 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570704.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



PackageResourceReference, MetaInfStaticResourceReference and timestamps

2011-03-23 Thread hok
Hello, 
I have two questions:
1. Currently it's possible to have: 

@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);

response.renderCSSReference(new 
PackageResourceReference(getClass(),
getClass().getSimpleName() + .css));
response.renderCSSReference(css/root.css);
}

Using a PackageResourceReference has the advantage of adding a last modified
timestamp to the filename (if enabled). Is it possible to have the same
thing for root.css, which resides in the root of the webapp ?

2. In the Servlet 3.0 specification it's possible to have static resources
under META-INF/resources and I noticed that wicket has
MetaInfStaticResourceReference, which is better for serving static
resources. In my case for some components I have css files which are loaded
like: 

response.renderCSSReference(new PackageResourceReference(getClass(),
getClass().getSimpleName() + .css));

So, it should be better to move all those css files under
META-INF/resources. However, this somehow contradicts with the wicket
philosophy of having everything in one place and requires maintaining a 
parallel package folder structure under META-INF/resources. Do you think
it's worth it?

Thanks.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/PackageResourceReference-MetaInfStaticResourceReference-and-timestamps-tp3401055p3401055.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



ModalWindow containing form in Wicket 1.5 RC1

2011-01-22 Thread hok

Hello,
There is a modal window that contains a panel, which contains a form:

FormVoid f = new FormVoid(modal_form);
add(f);
modal = new ModalWindow(window);
f.add(modal);
modal.setContent(new ModalTestPanel(modal.getContentId(), modal));

ModalTestPanel contains a form which is submitted via AjaxButton:

protected void onInitialize() {
super.onInitialize();

form = new FormVoid(form);
add(form);

AjaxButton submitButton = new AjaxButton(submit, form) {

private static final long serialVersionUID = 
7737945087600561134L;

@Override
protected void onError(AjaxRequestTarget target, 
Form? form) {
}

@Override
protected void onSubmit(AjaxRequestTarget target, 
Form? form) {
window.close(target);
}
};
form.add(submitButton);
}

Inside submitButton.onSubmit - window.close there is
getContent().setVisible(false) which hides ModalTestPanel (the content of
the window).


submitButton.onSubmit is called in Form.delegateSubmit: 

// when the given submitting component is not null, it means that it was
the
// submitting component
if (submittingComponent != null)
{
// use the form which the submittingComponent has submitted for 
further
processing
submittingComponent.onSubmit();
}

// Model was successfully updated with valid data

Visits.visitPostOrder(this, new IVisitorForm?, Void()
{
public void component(Form? form, IVisitVoid visit)
{
if (form.isEnabledInHierarchy()  
form.isVisibleInHierarchy())
{
form.onSubmit();
}
}
}, new ClassVisitFilter(Form.class));


In this case submitButton.onSubmit is called before form.onSubmit.
However inside submitButton.onSubmit ModalTestPanel is hidden (and so is the
form in it) and in this case:

if (form.isEnabledInHierarchy()  form.isVisibleInHierarchy())

returns false, because form.isVisibleInHierarchy() returns false.

This code worked under 1.5-M3.
Is this a desired behavior? Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-containing-form-in-Wicket-1-5-RC1-tp3232077p3232077.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



Re: ModalWindow containing form in Wicket 1.5 RC1

2011-01-22 Thread hok

Forgot to add the main thing - in this case Form.onSubmit is never called,
because the form is hidden before this.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-containing-form-in-Wicket-1-5-RC1-tp3232077p3232079.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



Custom error 404 page and page id-s

2011-01-16 Thread hok

Hello,
I've implemented the custom error 404 page solution from 
http://www.mkyong.com/wicket/how-do-configure-404-error-page-in-wicket-solution/
http://www.mkyong.com/wicket/how-do-configure-404-error-page-in-wicket-solution/
. However, I noticed some strange behavior:

There is a home page with a modal window in it, so the page is not
stateless:

public class TestPage extends WebPage {

public TestPage() {
}

@Override
protected void onInitialize() {
super.onInitialize();

add(new ModalWindow(modal_window));
}
}


The custom error page is stateless: 

public class PageNotFound extends WebPage {

public PageNotFound() {
super();
}

public PageNotFound(IModel? model) {
super(model);
}

public PageNotFound(PageParameters parameters) {
super(parameters);
}
}


The application class is: 

public class TestApplication extends WebApplication {
public TestApplication() {
}

@Override
protected void init() {
super.init();

ICompoundRequestMapper rootRequestMapper =
getRootRequestMapperAsCompound();
rootRequestMapper.add(new MountedMapper(/home, 
TestPage.class));
rootRequestMapper.add(new MountedMapper(/404, 
PageNotFound.class));
}

@Override
public Class? extends Page getHomePage() {
return TestPage.class;
}
}

... and the web.xml:

filter
filter-namewicket.WicketWarp/filter-name

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

param-valueorg.apache.wicket.TestApplication/param-value
/init-param
/filter

filter-mapping
filter-namewicket.WicketWarp/filter-name
url-pattern/*/url-pattern
dispatcherREQUEST/dispatcher 
dispatcherERROR/dispatcher
/filter-mapping

error-page
error-code404/error-code
location/404/location
/error-page

Since the home page is not stateless the page id is displayed also. When:

rootRequestMapper.add(new MountedMapper(/404, PageNotFound.class));

is present in the TestApplication the id of the home page is incremented by
2 each time the page is displayed (home?0, home?2, home?4..). When the error
page mapping is commented the id is incremented by 1 (as expected). From I
was able to trace in the wicket code on each request for the home page, also
a request for the error 404 custom page is made and because of this the id
is incremented by 2. Is this a normal behavior? Thanks in advance.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-error-404-page-and-page-id-s-tp3220118p3220118.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



Re: Custom error 404 page and page id-s

2011-01-16 Thread hok

Thanks for the fast response.
I've tried to test it with a simple test page, containing one AjaxLink:

public class TestPage extends WebPage {

public TestPage() {
}

@Override
protected void onInitialize() {
super.onInitialize();
add(new AjaxLinkVoid(link) {

private static final long serialVersionUID =
1135836169949178116L;

@Override
public void onClick(AjaxRequestTarget target) {
target.appendJavascript(alert('test'));
}
});
}
}

In this scenario the ajax link is working fine, but in chrome 9 the id's are
always incremented with 2, while in firefox 3.6 it's a bit strange - on the
first reload the id is incremented with 3, on the second time with 4 and
after this on every reload the id is incremented by 1 (this is a repeated
pattern that happens every time). 

I've also tried with the same page, but this time containing only a Form
(stateful): 

public class TestPage extends WebPage {

public TestPage() {
}

@Override
protected void onInitialize() {
super.onInitialize();
add(new FormVoid(form));
}
}

The result with both pages is the same, the second page doesn't have any
links. Can those page-not-found requests that lead to the incrementing ids
lead to a slower page load time and increased load on the server? Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-error-404-page-and-page-id-s-tp3220118p3220233.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



Re: Custom error 404 page and page id-s

2011-01-16 Thread hok

https://issues.apache.org/jira/browse/WICKET-3340
https://issues.apache.org/jira/browse/WICKET-3340 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Custom-error-404-page-and-page-id-s-tp3220118p3220259.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



Re: ModalWindow and z-index

2011-01-12 Thread hok

Thanks for the reply. As it appears I made a mistake by omitting the position
css property and according to 
http://www.w3schools.com/css/pr_pos_z-index.asp
http://www.w3schools.com/css/pr_pos_z-index.asp : 
z-index only works on positioned elements (position:absolute,
position:relative, or position:fixed).

After setting a position the element with large z-index is displayed in
front of the mask.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-z-index-tp3209922p3213703.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



ModalWindow and z-index

2011-01-11 Thread hok

Hello,
I'm trying to create a dijit tooltip
(http://docs.dojocampus.org/dijit/Tooltip) on a Modal window. However the
tooltip is displayed behind it (and behind the mask also). I checked
modal.css and modal.js and noticed the following: 
the mask that disables everything on the page has a z-index 2 and the
modal window itself has a z-index 20001 (I assume that by this the window
stays on top of the mask). I tried to set a much larger z-index value to the
tooltip, but it's still displayed behind the mask and the window. 
Also tried a simple div tag with larger z-index value on a random place of
the page (outside the window) but it's still hidden behind the mask. 
Is there a way to display something in front of the window and the mask
while the window is opened? Thanks in advance.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-and-z-index-tp3209922p3209922.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



DropDownChoice no selection value

2010-12-22 Thread hok

Hello,
I've noticed that the method
AbstractSingleSelectChoice.getNoSelectionValue() returns the value for no
selection. However in AbstractSingleSelectChoice.getDefaultChoice(final
Object selected) on line 314:
  return \noption selected=\selected\ value=\\ + option +
/option;

and on line 296:
  buffer.append( value=\\).append(option).append(/option);

In those cases the null value option has empty value attribute. Wouldn't it
be more consistent for this option to have the value attribute with the
result provided from getNoSelectionValue() ? I came into this while trying
to use dojo FilteringSelect, which doesn't select the first option if it
has empty value attribute.
Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-no-selection-value-tp3160661p3160661.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



Re: DropDownChoice no selection value

2010-12-22 Thread hok

Issue created:
https://issues.apache.org/jira/browse/WICKET-3278
https://issues.apache.org/jira/browse/WICKET-3278 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-no-selection-value-tp3160661p3160849.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



Re: DropDownChoice, AjaxFormComponentUpdatingBehavior and dijit.form.FilteringSelect

2010-12-20 Thread hok

Jeremy, thanks for the fast response. However my problem is not the same as
described in the other topic.
I'm using DropDownChoice, so I cannot use
AjaxFormChoiceComponentUpdatingBehavior (it throws an exception that it's
supposed to be used with RadioChoice/CheckboxChoice/RadioGroup/CheckGroup).
When I use the regular AjaxFormComponentUpdatingBehavior without dojo
FilteringSelect the behavior works normal and the value is transferred. The
problem occurs when I use FilteringSelect. 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-AjaxFormComponentUpdatingBehavior-and-dijit-form-FilteringSelect-tp3102241p3104029.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



ModalWindow open on page load (without ajax)

2010-12-03 Thread hok

Hello,
I'm trying to open a modal window without ajax request (when the page is
loaded). I've looked at 
https://issues.apache.org/jira/browse/WICKET-12
https://issues.apache.org/jira/browse/WICKET-12 

but trying the proposed solution does not work in my case. I can see in the
log that the window's panel is created but the window itself does not open
when the page is loaded. The code that I'm using is:

public class TestPage extends WebPage {

public TestPage() {
}

@Override
protected void onInitialize() {
super.onInitialize();

ModalWindow window = new ModalWindow(modal_window) {
private static final long serialVersionUID = 
-2976925047468282833L;

@Override
protected boolean makeContentVisible() {
if (getWebRequest().isAjax() == false) {
return true;
} else {
return false;
}
}

};
window.setContent(new EmptyPanel(window.getContentId()));
add(window);
}
}

and for the markup file:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.apache.org/; xml:lang=en lang=en
head
titleWicket test/title
/head
body  
div wicket:id=modal_windowModal window/div
/body
/html

Is there something wrong in the code? Thanks in advance.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ModalWindow-open-on-page-load-without-ajax-tp3071714p3071714.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



IResourceSettings.setUseTimestampOnResources(true) and performance

2010-11-24 Thread hok

Hello,
I had a problem with slow loading of pages and response to ajax requests.
After some debugging I traced the problem to be that wicket constantly
tries: 

DEBUG - UrlResourceStream  - cannot convert url:
jar:file:/C:/Users/hok/.m2/repository/org/apache/wicket/wicket/1.5-M3/wicket-1.5-M3.jar!/org/apache/wicket/markup/html/wicket-event.js
to file (URI is not hierarchical), falling back to the inputstream for
polling
DEBUG - ResourceStreamLocator  - Attempting to locate resource
'org/apache/wicket/markup/html/wicket-event_en_US.js' on path [folders = [],
webapppaths: []]
DEBUG - ResourceStreamLocator  - Attempting to locate resource
'org/apache/wicket/markup/html/wicket-event_en_US.js' using classloader
sun.misc.launcher$appclassloa...@cac268

and this happens because that by default (or at least I think so) wicket
adds timestamp on the resources -
ResourceSettings.setUseTimestampOnResources(true) and every resource is read
from the jar files on every request. When a resource is in a jar file a
java.lang.IllegalArgumentException: URI is not hierarchical is thrown in the
UrlResourceStream constructor and a lot of attempts are made to load the jar
file through different loaders. In my case this led to a slow response
times.
After disabling timestamp on resources
(ResourceSettings.setUseTimestampOnResources(false)) the problem disappears
and the performance is fine. However in the javadoc of
setUseTimestampOnResources:

Enabling timestamps on resources will inject the last modification time of
the resource into the filename (the name will look something like
'style-ts1282915831000.css' where the large number is the last modified date
in milliseconds and '-ts' is a prefix to avoid conflicts with filenames that
already contain a number before their extension. * 

Since browsers and proxies use the filename of the resource as a cache key
the changed filename will not hit the cache and the page gets rendered with
the changed file.

In this case this useful functionality is lost. Is it possible to have the
best of both worlds? Thanks.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IResourceSettings-setUseTimestampOnResources-true-and-performance-tp3057946p3057946.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



Re: IResourceSettings.setUseTimestampOnResources(true) and performance

2010-11-24 Thread hok

https://issues.apache.org/jira/browse/WICKET-3194
https://issues.apache.org/jira/browse/WICKET-3194 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IResourceSettings-setUseTimestampOnResources-true-and-performance-tp3057946p3058085.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



Ajax requests and page Id incrementing in 1.5-M1

2010-09-05 Thread hok

Hi,

I'm in process of migrating to wicket 1.5-M1 and I found an interesting (at
least to me) scenario: 
There is a form Form1 in a stateful page Page1. The action attribute of
the form contains the id of the page and after the form is submitted the
page is retrieved on the server according to the given id in the form
action. 
Inside Form1 there is a markup container C1 and in it a check box (Chkb1)
with an OnChangeAjaxBehavior attached to it. When the Chkb1 is checked a few
more fields are added to C1 via Ajax (and therefore in Form1). On the server
side only C1 is added to the AjaxRequestTarget object. In this case the Id
of Page1 is incremented, however only C1 knows about this, since this is
the only component updated after the ajax call.
After this, when Form1 is submitted the id in the action attribute is not
the most recent one and the result in my case is that after the Page1 is
reloaded it is in the same state as the one before the ajax update.

A pseudo html below:

form wicket:id=Form1   !--
Form1 is not updated on the ajax call --
!-- C1 is updated on the
ajax call --
 input type=checkbox wicket:id=Chkb1 /

    
 
!-- the new fields are added here --

 
 input type=submit wicket:id=submit_button value=submit /
/form

This worked in 1.4.9. I think that if Form1 is updated also when Chkb1 is
clicked this would work. However in this case the whole form have to be
rebuild, and not only C1. This is a very specific example, but I think
that in the practice there is a wide range of similar scenarios.

Is there a more elegant solution for this case? Thanks in advance.

Regards,
Ivan Vasilev
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-requests-and-page-Id-incrementing-in-1-5-M1-tp2527218p2527218.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