Re: Why has a cell item a model (and why is it a model with the populator (with the property) of the column)?

2017-05-04 Thread Eric J. Van der Velden
Hi Sven,

Thank you!

No, I was just wondering. I have not seen this model used.



On Wed, May 3, 2017 at 1:44 PM, Sven Meier  wrote:

> Hi,
>
> a cell item is an org.apache.wicket.markup.repeater.Item, and each item
> has
> a model - so AbstractDataGridView just uses a model containing the
> ICellPopulator for that.
>
> It seems strange, that all cells of a row share the same model object, but
> it does no harm.
>
> Do you see a problem?
>
> Have fun
> Sven
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Why-has-a-cell-item-a-model-and-why-is-it-a-
> model-with-the-populator-with-the-property-of-the-column-
> tp462p463.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
>
>


Why has a cell item a model (and why is it a model with the populator (with the property) of the column)?

2017-05-03 Thread Eric J. Van der Velden
Hello,

I don't understand why a cell item gets a model, because I have not seen
where it is used. Only the model in the row item is used, together with the
property of the column.

Also why is the populator of the column in that model?


public abstract class AbstractDataGridView extends DataViewBase
@Override
protected final void populateItem(final Item item)
{

RepeatingView cells = new RepeatingView(CELL_REPEATER_ID);
item.add(cells);

int populatorsNumber = populators.size();
for (int i = 0; i < populatorsNumber; i++)
{
ICellPopulator populator = populators.get(i);
IModel populatorModel = new Model<>(populator);
Item cellItem = newCellItem(cells.newChildId(), i,
populatorModel);
cells.add(cellItem);
...

For example here we see that the row model + property of the column is
used, and not the model of the cell item:

public class PropertyPopulator implements ICellPopulator
@Override
public void populateItem(final Item cellItem, final
String componentId,
final IModel rowModel)
{
cellItem.add(new Label(componentId, new PropertyModel<>(rowModel,
property)));
}

Thanks.


Re: Cannot mock final SortableDataProvider.getSortState

2017-01-13 Thread Eric J. Van der Velden
Hoi Bas,

I am at the office now, so now I would like to comment on the first
question in your last answer.

My experience is that when you mock a class, and you call a final method on
the mock, Mockito returns null. So it is not that you can trust a final
method or not, the mock's method returns null. Or maybe I make a mistake.

It happens in OrderByBorder.onComponentTag. This method calls the
provider's getSortState(), which will return null. That is why I wanted to
mock this method, but I cannot, because it is final.

Thanks, I will comment on your other remarks later.

On Fri, Jan 13, 2017 at 1:41 PM, Bas Gooren <b...@iswd.nl> wrote:

> Hi Eric,
>
>
> Well - looking at SortableDataProvider I suppose you cold mock an
> implementation of it. As getSortState() is final, you need to trust that it
> does it’s job. Why do you want to mock that method?
>
> The same applies to LoadableDetachableModel - why do you need to mock
> final getObject(), which has a know contract/implementation?
>
>
> In general I’m not sure I understand yet why you are mocking your
> SortableContactDataProvider.
>
>
> If you want to test that your SortableContactDataProvider does it’s job
> properly, provide it with a mock database so you can verify that it makes
> all expected calls.
>
> Since you are using a static call to locate your database, you could
> introduce a way to force a ContactsDatabase for the current thread in your
> locator class.
>
>
> For example (pseudocode for a unit test):
>
>
> … run before test
>
> ContactsDatabase mockDatabase = createMock(…)
>
> DatabaseLocator.setDatabaseForCurrentThread(mockDatabase)
>
>
> … in test
>
> expect(mockDatabase.getIndex(anyObject())).andReturn(…)
>
> SortableContactDataProvider.iterator(….)
>
> etc.
>
>
> … run after test
>
> DatabaseLocator.clearDatabaseForCurrentThread()
>
> Met vriendelijke groet,
> Kind regards,
>
> Bas Gooren
>
> Op 13 januari 2017 bij 12:10:03, Eric J. Van der Velden (
> ericjvandervel...@gmail.com) schreef:
>
> Hoi Bas,
>
> Thank you for your answer!
>
> So maybe I am doing it wrong.
>
> Let's take an example. In the wicket examples, in package
> org.apache.wicket.examples.repeater, there is the provider:
>
> public class SortableContactDataProvider_my extends
> SortableDataProvider_my<Contact, String> implements IFilterStateLocator<
> ContactFilter_my>
> {
> ...
>
> protected ContactsDatabase getContactsDB()
> {
> return DatabaseLocator.getDatabase();
> }
>
> @Override
> public Iterator iterator(long first, long count)
> {
> List contactsFound = getContactsDB().getIndex(getSort());
> return filterContacts(contactsFound).
> subList((int)first, (int)(first + count)).
> iterator();
> }
>
> I mocked the iterator method. But you are saying that I should mock the
> getContactsDB method?
>
> Thank you.
>
> On Thu, Jan 12, 2017 at 11:10 AM, Bas Gooren <b...@iswd.nl> wrote:
>
>> Eric,
>>
>>
>> All of our data providers use an external source to load the actual data,
>> e.g. a repository or dao.
>>
>> As all of our repositories and daos are interfaces, those are easy to
>> mock.
>>
>>
>> Testing the provider is then simply a matter of ensuring the right
>> methods, with the right parameters are called on the mocked objects.
>>
>>
>> What functionality in your (custom) data providers do you have that you
>> want to test? In general I would say that final methods in a known and
>> tested library (wicket) do not need to be tested anyway - that is the
>> responsibility of the library.
>>
>> Met vriendelijke groet,
>> Kind regards,
>>
>> Bas Gooren
>>
>> Op 12 januari 2017 bij 10:23:12, Eric J. Van der Velden (
>> ericjvandervel...@gmail.com) schreef:
>>
>> Hello,
>>
>> SortableDataProvider, in
>> package org.apache.wicket.extensions.markup.html.repeater.util, has a
>> final
>> method getSortState().
>>
>> I cannot mock this method.
>>
>> I have copied SortableDataProvider under a different name, and subclassed
>> this one,but I do not like this.
>>
>> The same happens with final LoadableDetachableModel.getObject(), but in
>> this case I could mock LoadableDetachableModel.load().
>>
>> So why are these methods final, and how do programmers test the provider?
>>
>> Thank you!
>>
>>
>


Re: Cannot mock final SortableDataProvider.getSortState

2017-01-13 Thread Eric J. Van der Velden
Hoi Bas,

Thank you for your answer!

So maybe I am doing it wrong.

Let's take an example. In the wicket examples, in package
org.apache.wicket.examples.repeater, there is the provider:

public class SortableContactDataProvider_my extends
SortableDataProvider_my<Contact, String> implements
IFilterStateLocator
{
...

protected ContactsDatabase getContactsDB()
{
return DatabaseLocator.getDatabase();
}

@Override
public Iterator iterator(long first, long count)
{
List contactsFound = getContactsDB().getIndex(getSort());
return filterContacts(contactsFound).
subList((int)first, (int)(first + count)).
iterator();
}

I mocked the iterator method. But you are saying that I should mock the
getContactsDB method?

Thank you.

On Thu, Jan 12, 2017 at 11:10 AM, Bas Gooren <b...@iswd.nl> wrote:

> Eric,
>
>
> All of our data providers use an external source to load the actual data,
> e.g. a repository or dao.
>
> As all of our repositories and daos are interfaces, those are easy to mock.
>
>
> Testing the provider is then simply a matter of ensuring the right
> methods, with the right parameters are called on the mocked objects.
>
>
> What functionality in your (custom) data providers do you have that you
> want to test? In general I would say that final methods in a known and
> tested library (wicket) do not need to be tested anyway - that is the
> responsibility of the library.
>
> Met vriendelijke groet,
> Kind regards,
>
> Bas Gooren
>
> Op 12 januari 2017 bij 10:23:12, Eric J. Van der Velden (
> ericjvandervel...@gmail.com) schreef:
>
> Hello,
>
> SortableDataProvider, in
> package org.apache.wicket.extensions.markup.html.repeater.util, has a
> final
> method getSortState().
>
> I cannot mock this method.
>
> I have copied SortableDataProvider under a different name, and subclassed
> this one,but I do not like this.
>
> The same happens with final LoadableDetachableModel.getObject(), but in
> this case I could mock LoadableDetachableModel.load().
>
> So why are these methods final, and how do programmers test the provider?
>
> Thank you!
>
>


Cannot mock final SortableDataProvider.getSortState

2017-01-12 Thread Eric J. Van der Velden
Hello,

SortableDataProvider, in
package org.apache.wicket.extensions.markup.html.repeater.util, has a final
method getSortState().

I cannot mock this method.

I have copied SortableDataProvider under a different name, and subclassed
this one,but I do not like this.

The same happens with final LoadableDetachableModel.getObject(), but in
this case I could mock LoadableDetachableModel.load().

So why are these methods final, and how do programmers test the provider?

Thank you!


Re: Question About ModalWindows and IEventSink

2016-02-12 Thread Aaron J . Garcia
Aaron J. Garcia  rentec.com> writes:

> 
> Hi Martin & Sven,
> 
> Thanks for your replies!
> 
> I ended up sending getPage().getPageId().  Is the better practice to use a
> PageReference?  If so, I'll change my code to use that instead.
> 
> Secondly, I had no idea that you could use a Panel for the contents of a
> ModalWindow.  I always thought you needed to use setPageCreator() of the
> ModalWindow class, and provide a page.
> 
> It would make things cleaner if I could just use a Panel instead.  Can you
> point me to an example?

The link Martin posted has a setContent() method for the ModalWindow that
takes a panel. 

So I have a different question:

When would you use a Page inside a ModalWindow, instead of a Panel?  It
seems like a Panel would be a better practice in most circumstances...

-- Aaron

 
> Thanks again!
> 





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



Re: Question About ModalWindows and IEventSink

2016-02-12 Thread Aaron J . Garcia
Hi Martin & Sven,

Thanks for your replies!

I ended up sending getPage().getPageId().  Is the better practice to use a
PageReference?  If so, I'll change my code to use that instead.

Secondly, I had no idea that you could use a Panel for the contents of a
ModalWindow.  I always thought you needed to use setPageCreator() of the
ModalWindow class, and provide a page.

It would make things cleaner if I could just use a Panel instead.  Can you
point me to an example?

Thanks again!

-- Aaron


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



Question About ModalWindows and IEventSink

2016-02-11 Thread Aaron J . Garcia
Hi Everyone,

ModalWindow has a "setPageCreator()" method, to set the page that you want
to display inside of the ModalWindow.

I've never used Wicket's event infrastructure, but I decided to use it today
to pass a message from the content of my ModalWindow back to the ModalWindow
itself.

Apparently, even if you use an event sink at the session or application
level, the event only broadcasts to components of the page that the event
originated from... A lot of Google searching took me to a post on the
mailing list that described that behavior, and let me to the below workaround.

I ended up using getSession().getPageManager().getPage(int id...) on my
content page to retrieve the page that contained the modal window.  Using
that as the event sink (instead of getSession() or Application.get()),
allowed the ModalWindow to consume my event...

Is it at all possible for one of the following "enhancements" to be made:

1) When inside of a ModalWindow, getPage().getParent() returns null.  Is
there a reason for this?  It would be *awesome* if getPage().getParent()
could return the ModalWindow that created the page.

2) I guess if 1) occurred, then events would properly propagate to the
ModalWindow when using a session or application level sink.

Thanks for your feedback.

Regards,
Aaron J. Garcia


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



Re: Performance Degredation for Adding Components in Wicket 7.0.0 vs. Wicket 6.20.0

2015-09-14 Thread Aaron J . Garcia
> Actually we have some perf tests in our tests suite and it doesn't show any
> noticeable degradation between #add() and #queue().
> Although I see now that it just println's the diff, but there is no
> assertion:
>
 

Hi Martin,

Thank you for your reply.
 
Yes, 158 seconds is slow!  Instead of spending time profiling the issue in
our application-specific code, I made a quick-start.  It turns out that this
issue is very easy to reproduce with a vanilla RepeatingView component (as I
had suspected).

In summary, Wicket 6.20.0 adds 5,000 rows x 6 columns + 5,000
AttributeModifiers [one per row] (i.e. 35,000 add() calls) in about 200
milliseconds.  Wicket 7.0.0 takes about 10 seconds to add the same amount of
components to the hierarchy.  

With 10,000 rows x 6 columns + 10,000 AttributeModifiers, (i.e. 70,000 add()
calls), Wicket 6.20.0 takes about 500 milliseconds to add all of the
components, while Wicket 7.0.0 takes about 40 seconds.

In my opinion, this is a huge performance degradation from 6.X.Y to 7.X.Y,
and is something that should be looked at.  I created an issue in JIRA,
attached a quick-start, and marked it as Major issue.  In my opinion, this
should be moved to Critical or Blocker status though...  I'm sure I'm not
the only one who adds that many components or attribute modifiers to a page
at one time.

Thanks for your help.  You can reach me here or via e-mail if you need me.

Regards,
Aaron J. Garcia

P.S. I looked at your performance test, and I think it should try and add
more than 250 contacts to the page...




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



Re: Performance Degredation for Adding Components in Wicket 7.0.0 vs. Wicket 6.20.0

2015-09-14 Thread Aaron J . Garcia

> I created an issue in JIRA,
> attached a quick-start, and marked it as Major issue.  In my opinion, this
> should be moved to Critical or Blocker status though...  I'm sure I'm not
> the only one who adds that many components or attribute modifiers to a page
> at one time.

Forgot the link to the issue:

https://issues.apache.org/jira/browse/WICKET-5981


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



Performance Degredation for Adding Components in Wicket 7.0.0 vs. Wicket 6.20.0

2015-09-13 Thread Aaron J . Garcia
Hello,

I'm hoping someone here can help me.  My organization uses Wicket as the
framework for a fairly large internal web application.  

We have a page that renders a hierarchal data table.  It's implemented with
a RepeatingView for the table rows, and various WebMarkupContainers for the
columns (each column's component for one row gets attached to a new
WebMarkupContainer(rv.newChildId()) container).  Anyway, the table has about
1,000 rows, and 95% of them are collapsed via JavaScript when the page is
rendered.  Each top-level table row has a link to expand all of the sub-rows
underneath via a small JavaScript function to expand/collapse DOM elements
with a certain id.

This page has been in use since Wicket 1.4.X, and went through all of the
various 5.X.0 and 6.X.0 versions with no issues.  However, something changed
-- big time -- between Wicket 6.20.0 and Wicket 7.0.0.  In Wicket 6.20.0,
the server-side page rendering takes about 6s, with another second or two of
rendering the HTML in the browser.  In Wicket 7.0.0, this increases
dramatically to 158 seconds for server-side rendering (with the same one to
two second penalty for rendering in the browser).

I'm assuming that Wicket's internals changed a lot to support the new
Component Queuing functionality.  I'm wondering if maybe these changes
accidentally degraded performance for large component trees in a single Page
(which unfortunately, is our main use-case).  A colleague of mine put a
bunch of print statements in our code, and found out that some
WebMarkupContainer#add(); function calls were taking over 1 second each to
complete as the page is rendered (with performance degrading as more and
more components are added to the page).

Is anyone able to reproduce this issue, or hand any problems like this since
upgrading to Wicket 7.0.0?  I wanted to check here before trying to put
together a Quickstart...  Unfortunately, we are in a big crunch for the next
few months, so for the time being, we have just reverted to Wicket 6.20.0...
(and as a consequence, there's not much time allowed to spend debugging this
issue right now). 

Thanks for anyone's input and help.  I really appreciate it.

-- Aaron J. Garcia


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



Re: More Wicket JSESSION_ID Issues

2014-03-12 Thread Aaron J . Garcia


Martin Grigorov mgrigorov at apache.org writes:

 
 Hi,
 
 It sounds like an issue with the IDE.
 What is the produced url with the custom jsession id ? Does it work if you
 paste this url directly in the browser address bar without involving the
 IDE ?
 
 And what is the sign of my page ?
 
 Martin Grigorov
 Wicket Training and Consulting
 

Hi Martin,

Sorry for the delayed response.

The URLs are identical in both cases: http://machine:8085/appName/ 

Wicket turns this into: http://machine:8085/appName/app/SignInPage

Intellij tries to open the first URL (http://machine:8085/appName/), but it
fails with this error message Cannot open URL. Please check this URL is
correct:.  When I copy and paste that same URL
(http://machine:8085/appName/) and paste it into my browser, it works fine,
and directs me to sign in page.  

(That's what I meant by sign of my page... sorry for not catching that sooner). 

What is interesting is that if I remove any of the JSESSIONID changes I made
(or downgrade to Wicket 6.13.0), everything works fine, and Intellij opens
up http://machine:8085/appName/ like I would expect.

-- Aaron

P.S. I don't need an immediate solution to this, because I figured out a
workaround yesterday.  I would like to get to the bottom of the issue
though, as the change in behavior is surprising.


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



More Wicket JSESSION_ID Issues

2014-03-11 Thread Aaron J . Garcia
I finally got around to upgrading to Wicket 6.14.0 yesterday.  With the new
changes in Wicket, I no longer get the exception spit out to the log when I
change the JSESSION_ID to JSESSION_ID_MYAPP.  Thanks for that!

I have another issue now:

When I run my app in my IDE (I use Intellij 13.0.2 and Tomcat 7.0.39), it
usually opens up a browser window for me pointing to the sign in page of my
app.  If JSESSION_ID is left alone, this behavior continues to work fine. 
Once I change my JSESSION_ID to something else, I get a message from
Intellij that says Cannot open URL. Please check this URL is correct:.  It
then shows the URL of my sign in page.  

Of course, if I navigate there directly, it comes up fine.  This is
perplexing to me.  Perhaps something in Wicket isn't playing nice with this
functionality?  This was all working fine with Wicket 6.13.0, so I don't
know what changed.

Would someone mind trying to reproduce?


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



Changed JSESSIONID Results in Wicket Exception

2014-02-05 Thread Aaron J. Garcia

Hi Everyone,

I maintain a Wicket application running on Tomcat 7.0.39, and I recently 
altered $TOMCAT_HOME/conf/context.xml to include a sessionCookieName 
parameter.  I made a change like this:


Context sessionCookieName=JSESSIONID_MYAPP

This properly changes the session cookie that is used by Wicket to 
JESSIONID_MYAPP instead of JSESSIONID.  However, when I start up my 
Wicket app, I get the following error spit out to the logs in 
Development mode, when running in Intellij.  Any idea why?


When I was using the normal JSESSIONID, it was properly ignoring it when 
it was appended to the classname for the SignInPage.


Thanks for your help!

-- Aaron

java.lang.ClassNotFoundException: 
my/orgs/package/SignInPage;JSESSIONID_MYAPP=075861AE6FB6CE4ED36F2B5EE01B387B

at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at 
org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:108)
at 
org.apache.wicket.core.util.lang.WicketObjects.resolveClass(WicketObjects.java:72)
at 
org.apache.wicket.core.request.mapper.AbstractComponentMapper.getPageClass(AbstractComponentMapper.java:139)
at 
org.apache.wicket.core.request.mapper.BookmarkableMapper.parseRequest(BookmarkableMapper.java:118)
at 
org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:292)
at 
org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:152)
at 
org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:190)
at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:215)
at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
at 
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
at 
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:137)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1179)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:744)

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



Re: Changed JSESSIONID Results in Wicket Exception

2014-02-05 Thread Aaron J . Garcia
Timo Schmidt wicket at xomit.de writes:

 
 On Wed 05.02.2014 13:12, Aaron J. Garcia wrote:
  Hi Everyone,
  
  I maintain a Wicket application running on Tomcat 7.0.39, and I recently
  altered $TOMCAT_HOME/conf/context.xml to include a sessionCookieName
  parameter.  I made a change like this:
  
  Context sessionCookieName=JSESSIONID_MYAPP
  
  This properly changes the session cookie that is used by Wicket to
  JESSIONID_MYAPP instead of JSESSIONID.  However, when I start up my Wicket
  app, I get the following error spit out to the logs in Development mode,
  when running in Intellij.  Any idea why?
  
  When I was using the normal JSESSIONID, it was properly ignoring it when it
  was appended to the classname for the SignInPage.
 
 See https://issues.apache.org/jira/browse/WICKET-4873
 
 as of Wicket 6.4.0 you may use a different session id name. Set
 a system property »wicket.jsessionid.name« to the desired
 value.
 
   -Timo
 
 -
 To unsubscribe, e-mail: users-unsubscribe at wicket.apache.org
 For additional commands, e-mail: users-help at wicket.apache.org
 
 

This doesn't work for me.  Looking at the source for WicketObjects.java
(where the error is coming from), it seems like the className passed into it
should be passed through Strings.stripJSessionId() before it is attempted to
be resolved.

Should I open a JIRA issue for this change?  

-- Aaron

WARN  - WicketObjects  - Could not resolve class
[org.mine.SignInPage;JSESSIONID_MYAPP=AFAB91436EA86A0DF57057C56DEBEEB4]
java.lang.ClassNotFoundException:
org/mine/SignInPage;JSESSIONID_MYAPP=AFAB91436EA86A0DF57057C56DEBEEB4
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at org.apache.wicket.application.AbstractClassResolver
  .resolveClass(AbstractClassResolver.java:108)
at org.apache.wicket.core.util.lang.WicketObjects
  .resolveClass(WicketObjects.java:72)

... snip ...


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



Re: Changed JSESSIONID Results in Wicket Exception

2014-02-05 Thread Aaron J . Garcia
Martin Grigorov mgrigorov at apache.org writes:


 Hi,
 
 I will test this tomorrow.
 
 Martin Grigorov
 Wicket Training and Consulting

Thanks Martin,

FWIW, I was setting this when running Tomcat:

-Dwicket.jsessionid.name=JSESSIONID_MYAPP

It didn't work with the -D option, so I added it to my class that extends
WebApplication, like so:

System.setProperty(wicket.jsessionid.name, JSESSIONID_MYAPP);

and that didn't work either.

I'm happy to help pinpoint the issue however I can.  Please let me know.

-- Aaron


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



Wicket 6.0.0 Issue: RadioChoice with AjaxFormChoiceComponentUpdatingBehavior

2012-09-21 Thread Aaron J . Garcia
Hello,

I just wanted to report an issue I encountered with Wicket 6.0.0 (there already
is a JIRA issue about it).

https://issues.apache.org/jira/browse/WICKET-4769

When you attach an AjaxFormChoiceComponentUpdatingBehavior to a RadioChoice
inside of a form, clicking on the label of an item doesn't select it's
corresponding radio button.  This was working fine in Wicket 1.5.8, and is
annoying in the sense that you need to click on the radio button (and not the
label), to get the corresponding Ajax behavior to occur.

Does anyone know if this can or will be fixed for the next maintenance release?

Thanks a lot for your help!

-- Aaron


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



AjaxEditableLabel Missing setConvertEmptyInputStringToNull(...)?

2012-04-12 Thread Aaron J . Garcia
I am wondering if AjaxEditableLabel is intentionally missing a
setConvertEmptyInputStringToNull(...) method?  I have a use case for it, and it
seems like it would be reasonable to implement.

For now, I have a work-around for this by overriding AjaxEditableLabel's
newEditor(...) method.  However, I don't like this solution because I need to
cast the returned FormComponentT into a TextFieldT in order to get access to
the setConvertEmptyInputStringToNull(...) method.  If the underlying newEditor
implementation is changed at some point, my code won't work.  

Can this functionality be added to AjaxEditableLabel?  If so, how would I go
about requesting it?  

Thanks a lot for your help. 

Regards,
Aaron J. Garcia


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



Re: wicket-rest and Wicket 1.5-RC4.2: MarkupNotFoundException: Can not determine Markup

2011-06-16 Thread Gerard J. Piek
Bruno,

Thanks. Once I have the details right, I'll dive into this.

Cheers,

Gerard

2011/6/16 Bruno Borges bruno.bor...@gmail.com

 I forked the project wicket-rest from googlecode to wicketstuff-sandbox.

 Gerard, you can now ask for commit access at wicketstuff, or just fork it
 from there and then push a patch.

 https://github.com/wicketstuff/sandbox/tree/master/wicket-rest

 Thanks again for showing interest in this project.

 Cheers
 *Bruno Borges*
 www.brunoborges.com.br
 +55 21 76727099



 On Thu, Jun 16, 2011 at 9:42 AM, Martin Grigorov mgrigo...@apache.org
 wrote:

  One more replace:
 
   @Override
protected final void onRender() {
getResponse().write(getXML().toString());
}
 
  with
   @Override
public void renderPage() {
getResponse().write(getXML().toString());
 }
 
  On Thu, Jun 16, 2011 at 3:39 PM, gerar gerardp...@gmail.com wrote:
   Thanks for the very quick answer.
  
   However, now another error message appears.
  
   The superclass now looks like this:
  
   public abstract class AbstractWebServicePage extends WebPage implements
   IMarkupResourceStreamProvider {
   // Removed hasAssociatedMarkup method and added:
   
  public IResourceStream getMarkupResourceStream(MarkupContainer
   container, Class? containerClass) {
  return new StringResourceStream();
  }
  
   
  
   This error appears when requesting the page in a browser:
  
   Root cause:
  
   java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
   at java.util.ArrayList.RangeCheck(ArrayList.java:547)
   at java.util.ArrayList.get(ArrayList.java:322)
   at java.util.Collections$UnmodifiableList.get(Collections.java:1154)
   at org.apache.wicket.markup.Markup.get(Markup.java:109)
   at org.apache.wicket.Component.internalRender(Component.java:2371)
   at org.apache.wicket.Component.render(Component.java:2322)
   at org.apache.wicket.Page.renderPage(Page.java:1120)
   at
  
 
 org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
   at
  
 
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:218)
   at
  
 
 org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:139)
   at
  
 
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:718)
   at
  
 
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
   at
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
   at
  
 
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
   at
  
 
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:138)
   at
  
 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
   at
  
 
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112)
   .
  
  
  
  
   --
   View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/wicket-rest-and-Wicket-1-5-RC4-2-MarkupNotFoundException-Can-not-determine-Markup-tp3600779p3602317.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
  
  
 
 
 
  --
  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
 
 



Skip session creation when AjaxLink is disabled

2011-01-15 Thread J
I have a page that has two states:
-user logged in (session creation allowed)
-no user logged in (no session creation allowed, otherwise bots will crash the 
server by exploding session creation)

When a logged-in user requests the page, the page should be render with 
AjaxLinks visible (which will cause sessions to be created).
When a non-logged-in request comes in, the page should render without AjaxLinks 
visible. How can I achieve this last situation (disabled AjaxLinks) while 
avoiding sessions?

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



Re: wicket 1.5, css resourcereference from string?

2010-10-10 Thread m j
I actually just made a youtube video how to add css/js to a page.
See it here: http://www.youtube.com/watch?v=9toRTCFJf3Y

Though I did not cover textemplateresourcereference. It is just as Igor
described but now you can see the complete code if necessary.

On Fri, Oct 8, 2010 at 12:50 PM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 hmm right, could I just embed it in the html page then, I guess the answer
 is yes?

 I guess the reason I took this path was because of the
 texttemplateresourcereference which seems to do something much like this.

 regards Nino

 2010/10/8 Igor Vaynberg igor.vaynb...@gmail.com

  what you are trying to do doesnt make sense, think about it.
 
  how is wicket supposed to build a url to your anonymous reference
 instance?
 
  you have two options, use renderCssReference(String url) to output the
  url to your custom css or if you need to stream it from somewhere
  inaccessible by the browser you can create a shared resource or a
  servlet
 
  -igor
 
  On Fri, Oct 8, 2010 at 2:44 AM, nino martinez wael
  nino.martinez.w...@gmail.com wrote:
   Has someone an idea?
  
   I am just trying to read a custom css from a string and render it as a
   reference on the page.
  
   Do I need to register the reference somewhere or sormething?
  
   2010/10/7 nino martinez wael nino.martinez.w...@gmail.com
  
   Hi
  
   I cant get below working:
  
   public void renderHead(IHeaderResponse response) {
super.renderHead(response);
   if (wallboardConfigurationModel.getObject().hasCustomCss()) {
final StringResourceStream stringResourceStream = new
   StringResourceStream(
   wallboardConfigurationModel.getObject().getCustomCss(),
text/css);
  
   ResourceReference resourceReference = new ResourceReference(
wallboardConfigurationModel.getObject().getId()) {
   @Override
   public IResource getResource() {
return new ResourceStreamResource(stringResourceStream);
   }
   };
response.renderCSSReference(resourceReference);
  
   }
   }
  
   I get this out put in the log:
  
   010-10-07 15:33:57,555 WARN
[org.apache.wicket.request.resource.ResourceReferenceRegistry]  -
 Asked
  to
   auto-create a ResourceReference, but
   ResourceReferenceRegistry.createDefaultResourceReference() return
 null.
[scope: org.apache.wicket.Application; name: test1; locale: null;
  style:
   null; variation: null]
   2010-10-07 15:33:57,555 ERROR
   [org.apache.wicket.request.cycle.RequestCycle]  - Unable to execute
  request.
   No suitable RequestHandler found.
   URL=wicket/resource/org.apache.wicket.Application/test1
  
  
  
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: Demystifying page serialization

2010-09-10 Thread J.-F. Rompre
Mike, in reference to your various questions, here is my take:

You are not seeing your constructor tracing print statements because it is
not invoked more than once (the page object is already in the page store,
with its component attached as per the constructor invocation) - all
components are the same, but the data can vary depending on your model as
observed. This is the case
for stateful, or non-bookmarkable pages.

Bookmarkable pages are re-instantiated and must be given their state if any,
at construction time.

That is how Wicket decides whether to go back to the page store or use a new
instance. I believe Bookmarkable links are there to accomodate fast access
to stateless pages or stateful pages with the state encoded in the request.



On Fri, Sep 10, 2010 at 8:36 PM, Mike Dee mdichiapp...@cardeatech.comwrote:


 But why?
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Demystifying-page-serialization-tp2533538p2535266.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: setRenderBodyOnly with ListView and attributes

2010-08-22 Thread J
That will work, but I already knew that.

The whole problem is that it violates Wickets just/pure HTML philosphy in 
that an extra unwanted div (or span) is required in WickedHTML just to make 
ListView work, even though it's a common scenario.
If ListView would follow Wickets philosophy, it would support this WicketHTML:
div wicket:id=products class=products
 div wicket:id=product class=productProduct1/div
/div

At the moment, there are two known workarounds in this discussion:
1) Accept the violation of just HTML by using the extra DIV.
2) Accept the violation of just HTML by using wicket:container.



 - Original Message -
 From: Igor Vaynberg
 Sent: 08/22/10 11:22 PM
 To: users@wicket.apache.org
 Subject: Re: setRenderBodyOnly with ListView and attributes
 
 listviews have nothing to do with tables, they are generic repeaters.
 here is the solution
 
 html
 body
 div class=products
 div wicket:id=products class=product
 span wicket:id=product class=product/span
 /div
 /div
 /body
 /html
 
 the only change needed to code is the tweak to this line:
 item.add(new Label(product, product).setRenderBodyOnly(true));
 
 -igor
 
 
 On Sat, Aug 21, 2010 at 10:31 AM, Fatih Mehmet UCAR fmu...@gmail.com wrote:
  I think ListView is designed for html TABLE and each iteration prints the TR
  tag, see the wiki for example.
  You may wanna use DataView instead to avoid that case. Live examples can be
  reference point for that.
 
  -fmu
 
  - Original Message - From: J bluecar...@gmx.com
  To: users@wicket.apache.org
  Sent: Saturday, August 21, 2010 4:44 PM
  Subject: Re: setRenderBodyOnly with ListView and attributes
 
 
  Here is the complete (test) code
 
 
   SOLUTION 1 : wicket:container =
 
   TestPage.html 
  html
  body
  div class=products
  wicket:container wicket:id=products
  div wicket:id=product class=product/div
  /wicket:container
  /div
  /body
  /html
 
 
   TestPage.java 
  import java.util.Arrays;
  import java.util.List;
  import org.apache.wicket.markup.html.WebPage;
  import org.apache.wicket.markup.html.basic.Label;
  import org.apache.wicket.markup.html.list.ListItem;
  import org.apache.wicket.markup.html.list.ListView;
 
  public class TestPage extends WebPage {
 
  public TestPage() {
 
  List products = Arrays.asList(productA, productB, productC);
  ListView productsView = new ListView(products, products) {
  protected void populateItem(ListItem item) {
  String product = (String) item.getModelObject();
  item.add(new Label(product, product));
  }
  };
  add(productsView);
 
  }
  }
 
  == SOLUTION 2 : extra div in WicketHTML ==
 
   TestPage.html 
  html
  body
  div class=products
  div wicket:id=products
  div wicket:id=product class=product/div
  /div
  /div
  /body
  /html
 
 
   TestPage.java 
  import java.util.Arrays;
  import java.util.List;
  import org.apache.wicket.markup.html.WebPage;
  import org.apache.wicket.markup.html.basic.Label;
  import org.apache.wicket.markup.html.list.ListItem;
  import org.apache.wicket.markup.html.list.ListView;
 
  public class TestPage extends WebPage {
 
  public TestPage() {
 
  List products = Arrays.asList(productA, productB, productC);
  ListView productsView = new ListView(products, products) {
  protected void populateItem(ListItem item) {
  String product = (String) item.getModelObject();
  item.add(new Label(product, product));
  item.setRenderBodyOnly(true);
  }
  };
  add(productsView);
 
  }
  }
 
 
   Wanted/Required and generated output of solution1  2 ===
  html
  body
  div class=products
  div class=productproductA/div
  div class=productproductB/div
  div class=productproductC/div
  /div
  /body
  /html
  ==
 
  For this common scenario:
  -solution 1 violates Wickets Just HTML philosophy in that the
  wicket:container tag is used.
  -solution 2 violates Wickets Just HTML philosophy in that an extra
  unwanted div is required in WicketHTML (although not visible in the
  generated HTML).
 
  No other solutions have been found/discussed yet.
 
 
  - Original Message -
  From: Fatih Mehmet UCAR
  Sent: 08/21/10 05:02 PM
  To: users@wicket.apache.org
  Subject: Re: setRenderBodyOnly with ListView and attributes
 
  send your html and java code, there may be other ways of doing this.
 
 
  - Original Message - From: J bluecar...@gmx.com
  To: users@wicket.apache.org
  Sent: Saturday, August 21, 2010 3:29 PM
  Subject: Re: setRenderBodyOnly with ListView and attributes
 
 
  I made a mistake in my first post. The output of wasn't:
  
   div
   div class=product./div
   div class=product./div
   div class=product./div
   div class=product./div
   /div
  
   but it was:
   div class=product./div
   div class=product./div
   div class=product./div
   div class=product./div
  
   So the outer div is missing.
   Which is caused

Re: setRenderBodyOnly with ListView and attributes

2010-08-22 Thread J
A feature/philosophy is that Wicket HTML is just plain HTML.
This means that a webdesigner can create plain HTML, annotate it with wicket:id 
attributes, and then the Java developer can just write Java code.
Plain HTML can be transformed to WicketHTML just by adding wicket:id attributes.

In the case of my problem, which is a very common scenario, you cannot just add 
wicket:id's, and let it work. It requires the use of extra divs (or 
wicket:container) just to let ListView work. The extra required div causes a 
difference between the plain HTML and WicketHTML, and therefore for WicketHTML 
the HTML rules differ.
The designer now has to know about these details of Wicket, such as: if the 
developer is going to use a ListView, the developer has to wrap extra divs 
around some elements.


 - Original Message -
 From: Igor Vaynberg
 Sent: 08/23/10 01:26 AM
 To: users@wicket.apache.org
 Subject: Re: setRenderBodyOnly with ListView and attributes
 
 first you have to prove that either of those cases is a violation, i
 do not see either one of them as being one.
 
 -igor
 
 On Sun, Aug 22, 2010 at 2:40 PM, J bluecar...@gmx.com wrote:
  That will work, but I already knew that.
 
  The whole problem is that it violates Wickets just/pure HTML philosphy in 
  that an extra unwanted div (or span) is required in WickedHTML just to make 
  ListView work, even though it's a common scenario.
  If ListView would follow Wickets philosophy, it would support this 
  WicketHTML:
  div wicket:id=products class=products
  div wicket:id=product class=productProduct1/div
  /div
 
  At the moment, there are two known workarounds in this discussion:
  1) Accept the violation of just HTML by using the extra DIV.
  2) Accept the violation of just HTML by using wicket:container.
 
 
 
  - Original Message -
  From: Igor Vaynberg
  Sent: 08/22/10 11:22 PM
  To: users@wicket.apache.org
  Subject: Re: setRenderBodyOnly with ListView and attributes
 
  listviews have nothing to do with tables, they are generic repeaters.
  here is the solution
 
  html
  body
  div class=products
  div wicket:id=products class=product
  span wicket:id=product class=product/span
  /div
  /div
  /body
  /html
 
  the only change needed to code is the tweak to this line:
  item.add(new Label(product, product).setRenderBodyOnly(true));
 
  -igor
 
 
  On Sat, Aug 21, 2010 at 10:31 AM, Fatih Mehmet UCAR fmu...@gmail.com 
  wrote:
   I think ListView is designed for html TABLE and each iteration prints 
   the TR
   tag, see the wiki for example.
   You may wanna use DataView instead to avoid that case. Live examples can 
   be
   reference point for that.
  
   -fmu
  
   - Original Message - From: J bluecar...@gmx.com
   To: users@wicket.apache.org
   Sent: Saturday, August 21, 2010 4:44 PM
   Subject: Re: setRenderBodyOnly with ListView and attributes
  
  
   Here is the complete (test) code
  
  
    SOLUTION 1 : wicket:container =
  
    TestPage.html 
   html
   body
   div class=products
   wicket:container wicket:id=products
   div wicket:id=product class=product/div
   /wicket:container
   /div
   /body
   /html
  
  
    TestPage.java 
   import java.util.Arrays;
   import java.util.List;
   import org.apache.wicket.markup.html.WebPage;
   import org.apache.wicket.markup.html.basic.Label;
   import org.apache.wicket.markup.html.list.ListItem;
   import org.apache.wicket.markup.html.list.ListView;
  
   public class TestPage extends WebPage {
  
   public TestPage() {
  
   List products = Arrays.asList(productA, productB, productC);
   ListView productsView = new ListView(products, products) {
   protected void populateItem(ListItem item) {
   String product = (String) item.getModelObject();
   item.add(new Label(product, product));
   }
   };
   add(productsView);
  
   }
   }
  
   == SOLUTION 2 : extra div in WicketHTML ==
  
    TestPage.html 
   html
   body
   div class=products
   div wicket:id=products
   div wicket:id=product class=product/div
   /div
   /div
   /body
   /html
  
  
    TestPage.java 
   import java.util.Arrays;
   import java.util.List;
   import org.apache.wicket.markup.html.WebPage;
   import org.apache.wicket.markup.html.basic.Label;
   import org.apache.wicket.markup.html.list.ListItem;
   import org.apache.wicket.markup.html.list.ListView;
  
   public class TestPage extends WebPage {
  
   public TestPage() {
  
   List products = Arrays.asList(productA, productB, productC);
   ListView productsView = new ListView(products, products) {
   protected void populateItem(ListItem item) {
   String product = (String) item.getModelObject();
   item.add(new Label(product, product));
   item.setRenderBodyOnly(true);
   }
   };
   add(productsView);
  
   }
   }
  
  
    Wanted/Required and generated output of solution1  2 ===
   html
   body
   div class=products
   div class=productproductA/div
   div class

setRenderBodyOnly with ListView and attributes

2010-08-21 Thread J
hi, I want to have Wicket to generate the following HTML precisely:

div class=products
 div class=product./div
 div class=product./div
 div class=product./div
 div class=product./div
/div

But with my code, I don't get further than:

div
 div class=product./div
 div class=product./div
 div class=product./div
 div class=product./div
/div

so the class attribute is missing in the outer div.

My Wicket HTML is:
div class=products wicket:id=productsView
 div class=product wicket:id=productPanel./div
/div


My code:
ListView productsView = new ListView(productsView, products) {
 protected void populateItem(ListItem item) {
 item.setRenderBodyOnly(true);
 item.add(new ProductPanel(productPanel, item.getModelObject()));
 }
};
add(productsView);


What is the Wicket way of achieving this?
(A solution is to use the wicket:container tag, but that's a bit ugly, right?)

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



Re: setRenderBodyOnly with ListView and attributes

2010-08-21 Thread J
Here is the complete (test) code


 SOLUTION 1 : wicket:container =

 TestPage.html 
html
body
 div class=products
 wicket:container wicket:id=products
 div wicket:id=product class=product/div
 /wicket:container
 /div
/body
/html


 TestPage.java 
import java.util.Arrays;
import java.util.List;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;

public class TestPage extends WebPage {

 public TestPage() {

 List products = Arrays.asList(productA, productB, productC);
 ListView productsView = new ListView(products, products) {
 protected void populateItem(ListItem item) {
 String product = (String) item.getModelObject();
 item.add(new Label(product, product));
 }
 };
 add(productsView);

 }
}

== SOLUTION 2 : extra div in WicketHTML ==

 TestPage.html 
html
body
 div class=products
 div wicket:id=products
 div wicket:id=product class=product/div
 /div
 /div
/body
/html


 TestPage.java 
import java.util.Arrays;
import java.util.List;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;

public class TestPage extends WebPage {

 public TestPage() {

 List products = Arrays.asList(productA, productB, productC);
 ListView productsView = new ListView(products, products) {
 protected void populateItem(ListItem item) {
 String product = (String) item.getModelObject();
 item.add(new Label(product, product));
 item.setRenderBodyOnly(true);
 }
 };
 add(productsView);

 }
}


 Wanted/Required and generated output of solution1  2 ===
html
body
 div class=products
 div class=productproductA/div
 div class=productproductB/div
 div class=productproductC/div
 /div
/body
/html
==

For this common scenario:
-solution 1 violates Wickets Just HTML philosophy in that the 
wicket:container tag is used.
-solution 2 violates Wickets Just HTML philosophy in that an extra unwanted 
div is required in WicketHTML (although not visible in the generated HTML).

No other solutions have been found/discussed yet.


 - Original Message -
 From: Fatih Mehmet UCAR
 Sent: 08/21/10 05:02 PM
 To: users@wicket.apache.org
 Subject: Re: setRenderBodyOnly with ListView and attributes
 
 send your html and java code, there may be other ways of doing this.
 
 
 - Original Message - 
 From: J bluecar...@gmx.com
 To: users@wicket.apache.org
 Sent: Saturday, August 21, 2010 3:29 PM
 Subject: Re: setRenderBodyOnly with ListView and attributes
 
 
 I made a mistake in my first post. The output of wasn't:
 
  div
  div class=product./div
  div class=product./div
  div class=product./div
  div class=product./div
  /div
 
  but it was:
  div class=product./div
  div class=product./div
  div class=product./div
  div class=product./div
 
  So the outer div is missing.
  Which is caused by item.setRenderBodyOnly(true). But if I disable (set to 
  false) this (the default), I get:
 
  div class=productsdiv class=product./div/div
  div class=productsdiv class=product./div/div
  div class=productsdiv class=product./div/div
  div class=productsdiv class=product./div/div
 
  which is even worse.
 
  A solution (the only?) to this double div problem and at the same time the 
  missing attribute problem, is using wicket:container tags. (see 
  http://apache-wicket.1842946.n4.nabble.com/Panel-in-List-remove-extra-div-td1877053.html
   )
  This leads to this solution:
 
 
  div class=products
  wicket:container wicket:id=products
  div class=product wicket:id=productPanel./div
  /wicket:container
  /div
 
  Wicket:container tags make it ugly imo, because it violates wickts just 
  HTML philosophy, even though my problem is a very common scenario.
 
 
  - Original Message -
  From: Fatih Mehmet UCAR
  Sent: 08/21/10 04:05 PM
  To: users@wicket.apache.org
  Subject: Re: setRenderBodyOnly with ListView and attributes
 
  Add another html div with css class you want around the below list div ;
 
  div class=products wicket:id=productsView
 
  and for the productsViev in the java code setRenderBodyOnly to true.
 
  -fmu
 
 
  - Original Message - 
  From: J bluecar...@gmx.com
  To: users@wicket.apache.org
  Sent: Saturday, August 21, 2010 2:49 PM
  Subject: Re: setRenderBodyOnly with ListView and attributes
 
 
   It somehow feels bad/wrong to move CSS from WicketHTML to JavaCode, 
   where
   it shouldn't belong, for such a common scenario.
   It defeats the purpose of having HTML in Wicket. But there probably is 
   no
   other way.
  
   Anyway, thanks for your reply :)
  
  
   - Original Message -
  
   From: Fatih Mehmet UCAR
   Sent: 08/21/10

WicketFilter doesn't chain?

2010-05-14 Thread J
I'm having some problems with 
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter in some 
cases. I did some debugging and found that 
org.apache.wicket.protocol.http.WicketFilter isn't doing ServletFilter 
chaining: when it is called when a Wicket page is requested, it is breaking the 
filter chain by not calling the Filter.doFilter method (from Servlet API), 
causing other filters defined in web.xml not to work within the same 
url-pattern. (A workaround is to define WicketFilter as last entry in web.xml.)
When a non-wicket url is called within the same url-pattern, then WicketFilter 
does perform a doFilter, allowing other filters to do some work.

In Servlet applications (which Wicket basically also is), I think it is 
expected behaviour that all filters within some url-pattern should always be 
called. But WicketFilter seems to break it. Is this expected behaviour?

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



RE: Wicket Wiki

2010-04-30 Thread Metzger, Natalie J.
I've been seeing this for about 2 weeks, usually I just looked at the html page 
source to find the code. But if someone had a fix for this problem, it would be 
greatly appreciated!

Natalie

-Original Message-
From: Martin Schayna [mailto:martin.scha...@abra.eu] 
Sent: Thursday, April 29, 2010 12:07 PM
To: users@wicket.apache.org
Subject: Re: Wicket Wiki

It's problem only {code} segments in wiki pages :)

Workaround: you can see hidden text by editing page -- but you have to 
register.
Just click on Edit Page link, than on Preview tab.

Martin Schayna


On 29.4.2010 15:48, Brian Mulholland wrote:
 I must be in some minority given that the problem hasn't been noticed
 and fixed, but does anyone else have issues seeing the code example on
 the Wiki site?  I have to view source and pick them out from the code
 in order to see them.  The rest of the site renders fine, but those
 sections show up as thin blue lines (almost like customHRs).

 For example, I have attached a screenshot of what this page looks like
 in my browser (every page on the wiki with source code sections looks
 the same):
 https://cwiki.apache.org/WICKET/using-custom-converters.html

 At work I am using MSIE 6, but at home i use Google Chrome.  They both
 do this.  Any maintainers of the wiki on this list who might want to
 pass that along to someone who can fix the style sheet or whatever
 might be causing it?

-
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



TabbedPanel: tab visibility

2010-04-27 Thread Metzger, Natalie J.
Hi all,

Maybe I'm blind, but is there a way to set the visibility of certain tabs in 
the TabbedPanel? I only found the method isVisible(), but no setVisible(). My 
goal is to have certain tabs only visible to users with corresponding 
permissions. So far I have to add/remove tabs depending on those permissions, 
and which is less than optimal.
And yes, I can change the visibility of the content of the tab, but this is not 
what I need.

Any ideas?

Thanks,
Natalie

P.S. I'm using Wicket 1.4.6


RE: TabbedPanel: tab visibility

2010-04-27 Thread Metzger, Natalie J.
Yes, I can, thanks!!!

-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] 
Sent: Tuesday, April 27, 2010 12:51 PM
To: users@wicket.apache.org
Subject: Re: TabbedPanel: tab visibility

can you not override isvisible() and do the check there?

-igor


On Tue, Apr 27, 2010 at 9:41 AM, Metzger, Natalie J. nmetz...@odu.edu wrote:
 Hi all,

 Maybe I'm blind, but is there a way to set the visibility of certain tabs in 
 the TabbedPanel? I only found the method isVisible(), but no setVisible(). My 
 goal is to have certain tabs only visible to users with corresponding 
 permissions. So far I have to add/remove tabs depending on those permissions, 
 and which is less than optimal.
 And yes, I can change the visibility of the content of the tab, but this is 
 not what I need.

 Any ideas?

 Thanks,
                Natalie

 P.S. I'm using Wicket 1.4.6


-
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 make a wicket web editor

2010-04-12 Thread m j
Well, if you know how to use JQuery you can hard code the javascript and
html into the page, which is pretty easy and obvious as it just goes into
the HTML.

The other option if your familiar at all with Wicket is to put it into a
panel to allow more control and usability.

On Mon, Apr 12, 2010 at 9:59 AM, wicketyan wicket...@gmail.com wrote:


 hi guys,I'm a freshman on js.Could anyone tell me how to user a web editor
 in wicket.I know wicket-stuff already have a project tinymce,But I don't
 like tinymce.There are so many web editor,I want to use my favorated
 editor.I just knew a little about abstractajaxbehavior,But something deep is
 hard for me,for example,the ajax upload using jquery.How to  encapsulate
 ajax upload using wicket? to understand tinymce project is hard for me
 now.so, hope someone can tell me how to use these editor writted by jquery
 or introduce tinymce project's detail about image upload.

  the editor xheditor use this


 $('#elm2').xheditor({upLinkUrl:upload.php?immediate=1,upLinkExt:zip,rar,txt,upImgUrl:upload.php?immediate=1,upImgExt:jpg,jpeg,gif,png,upFlashUrl:upload.php?immediate=1,upFlashExt:swf,upMediaUrl:upload.php?immediate=1,upMediaExt:avi});

 the upload.php?immediate=1 is a interface to save the data,and if I use
 servlet ,that's easy.chang the url to a new url like x.do,writing a
 url-pattern in web.xml. But this is not a wicket way.
 2010-04-12



 wicketyan



Wicket button label

2010-03-02 Thread Metzger, Natalie J.
Hi all,

I'm comparatively new to Wicket and have a question about the wizard button 
labels. I'm using a Wizard with an AjaxButtonBar and AjaxButtons for previous 
and next. I would like to change the labels on the last step of the wizard of 
the cancel and finish buttons. I know how to change those labels for the whole 
wizard, but it escapes me how do change them in the last step only. Is there 
any elegant solution to this?

Thanks,
Natalie


Re: images not under the context root directory

2010-01-29 Thread Matthew J
Question, as I am dealing with a similar issue, except I save my file  
to my glassfish directory (ie: glassfish/domains/domain1/uploads/ 
Videos/...). I can't seem to find the url though I have tried many  
different types of urls...


For the record
((WebApplication 
)WebApplication 
.get()).getServletContext().getRealPath(newFile.getCanonicalPath())

returns:
/Users/msj121/NetBeansProjects/WebBuilder/dist/gfdeploy/WebBuilder/ 
WebBuilder-war_war/Applications/Programs/NetBeans/sges-v3/glassfish/ 
domains/domain1/uploads/Videos/...



btw, for those using Glassfish you can have urls to physical hard  
drive space even not in the context root by using an alternatedocroot  
(ie: alternatedocroot_1 from=/uploads/* dir=/).



I assume my directory is in the context root and I should be able to  
find it, no?


On 29-Jan-10, at 12:47 AM, Ernesto Reinaldo Barreiro wrote:


Hi Riyad,

I didn't get offended by your message... which otherwise raised a  
very valid

issue.

Cheers,

Ernesto

On Thu, Jan 28, 2010 at 5:26 PM, Riyad Kalla rka...@gmail.com wrote:


Ernesto,

Sorry about that -- I didn't mean to imply your impl was back, that  
was

more
directed at Francois along the lines of that's a lot of overhead,  
are you
sure you need to do that? -- but now that I understand what his  
use-case

is
(saw his last reply about /usr/ext/img/IMAGES HERE) I get it. I was
thinking they were under /webapp/images.

I'll go back to sitting in my corner ;)

-R

On Wed, Jan 27, 2010 at 9:54 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:


Sure it is overhead but he wanted to serve images from a folder not
under application
context root directory... Then, you have to serve them somehow? The

options

I see are

1-A dedicated servlet?
2-With Wicket... and thats what the code shows... and for sure it  
can be

done in a simpler way...

A would try to use 1. As then Wicket would not have to serve the  
images.


Regards,

Ernesto

On Wed, Jan 27, 2010 at 9:43 PM, Riyad Kalla rka...@gmail.com  
wrote:



This seems like adding a large amount of overhead to an image-heavy

site
(e.g. image blog or something), I thought I read in Wicket in  
Action

that

WicketFilter ignored HTTP requests for non-wicket resources now and

passed
them through to the underlying server to handle avoiding the need  
to

remap
your wicket URLs to something like /app/* so you could have / 
images and

other resources under root and not have them go through the filter.

Is this not the case?

On Wed, Jan 27, 2010 at 1:38 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:


Hi Francois,

Following example works.

1-Create this class anywhere you want need.

package com.antilia.demo.manager.img;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.markup.html.image.Image;
import

org.apache.wicket.markup.html.image.resource.DynamicImageResource;

import org.apache.wicket.model.Model;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.protocol.http.WebRequestCycle;
import org.apache.wicket.util.file.Folder;

/**
*
* @author  Ernesto Reinaldo Barreiro (reier...@gmail.com)
*
*/
public abstract class MountedImageFactory {


static int BUFFER_SIZE = 10*1024;
/**
   * Copies one stream into the other..
* @param is source Stream
* @param os destination Stream
* */
static public void copy(InputStream is, OutputStream os) throws

IOException

{
byte[] buf = new byte[BUFFER_SIZE];
while (true) {
int tam = is.read(buf);
if (tam == -1) {
return;
}
os.write(buf, 0, tam);
}
}
public static  byte[] bytes(InputStream is) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
copy(is, out);
return out.toByteArray();
}
private static ImageFromFolderWebResource dynamicResource;
private static class ImageFromFolderWebResource extends
DynamicImageResource {
private static final long serialVersionUID = 1L;

private File folder;
public ImageFromFolderWebResource(File folder, String  
mountPoint) {

this.folder = folder;
WebApplication.get().getSharedResources().add(mountPoint, this);
WebApplication.get().mountSharedResource(mountPoint,
org.apache.wicket.Application/+mountPoint);
}
@Override
protected byte[] getImageData() {
try {
String name =

WebRequestCycle.get().getRequest().getParameter(name);

return bytes(new FileInputStream(new

File(getFolder().getAbsolutePath()

+

System.getProperty(file.separator)+(name;
} catch (Exception e) {
//TODO: do this properly
return null;
}
}

public File getFolder() {
return folder;
}
}
/**
* @return Folder from where images will be retrieved.
*/
protected abstract Folder getFolder();
/**
* @return the URL to mount the dynamic WEB resource.e.g.
*/
protected abstract String getMountPoint();
public Image createImage(String id, final String imageName) {
if(dynamicResource == 

Re: images not under the context root directory

2010-01-29 Thread Matthew J
Correct, Glassfish would allow this; however, if I can do it  
programmatically with ease I would rather do this (as installations  
may change and I would rather not have the static uri). I assumed  
Wicket had access to all files in the context root (or what I assume  
is one, which maybe isn't).


I am currently trying the code posted below (MountedImageFactory),  
though I need to alter it to work with all files, and its a little  
bulky.


I am not bound to where I upload, is there a way to upload to a Folder  
that wicket would be able to find easily? I currently make an upload  
Folder: Folder upload = new Folder(uploads); I upload to it similar  
to the wicket-examples.


On 29-Jan-10, at 2:39 PM, Riyad Kalla wrote:


ot sure how that mounting rule in glassfish works, it might be
relative to your app root, but it seems it should work and just be  
treated
as a normal path -- in the case of the previous fellow I understood  
his
situation to be that he *had* to host resources out of a system  
directory
that wasn't web-addressable. I believe in your case they are web  
addressable

if that glassfis



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



Re: images not under the context root directory

2010-01-29 Thread m j
Well after my question I started researching and changed my upload folder
to:

String path = WebApplication.get().getServletContext().getRealPath();
Folder uploadFolder = new Folder(path+/uploads);

I can now reference the files via the url (.../uploads/..), so much simpler
this way... I suppose this is what I was trying to do from the beginning.

Thanks for the help.


On Fri, Jan 29, 2010 at 2:51 PM, Matthew J msj...@gmail.com wrote:

 Correct, Glassfish would allow this; however, if I can do it
 programmatically with ease I would rather do this (as installations may
 change and I would rather not have the static uri). I assumed Wicket had
 access to all files in the context root (or what I assume is one, which
 maybe isn't).

 I am currently trying the code posted below (MountedImageFactory), though I
 need to alter it to work with all files, and its a little bulky.

 I am not bound to where I upload, is there a way to upload to a Folder that
 wicket would be able to find easily? I currently make an upload Folder:
 Folder upload = new Folder(uploads); I upload to it similar to the
 wicket-examples.


 On 29-Jan-10, at 2:39 PM, Riyad Kalla wrote:

  ot sure how that mounting rule in glassfish works, it might be
 relative to your app root, but it seems it should work and just be treated
 as a normal path -- in the case of the previous fellow I understood his
 situation to be that he *had* to host resources out of a system directory
 that wasn't web-addressable. I believe in your case they are web
 addressable
 if that glassfis





Serialization on objects inherited from a container

2009-09-10 Thread J.-F. Rompre
Hello,

I would like to know where I could find documentation on the issue of
serializing objects inherited from a component's container as in the example
below. I tried looking at the wicket source code to see when this occurs but
still don't understand when/how it is done.

//...

final Product p = //get non-serializable Product object

add new Link( addToCart) {
public void onClick() {
getSession().getCart().add( p.getId());
//..etc

The above throws a NotSerializableException. However, no problem occurs
after the code is changed to:

//...

//Product p already assigned
final String pId = p.getId() //serializable

add new Link( addToCart) {
public void onClick() {
getSession().getCart().add( pId);
//..etc

(Also, building the Link with a wrapping Model object also works, obviously)

However I am curious to know why a non-model object is serialized when
inherited from the container even though within the same request?

Thanks for any comment,

JF


Re: Stateful vs stateless requests and navigation

2009-06-09 Thread J.-F. Rompre
Thank you Igor - I hadn't turned the logs on. Making the domain serializable
fixed the issue. I didn't think this would happen because I am using
LoadableDetachable models passed to a list view - probably serializing to
produce list items - will see if individual items can be fetched from cache.

Sorry for any inconvenience..
JF
On Mon, Jun 8, 2009 at 12:26 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 On Sun, Jun 7, 2009 at 10:16 AM, J.-F. Romprejrom...@gmail.com wrote:
 SETUP A
  So I tried setting the response headers to 'no-cache','no-store' as
  prescribed in other threads - that forces each request to go to the
 server
  and fixed the accuracy problem. - cart contents were then always
 accurate.
  However all stateless- requests such as paging URLs got rejected with
 'Page
  expired', even though the session is obviously live (versions keep
 getting
  incremented
  using app. navigation for stateful requests, shopping cart is OK, etc..).

 this should work without problems. are you sure there are no errors in
 your logs? the page should not be expired. feel free to create a
 quickstart that reproduces the problem and attach it to a jira issue.

 -igor

 
 SETUP B
  Next I tried URLHybridCodingStrategy combined with the 'no-cache',
  'no-store' header config. and that removed the 'Page expired' problem.
  However, I still can't access the previous screen when it was accessed
 with
  a stateful request such as pagination: instead, the user is sent back to
 the
  beginning of the pageable list.
 
 
  Also, with my current setup B above, I am expecting page instances to be
  reused when accessed within a session: however new page instances are
  created for each single request except for pagination requests - those go
 to
  the latest version, I assume.
 
 
  So my question is two-fold:
 
  1) Does setting no-cache and/or no-store in the header cause the page map
 to
  keep only the current version, or older verions to be inaccessible via
 the
  request URL?  I know that 'Page Expired' can have other causes e.g.
  serialization issues, but if that was the case here then setup B would
 have
  failed as well? Unless the problem exists in both cases both is 'skipped
  over' by the HybridUrlCodingStrategy?
 
  2) What drives the decision to reuse page instances, other than
  non-bookmarkability?
 
  Any comment or pointer to existing documentation is greatly appreciated.
 
  Thanks,
 
  JF
 

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




-- 
JF
If you want the rainbow, you gotta put up with the rain. -- Steven Wright


Re: How do I reuse a rendered string, i.e. render once and past in multiple locations, e.g. paging nav at top and bottom?

2009-05-29 Thread J.-F. Rompre
Thanks Igor for the straight answer - much appreciated.

Thanks,

JF




On Wed, May 27, 2009 at 9:59 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 no it is not possible and does not make sense to do so.

 imagine you have a panel that renders div id=1div id=2/div/div

 not only would you have to rewrite the id of the top tag, but also of
 the inner tags. this becomes even more complicated if components
 output header contributors, eg javascript, that depends on those ids.

 if you are instantiating components with the same state then you
 should simply connect them all to the same state via models so the
 state is reused and does not present overhead.

 makes sense?

 -igor

 On Wed, May 27, 2009 at 5:03 PM, J.-F. Rompre jrom...@gmail.com wrote:
  OK, thanks Martjin and Jeremy - I think mentioning performance was a
 mistake
  on my part..let me try again.
 
  I am not trying to couple different components, only to reuse what I know
 is
  never going to change within the same rendering - actually, avoiding the
 use
  of multiple component instances of the same subtype where a single
 instance
  would suffice.
 
  My question is: Is it possible to capture a rendered string for reuse? In
  other words, if I have a component subtype that I am currently
 instantiating
  multiple times with exactly the same state (therefore the output is
 exactly
  the same), is it possible to render it once and once only and reuse the
  string from that rendering within the same container or page?
 
  At this stage I am only trying to know how to do something instead of why
  (optimization or other reason, such as saving markup coding, or some
 other
  reason). I went through the source and searched on forums as well to find
  out, but didn't.
 
  My apologies if that question has been answered elsewhere - please let me
  know where I can look.
 
  Thanks,
 
  JF
 
  On Wed, May 27, 2009 at 6:33 PM, Jeremy Thomerson 
 jer...@wickettraining.com
  wrote:
 
  The real question that has been asked time and time again on this list
  when such a question is received is this:
 
  WHY?  It's premature (and almost certainly unnecessary) optimization.
  Doing it needlessly couples multiple components together - reducing
  reuse.
 
  As always, we are more than interested in seeing any results of
  performance analysis that you have done that says that this will
  reduce your page load time by any significant factor.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
 
  On Wed, May 27, 2009 at 2:53 PM, J.-F. Rompre jrom...@gmail.com
 wrote:
I am trying to do something that should be easy to do, and may
 already
  be
available from the API (I am still usin 1.3.5).
  
How can one duplicate rendered strings?
  
In other words, I am trying to render once but copy a number of times
  for
better performance - e.g., putting a page navigator both at the top
 and
bottom of the list (the bottom is simply a label generated from
 copying
  the
rendered top one) or something more complex such as a calendar.
  
I tried using IBehavior.onRendered to copy getResponse.toString() for
  later
reuse, but myComponent.renderComponent() throws
 IllegalStateException:
  Page
not found - even though I am adding the component to a panel as
  instructed
by Component.renderComponent() - any ideas? My code is below.
  
I also thought of overriding one of the rendering methods to write
  directly
to the response, but Component.renderXXX() methods are all final -
 there
has to be a way to do this simply.
  
Any ideas?
  
Thanks!
JF
  
The containing panel java (groovy) code - 'ppn' is the component we
 want
  to
render only once
.//ProductPanel
//...
  productsContainer.add( products )
   ProductsPagingNavigator ppn = new ProductsPagingNavigator(
productsPagerTop, products)
   ppn.add( new MakeRenderedStringBehavior())
  
  productsContainer.add(  ppn)
  ppn.renderComponent()   //THOWS 'Page not found... exc.
 //save the rendering for reuse
  CharSequence ppnOut = ppn.getRendered()
//reuse it here
  productsContainer.add new Label( productsPagerBottom, ppnOut)
//
  
//***
The Behavior code attached to ppn above:
.// MakeRenderedStringBehavior
   //...
  public void onRendered(final Component component)
  {
//
  //  Copy the rendering if this component can store it..
  CharSequence output = response.toString();
  if ( component instanceof IRenderedString )
  ((IRenderedString )component ).setRendered( output);
  webResponse.write(output);
  }
//
//*
The containing ProductPanel markup:
wicket:panel

div class=Products wicket:id=products id=
  div

How do I reuse a rendered string, i.e. render once and past in multiple locations, e.g. paging nav at top and bottom?

2009-05-27 Thread J.-F. Rompre
 I am trying to do something that should be easy to do, and may already be
 available from the API (I am still usin 1.3.5).

 How can one duplicate rendered strings?

 In other words, I am trying to render once but copy a number of times for
 better performance - e.g., putting a page navigator both at the top and
 bottom of the list (the bottom is simply a label generated from copying the
 rendered top one) or something more complex such as a calendar.

 I tried using IBehavior.onRendered to copy getResponse.toString() for later
 reuse, but myComponent.renderComponent() throws IllegalStateException: Page
 not found - even though I am adding the component to a panel as instructed
 by Component.renderComponent() - any ideas? My code is below.

 I also thought of overriding one of the rendering methods to write directly
 to the response, but Component.renderXXX() methods are all final - there
 has to be a way to do this simply.

 Any ideas?

 Thanks!
 JF

 The containing panel java (groovy) code - 'ppn' is the component we want to
 render only once
 .//ProductPanel
 //...
productsContainer.add( products )
 ProductsPagingNavigator ppn = new ProductsPagingNavigator(
 productsPagerTop, products)
 ppn.add( new MakeRenderedStringBehavior())

productsContainer.add(  ppn)
ppn.renderComponent()   //THOWS 'Page not found... exc.
   //save the rendering for reuse
CharSequence ppnOut = ppn.getRendered()
  //reuse it here
productsContainer.add new Label( productsPagerBottom, ppnOut)
 //

 //***
 The Behavior code attached to ppn above:
 .// MakeRenderedStringBehavior
 //...
public void onRendered(final Component component)
{
  //
//  Copy the rendering if this component can store it..
CharSequence output = response.toString();
if ( component instanceof IRenderedString )
((IRenderedString )component ).setRendered( output);
webResponse.write(output);
}
 //
 //*
 The containing ProductPanel markup:
 wicket:panel
 
 div class=Products wicket:id=products id=
div wicket:id=productsPagerTop class=Navigation/div !--
 rendered --
ul
li wicket:id=productsList id=
 ...
/div/li
/ul
div wicket:id=productsPagerBottom class=Navigation/div !--
 pasted in--
 /div
 /wicket:panel


Re: How do I reuse a rendered string, i.e. render once and past in multiple locations, e.g. paging nav at top and bottom?

2009-05-27 Thread J.-F. Rompre
OK, thanks Martjin and Jeremy - I think mentioning performance was a mistake
on my part..let me try again.

I am not trying to couple different components, only to reuse what I know is
never going to change within the same rendering - actually, avoiding the use
of multiple component instances of the same subtype where a single instance
would suffice.

My question is: Is it possible to capture a rendered string for reuse? In
other words, if I have a component subtype that I am currently instantiating
multiple times with exactly the same state (therefore the output is exactly
the same), is it possible to render it once and once only and reuse the
string from that rendering within the same container or page?

At this stage I am only trying to know how to do something instead of why
(optimization or other reason, such as saving markup coding, or some other
reason). I went through the source and searched on forums as well to find
out, but didn't.

My apologies if that question has been answered elsewhere - please let me
know where I can look.

Thanks,

JF

On Wed, May 27, 2009 at 6:33 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 The real question that has been asked time and time again on this list
 when such a question is received is this:

 WHY?  It's premature (and almost certainly unnecessary) optimization.
 Doing it needlessly couples multiple components together - reducing
 reuse.

 As always, we are more than interested in seeing any results of
 performance analysis that you have done that says that this will
 reduce your page load time by any significant factor.

 --
 Jeremy Thomerson
 http://www.wickettraining.com




 On Wed, May 27, 2009 at 2:53 PM, J.-F. Rompre jrom...@gmail.com wrote:
   I am trying to do something that should be easy to do, and may already
 be
   available from the API (I am still usin 1.3.5).
 
   How can one duplicate rendered strings?
 
   In other words, I am trying to render once but copy a number of times
 for
   better performance - e.g., putting a page navigator both at the top and
   bottom of the list (the bottom is simply a label generated from copying
 the
   rendered top one) or something more complex such as a calendar.
 
   I tried using IBehavior.onRendered to copy getResponse.toString() for
 later
   reuse, but myComponent.renderComponent() throws IllegalStateException:
 Page
   not found - even though I am adding the component to a panel as
 instructed
   by Component.renderComponent() - any ideas? My code is below.
 
   I also thought of overriding one of the rendering methods to write
 directly
   to the response, but Component.renderXXX() methods are all final - there
   has to be a way to do this simply.
 
   Any ideas?
 
   Thanks!
   JF
 
   The containing panel java (groovy) code - 'ppn' is the component we want
 to
   render only once
   .//ProductPanel
   //...
 productsContainer.add( products )
  ProductsPagingNavigator ppn = new ProductsPagingNavigator(
   productsPagerTop, products)
  ppn.add( new MakeRenderedStringBehavior())
 
 productsContainer.add(  ppn)
 ppn.renderComponent()   //THOWS 'Page not found... exc.
//save the rendering for reuse
 CharSequence ppnOut = ppn.getRendered()
   //reuse it here
 productsContainer.add new Label( productsPagerBottom, ppnOut)
   //
 
   //***
   The Behavior code attached to ppn above:
   .// MakeRenderedStringBehavior
  //...
 public void onRendered(final Component component)
 {
   //
 //  Copy the rendering if this component can store it..
 CharSequence output = response.toString();
 if ( component instanceof IRenderedString )
 ((IRenderedString )component ).setRendered( output);
 webResponse.write(output);
 }
   //
   //*
   The containing ProductPanel markup:
   wicket:panel
   
   div class=Products wicket:id=products id=
 div wicket:id=productsPagerTop class=Navigation/div !--
   rendered --
 ul
 li wicket:id=productsList id=
  ...
 /div/li
 /ul
 div wicket:id=productsPagerBottom class=Navigation/div !--
   pasted in--
   /div
   /wicket:panel
 

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




-- 
JF
Half the people you know are below average. -- Steven Wright


Form Submit with non-serializable Model

2009-05-09 Thread J
I have a non-serializable User object that must be created when someone 
registers for an user account.
The problem that I have with my current code (below) is that the 
ModelObject in onSubmit() doesn't have the username property 
bounded/pushed to it, so it's null.
This problem doesn't occur when I use a serializable User object with a 
normal inner Model.


What is the Wicket way to fix this problem without having to make the 
User object serializable, and without having to manually access the 
formComponents to retrieve the values?




public class RegisterPage extends WebPage {
   
   private class User {

   private String username;

   public String getUsername() { return username; }
   public void setUsername(String username) { this.username = 
username; }

   }
   
   public RegisterPage(final PageParameters pars) {


   IModel userModel = new CompoundPropertyModelUser(new 
IModelUser() {

   private transient User user;
   
   @Override

   public User getObject() {
   if (user == null)
   return new User();
   return user;
   }

   @Override
   public void setObject(User user) {
   this.user = user;
   }

   @Override
   public void detach() {
   user = null;
   }
   });
   setDefaultModel(userModel);
   
   FormUser form = new FormUser(registerForm, userModel) {

   @Override
   public void onSubmit() {
   // This one prints null instead of the username.
   System.out.println(getModelObject().getUsername());
   }
   };
   add(form);
   
   form.add(new TextField(username));

   }
}

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



Re: Form Submit with non-serializable Model

2009-05-09 Thread J

Code identation was a bit messed up. Maybe this copy/paste is a bit better:



public class RegisterPage extends WebPage {
  
   private class User {

   private String username;

   public String getUsername() { return username; }
   public void setUsername(String username) { this.username = 
username; }

   }
  
  
   public RegisterPage(final PageParameters pars) {


   IModel userModel = new CompoundPropertyModelUser(new 
IModelUser() {

   private transient User user;
  
   @Override

   public User getObject() {
   if (user == null)
   return new User();
   return user;
   }

   @Override
   public void setObject(User user) {
   this.user = user;
   }

   @Override
   public void detach() {
   user = null;
   }
   });
   setDefaultModel(userModel);
  
   FormUser form = new FormUser(registerForm, userModel) {

   @Override
   public void onSubmit() {
   System.out.println(getModelObject().getUsername());
   }
   };
   add(form);
  
   form.add(new TextField(username));

   }
}


J wrote:
I have a non-serializable User object that must be created when 
someone registers for an user account.
The problem that I have with my current code (below) is that the 
ModelObject in onSubmit() doesn't have the username property 
bounded/pushed to it, so it's null.
This problem doesn't occur when I use a serializable User object with 
a normal inner Model.


What is the Wicket way to fix this problem without having to make the 
User object serializable, and without having to manually access the 
formComponents to retrieve the values?


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



Re: Form Submit with non-serializable Model

2009-05-09 Thread J

ah, thanks! I totally looked over it :)

Clint Popetz wrote:

On Sat, May 9, 2009 at 5:43 PM, J bluecar...@gmx.com wrote:
  

  private transient User user;
@Override
  public User getObject() {
  if (user == null)
  return new User();
  return user;
  }



You didn't set user = new User(), so when the form updates your model,
it's not updating the user stored in the field, but rather one that
only lives for the duration of the form processing, and then your
onSubmit is checking the one represented by the field.

So change the above to:

if (user == null)
   user = new User();
return user;

and it should work.

-Clint
  


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



Validation on Beans

2009-05-02 Thread J
hi,  I'm using Wicket, Spring and Hibernate, and would like to have bean 
validation declaratively defined in the beans instead of in Wicket UI 
components. Hibernate has a bean validation framework called Hibernate 
Validator, and Spring has validation framework that is part of the 
third party Spring-Modules. Both use validation by annotating the beans.


I like this approach, but how can I use it with Wicket?


Cheers,
J

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



RE: WebApp Freezes

2009-04-15 Thread J
(Sorry for the empty message. First I tried Gmail, but that doesn't work
with this mailing list. Then I tried GMX webclient, but that client always
sends as HTML, which probably caused the message to be stripped to empty.)


I'm experiencing freezes on a production website.

Server specs:
-OS: Linux CentOS
-Webserver: Tomcat 6
-MySQL 5 with default settings
-Frameworks: Wicket 1.4-rc2 (webframework), Spring 2.5.6, Hibernate
3.3.1.GA, C3P0 db pooling 0.9.1.2, URLRewriteFilter 3.1.0, Spring
OpenSessionInViewFilter 

Problem:
At some point (about 5 to 24 hours) after a boot, Tomcat seems to stop
serving requests, although it does create new threads for new incoming
connections. But since it does not serve those connections, the new
connections will show and keep showing 0kb transfer. Shortly after that,
max-thread is reached, so then I'm unable to access any webapp (the main
website + tomcat manager) running on that Tomcat server. I'm not sure if it
is able to serve static resources in the short time window where it still
has some threads free, because the time window is too short to notice when
it happens.

Observations:
-No exceptions or errors in the catalina logs. So no memory problems, since
no error occurs in the logs
-Java Thread dump using command: kill -QUIT (see output below), shows the
text locked and WAITING.
-Adding c3p0 db pooling idle checks, tests and timeout settings (see below)
did not help.
-Using Mysql Administrator GUI shows that after a freeze, there will be 15
threads, all sleeping. Normally this would return to a minPoolSize of 5, if
I'm correct, but thats not the case.
-The freeze continues for hours, and does not recover. I have to restart
Tomcat.


I'm suspecting that it has something to do with DB pooling. I'm not sure if
locked and WAITING are normal behaviour. But if there is something
wrong, why doesn't c3p0 recover from it?

Can somebody shed some light on this? :)





Configuration:

=== DB pooling in Spring applicationContext.xml 
bean id=dataSource class=com.mchange.v2.c3p0.ComboPooledDataSource
property
name=driverClassvaluecom.mysql.jdbc.Driver/value/property
property name=jdbcUrl value=jdbc:mysql://localhost/xx /
property name=uservalue/value/property
property name=passwordvaluex/value/property

property name=maxConnectionAgevalue600/value/property
property
name=idleConnectionTestPeriodvalue180/value/property
property
name=testConnectionOnCheckinvaluetrue/value/property

property name=acquireIncrementvalue5/value/property
property name=maxIdleTimevalue180/value/property
property name=maxPoolSizevalue15/value/property
property name=maxStatementsvalue100/value/property
property name=minPoolSizevalue5/value/property
/bean
===


= Thread dump part ===
http-8080-28 daemon prio=10 tid=0xb4fbb400 nid=0x4ae2 in Object.wait()
[0xb4316000..0xb4318130]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at
com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePo
ol.java:1315)
at
com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicRe
sourcePool.java:557)
- locked 0x72c74b10 (a
com.mchange.v2.resourcepool.BasicResourcePool)
at
com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResource
Pool.java:477)
at
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C
3P0PooledConnectionPool.java:525)
at
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(Abstract
PoolBackedDataSource.java:128)
at
org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConn
ection(LocalDataSourceConnectionProvider.java:81)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:4
23)
at
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:14
4)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(Hiber
nateTransactionManager.java:510)
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.g
etTransaction(AbstractPlatformTransactionManager.java:350)
at
org.springframework.transaction.interceptor.TransactionAspectSupport.createT
ransactionIfNecessary(TransactionAspectSupport.java:262)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr
ansactionInterceptor.java:101)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:171)
at

RE: WebApp Freezes

2009-04-15 Thread J
-MySQL 5 is configured using defaults, which is max_connections 100
-Tomcat is configured with maxThreads 150
-C3P0 is configured with maxPoolSize 15

I'll increase C3P0's maxPoolSize to 90, to see if that makes any difference
in the occurences of freezes. Most of Tomcats threads are used to serve
static resources (running in a different webapp) that don't use a db
connection at all.


Here some output of JSTAT. I'm not sure if these values are okay.

ps -ef output:
-tomcat   28392 1  8 11:22 pts/000:20:52 /usr/java/latest/bin/java
-Xmx512m -Xms512m -Dwicket.configuration=deployment
-Djava.util.logging.manager=org.apache.juli.ClassLoade


[tomcat]$jstat -gc 28392
 S0CS1CS0US1U  EC   EUOC OU   PC
PUYGC YGCTFGCFGCT GCT
4032.0 4032.0 2856.3  0.0   32256.0  19546.2   483968.0   464268.9  22784.0
22633.9   1770   40.553   6  3.114   43.667



-Oorspronkelijk bericht-
Van: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] 
Verzonden: woensdag 15 april 2009 15:47
Aan: users@wicket.apache.org
Onderwerp: Re: WebApp Freezes

your max database connections should mirror the max request threads of
tomcat. Otherwise you'll endup in deadlock country...

Also make sure you don't have deadlocks in your database.

The lack of errors in your tomcat logs don't necessarily mean there
are no memory problems. Check with jstat -gc pid if your garbage
collector is having problems.

Martijn

On Wed, Apr 15, 2009 at 3:41 PM, J bluecar...@gmx.com wrote:
 (Sorry for the empty message. First I tried Gmail, but that doesn't work
 with this mailing list. Then I tried GMX webclient, but that client always
 sends as HTML, which probably caused the message to be stripped to empty.)


 I'm experiencing freezes on a production website.

 Server specs:
 -OS: Linux CentOS
 -Webserver: Tomcat 6
 -MySQL 5 with default settings
 -Frameworks: Wicket 1.4-rc2 (webframework), Spring 2.5.6, Hibernate
 3.3.1.GA, C3P0 db pooling 0.9.1.2, URLRewriteFilter 3.1.0, Spring
 OpenSessionInViewFilter

 Problem:
 At some point (about 5 to 24 hours) after a boot, Tomcat seems to stop
 serving requests, although it does create new threads for new incoming
 connections. But since it does not serve those connections, the new
 connections will show and keep showing 0kb transfer. Shortly after that,
 max-thread is reached, so then I'm unable to access any webapp (the main
 website + tomcat manager) running on that Tomcat server. I'm not sure if
it
 is able to serve static resources in the short time window where it still
 has some threads free, because the time window is too short to notice when
 it happens.

 Observations:
 -No exceptions or errors in the catalina logs. So no memory problems,
since
 no error occurs in the logs
 -Java Thread dump using command: kill -QUIT (see output below), shows the
 text locked and WAITING.
 -Adding c3p0 db pooling idle checks, tests and timeout settings (see
below)
 did not help.
 -Using Mysql Administrator GUI shows that after a freeze, there will be 15
 threads, all sleeping. Normally this would return to a minPoolSize of 5,
if
 I'm correct, but thats not the case.
 -The freeze continues for hours, and does not recover. I have to restart
 Tomcat.


 I'm suspecting that it has something to do with DB pooling. I'm not sure
if
 locked and WAITING are normal behaviour. But if there is something
 wrong, why doesn't c3p0 recover from it?

 Can somebody shed some light on this? :)





 Configuration:

 === DB pooling in Spring applicationContext.xml 
 bean id=dataSource class=com.mchange.v2.c3p0.ComboPooledDataSource
        property
 name=driverClassvaluecom.mysql.jdbc.Driver/value/property
        property name=jdbcUrl value=jdbc:mysql://localhost/xx /
        property name=uservalue/value/property
        property name=passwordvaluex/value/property

        property name=maxConnectionAgevalue600/value/property
        property
 name=idleConnectionTestPeriodvalue180/value/property
        property
 name=testConnectionOnCheckinvaluetrue/value/property

        property name=acquireIncrementvalue5/value/property
        property name=maxIdleTimevalue180/value/property
        property name=maxPoolSizevalue15/value/property
        property name=maxStatementsvalue100/value/property
        property name=minPoolSizevalue5/value/property
 /bean
 ===


 = Thread dump part ===
 http-8080-28 daemon prio=10 tid=0xb4fbb400 nid=0x4ae2 in Object.wait()
 [0xb4316000..0xb4318130]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at

com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePo
 ol.java:1315)
        at

com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicRe
 sourcePool.java:557)
        - locked 0x72c74b10 (a
 com.mchange.v2.resourcepool.BasicResourcePool)
        at

com.mchange.v2

RE: WebApp Freezes

2009-04-15 Thread J
Not just one thread, but that thread dump part (from my first post) is
repeated for 149 other threads have the same situation. ( because of tomcats
150 maxthreads).

But when looking at the db during a freeze, there is no lock on any table at
db level. MySQL Administrator shows that there are 15 threads during the
freeze (equal to c3p0's maxPoolSize), all sleeping.

I have now added some C3P0 debug and workaround options to see if I can get
some extra info out of it.
http://www.mchange.com/projects/c3p0/index.html#configuring_to_debug_and_wor
karound_broken_clients
(debugUnreturnedConnectionStackTraces true and unreturnedConnectionTimeout
180)


-Oorspronkelijk bericht-
Van: John Krasnay [mailto:j...@krasnay.ca] 
Verzonden: woensdag 15 april 2009 15:57
Aan: users@wicket.apache.org
Onderwerp: Re: WebApp Freezes

Sounds like you have a thread holding a lock on a critical table and
subsequent threads are lining up behind it waiting for it to finish. You
should check your MySQL to try and figure out who's holding the lock and
why.

Note that the culprit thread need not be hung up in the database. Locks
are held until the transaction commits, so your thread could be hung up
in app code after making a database update but before the transaction is
committed.

jk

On Wed, Apr 15, 2009 at 03:41:07PM +0200, J wrote:
 (Sorry for the empty message. First I tried Gmail, but that doesn't work
 with this mailing list. Then I tried GMX webclient, but that client always
 sends as HTML, which probably caused the message to be stripped to empty.)
 
 
 I'm experiencing freezes on a production website.
 
 Server specs:
 -OS: Linux CentOS
 -Webserver: Tomcat 6
 -MySQL 5 with default settings
 -Frameworks: Wicket 1.4-rc2 (webframework), Spring 2.5.6, Hibernate
 3.3.1.GA, C3P0 db pooling 0.9.1.2, URLRewriteFilter 3.1.0, Spring
 OpenSessionInViewFilter 
 
 Problem:
 At some point (about 5 to 24 hours) after a boot, Tomcat seems to stop
 serving requests, although it does create new threads for new incoming
 connections. But since it does not serve those connections, the new
 connections will show and keep showing 0kb transfer. Shortly after that,
 max-thread is reached, so then I'm unable to access any webapp (the main
 website + tomcat manager) running on that Tomcat server. I'm not sure if
it
 is able to serve static resources in the short time window where it still
 has some threads free, because the time window is too short to notice when
 it happens.
 
 Observations:
 -No exceptions or errors in the catalina logs. So no memory problems,
since
 no error occurs in the logs
 -Java Thread dump using command: kill -QUIT (see output below), shows the
 text locked and WAITING.
 -Adding c3p0 db pooling idle checks, tests and timeout settings (see
below)
 did not help.
 -Using Mysql Administrator GUI shows that after a freeze, there will be 15
 threads, all sleeping. Normally this would return to a minPoolSize of 5,
if
 I'm correct, but thats not the case.
 -The freeze continues for hours, and does not recover. I have to restart
 Tomcat.
 
 
 I'm suspecting that it has something to do with DB pooling. I'm not sure
if
 locked and WAITING are normal behaviour. But if there is something
 wrong, why doesn't c3p0 recover from it?
 
 Can somebody shed some light on this? :)
 
 
 
 
 
 Configuration:
 
 === DB pooling in Spring applicationContext.xml 
 bean id=dataSource class=com.mchange.v2.c3p0.ComboPooledDataSource
   property
 name=driverClassvaluecom.mysql.jdbc.Driver/value/property
   property name=jdbcUrl value=jdbc:mysql://localhost/xx /
   property name=uservalue/value/property
   property name=passwordvaluex/value/property
 
   property name=maxConnectionAgevalue600/value/property
   property
 name=idleConnectionTestPeriodvalue180/value/property
   property
 name=testConnectionOnCheckinvaluetrue/value/property
 
   property name=acquireIncrementvalue5/value/property
   property name=maxIdleTimevalue180/value/property
   property name=maxPoolSizevalue15/value/property
   property name=maxStatementsvalue100/value/property
   property name=minPoolSizevalue5/value/property
 /bean
 ===
 
 
 = Thread dump part ===
 http-8080-28 daemon prio=10 tid=0xb4fbb400 nid=0x4ae2 in Object.wait()
 [0xb4316000..0xb4318130]
java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   at

com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePo
 ol.java:1315)
   at

com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicRe
 sourcePool.java:557)
   - locked 0x72c74b10 (a
 com.mchange.v2.resourcepool.BasicResourcePool)
   at

com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResource
 Pool.java:477)
   at

com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C
 3P0PooledConnectionPool.java:525

RadioChoice : default choice ?

2008-01-16 Thread j . bokobza
Hello,
I'm using a RadioChoice component like this :
RadioChoice Radios = new RadioChoice(ca_reel, new
PropertyModel(this.getModelObject(), ca_reel), Choices);
I would like to know if I can have a default choice selected (the first in
my variable List Choices) and if yes how ? (I didn't find on wicket API
page nor that on examples)
Thanks


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Centering ModalWindow during scroll?

2007-09-14 Thread Anthony J Webster
Ok well I think I'm going to abandon this for the meantime and just use an 
indicator and a modal semi-transparent overlay over the site. I don't really 
have the time to learn cross-browser javascript!


- Original Message - 
From: Matej Knopp [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Friday, September 14, 2007 11:13 AM
Subject: Re: Centering ModalWindow during scroll?



It's not a simple thing. A huge amount of time (both for
implementation and testing) went into the current modal window library
to make it work as cross-browser as possible. Unfortunately, I wasn't
aware of all the exotic use cases people want so the library is rather
monolithic. There is a rewrite on my to-do list that would split the
modal window into pieces (mask, basic window, style, etc.), but it's
not really a high priority.

-Matej

On 9/14/07, Anthony J Webster [EMAIL PROTECTED] wrote:

It seems to be a rather tricky issue in terms of browser compatibilty. I
have been looking around for alternatives to ModalWindow and most of them
only have this working in FF (the small ones which don't involve a huge
library that is). Pity I'm not a JS expert...

- Original Message -
From: Matej Knopp [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Friday, September 14, 2007 11:04 AM
Subject: Re: Centering ModalWindow during scroll?


 No, currently there is not.

 -Matej

 On 9/14/07, Anthony J Webster [EMAIL PROTECTED] wrote:
 Hi,

 Is there a way to center a ModalWindow so that when a user scrolls the
 site with the navigator scrollbar, the ModalWindow stays centered 
 while

 the site behind scrolls?

 Thanks

 Anthony

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Centering ModalWindow during scroll?

2007-09-14 Thread Anthony J Webster
Hi,

Is there a way to center a ModalWindow so that when a user scrolls the site 
with the navigator scrollbar, the ModalWindow stays centered while the site 
behind scrolls?

Thanks

Anthony

Re: Centering ModalWindow during scroll?

2007-09-14 Thread Anthony J Webster
It seems to be a rather tricky issue in terms of browser compatibilty. I 
have been looking around for alternatives to ModalWindow and most of them 
only have this working in FF (the small ones which don't involve a huge 
library that is). Pity I'm not a JS expert...


- Original Message - 
From: Matej Knopp [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Friday, September 14, 2007 11:04 AM
Subject: Re: Centering ModalWindow during scroll?



No, currently there is not.

-Matej

On 9/14/07, Anthony J Webster [EMAIL PROTECTED] wrote:

Hi,

Is there a way to center a ModalWindow so that when a user scrolls the 
site with the navigator scrollbar, the ModalWindow stays centered while 
the site behind scrolls?


Thanks

Anthony


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Modal dialogs with Ajax

2007-09-13 Thread Anthony J Webster
Hello again,

I have a form with ajax validation on its component's 'onblur' and a sumit 
link. The submission process takes a while as it results in numerous database 
lookups and so on. Initially I used an IndicatingAjaxSubmitButton to show the 
user that their request was being processed, with the help of mailinglist and 
#wicket members I also disabled the link during the submission with an 
AjaxCallDecorator and I suppose I could always add a modal div over the whole 
site as well (in the same callDecorator) in order to stop users changing the 
form contents or navigating to another part of the site.

That all works fine however I need to push this further. If a user submits 
information which corresponds to a object that already exists in the database, 
I need to ask him whether he wishes to create a duplicate.

The way I see this working is as follows. The user submits a valid form by 
clicking the link. This results in a modal centered dialog with some loading 
animation being displayed. If the submission works the user is redirected to a 
'success' page where the entered data is display along with any information 
calculated during the submission. However if there is an error (an Exception 
thrown from the server) either a connection problem or duplicate data, the 
animation is replaced by some text explaining the problem and 1 or 2 buttons 
(Cancel for connection problems and Make Duplicate/Cancel for duplicate data). 
The Cancel button simply removes the modal window effectively returning the 
user to the form, whereas the Duplicate button launches the submission again 
and displays the animation until it succeeds or fails again in the case of 
connectivity problems.

I know this a lot to ask but has anyone got any idea how to achieve this as I'm 
getting a tad confused!

Many Thanks

Anthony

ModalWindow customisation ?

2007-09-11 Thread Anthony J Webster
Hi,

Is there any way to customise the actual frame of a ModalWindow? Preferably I'd 
like to get rid of the frame entirely or just replace it with a simple box of 
the same colour as the enclosed page/panel without the top-right close button.

Any ideas?

Many Thanks

Anthony

Re: ModalWindow customisation ?

2007-09-11 Thread Anthony J Webster

hmm it uses image maps for the frame graphics :/
I suppose I could rewrite it and strip it of most of its functionality

- Original Message - 
From: Frank Bille [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Tuesday, September 11, 2007 3:15 PM
Subject: Re: ModalWindow customisation ?



It's in the stylesheet. Some time ago I did a custom skin for it. The
project died, so I don't have it anymore, but it's not that hard (read: if 
I

can do it, you can do it)

Frank

On 9/11/07, Anthony J Webster [EMAIL PROTECTED] wrote:


Hi,

Is there any way to customise the actual frame of a ModalWindow?
Preferably I'd like to get rid of the frame entirely or just replace it 
with

a simple box of the same colour as the enclosed page/panel without the
top-right close button.

Any ideas?

Many Thanks

Anthony






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Image from DB example

2007-09-10 Thread Anthony J Webster
If I remember correctly (this was a while back) it doesn't work over firefox 
either...

I'll check up on the link.
Thanks

Anthony

- Original Message - 
From: Igor Vaynberg [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Monday, September 10, 2007 4:58 PM
Subject: Re: Image from DB example



google pngfix for explorer

-igor


On 9/10/07, Anthony J Webster [EMAIL PROTECTED] wrote:


Along these lines I haven't managed to get images with transparency to
display properly. My PNGs all display black instead of transparent pixels
:(.
Anthony

- Original Message -
From: Igor Vaynberg [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Monday, September 10, 2007 4:32 PM
Subject: Re: Image from DB example


 see sourcecode of the pastebin, i think its on belios. also there is an
 article on the wiki about it.

 -igor


 On 9/9/07, Doug Leeper [EMAIL PROTECTED] wrote:


 I am looking for an example that obtains an image from the db and
 displays
 it.  Can anyone point me in the right direction?  I couldn't find the
 cdApp
 in wicket-contrib-examples

 I know that I need to use a Resource or some derivative of one, but I
 want
 to make sure that the Image is not stored in session.  I am converting
an
 existing JSP/Pageflow project to Wicket and have used a specific
servlet
 to
 stream the image but not sure how to do in Wicket.


 Thanks in advance,
 - Doug
 --
 View this message in context:
 http://www.nabble.com/Image-from-DB-example-tf4410796.html#a12582968
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AjaxSubmitLink does nothing in IE

2007-09-07 Thread Anthony J Webster

That works fine. Thanks
However I've just noticed that this AjaxSubmitLink doesn't do anything in IE 
whereas in Firefox it works.
I check the Ajax debug window and the server *is* contacted and everything 
however after recieving the response I get an ERROR: Error while parsing 
response: Unknown runtime error in IE.


Any Ideas?

Many Thanks

Anthony

- Original Message - 
From: Matej Knopp [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Thursday, September 06, 2007 11:35 PM
Subject: Re: Creating a disableable AjaxSubmitLink



Something like the following should work:

decorateScript:
this.onclick_=this.onclick; this.onclick=function() { return false;
}; + script;

onSuccess,onFailureScript:
this.onclick=this.onclick_; + script;

-Matej

On 9/6/07, Anthony J Webster [EMAIL PROTECTED] wrote:

Hi,

I'm trying to create a disableable AjaxSubmitLink. When a user clicks on 
the link further clicks must not result in anything until the 
'submission' is complete. This call be achieved by adding return false; 
in a call decorator. However I'm stuggling with the re-enabling. I need 
to strip the return false and put the original destination back.


form.add(new AjaxSubmitLink(randomise, form) {

protected void onSubmit(AjaxRequestTarget target, Form form) 
{

   somethingLong();
}
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {

public CharSequence decorateScript(CharSequence 
script) {

return return false; + script;
}
public CharSequence 
decorateOnSuccessScript(CharSequence script) {

// NEED TO RESET TO PREVIOUS STATE
}
public CharSequence 
decorateOnFailureScript(CharSequence script) {

// NEED TO RESET TO PREVIOUS STATE
}
};
}
});

Any help would be most appreciated.

Thanks in advance

Anthony


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Upcoming jWeekend Wicket training courses

2007-09-07 Thread Anthony J Webster
Hmm nice. I'd hop on a Eurostar if I weren't submerged with work and totally 
exhausted!

A

- Original Message - 
From: Al Maw [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Friday, September 07, 2007 11:02 AM
Subject: Upcoming jWeekend Wicket training courses



Hi folks,

Cemal and I have been working hard refining jWeekend's upcoming Getting 
Started With Apache Wicket 1.3 [1] and Apache Wicket 1.3 [2] courses. 
The next ones are scheduled for September 22nd and September 29th-30th 
respectively.


They're an excellent way to get up to speed with Wicket and develop an 
in-depth understanding of Models, Behaviors, the AJAX functionality, 
advanced validation, etc., etc. As such, they will be useful to you 
whether you're a beginner or a fairly seasoned Wicket programmer, so I'd 
encourage you to visit the jWeekend site [3] for more information and to 
see just what you'll be getting (and hopefully to book your place ;-) ).


Hope to see some of you there!

Best regards,

Al

[1] http://jweekend.co.uk/dev/JW7031
[2] http://jweekend.co.uk/dev/JW703
[3] http://jweekend.co.uk/

--
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Upcoming jWeekend Wicket training courses

2007-09-07 Thread Anthony J Webster
I'd be arriving from Paris but I know my way around London having been born 
there!
Something tells me the boss isn't going to pick up the check though (he's 
got struts suck in his head) grrr :(


- Original Message - 
From: jweekend [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Friday, September 07, 2007 12:52 PM
Subject: Re: Upcoming jWeekend Wicket training courses




(there's a link below if you'd like to see a presentation Al gave at one 
of

our London Wicket User Groups and at the last Java Web users Group)
That's interesting Anthony; our first 2 Wicket-course students also found 
us
from continental Europe, in fact, both from Belgium (is this where the 
next

wave of the popularist Wicket revolution will start to gather pace? ;-),
with at least one arriving on Eurostar; from Waterloo Station (where
Eurostar stops in London) it's a direct, 17 minute underground ride. I 
think

it's like a weekend break for some people; but beware that the Wicket
courses are pretty intensive. All the details are at 
http://jWeekend.co.uk

jWeekend.co.uk .
We have helped people from out of town with accommodation (for the 
Saturday

night or, Friday and Saturday nights) as well, so let us know if you're
looking at this.
We have had excellent feedback about our last Wicket course (2 day), and 
we

believe we have further improved the material for our 2 new 1 day Wicket
courses and our original 2 day course (all now based on 1.3), with Al
deserving all the credit here as well. If we continue to get interest and
such good and satisfying feedback we will continue delivering these 
courses

beyond the dates already scheduled.
Regards - Cemal
http://jWeekend.co.uk jWeekend.co.uk

PS If you'd like to get a taste of how Al presents Wicket material, you 
can

enjoy an example  http://talks.londonwicket.org/BeanEditor.mov here ; a
presentation he gave at one of our London Wicket User Groups and at the 
last

Java Web users Group. Of course, our course material is even more
thoughtfully put together and pedagogically delivered.






Anthony J Webster wrote:


Hmm nice. I'd hop on a Eurostar if I weren't submerged with work and
totally
exhausted!
A

- Original Message - 
From: Al Maw [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Friday, September 07, 2007 11:02 AM
Subject: Upcoming jWeekend Wicket training courses



Hi folks,

Cemal and I have been working hard refining jWeekend's upcoming Getting
Started With Apache Wicket 1.3 [1] and Apache Wicket 1.3 [2] courses.
The next ones are scheduled for September 22nd and September 29th-30th
respectively.

They're an excellent way to get up to speed with Wicket and develop an
in-depth understanding of Models, Behaviors, the AJAX functionality,
advanced validation, etc., etc. As such, they will be useful to you
whether you're a beginner or a fairly seasoned Wicket programmer, so I'd
encourage you to visit the jWeekend site [3] for more information and to
see just what you'll be getting (and hopefully to book your place ;-) ).

Hope to see some of you there!

Best regards,

Al

[1] http://jweekend.co.uk/dev/JW7031
[2] http://jweekend.co.uk/dev/JW703
[3] http://jweekend.co.uk/

--
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
View this message in context: 
http://www.nabble.com/Upcoming-jWeekend-Wicket-training-courses-tf4400269.html#a12553097

Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Upcoming jWeekend Wicket training courses

2007-09-07 Thread Anthony J Webster

Oh I agree. I'll definitely try and go if I'm up to it.

- Original Message - 
From: Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Friday, September 07, 2007 11:58 AM
Subject: Re: Upcoming jWeekend Wicket training courses


ahh but going to the weeekend might make it easier for you to get the 
load of work off your shoulders:)


I've been hearing the phrase we haven't got time to education, because 
we are too busy too much, that itself are oxymoron.


That could easily be translate into : we havent got time to make 
ourselfs faster, because we are too busy



my 2 dry cents.

regards Nino

Anthony J Webster wrote:
Hmm nice. I'd hop on a Eurostar if I weren't submerged with work and 
totally exhausted!

A

- Original Message - From: Al Maw [EMAIL PROTECTED]
To: users@wicket.apache.org
Sent: Friday, September 07, 2007 11:02 AM
Subject: Upcoming jWeekend Wicket training courses



Hi folks,

Cemal and I have been working hard refining jWeekend's upcoming 
Getting Started With Apache Wicket 1.3 [1] and Apache Wicket 1.3 
[2] courses. The next ones are scheduled for September 22nd and 
September 29th-30th respectively.


They're an excellent way to get up to speed with Wicket and develop 
an in-depth understanding of Models, Behaviors, the AJAX 
functionality, advanced validation, etc., etc. As such, they will be 
useful to you whether you're a beginner or a fairly seasoned Wicket 
programmer, so I'd encourage you to visit the jWeekend site [3] for 
more information and to see just what you'll be getting (and 
hopefully to book your place ;-) ).


Hope to see some of you there!

Best regards,

Al

[1] http://jweekend.co.uk/dev/JW7031
[2] http://jweekend.co.uk/dev/JW703
[3] http://jweekend.co.uk/

--
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Creating a disableable AjaxSubmitLink

2007-09-06 Thread Anthony J Webster
Hi,

I'm trying to create a disableable AjaxSubmitLink. When a user clicks on the 
link further clicks must not result in anything until the 'submission' is 
complete. This call be achieved by adding return false; in a call decorator. 
However I'm stuggling with the re-enabling. I need to strip the return false 
and put the original destination back.

form.add(new AjaxSubmitLink(randomise, form) {

protected void onSubmit(AjaxRequestTarget target, Form form) {
   somethingLong();
}
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {

public CharSequence decorateScript(CharSequence script) {
return return false; + script;
}
public CharSequence decorateOnSuccessScript(CharSequence 
script) {
// NEED TO RESET TO PREVIOUS STATE
}
public CharSequence decorateOnFailureScript(CharSequence 
script) {
// NEED TO RESET TO PREVIOUS STATE
}
};
}
});

Any help would be most appreciated.

Thanks in advance

Anthony

Houdini FeedBackPanel Problem

2007-09-03 Thread Anthony J Webster
Hello,

I'm having some trouble with FeedbackPanel. I have an ajax validated form and 
submit button. Whenever a component looses focus it and the others are 
validated and if there are errors these are displayed in the single 
feedbackpanel abover the form. This works fine however I have a problem when 
submitting with my AjaxButton. There is a lengthy method call in 
AjaxButton#onSubmit() which (as it contacts other servers) mail fail. If an 
exception in thrown I call error() in order to show the user that the 
submission process has failed. This call works, however most of the time I only 
see the error message for a split second. When I submit by pressing enter it 
seems to work OK.

I think his has something to do with the componenet focus and have been trying 
to decern a pattern in this behaviour but so far despite numerous re-workings 
the feedbackpanel behaviour remains the same.

I have uploaded a small quickstart project demonstrating this problem over at 
http://www.transcendenz.co.uk/quickstart.zip and I would be most grateful if 
someone with greater Wicket knowledge than I could have a quick look and tell 
me what I'm doing wrong.

Many thanks in advance,

Anthony

Re: Houdini FeedBackPanel Problem

2007-09-03 Thread Anthony J Webster
D'oh. Ignore the javascript. I was testing sometning and it would seem I 
forgot to remove it all before uploading the quickstart.


Is there a way I can register my error as a regular validation error from 
the onSubmit()? Or somehow deactivate the validation behaviour until after 
the submission error is displayed...


Thanks

Anthony

- Original Message - 
From: Matej Knopp [EMAIL PROTECTED]

To: users@wicket.apache.org
Sent: Monday, September 03, 2007 5:17 PM
Subject: Re: Houdini FeedBackPanel Problem



Hi,

there are multiple problems with your code. First you have
   script type=text/javascript
 document.getElementById('a').
   /script
In your page's header. That's a javascript error (trailing .).

Also you've attached validating behavior in onblur. That's the behavior 
that

clears feedback from your panel. Your problem is that the error message is
registered only during onSubmit(), but not during regular validaiton. In
wicket, all validation message sare supposed to be displayed only once. So
when you submit your form, the message is registered, and if after that 
for

any reason onblur is triggered, it clears your message.

-Matej


On 9/3/07, Anthony J Webster [EMAIL PROTECTED] wrote:


Hello,

I'm having some trouble with FeedbackPanel. I have an ajax validated form
and submit button. Whenever a component looses focus it and the others 
are

validated and if there are errors these are displayed in the single
feedbackpanel abover the form. This works fine however I have a problem 
when

submitting with my AjaxButton. There is a lengthy method call in
AjaxButton#onSubmit() which (as it contacts other servers) mail fail. If 
an

exception in thrown I call error() in order to show the user that the
submission process has failed. This call works, however most of the time 
I

only see the error message for a split second. When I submit by pressing
enter it seems to work OK.

I think his has something to do with the componenet focus and have been
trying to decern a pattern in this behaviour but so far despite numerous
re-workings the feedbackpanel behaviour remains the same.

I have uploaded a small quickstart project demonstrating this problem 
over

at http://www.transcendenz.co.uk/quickstart.zip and I would be most
grateful if someone with greater Wicket knowledge than I could have a 
quick

look and tell me what I'm doing wrong.

Many thanks in advance,

Anthony






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]