Re: Wicket ResourceStreamLocator performance issue

2011-09-07 Thread armandoxxx
thank you for your reply
is it fixed in final release (since I saw a final release was made
yesterday) or just in trunk ?

regards

Armando


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3797981.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



[SVN] Where is the release of 1.5.0?

2011-09-07 Thread Mike Mander

Hi,

at first thanks to the wicket devs for wicket-1.5. Migration here is 
still in process but it's not that hard (escpecially with help of Martin 
:-).


I would like to patch the sources by i couldn't find a 1.5.0 folder in 
releases. Is that moved away from

http://svn.apache.org/repos/asf/wicket/releases/? If so were can i find it?

Thanks
Mike

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



Re: Apache Wicket releases Wicket 1.5

2011-09-07 Thread Hans Lesmeister
Congratulations! Thank you for this great Framework. 



Martijn Dashorst  schrieb:

The Apache Wicket team is proud to announce the immediate availability of the
newest release of their component oriented open source Java web framework.
Apache Wicket 1.5 has been in development for the last two years and brings
many improvements over previous versions.

Downloading Apache Wicket 1.5
-

You can download the release here:
http://www.apache.org/dyn/closer.cgi/wicket/1.5.0

Or use this in your Maven POM to upgrade to the new version:


org.apache.wicket
wicket-core
1.5.0


Please note that Wicket’s main artifact ID has been renamed to wicket-core.

You will need to upgrade all modules (i.e. wicket, wicket-extensions,
wicket-ioc, wicket-spring, etc) to 1.5.0. It is not possible to mix previous
versions of Wicket with modules of this release.

Most notable changes


With this release the Wicket team has revised many of its internals. A
short list:

- HTML5 components added: EmailTextField, NumberTextField, UrlTextField and
RangeTextField

- New inter-component events (explained below)

- Minimum required servlet API is servlet-api 2.5

- All standard validators now extend Behavior to allow for client side
validations

- IBehavior has been removed and AbstractBehavior has been deprecated, you
should now extend Behavior instead

- Simplified the request cycle processing and made it more extensible

- URL handling is now in one place

- Wicket’s rendering code has been greatly simplified

- Improved browser caching support

- ClientSideImageMap replaces old ImageMap

- Better support for running behind proxies with x-forwarded-for header

- Request cycle listeners make it easier to integrate frameworks in your
Wicket application

- Consistent naming: methods with Javascript in the name have been renamed to
use proper capitalization: JavaScript

- Switching to HTTPS is as simple as configuring a new root mapper to make
Wicket HTTPS aware and annotating a page with @RequireHttps

A longer list of changes and improvements can be found in our migration
guide.

Inter-component events
--

Wicket 1.5 offers a simple, yet flexible, way for component to communicate
with each other in a decoupled manner. The two major interfaces that
facilitate this are:

/**
 * Objects that can send events
 */
public interface IEventSource {
  void send(IEventSink sink, Broadcast broadcast, T payload);
}

and

/**
 * Objects that can receive events
 */
public interface IEventSink
{
 /**
 * Called when an event is sent to this sink
 */
 void onEvent(IEvent event);
}

The classes that implement these interfaces, and can thus participate in the
event mechanism are: Component, RequestCycle, Session, and Application.

The mechanism allows for different event broadcast methods defined here:

/**
 * Defines the event broadcast type.
 */
public enum Broadcast {
 BREADTH,
 DEPTH,
 BUBBLE,
 EXACT;
}

There is an example in wicket-examples which demonstrates the usage of this.

Applications can register custom event dispatchers in FrameworkSettings; the
dispatchers can be used to build custom event delivery mechanisms. For example
a custom IEventDispatcher mechanism can route events to annotated methods, for
example:

public class MyComponent extends Component {
 @OnEvent
 private void onUserAdded(UserAddedEvent event) {...}
}

where UserAddedEvent is the event payload object.

The default Component#onEvent method will be called even if custom dispatchers
are registered.

A default event is raised whenever Wicket begins to create an AJAX response.
The payload of the event is the AjaxRequestTarget used for event. Sample
implementation:

// component that always adds itself to the ajax response
public class MyCompo



Re: Wicket ResourceStreamLocator performance issue

2011-09-07 Thread Igor Vaynberg
this one is fixed in trunk

-igor

On Wed, Sep 7, 2011 at 10:14 PM, armandoxxx  wrote:
> Another question.
>
> Is it normal that onAfterRender() methods gets called several times for each
> component ?
>
> Regards
>
> Armando
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3797892.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Apache Wicket releases Wicket 1.5

2011-09-07 Thread Bernhard Schauer

w00t, Wicket FTW!

On 2011-09-08 05:31, Duy Do wrote:

Big news! You made my day. Thanks a lot for your great working.


On 9/8/11 5:17 AM, Martijn Dashorst wrote:
The Apache Wicket team is proud to announce the immediate 
availability of the
newest release of their component oriented open source Java web 
framework.
Apache Wicket 1.5 has been in development for the last two years and 
brings

many improvements over previous versions.

Downloading Apache Wicket 1.5
-

You can download the release here:
http://www.apache.org/dyn/closer.cgi/wicket/1.5.0

Or use this in your Maven POM to upgrade to the new version:


org.apache.wicket
wicket-core
1.5.0


Please note that Wicket’s main artifact ID has been renamed to 
wicket-core.


You will need to upgrade all modules (i.e. wicket, wicket-extensions,
wicket-ioc, wicket-spring, etc) to 1.5.0. It is not possible to mix 
previous

versions of Wicket with modules of this release.

Most notable changes


With this release the Wicket team has revised many of its internals. A
short list:

  - HTML5 components added: EmailTextField, NumberTextField, 
UrlTextField and

RangeTextField

  - New inter-component events (explained below)

  - Minimum required servlet API is servlet-api 2.5

  - All standard validators now extend Behavior to allow for client side
validations

  - IBehavior has been removed and AbstractBehavior has been 
deprecated, you

should now extend Behavior instead

  - Simplified the request cycle processing and made it more extensible

  - URL handling is now in one place

  - Wicket’s rendering code has been greatly simplified

  - Improved browser caching support

  - ClientSideImageMap replaces old ImageMap

  - Better support for running behind proxies with x-forwarded-for 
header


  - Request cycle listeners make it easier to integrate frameworks in 
your

Wicket application

  - Consistent naming: methods with Javascript in the name have been 
renamed to

use proper capitalization: JavaScript

  - Switching to HTTPS is as simple as configuring a new root mapper 
to make

Wicket HTTPS aware and annotating a page with @RequireHttps

A longer list of changes and improvements can be found in our migration
guide.

Inter-component events
--

Wicket 1.5 offers a simple, yet flexible, way for component to 
communicate

with each other in a decoupled manner. The two major interfaces that
facilitate this are:

/**
 * Objects that can send events
 */
public interface IEventSource {
  void send(IEventSink sink, Broadcast broadcast, T payload);
}

and

/**
 * Objects that can receive events
 */
public interface IEventSink
{
/**
 * Called when an event is sent to this sink
 */
void onEvent(IEvent  event);
}

The classes that implement these interfaces, and can thus participate 
in the

event mechanism are: Component, RequestCycle, Session, and Application.

The mechanism allows for different event broadcast methods defined here:

/**
 * Defines the event broadcast type.
 */
public enum Broadcast {
BREADTH,
DEPTH,
BUBBLE,
EXACT;
}

There is an example in wicket-examples which demonstrates the usage 
of this.


Applications can register custom event dispatchers in 
FrameworkSettings; the
dispatchers can be used to build custom event delivery mechanisms. 
For example
a custom IEventDispatcher mechanism can route events to annotated 
methods, for

example:

public class MyComponent extends Component {
@OnEvent
private void onUserAdded(UserAddedEvent event) {...}
}

where UserAddedEvent is the event payload object.

The default Component#onEvent method will be called even if custom 
dispatchers

are registered.

A default event is raised whenever Wicket begins to create an AJAX 
response.

The payload of the event is the AjaxRequestTarget used for event. Sample
implementation:

// component that always adds itself to the ajax response
public class MyComponent extends Component {
public void onEvent(IEvent event) {
if (event.getPayload() instanceof AjaxRequestTarget) {
((AjaxRequestTarget)event.getPayload()).add(this);
 }
}
}

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




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



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



Re: Apache Wicket releases Wicket 1.5

2011-09-07 Thread Frédéric Donckels
Congratulations!

The event system is really a bliss.

F.

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



Re: Wicket ResourceStreamLocator performance issue

2011-09-07 Thread armandoxxx
Another question. 

Is it normal that onAfterRender() methods gets called several times for each
component ?

Regards

Armando
 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3797892.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket ResourceStreamLocator performance issue

2011-09-07 Thread armandoxxx
Please give me time till weekend cause I'm really busy. I'll write it then ! 


Kind regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3797889.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Apache Wicket releases Wicket 1.5

2011-09-07 Thread Duy Do

Big news! You made my day. Thanks a lot for your great working.


On 9/8/11 5:17 AM, Martijn Dashorst wrote:

The Apache Wicket team is proud to announce the immediate availability of the
newest release of their component oriented open source Java web framework.
Apache Wicket 1.5 has been in development for the last two years and brings
many improvements over previous versions.

Downloading Apache Wicket 1.5
-

You can download the release here:
http://www.apache.org/dyn/closer.cgi/wicket/1.5.0

Or use this in your Maven POM to upgrade to the new version:


 org.apache.wicket
 wicket-core
 1.5.0


Please note that Wicket’s main artifact ID has been renamed to wicket-core.

You will need to upgrade all modules (i.e. wicket, wicket-extensions,
wicket-ioc, wicket-spring, etc) to 1.5.0. It is not possible to mix previous
versions of Wicket with modules of this release.

Most notable changes


With this release the Wicket team has revised many of its internals. A
short list:

  - HTML5 components added: EmailTextField, NumberTextField, UrlTextField and
RangeTextField

  - New inter-component events (explained below)

  - Minimum required servlet API is servlet-api 2.5

  - All standard validators now extend Behavior to allow for client side
validations

  - IBehavior has been removed and AbstractBehavior has been deprecated, you
should now extend Behavior instead

  - Simplified the request cycle processing and made it more extensible

  - URL handling is now in one place

  - Wicket’s rendering code has been greatly simplified

  - Improved browser caching support

  - ClientSideImageMap replaces old ImageMap

  - Better support for running behind proxies with x-forwarded-for header

  - Request cycle listeners make it easier to integrate frameworks in your
Wicket application

  - Consistent naming: methods with Javascript in the name have been renamed to
use proper capitalization: JavaScript

  - Switching to HTTPS is as simple as configuring a new root mapper to make
Wicket HTTPS aware and annotating a page with @RequireHttps

A longer list of changes and improvements can be found in our migration
guide.

Inter-component events
--

Wicket 1.5 offers a simple, yet flexible, way for component to communicate
with each other in a decoupled manner. The two major interfaces that
facilitate this are:

/**
 * Objects that can send events
 */
public interface IEventSource {
  void send(IEventSink sink, Broadcast broadcast, T payload);
}

and

/**
 * Objects that can receive events
 */
public interface IEventSink
{
/**
 * Called when an event is sent to this sink
 */
void onEvent(IEvent  event);
}

The classes that implement these interfaces, and can thus participate in the
event mechanism are: Component, RequestCycle, Session, and Application.

The mechanism allows for different event broadcast methods defined here:

/**
 * Defines the event broadcast type.
 */
public enum Broadcast {
BREADTH,
DEPTH,
BUBBLE,
EXACT;
}

There is an example in wicket-examples which demonstrates the usage of this.

Applications can register custom event dispatchers in FrameworkSettings; the
dispatchers can be used to build custom event delivery mechanisms. For example
a custom IEventDispatcher mechanism can route events to annotated methods, for
example:

public class MyComponent extends Component {
@OnEvent
private void onUserAdded(UserAddedEvent event) {...}
}

where UserAddedEvent is the event payload object.

The default Component#onEvent method will be called even if custom dispatchers
are registered.

A default event is raised whenever Wicket begins to create an AJAX response.
The payload of the event is the AjaxRequestTarget used for event. Sample
implementation:

// component that always adds itself to the ajax response
public class MyComponent extends Component {
public void onEvent(IEvent event) {
if (event.getPayload() instanceof AjaxRequestTarget) {
((AjaxRequestTarget)event.getPayload()).add(this);
 }
}
}

-
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: Apache Wicket releases Wicket 1.5

2011-09-07 Thread Jonathan Locke
Hooray!!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-releases-Wicket-1-5-tp3797412p3797722.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Apache Wicket releases Wicket 1.5

2011-09-07 Thread Carl-Eric Menzel
On Thu, 8 Sep 2011 00:17:25 +0200
Martijn Dashorst  wrote:

> The Apache Wicket team is proud to announce the immediate
> availability of the newest release of their component oriented open
> source Java web framework. Apache Wicket 1.5 has been in development
> for the last two years and brings many improvements over previous
> versions.

Congratulations! And thanks to the Wicket team for the good work.

Carl-Eric
www.wicketbuch.de

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



Apache Wicket releases Wicket 1.5

2011-09-07 Thread Martijn Dashorst
The Apache Wicket team is proud to announce the immediate availability of the
newest release of their component oriented open source Java web framework.
Apache Wicket 1.5 has been in development for the last two years and brings
many improvements over previous versions.

Downloading Apache Wicket 1.5
-

You can download the release here:
http://www.apache.org/dyn/closer.cgi/wicket/1.5.0

Or use this in your Maven POM to upgrade to the new version:


org.apache.wicket
wicket-core
1.5.0


Please note that Wicket’s main artifact ID has been renamed to wicket-core.

You will need to upgrade all modules (i.e. wicket, wicket-extensions,
wicket-ioc, wicket-spring, etc) to 1.5.0. It is not possible to mix previous
versions of Wicket with modules of this release.

Most notable changes


With this release the Wicket team has revised many of its internals. A
short list:

 - HTML5 components added: EmailTextField, NumberTextField, UrlTextField and
   RangeTextField

 - New inter-component events (explained below)

 - Minimum required servlet API is servlet-api 2.5

 - All standard validators now extend Behavior to allow for client side
   validations

 - IBehavior has been removed and AbstractBehavior has been deprecated, you
   should now extend Behavior instead

 - Simplified the request cycle processing and made it more extensible

 - URL handling is now in one place

 - Wicket’s rendering code has been greatly simplified

 - Improved browser caching support

 - ClientSideImageMap replaces old ImageMap

 - Better support for running behind proxies with x-forwarded-for header

 - Request cycle listeners make it easier to integrate frameworks in your
   Wicket application

 - Consistent naming: methods with Javascript in the name have been renamed to
   use proper capitalization: JavaScript

 - Switching to HTTPS is as simple as configuring a new root mapper to make
   Wicket HTTPS aware and annotating a page with @RequireHttps

A longer list of changes and improvements can be found in our migration
guide.

Inter-component events
--

Wicket 1.5 offers a simple, yet flexible, way for component to communicate
with each other in a decoupled manner. The two major interfaces that
facilitate this are:

/**
 * Objects that can send events
 */
public interface IEventSource {
 void send(IEventSink sink, Broadcast broadcast, T payload);
}

and

/**
 * Objects that can receive events
 */
public interface IEventSink
{
/**
 * Called when an event is sent to this sink
 */
void onEvent(IEvent event);
}

The classes that implement these interfaces, and can thus participate in the
event mechanism are: Component, RequestCycle, Session, and Application.

The mechanism allows for different event broadcast methods defined here:

/**
 * Defines the event broadcast type.
 */
public enum Broadcast {
BREADTH,
DEPTH,
BUBBLE,
EXACT;
}

There is an example in wicket-examples which demonstrates the usage of this.

Applications can register custom event dispatchers in FrameworkSettings; the
dispatchers can be used to build custom event delivery mechanisms. For example
a custom IEventDispatcher mechanism can route events to annotated methods, for
example:

public class MyComponent extends Component {
@OnEvent
private void onUserAdded(UserAddedEvent event) {...}
}

where UserAddedEvent is the event payload object.

The default Component#onEvent method will be called even if custom dispatchers
are registered.

A default event is raised whenever Wicket begins to create an AJAX response.
The payload of the event is the AjaxRequestTarget used for event. Sample
implementation:

// component that always adds itself to the ajax response
public class MyComponent extends Component {
public void onEvent(IEvent event) {
if (event.getPayload() instanceof AjaxRequestTarget) {
((AjaxRequestTarget)event.getPayload()).add(this);
 }
}
}

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



Re: Replacing the contents of a table with ajax

2011-09-07 Thread Gabriel Landon
Maybe you should try something like :

protected void onSubmit(AjaxRequestTarget target, Form form) {

TablePanel tp = new TablePanel(tablePanel.getId(),
getItemList(selectedFromDropDown));
tp.setOutputMarkupId(true);

   //replace the panel of you page
   getPage().replace(tp); //or getPage().replaceWith(tp);

target.add(tp);
} 

Regards,

Gabriel.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Replacing-the-contents-of-a-table-with-ajax-tp3796223p3797361.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket ResourceStreamLocator performance issue

2011-09-07 Thread Martin Grigorov
Next question: what did you change in your version to make it faster ?
Create a ticket with the patch ;-)

On Wed, Sep 7, 2011 at 11:19 PM, armandoxxx  wrote:
> Sorry man .. forgot to mention version we're using is 1.5 RC7
>
> Regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3797143.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



Re: Wicket ResourceStreamLocator performance issue

2011-09-07 Thread armandoxxx
Sorry man .. forgot to mention version we're using is 1.5 RC7 

Regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3797143.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
Using the session does not work, but using the RequestCycle works fine.

Below is how I solved the problem, and it seems to work quite well for
stateless pages.

Thank you for your help.

public class StatelessAjaxSelfUpdatingTimerBehavior extends
AjaxSelfUpdatingTimerBehavior {

private final static MetaDataKey requestIdsSequenceMetaDataKey
= new MetaDataKey() {
private static final long serialVersionUID = 1L;
};

static final String GENERATED_IDS_PREFIX = "SASUTB";

public StatelessAjaxSelfUpdatingTimerBehavior(Duration updateInterval)
{
super( updateInterval );
}

@Override
public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
component) {
return true;
}

private static int getRequestNextSequenceValue() {
Integer currentSequence =
RequestCycle.get().getMetaData( requestIdsSequenceMetaDataKey );
if( currentSequence == null )
currentSequence = 0;
else
currentSequence++;

RequestCycle.get().setMetaData( requestIdsSequenceMetaDataKey,
currentSequence );

return currentSequence;
}

@Override
protected void onBind() {
Object storedMarkupId = getComponent().getMarkupIdImpl();
if( storedMarkupId == null || storedMarkupId instanceof Integer 
){
String markupIdPrefix = "id";
if( 
!getComponent().getApplication().usesDeploymentConfig() ){
// in non-deployment mode we make the markup id 
include component id
// so it is easier to debug
markupIdPrefix = getComponent().getId();
}

String markupIdPostfix = GENERATED_IDS_PREFIX +
Integer.toHexString( getRequestNextSequenceValue() ).toLowerCase();

String markupId = markupIdPrefix + markupIdPostfix;

getComponent().setMarkupId( markupId );
}

super.onBind();
}
}

On Wed, 2011-09-07 at 21:42 +0300, Martin Grigorov wrote:

> Session#nextSequenceValue() is public and non-final.
> 
> You can override it in YourWebSession to do whatever fits for your
> needs.
> 
> 
> On Wed, Sep 7, 2011 at 9:35 PM, Sylvain Vieujot 
> wrote:
> 
> On Wed, 2011-09-07 at 10:19 -0700, Igor Vaynberg wrote: 
> 
> > On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot 
>  wrote:
> > > I looked at this code, but it does not really help as it has to 
> bind to an
> > > event, whilst I am trying to do an auto update component.
> > >
> > > I have 2 questions :
> > >
> > > 1) Why does the AbstractAjaxBehavior sets the getStatelessHint to 
> false ?
> > > It seems to me that this "non stateless" hint could be set much 
> lower in the
> > > classe hierarchy, but I must be missing something.
> > 
> > because the behavior itself is stateful. it needs to generate a
> > callback url to a component, which means it needs a page id - which
> > means the page has to exist already - which means it cannot be
> > stateless. it works much the same way as a Link component.
> 
> But if the page is stateless you should not need the page id,
> just the page class to create a new instance isn't it ? (that
> is if the page's components ids are stable - see 2 below)
> 
> 
> 
> 
> > > 2) The main problem I have is in the component's id generation.
> > > In Component.getMarkupId, line 1505, we have :
> > > final int generatedMarkupId = storedMarkupId instanceof 
> Integer ?
> > > (Integer)storedMarkupId
> > > : getSession().nextSequenceValue();
> > > So on every request, the id changes because of the
> > > getSession().nextSequenceValue().
> > > If in the Behaviour's onBind method, the component's id is fixed, 
> then I
> > > have no problem ... except this is not very clean programming!
> > 
> > if you fix the id yourself you have no way to guarantee it is 
> unique.
> > eg if this is a panel you can have two instances of the panel in the
> > page, etc. the id itself should not matter much as long as you 
> repaint
> > the component so its markup id changes to the new value.
> 
> I agree that fixing the id is not a great idea ;-)
> But if the id generation could be stable for stateless pages,
> it would be quite helpful.
> My behaviour needs to repaint a component on a stateless page
> (which in the concept is like a stateless version of the clock
> example
> http://www.wick

Re: Stateless page with an auto update section

2011-09-07 Thread Igor Vaynberg
On Wed, Sep 7, 2011 at 11:35 AM, Sylvain Vieujot  wrote:
>
> On Wed, 2011-09-07 at 10:19 -0700, Igor Vaynberg wrote:
>
> On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot  wrote:
> > I looked at this code, but it does not really help as it has to bind to an
> > event, whilst I am trying to do an auto update component.
> >
> > I have 2 questions :
> >
> > 1) Why does the AbstractAjaxBehavior sets the getStatelessHint to false ?
> > It seems to me that this "non stateless" hint could be set much lower in the
> > classe hierarchy, but I must be missing something.
>
> because the behavior itself is stateful. it needs to generate a
> callback url to a component, which means it needs a page id - which
> means the page has to exist already - which means it cannot be
> stateless. it works much the same way as a Link component.
>
> But if the page is stateless you should not need the page id, just the page 
> class to create a new instance isn't it ? (that is if the
> page's components ids are stable - see 2 below)


suppose in your behavior you do panel1.replacewith(panel2) and panel2
has another stateless behavior. when that behavior fires and recreates
the stateless page - this instance will not have panel2 so you will
get an error. all these kinds of weird situations may creep up and
they are hard to track. this is why our default behaviors are stateful
by default, because most of the time that is what you want.

there are some stateless behaviors out there, and a way for you to use
them - its just not the model we support by default.

-igor



>
> > 2) The main problem I have is in the component's id generation.
> > In Component.getMarkupId, line 1505, we have :
> >     final int generatedMarkupId = storedMarkupId instanceof Integer ?
> > (Integer)storedMarkupId
> > : getSession().nextSequenceValue();
> > So on every request, the id changes because of the
> > getSession().nextSequenceValue().
> > If in the Behaviour's onBind method, the component's id is fixed, then I
> > have no problem ... except this is not very clean programming!
>
> if you fix the id yourself you have no way to guarantee it is unique.
> eg if this is a panel you can have two instances of the panel in the
> page, etc. the id itself should not matter much as long as you repaint
> the component so its markup id changes to the new value.
>
> I agree that fixing the id is not a great idea
> But if the id generation could be stable for stateless pages, it would be 
> quite helpful.
> My behaviour needs to repaint a component on a stateless page (which in the 
> concept is like a stateless version of the clock example 
> http://www.wicket-library.com/wicket-examples/ajax/clock ).
>
> In the Component id generation, couldn't we replace 
> getSession().nextSequenceValue() by a new 
> RequestCycle.get().nextSequenceValue() ( like the Page.getAutoIndex(), but we 
> can not use the Page.getAutoIndex here as the page is not yet accessible) ?
> The ids would then be fixed for 2 instances of the same stateless page ?
> The ids would be much more stable and we could then have stable callback 
> urls, i.e. stateless behaviours.
>
> Would this work ?
>
> -igor
>
>
> >
> > public class StatelessAjaxTimerBehavior extends
> > AjaxSelfUpdatingTimerBehavior {
> >
> > public StatelessAjaxTimerBehavior(Duration updateInterval) {
> > super( updateInterval );
> > }
> >
> > @Override
> > public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> > component) {
> > return true;
> > }
> >
> > @Override
> > protected void onBind() {
> > getComponent().setMarkupId( "myForcedID" ); // FIXME: This works, but is not
> > very clean ... to say the least
> > super.onBind();
> > }
> > }
> >
> > Is there a recommended way to fix this ?
> >
> > Thank you,
> >
> > Sylvain.
> >
> > On Wed, 2011-09-07 at 08:34 -0700, Igor Vaynberg wrote:
> >
> > use something like this [1] as a base and build your own timer behavior
> >
> > [1]
> > https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java
> >
> > -igor
> >
> >
> > On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot  wrote:
> >> Hello,
> >>
> >> I have a stateless page, and I would like to periodically refresh a
> >> section
> >> of this page.
> >> If I do :
> >>
> >> add( new MyPanel( "header" )
> >>     .setOutputMarkupId( true )
> >>     .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
> >>   );
> >>
> >> The page becomes stateless.
> >>
> >> If in MyPanel, I have :
> >> class MyPanel{
> >>  ...
> >>  @Override
> >>  public boolean getStatelessHint(@SuppressWarnings( "unused" )
> >> Component
> >> component) {
> >>   return true;
> >>  }
> >>  ...
> >> }
> >>
> >> The update does not work as the expected component's HTML id does not
> >> remain
> >> constant :
> >>
> >> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> >> [[header2]] was not found while trying to perf

Re: Stateless page with an auto update section

2011-09-07 Thread Martin Grigorov
Session#nextSequenceValue() is public and non-final.
You can override it in YourWebSession to do whatever fits for your needs.

On Wed, Sep 7, 2011 at 9:35 PM, Sylvain Vieujot  wrote:

> **
> On Wed, 2011-09-07 at 10:19 -0700, Igor Vaynberg wrote:
>
> On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot  wrote:
> > I looked at this code, but it does not really help as it has to bind to an
> > event, whilst I am trying to do an auto update component.
> >
> > I have 2 questions :
> >
> > 1) Why does the AbstractAjaxBehavior sets the getStatelessHint to false ?
> > It seems to me that this "non stateless" hint could be set much lower in the
> > classe hierarchy, but I must be missing something.
>
> because the behavior itself is stateful. it needs to generate a
> callback url to a component, which means it needs a page id - which
> means the page has to exist already - which means it cannot be
> stateless. it works much the same way as a Link component.
>
>  But if the page is stateless you should not need the page id, just the
> page class to create a new instance isn't it ? (that is if the page's
> components ids are stable - see 2 below)
>
>
>  > 2) The main problem I have is in the component's id generation.
> > In Component.getMarkupId, line 1505, we have :
> > final int generatedMarkupId = storedMarkupId instanceof Integer ?
> > (Integer)storedMarkupId
> > : getSession().nextSequenceValue();
> > So on every request, the id changes because of the
> > getSession().nextSequenceValue().
> > If in the Behaviour's onBind method, the component's id is fixed, then I
> > have no problem ... except this is not very clean programming!
>
> if you fix the id yourself you have no way to guarantee it is unique.
> eg if this is a panel you can have two instances of the panel in the
> page, etc. the id itself should not matter much as long as you repaint
> the component so its markup id changes to the new value.
>
>  I agree that fixing the id is not a great idea [image: ;-)]
> But if the id generation could be stable for stateless pages, it would be
> quite helpful.
> My behaviour needs to repaint a component on a stateless page (which in the
> concept is like a stateless version of the clock example
> http://www.wicket-library.com/wicket-examples/ajax/clock ).
>
> In the Component id generation, couldn't we replace
> getSession().nextSequenceValue() by a new
> RequestCycle.get().nextSequenceValue() ( like the Page.getAutoIndex(), but
> we can not use the Page.getAutoIndex here as the page is not yet accessible)
> ?
> The ids would then be fixed for 2 instances of the same stateless page ?
> The ids would be much more stable and we could then have stable callback
> urls, i.e. stateless behaviours.
>
> Would this work ?
>
> -igor
>
>
> >
> > public class StatelessAjaxTimerBehavior extends
> > AjaxSelfUpdatingTimerBehavior {
> >
> > public StatelessAjaxTimerBehavior(Duration updateInterval) {
> > super( updateInterval );
> > }
> >
> > @Override
> > public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> > component) {
> > return true;
> > }
> >
> > @Override
> > protected void onBind() {
> > getComponent().setMarkupId( "myForcedID" ); // FIXME: This works, but is not
> > very clean ... to say the least
> > super.onBind();
> > }
> > }
> >
> > Is there a recommended way to fix this ?
> >
> > Thank you,
> >
> > Sylvain.
> >
> > On Wed, 2011-09-07 at 08:34 -0700, Igor Vaynberg wrote:
> >
> > use something like this [1] as a base and build your own timer behavior
> >
> > [1]
> > https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java
> >
> > -igor
> >
> >
> > On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot  wrote:
> >> Hello,
> >>
> >> I have a stateless page, and I would like to periodically refresh a
> >> section
> >> of this page.
> >> If I do :
> >>
> >> add( new MyPanel( "header" )
> >> .setOutputMarkupId( true )
> >> .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
> >>   );
> >>
> >> The page becomes stateless.
> >>
> >> If in MyPanel, I have :
> >> class MyPanel{
> >>  ...
> >>  @Override
> >>  public boolean getStatelessHint(@SuppressWarnings( "unused" )
> >> Component
> >> component) {
> >>   return true;
> >>  }
> >>  ...
> >> }
> >>
> >> The update does not work as the expected component's HTML id does not
> >> remain
> >> constant :
> >>
> >> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> >> [[header2]] was not found while trying to perform markup update. Make sure
> >> you called component.setOutputMarkupId(
> > true) on the component whose markup
> >> you are trying to update. console.error('Wicket.Ajax: ' + msg);
> >> I also tried to use .setVersioned( false ) on both the component and the
> >> page, but without success.
> >> Is there a way to do this ?
> >>
> >> Thank you,
> >>
> >> Sylvain.
> >
> > ---

Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
On Wed, 2011-09-07 at 10:19 -0700, Igor Vaynberg wrote:

> On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot  wrote:
> > I looked at this code, but it does not really help as it has to bind to an
> > event, whilst I am trying to do an auto update component.
> >
> > I have 2 questions :
> >
> > 1) Why does the AbstractAjaxBehavior sets the getStatelessHint to false ?
> > It seems to me that this "non stateless" hint could be set much lower in the
> > classe hierarchy, but I must be missing something.
> 
> because the behavior itself is stateful. it needs to generate a
> callback url to a component, which means it needs a page id - which
> means the page has to exist already - which means it cannot be
> stateless. it works much the same way as a Link component.



But if the page is stateless you should not need the page id, just the
page class to create a new instance isn't it ? (that is if the page's
components ids are stable - see 2 below)


> > 2) The main problem I have is in the component's id generation.
> > In Component.getMarkupId, line 1505, we have :
> > final int generatedMarkupId = storedMarkupId instanceof Integer ?
> > (Integer)storedMarkupId
> > : getSession().nextSequenceValue();
> > So on every request, the id changes because of the
> > getSession().nextSequenceValue().
> > If in the Behaviour's onBind method, the component's id is fixed, then I
> > have no problem ... except this is not very clean programming!
> 
> if you fix the id yourself you have no way to guarantee it is unique.
> eg if this is a panel you can have two instances of the panel in the
> page, etc. the id itself should not matter much as long as you repaint
> the component so its markup id changes to the new value.

I agree that fixing the id is not a great idea ;-)
But if the id generation could be stable for stateless pages, it would
be quite helpful.
My behaviour needs to repaint a component on a stateless page (which in
the concept is like a stateless version of the clock example
http://www.wicket-library.com/wicket-examples/ajax/clock ).

In the Component id generation, couldn't we replace
getSession().nextSequenceValue() by a new
RequestCycle.get().nextSequenceValue() ( like the Page.getAutoIndex(),
but we can not use the Page.getAutoIndex here as the page is not yet
accessible) ?
The ids would then be fixed for 2 instances of the same stateless page ?
The ids would be much more stable and we could then have stable callback
urls, i.e. stateless behaviours.

Would this work ?

> 
> -igor
> 
> 
> >
> > public class StatelessAjaxTimerBehavior extends
> > AjaxSelfUpdatingTimerBehavior {
> >
> > public StatelessAjaxTimerBehavior(Duration updateInterval) {
> > super( updateInterval );
> > }
> >
> > @Override
> > public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> > component) {
> > return true;
> > }
> >
> > @Override
> > protected void onBind() {
> > getComponent().setMarkupId( "myForcedID" ); // FIXME: This works, but is not
> > very clean ... to say the least
> > super.onBind();
> > }
> > }
> >
> > Is there a recommended way to fix this ?
> >
> > Thank you,
> >
> > Sylvain.
> >
> > On Wed, 2011-09-07 at 08:34 -0700, Igor Vaynberg wrote:
> >
> > use something like this [1] as a base and build your own timer behavior
> >
> > [1]
> > https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java
> >
> > -igor
> >
> >
> > On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot  wrote:
> >> Hello,
> >>
> >> I have a stateless page, and I would like to periodically refresh a
> >> section
> >> of this page.
> >> If I do :
> >>
> >> add( new MyPanel( "header" )
> >> .setOutputMarkupId( true )
> >> .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
> >>   );
> >>
> >> The page becomes stateless.
> >>
> >> If in MyPanel, I have :
> >> class MyPanel{
> >>  ...
> >>  @Override
> >>  public boolean getStatelessHint(@SuppressWarnings( "unused" )
> >> Component
> >> component) {
> >>   return true;
> >>  }
> >>  ...
> >> }
> >>
> >> The update does not work as the expected component's HTML id does not
> >> remain
> >> constant :
> >>
> >> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> >> [[header2]] was not found while trying to perform markup update. Make sure
> >> you called component.setOutputMarkupId(
> > true) on the component whose markup
> >> you are trying to update. console.error('Wicket.Ajax: ' + msg);
> >> I also tried to use .setVersioned( false ) on both the component and the
> >> page, but without success.
> >> Is there a way to do this ?
> >>
> >> Thank you,
> >>
> >> Sylvain.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> 
> -

Re: Wicket ResourceStreamLocator performance issue

2011-09-07 Thread Martin Grigorov
For which version of Wicket we are talking about ?
In 1.5 there is CachingResourceStreamLocator which is setup by default.

On Wed, Sep 7, 2011 at 9:01 PM, armandoxxx  wrote:
> Hi
>
> We found serious performance issue costing aprox. 1 sec per request in
> ResourceStreamLocator.
>
> these are the resources searched by locate() method
>
>
> We wrote custom ResourceStreamLocator to temporarly resolve this issue.
>
>
> Attaching  http://www.dropchop.org/log/log.txt log file  to see the
> behavior.
>
> Any feedback appreciated
>
> Regards
>
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3796815.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



Wicket ResourceStreamLocator performance issue

2011-09-07 Thread armandoxxx
Hi 

We found serious performance issue costing aprox. 1 sec per request in
ResourceStreamLocator. 

these are the resources searched by locate() method


We wrote custom ResourceStreamLocator to temporarly resolve this issue.  


Attaching  http://www.dropchop.org/log/log.txt log file  to see the
behavior.

Any feedback appreciated 

Regards

Armando

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ResourceStreamLocator-performance-issue-tp3796815p3796815.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Stateless page with an auto update section

2011-09-07 Thread Igor Vaynberg
On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot  wrote:
> I looked at this code, but it does not really help as it has to bind to an
> event, whilst I am trying to do an auto update component.
>
> I have 2 questions :
>
> 1) Why does the AbstractAjaxBehavior sets the getStatelessHint to false ?
> It seems to me that this "non stateless" hint could be set much lower in the
> classe hierarchy, but I must be missing something.

because the behavior itself is stateful. it needs to generate a
callback url to a component, which means it needs a page id - which
means the page has to exist already - which means it cannot be
stateless. it works much the same way as a Link component.

> 2) The main problem I have is in the component's id generation.
> In Component.getMarkupId, line 1505, we have :
>     final int generatedMarkupId = storedMarkupId instanceof Integer ?
> (Integer)storedMarkupId
> : getSession().nextSequenceValue();
> So on every request, the id changes because of the
> getSession().nextSequenceValue().
> If in the Behaviour's onBind method, the component's id is fixed, then I
> have no problem ... except this is not very clean programming!

if you fix the id yourself you have no way to guarantee it is unique.
eg if this is a panel you can have two instances of the panel in the
page, etc. the id itself should not matter much as long as you repaint
the component so its markup id changes to the new value.

-igor


>
> public class StatelessAjaxTimerBehavior extends
> AjaxSelfUpdatingTimerBehavior {
>
> public StatelessAjaxTimerBehavior(Duration updateInterval) {
> super( updateInterval );
> }
>
> @Override
> public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> component) {
> return true;
> }
>
> @Override
> protected void onBind() {
> getComponent().setMarkupId( "myForcedID" ); // FIXME: This works, but is not
> very clean ... to say the least
> super.onBind();
> }
> }
>
> Is there a recommended way to fix this ?
>
> Thank you,
>
> Sylvain.
>
> On Wed, 2011-09-07 at 08:34 -0700, Igor Vaynberg wrote:
>
> use something like this [1] as a base and build your own timer behavior
>
> [1]
> https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java
>
> -igor
>
>
> On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot  wrote:
>> Hello,
>>
>> I have a stateless page, and I would like to periodically refresh a
>> section
>> of this page.
>> If I do :
>>
>> add( new MyPanel( "header" )
>>     .setOutputMarkupId( true )
>>     .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
>>   );
>>
>> The page becomes stateless.
>>
>> If in MyPanel, I have :
>> class MyPanel{
>>  ...
>>  @Override
>>  public boolean getStatelessHint(@SuppressWarnings( "unused" )
>> Component
>> component) {
>>   return true;
>>  }
>>  ...
>> }
>>
>> The update does not work as the expected component's HTML id does not
>> remain
>> constant :
>>
>> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
>> [[header2]] was not found while trying to perform markup update. Make sure
>> you called component.setOutputMarkupId(
> true) on the component whose markup
>> you are trying to update. console.error('Wicket.Ajax: ' + msg);
>> I also tried to use .setVersioned( false ) on both the component and the
>> page, but without success.
>> Is there a way to do this ?
>>
>> Thank you,
>>
>> Sylvain.
>
> -
> 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: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
I looked at this code, but it does not really help as it has to bind to
an event, whilst I am trying to do an auto update component.

I have 2 questions :

1) Why does the AbstractAjaxBehavior sets the getStatelessHint to
false ?
It seems to me that this "non stateless" hint could be set much lower in
the classe hierarchy, but I must be missing something.

2) The main problem I have is in the component's id generation.
In Component.getMarkupId, line 1505, we have :
final int generatedMarkupId = storedMarkupId instanceof Integer ?
(Integer)storedMarkupId
: getSession().nextSequenceValue();
So on every request, the id changes because of the
getSession().nextSequenceValue().
If in the Behaviour's onBind method, the component's id is fixed, then I
have no problem ... except this is not very clean programming!

public class StatelessAjaxTimerBehavior extends
AjaxSelfUpdatingTimerBehavior {

public StatelessAjaxTimerBehavior(Duration updateInterval) {
super( updateInterval );
}

@Override
public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
component) {
return true;
}

@Override
protected void onBind() {
getComponent().setMarkupId( "myForcedID" ); // FIXME: This 
works, but
is not very clean ... to say the least
super.onBind();
}
}

Is there a recommended way to fix this ?

Thank you,

Sylvain.

On Wed, 2011-09-07 at 08:34 -0700, Igor Vaynberg wrote:

> use something like this [1] as a base and build your own timer behavior
> 
> [1] 
> https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java
> 
> -igor
> 
> 
> On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot  wrote:
> > Hello,
> >
> > I have a stateless page, and I would like to periodically refresh a section
> > of this page.
> > If I do :
> >
> > add( new MyPanel( "header" )
> > .setOutputMarkupId( true )
> > .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
> >   );
> >
> > The page becomes stateless.
> >
> > If in MyPanel, I have :
> > class MyPanel{
> >  ...
> >  @Override
> >  public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> > component) {
> >   return true;
> >  }
> >  ...
> > }
> >
> > The update does not work as the expected component's HTML id does not remain
> > constant :
> >
> > Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> > [[header2]] was not found while trying to perform markup update. Make sure
> > you called component.setOutputMarkupId(true) on the component whose markup
> > you are trying to update. console.error('Wicket.Ajax: ' + msg);
> > I also tried to use .setVersioned( false ) on both the component and the
> > page, but without success.
> > Is there a way to do this ?
> >
> > Thank you,
> >
> > Sylvain.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 


signature.asc
Description: This is a digitally signed message part


Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
I will look at this.

Thank you.

On Wed, 2011-09-07 at 08:34 -0700, Igor Vaynberg wrote:

> use something like this [1] as a base and build your own timer behavior
> 
> [1] 
> https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java
> 
> -igor
> 
> 
> On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot  wrote:
> > Hello,
> >
> > I have a stateless page, and I would like to periodically refresh a section
> > of this page.
> > If I do :
> >
> > add( new MyPanel( "header" )
> > .setOutputMarkupId( true )
> > .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
> >   );
> >
> > The page becomes stateless.
> >
> > If in MyPanel, I have :
> > class MyPanel{
> >  ...
> >  @Override
> >  public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> > component) {
> >   return true;
> >  }
> >  ...
> > }
> >
> > The update does not work as the expected component's HTML id does not remain
> > constant :
> >
> > Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> > [[header2]] was not found while trying to perform markup update. Make sure
> > you called component.setOutputMarkupId(true) on the component whose markup
> > you are trying to update. console.error('Wicket.Ajax: ' + msg);
> > I also tried to use .setVersioned( false ) on both the component and the
> > page, but without success.
> > Is there a way to do this ?
> >
> > Thank you,
> >
> > Sylvain.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 


signature.asc
Description: This is a digitally signed message part


RE: Replacing the contents of a table with ajax

2011-09-07 Thread Werner Riegel

Thanks for your reply.
I've already done that, as described in my first mail, but it still doesn't 
work.

> Date: Wed, 7 Sep 2011 16:37:39 +0200
> From: robert.dahlst...@ongame.com
> To: users@wicket.apache.org
> Subject: Re: Replacing the contents of a table with ajax
> 
> Usually, put a container around the table and update the container 
> through ajax and not the table directly.
> 
> /Robert
> 
> On 09/07/2011 04:22 PM, Werner Riegel wrote:
> >
> > Hello,
> >
> > im trying to update the contents of a table, but it doesn't really work. I 
> > hope you guys can help me with that.
> >
> > My page looks like the following:
> > It has a Form, consisting of a drop down list + an ajaxbutton, and below 
> > the form is a table.
> > After choosing an element from the list and pressing the ajaxbutton,
> > a serverside function will be executed that returns a list of 
> > items/objects. These items should then be displayed in the table.
> > That means, that all existing content in the table should be replaced by 
> > the new items (one item per row)
> > Actually all i want is to switch the old table contents with the new ones.
> >
> > Since i couldnt replace the table itself, i put it in a Panel, which i am 
> > now replacing when the button is pressed.
> >
> >
> >
> > The panel looks like this:
> >
> > TablePanel.java: 
> > -
> > public TablePanel(String id, List  objectList) {
> >  super(id);
> >
> >  DataView  dataView = new DataView("objects", new 
> > ListDataProvider(objectList)) {
> >
> >  @Override
> >  protected void populateItem(Item  item) {
> >  MyObject obj = item.getModelObject();
> >  // populate
> >  }
> >  };
> >
> >  dataView.setOutputMarkupId(true);
> >  add(dataView);
> > }
> > //TablePanel.java: 
> > ---
> >
> >
> >
> > The corresponding html file:
> >
> > TablePanel.html: 
> > -
> > 
> > 
> >
> >
> >  // header-content
> >
> >
> >
> >
> >
> >
> >  
> >  [id]  
> > // etc
> >  
> >
> > 
> > 
> > //TablePanel.html: 
> > ---
> >
> >
> >
> > In the onSubmit function i build a new TablePanel object with the id from 
> > the old tablePanel and with the new list of items that i want to display, 
> > then add it to the target.
> > It looks like this:
> >
> > AjaxButton: 
> > --
> > @Override
> > protected void onSubmit(AjaxRequestTarget target, Form  form) {
> >
> >  TablePanel tp = new TablePanel(tablePanel.getId(), 
> > getItemList(selectedFromDropDown));
> >  tp.setOutputMarkupId(true);
> >  target.add(tp);
> > }
> > //AjaxButton: 
> > 
> >
> >
> >
> > The page.html in which the TablePanel is inserted contains this markup:
> >
> > ItemPage.html: 
> > ---
> > 
> >
> > 
> >
> >  [some option]
> >
> >
> > 
> >
> > [table content]
> >
> > 
> > //ItemPage.html: 
> > -
> >
> >
> >
> > After i press the button, the list of items gets generated and the new 
> > tablePanel is added to the target, but in the webbrowser i dont see any 
> > change.
> > The populateItem method in the TablePanel's DataView does not get executed 
> > either.
> >
> > If i hardcode it, so that the TablePanel just uses a the getItems method - 
> > ignoring the ajaxbutton + dropbown - the items get displayed in the table 
> > just fine.
> > So that part seems to work OK, i guess it's just something with the ajax.
> > But i really don't know what i'm missing.
> >
> >
> > Regards,
> > Werner  
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
  

Re: Stateless page with an auto update section

2011-09-07 Thread Igor Vaynberg
use something like this [1] as a base and build your own timer behavior

[1] 
https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java

-igor


On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot  wrote:
> Hello,
>
> I have a stateless page, and I would like to periodically refresh a section
> of this page.
> If I do :
>
> add( new MyPanel( "header" )
>     .setOutputMarkupId( true )
>     .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
>   );
>
> The page becomes stateless.
>
> If in MyPanel, I have :
> class MyPanel{
>  ...
>  @Override
>  public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> component) {
>   return true;
>  }
>  ...
> }
>
> The update does not work as the expected component's HTML id does not remain
> constant :
>
> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> [[header2]] was not found while trying to perform markup update. Make sure
> you called component.setOutputMarkupId(true) on the component whose markup
> you are trying to update. console.error('Wicket.Ajax: ' + msg);
> I also tried to use .setVersioned( false ) on both the component and the
> page, but without success.
> Is there a way to do this ?
>
> Thank you,
>
> Sylvain.

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



Re: Stateless page with an auto update section

2011-09-07 Thread Martin Grigorov
See jolira-tools Wicket Ajax stateless components and behaviors.
You'll have to roll your own timer behavior.

On Wed, Sep 7, 2011 at 6:20 PM, Sylvain Vieujot  wrote:
> The component is indeed stateless, but adding the
> AjaxSelfUpdatingTimerBehavior prevents it to staying stateless and generates
> an exception like :
>
> Last cause: '[Header [Component id = header]]' claims to be stateless but
> isn't. Possible reasons: no stateless hint, statefull behaviors
>
> WicketMessage: Error attaching this container for rendering: [Page class =
> com.windsOfDubai.web.HomePage, id = 2, render count = 1]
>
> I am trying to add the self updating behaviour whilst keeping the page
> stateless.
>
>
> On Wed, 2011-09-07 at 15:09 +0300, Martin Grigorov wrote:
>
> Hi,
>
> A Component (inc. Page) is stateless by nature.
>
> On Wed, Sep 7, 2011 at 11:51 AM, Sylvain Vieujot
>  wrote:
>> Hello,
>>
>> I have a stateless page, and I would like to periodically refresh a
>> section
>> of this page.
>> If I do :
>>
>> add( new MyPanel( "header" )
>>     .setOutputMarkupId( true )
>>     .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
>>   );
>>
>> The page becomes stateless.
> Adding Ajax**Behavior to it makes it stateful because this behavior
> needs to do the callback (onTimer() in your case)
>>
>> If in MyPanel, I have :
>> class MyPanel{
>>  ...
>>  @Override
>>  public boolean getStatelessHint(@SuppressWarnings( "unused" )
>> Component
>> component) {
>>   return true;
>>  }
> This makes no difference, since this is the default.
> See org.apache.wicket.Component.getStatelessHint()
>
> But the actual method that decides whether a component is stateless
> is: org.apache.wicket.Component.isStateless()
>>  ...
>> }
>>
>> The update does not work as the expected component's HTML id does not
>> remain
>> constant :
>>
>> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
>> [[header2]] was not found while trying to perform markup update. Make sure
>> you called component.setOutputMarkupId(true) on the component whose markup
>> you are trying to update. console.error('Wicket.Ajax: ' + msg);
>> I also tried to use .setVersioned( false ) on both the component and the
>> page, but without success.
>> Is there a way to do this ?
>>
>> Thank you,
>>
>> Sylvain.
>
>
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
The component is indeed stateless, but adding the
AjaxSelfUpdatingTimerBehavior prevents it to staying stateless and
generates an exception like :

Last cause: '[Header [Component id = header]]' claims to be stateless
but isn't. Possible reasons: no stateless hint, statefull behaviors

WicketMessage: Error attaching this container for rendering: [Page class = 
com.windsOfDubai.web.HomePage, id = 2, render count = 1]


I am trying to add the self updating behaviour whilst keeping the page
stateless.


On Wed, 2011-09-07 at 15:09 +0300, Martin Grigorov wrote:

> Hi,
> 
> A Component (inc. Page) is stateless by nature.
> 
> On Wed, Sep 7, 2011 at 11:51 AM, Sylvain Vieujot
>  wrote:
> > Hello,
> >
> > I have a stateless page, and I would like to periodically refresh a section
> > of this page.
> > If I do :
> >
> > add( new MyPanel( "header" )
> > .setOutputMarkupId( true )
> > .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
> >   );
> >
> > The page becomes stateless.
> Adding Ajax**Behavior to it makes it stateful because this behavior
> needs to do the callback (onTimer() in your case)
> >
> > If in MyPanel, I have :
> > class MyPanel{
> >  ...
> >  @Override
> >  public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> > component) {
> >   return true;
> >  }
> This makes no difference, since this is the default.
> See org.apache.wicket.Component.getStatelessHint()
> 
> But the actual method that decides whether a component is stateless
> is: org.apache.wicket.Component.isStateless()
> >  ...
> > }
> >
> > The update does not work as the expected component's HTML id does not remain
> > constant :
> >
> > Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> > [[header2]] was not found while trying to perform markup update. Make sure
> > you called component.setOutputMarkupId(true) on the component whose markup
> > you are trying to update. console.error('Wicket.Ajax: ' + msg);
> > I also tried to use .setVersioned( false ) on both the component and the
> > page, but without success.
> > Is there a way to do this ?
> >
> > Thank you,
> >
> > Sylvain.
> 
> 
> 


signature.asc
Description: This is a digitally signed message part


Re: Replacing the contents of a table with ajax

2011-09-07 Thread Robert Dahlström
Usually, put a container around the table and update the container 
through ajax and not the table directly.


/Robert

On 09/07/2011 04:22 PM, Werner Riegel wrote:


Hello,

im trying to update the contents of a table, but it doesn't really work. I hope 
you guys can help me with that.

My page looks like the following:
It has a Form, consisting of a drop down list + an ajaxbutton, and below the 
form is a table.
After choosing an element from the list and pressing the ajaxbutton,
a serverside function will be executed that returns a list of items/objects. 
These items should then be displayed in the table.
That means, that all existing content in the table should be replaced by the 
new items (one item per row)
Actually all i want is to switch the old table contents with the new ones.

Since i couldnt replace the table itself, i put it in a Panel, which i am now 
replacing when the button is pressed.



The panel looks like this:

TablePanel.java: 
-
public TablePanel(String id, List  objectList) {
 super(id);

 DataView  dataView = new DataView("objects", new 
ListDataProvider(objectList)) {

 @Override
 protected void populateItem(Item  item) {
 MyObject obj = item.getModelObject();
 // populate
 }
 };

 dataView.setOutputMarkupId(true);
 add(dataView);
}
//TablePanel.java: 
---



The corresponding html file:

TablePanel.html: 
-



   
 // header-content
   

   
   

   
 
 [id]  
// etc
 
   


//TablePanel.html: 
---



In the onSubmit function i build a new TablePanel object with the id from the 
old tablePanel and with the new list of items that i want to display, then add 
it to the target.
It looks like this:

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

 TablePanel tp = new TablePanel(tablePanel.getId(), 
getItemList(selectedFromDropDown));
 tp.setOutputMarkupId(true);
 target.add(tp);
}
//AjaxButton: 




The page.html in which the TablePanel is inserted contains this markup:

ItemPage.html: 
---



   
 [some option]
   
   


[table content]


//ItemPage.html: 
-



After i press the button, the list of items gets generated and the new 
tablePanel is added to the target, but in the webbrowser i dont see any change.
The populateItem method in the TablePanel's DataView does not get executed 
either.

If i hardcode it, so that the TablePanel just uses a the getItems method - 
ignoring the ajaxbutton + dropbown - the items get displayed in the table just 
fine.
So that part seems to work OK, i guess it's just something with the ajax.
But i really don't know what i'm missing.


Regards,
Werner  


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



Replacing the contents of a table with ajax

2011-09-07 Thread Werner Riegel

Hello,

im trying to update the contents of a table, but it doesn't really work. I hope 
you guys can help me with that.

My page looks like the following:
It has a Form, consisting of a drop down list + an ajaxbutton, and below the 
form is a table.
After choosing an element from the list and pressing the ajaxbutton, 
a serverside function will be executed that returns a list of items/objects. 
These items should then be displayed in the table.
That means, that all existing content in the table should be replaced by the 
new items (one item per row)
Actually all i want is to switch the old table contents with the new ones.

Since i couldnt replace the table itself, i put it in a Panel, which i am now 
replacing when the button is pressed.



The panel looks like this:

TablePanel.java: 
-
public TablePanel(String id, List objectList) {
super(id);

DataView dataView = new DataView("objects", new 
ListDataProvider(objectList)) {

@Override
protected void populateItem(Item item) {
MyObject obj = item.getModelObject();
// populate
}
};

dataView.setOutputMarkupId(true);
add(dataView);
}
//TablePanel.java: 
---



The corresponding html file:

TablePanel.html: 
-


  
  
// header-content
  

  
  

  

[id] 
   // etc




//TablePanel.html: 
---



In the onSubmit function i build a new TablePanel object with the id from the 
old tablePanel and with the new list of items that i want to display, then add 
it to the target.
It looks like this:

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

TablePanel tp = new TablePanel(tablePanel.getId(), 
getItemList(selectedFromDropDown));
tp.setOutputMarkupId(true);
target.add(tp);
}
//AjaxButton: 




The page.html in which the TablePanel is inserted contains this markup:

ItemPage.html: 
---



  
[some option]
  
  


[table content]


//ItemPage.html: 
-



After i press the button, the list of items gets generated and the new 
tablePanel is added to the target, but in the webbrowser i dont see any change.
The populateItem method in the TablePanel's DataView does not get executed 
either.

If i hardcode it, so that the TablePanel just uses a the getItems method - 
ignoring the ajaxbutton + dropbown - the items get displayed in the table just 
fine.
So that part seems to work OK, i guess it's just something with the ajax.
But i really don't know what i'm missing.


Regards,
Werner

Re: Stateless page with an auto update section

2011-09-07 Thread Martin Grigorov
Hi,

A Component (inc. Page) is stateless by nature.

On Wed, Sep 7, 2011 at 11:51 AM, Sylvain Vieujot
 wrote:
> Hello,
>
> I have a stateless page, and I would like to periodically refresh a section
> of this page.
> If I do :
>
> add( new MyPanel( "header" )
>     .setOutputMarkupId( true )
>     .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
>   );
>
> The page becomes stateless.
Adding Ajax**Behavior to it makes it stateful because this behavior
needs to do the callback (onTimer() in your case)
>
> If in MyPanel, I have :
> class MyPanel{
>  ...
>  @Override
>  public boolean getStatelessHint(@SuppressWarnings( "unused" ) Component
> component) {
>   return true;
>  }
This makes no difference, since this is the default.
See org.apache.wicket.Component.getStatelessHint()

But the actual method that decides whether a component is stateless
is: org.apache.wicket.Component.isStateless()
>  ...
> }
>
> The update does not work as the expected component's HTML id does not remain
> constant :
>
> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
> [[header2]] was not found while trying to perform markup update. Make sure
> you called component.setOutputMarkupId(true) on the component whose markup
> you are trying to update. console.error('Wicket.Ajax: ' + msg);
> I also tried to use .setVersioned( false ) on both the component and the
> page, but without success.
> Is there a way to do this ?
>
> Thank you,
>
> Sylvain.



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Statful image

2011-09-07 Thread vineet semwal
same as what joechen said but in a little different way
if  the Image resource reference is null the resource is just not
added to the current available application sharedresources,
it is treated in stateful way ,the url generated for such a image  is
not bookmarkable ..

its mentioned in the javdoc of image constructors that use resourcereference

/*Constructs an image from an image resourcereference. That resource
reference will bind its
  resource to the current SharedResources.
*/



On Wed, Sep 7, 2011 at 4:19 PM, Jochen Mader  wrote:
> Uh, sorry :)
> It all comes doen to the handling of shared and-nonshared resources.
> If a resource is non-shared (read: not registered with
> sharedresources). If the Image resource is null it can't assume that
> it's shared, therefore handling is at a non-shared/stateful resource.
>
> On Wed, Sep 7, 2011 at 11:42 AM, Martin Grigorov  wrote:
>> Would you share your knowledge with us ? :-)
>>
>> On Wed, Sep 7, 2011 at 12:33 PM, Jochen Mader  
>> wrote:
>>> Found it shortly after my mail (as always). Never mind.
>>> Am 07.09.2011 09:31 schrieb "Jochen Mader" :
 We just stumbled upon the following code in the Wicket(1.4.17) Image
 class getStatelessHint method:
 return (getImageResource() == null || getImageResource() ==
 localizedImageResource.getResource()) &&
 localizedImageResource.isStateless)

 My question is:
 Why does an image become stateful because of a missing reference?

 Thx
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
thank you,

regards,
Vineet Semwal

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



Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
Hello,

I have a stateless page, and I would like to periodically refresh a
section of this page.
If I do :

add( new MyPanel( "header" )
.setOutputMarkupId( true )
.add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
  );

The page becomes stateless.

If in MyPanel, I have :
class MyPanel{
 ...
 @Override
 public boolean getStatelessHint(@SuppressWarnings( "unused" )
Component component) {
  return true;
 }
 ...
}

The update does not work as the expected component's HTML id does not
remain constant :

Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
[[header2]] was not found while trying to perform markup update. Make
sure you called component.setOutputMarkupId(true) on the component whose
markup you are trying to update.
console.error('Wicket.Ajax: ' + msg);

I also tried to use .setVersioned( false ) on both the component and the
page, but without success.
Is there a way to do this ?

Thank you,

Sylvain.


signature.asc
Description: This is a digitally signed message part


Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
Hello,

I have a stateless page, and I would like to periodically refresh a
section of this page.
If I do :

add( new MyPanel( "header" )
.setOutputMarkupId( true )
.add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) )
  );

The page becomes stateless.

If in MyPanel, I have :
class MyPanel{
 ...
 @Override
 public boolean getStatelessHint(@SuppressWarnings( "unused" )
Component component) {
  return true;
 }
 ...
}

The update does not work as the expected component's HTML id does not
remain constant :

Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id
[[header2]] was not found while trying to perform markup update. Make
sure you called component.setOutputMarkupId(true) on the component whose
markup you are trying to update. console.error('Wicket.Ajax: ' + msg); 
I also tried to use .setVersioned( false ) on both the component and the
page, but without success.
Is there a way to do this ?

Thank you,

Sylvain.


signature.asc
Description: This is a digitally signed message part


Re: Using Wicket together with Microsoft VirtualEarth/BingMaps

2011-09-07 Thread vittorio
Hi, t3_chris!

I recently worked on integrating wicket and bing maps.
All sources you can find on github
(https://github.com/canwe/wicket-bingmaps-integration)
Maybe this helps you after two years :)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-Wicket-together-with-Microsoft-VirtualEarth-BingMaps-tp1889515p3795787.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Include wicket into jsp page

2011-09-07 Thread sauli.ketola
I've added wicket pages to a jsp-page based application using a jsp-page
which included the wicket page in an iframe. The reason it was done like
this was because the jsp-application had a menu bar that I didn't want to
clone in wicket. 
So basically I had a wicketPage.jsp which took as a parameter the wicket
page name. Then the newly created pages were in the menu bar as links like
wicketPage.jsp?page=SomeWicketPage. And the "SomeWicketPage" was mounted as
a bookmarkable page in the wicket application.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Include-wicket-into-jsp-page-tp3793485p3795832.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Statful image

2011-09-07 Thread Jochen Mader
Uh, sorry :)
It all comes doen to the handling of shared and-nonshared resources.
If a resource is non-shared (read: not registered with
sharedresources). If the Image resource is null it can't assume that
it's shared, therefore handling is at a non-shared/stateful resource.

On Wed, Sep 7, 2011 at 11:42 AM, Martin Grigorov  wrote:
> Would you share your knowledge with us ? :-)
>
> On Wed, Sep 7, 2011 at 12:33 PM, Jochen Mader  
> wrote:
>> Found it shortly after my mail (as always). Never mind.
>> Am 07.09.2011 09:31 schrieb "Jochen Mader" :
>>> We just stumbled upon the following code in the Wicket(1.4.17) Image
>>> class getStatelessHint method:
>>> return (getImageResource() == null || getImageResource() ==
>>> localizedImageResource.getResource()) &&
>>> localizedImageResource.isStateless)
>>>
>>> My question is:
>>> Why does an image become stateful because of a missing reference?
>>>
>>> Thx
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Statful image

2011-09-07 Thread Martin Grigorov
Would you share your knowledge with us ? :-)

On Wed, Sep 7, 2011 at 12:33 PM, Jochen Mader  wrote:
> Found it shortly after my mail (as always). Never mind.
> Am 07.09.2011 09:31 schrieb "Jochen Mader" :
>> We just stumbled upon the following code in the Wicket(1.4.17) Image
>> class getStatelessHint method:
>> return (getImageResource() == null || getImageResource() ==
>> localizedImageResource.getResource()) &&
>> localizedImageResource.isStateless)
>>
>> My question is:
>> Why does an image become stateful because of a missing reference?
>>
>> Thx
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Statful image

2011-09-07 Thread Jochen Mader
Found it shortly after my mail (as always). Never mind.
Am 07.09.2011 09:31 schrieb "Jochen Mader" :
> We just stumbled upon the following code in the Wicket(1.4.17) Image
> class getStatelessHint method:
> return (getImageResource() == null || getImageResource() ==
> localizedImageResource.getResource()) &&
> localizedImageResource.isStateless)
>
> My question is:
> Why does an image become stateful because of a missing reference?
>
> Thx


upgrade from version 1.4.17 to 1.4.18 : a test broken

2011-09-07 Thread Mathilde Pellerin
Hi all,

when I upgrade my application from wicket version 1.4.17 to version 1.4.18,
there is one test which fails.
When I test application manually, there is no problem, so I think there is a
problem inside the test.

this is the test which failed with 1.4.18 :

@Test
public void testStory06_TA2_RenseignementToutesInfosPersos(){
tester.startPage(InfosPersoPage.class);
tester.assertRenderedPage(InfosPersoPage.class);

//On verifie que les champs sont vides et que le bouton
d'enregistrement est désactivé
FormTester formTester = tester.newFormTester("infosPersoForm");
Assert.assertEquals("", formTester.getTextComponentValue("email"));
Assert.assertEquals("",
formTester.getTextComponentValue("codePostal"));
Assert.assertEquals("", formTester.getTextComponentValue("ville"));
Assert.assertEquals("", formTester.getTextComponentValue("taille"));
Assert.assertEquals("", formTester.getTextComponentValue("poids"));
tester.assertDisabled("infosPersoForm:boutonEnregistrerInfos");

//vérification du texte sur le bouton
Form infosPersoForm = (Form)
tester.getComponentFromLastRenderedPage("infosPersoForm");
Button submitbutton = (Button)
infosPersoForm.get("boutonEnregistrerInfos");
Assert.assertEquals("Enregistrer", submitbutton.getValue());

//on renseigne l'Email et on verifie que le bouton d'enregistrement
est activé
formTester.setValue("codePostal", cp);
formTester.setValue("ville", ville);
formTester.setValue("taille", taille.toString());
formTester.setValue("poids", poids.toString());
tester.executeAjaxEvent("infosPersoForm:email", "onkeyup");
Assert.assertTrue("Le bouton Enregistrer doit être activé",
submitbutton.isEnabled());

//On vérifie que l'email a bien été enregistré dans les infos perso
de lola

tester.executeAjaxEvent(infosPersoForm.get("boutonEnregistrerInfos"),
"onclick");
Membre lolaUpdate = serviceMembre.getOne(lola.getIdentifiant());
Assert.assertNotNull("Pas d'infos perso pour ce membre",
lolaUpdate.getInfosPersoEnregistrees());
Assert.assertTrue("Infos perso pas enregistrées pour ce membre",
lolaUpdate.getInfosPersoEnregistrees());
   * Assert.assertEquals(taille, lolaUpdate.getTaille()); //failed at
this line  : expected:<167> but was:*
Assert.assertEquals(poids, lolaUpdate.getPoids());
Assert.assertEquals(cp, lolaUpdate.getCodePostal());
Assert.assertEquals(ville, lolaUpdate.getVille());

//on vérifie que le membre en session a bien été mis à jour
Assert.assertEquals(lolaUpdate, session.getMembre());
//on vérifie qu'il n'y pas de message d'erreur mais un message
d'information
tester.assertErrorMessages(new String[]{});
tester.assertInfoMessages(new String[]{"Données enregistrées"});
}

I read changelog of version 1.4.18, but I did not find any change which can
explain that failed.
Is there a mistake in my test?

Thanks.
Mathilde

PS : this is the stacktrace of this test failure :

junit.framework.AssertionFailedError: expected:<167> but was:
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:283)
at junit.framework.Assert.assertEquals(Assert.java:64)
at junit.framework.Assert.assertEquals(Assert.java:71)
at
fr.statlife.protoE4N.wicket.TestStory06_QuestionnaireEntree.testStory06_TA2_RenseignementToutesInfosPersos(TestStory06_QuestionnaireEntree.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.s

Statful image

2011-09-07 Thread Jochen Mader
We just stumbled upon the following code in the Wicket(1.4.17) Image
class getStatelessHint method:
return (getImageResource() == null || getImageResource() ==
localizedImageResource.getResource()) &&
localizedImageResource.isStateless)

My question is:
Why does an image become stateful because of a missing reference?

Thx

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