Re: date picker

2008-11-03 Thread Wayne Pope
it probably hasn't been updated. just download the source and do it yourself
- its usually very trivial change.

On Tue, Nov 4, 2008 at 8:37 AM, tbt <[EMAIL PROTECTED]> wrote:

>
> Hi
>
> I'm using wicket 1.3.2 and downloaded wicket-contrib-datepicker-1.2 because
> I want to use a date picker for my application. But this release is not
> compatible with wicket 1.3 because it gives errors. Can someone give me the
> link to download a date picker component that is compatible with wicket 1.3
>
> Thanks
> --
> View this message in context:
> http://www.nabble.com/date-picker-tp20317456p20317456.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: attribute modifier on onclick

2008-11-03 Thread Wayne Pope
not sure but perhaps try modelchanged on the label

On Mon, Nov 3, 2008 at 9:32 PM, miro <[EMAIL PROTECTED]> wrote:

>
> I have a linkthis contains a label , now I want  to change the style of
> the label   whenever user clicks on the link ,  to do this   I override
>  the
> method onClick()  in  link component  I am retrieving the label  and adding
> simpleattributemodifier to the label , but there is no change , when I see
> the generated html it does not include  the added style  , can I change the
> style of a component in  any of the   events of a component ?
> --
> View this message in context:
> http://www.nabble.com/attribute-modifier-on-onclick-tp20310246p20310246.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


date picker

2008-11-03 Thread tbt

Hi

I'm using wicket 1.3.2 and downloaded wicket-contrib-datepicker-1.2 because
I want to use a date picker for my application. But this release is not
compatible with wicket 1.3 because it gives errors. Can someone give me the
link to download a date picker component that is compatible with wicket 1.3

Thanks
-- 
View this message in context: 
http://www.nabble.com/date-picker-tp20317456p20317456.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Testing + IFrame

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael

Ahh ok..

Timo now that you've mentioned jdave... Are there any way jdave supports 
plain text scenarios like jBehave?


Timo Rantalaiho wrote:

On Mon, 03 Nov 2008, Nino Saturnino Martinez Vazquez Wael wrote:
  

Argh really bad example, heres a better one:

tester.getComponent("basepath").getIframe().addvisitor or something?

And then visitor would have to sort out if the component probed were a 
form etc?



Something like 


Form form = (Form) tester.getLastRenderedPage().visitChildren(Form.class, new 
Component.IVisitor() {
public Object component(Component component) {
return component;
});
FormTester = tester.newFormTester(form);

In jdave-wicket you have this bundled in and can do just

Form form = selectFirst(Form.class).from(context);

If there are more than one Form visible on the page, you have
to differentiate a bit more in the visitor and it gets more 
messy.


Best wishes,
Timo

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: How does serialization work?

2008-11-03 Thread Timo Rantalaiho
On Mon, 03 Nov 2008, Igor Vaynberg wrote:
> it doesnt matter if you do this. because the page object is serialized
> and those components are fields of the page they are serialized only
> once and further references are replaced with links, this is how
> serialization works and it preserves proper references.

Right, it doesn't matter from the serialisation point of 
view, but if you replace the component in the component 
hierarchy, you should make sure that you also update these
references to point to the new component instances. 

That's why I prefer accessing child components dynamically
whenever it can be easily done.

Best wishes,
Timo


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



Re: AjaxFallbackButton and setDefaultFormProcessing(false)

2008-11-03 Thread Timo Rantalaiho
On Mon, 03 Nov 2008, jpswain wrote:
> I'm building a registration page for my wicket app, and I'm having trouble

Building... Designing, rather :)

  http://www.bleading-edge.com/Publications/C++Journal/abstract.htm

> What I want is to have an AjaxFallbackButton next to desired-username to see
> if it is available and then display a label saying whether it is or isn't
> available.  This works fine when AjaxFallbackButton's
> setDefaultFormProcessing is set to true (as by default).  However, this runs
> the onSubmit() of the form, not just the onSubmit() of the button itself as
> I want it to.

You have to do the submit to get the desired username to
server for checking, and then react accordingly. You could
make uniqueness check a validator and then models do not
get updated if the username is not unique.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: How does serialization work?

2008-11-03 Thread Timo Rantalaiho
On Mon, 03 Nov 2008, Graeme Knight wrote:
> Where on disk are these serialized pages? 

Servlet context temporary directory, which can be something
like /tmp/ or %HOME%\Local Settings\Temp . It can be changed
in web.xml (and I suppose that whether it's the servlet 
context temp dir or some other place can be changed with 
some Wicket setting or by providing a custom pagestore).

I remember seeing a presentation by Johan on some of this
stuff on slideshare.net .

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



AjaxFallbackButton and setDefaultFormProcessing(false)

2008-11-03 Thread jpswain

I'm building a registration page for my wicket app, and I'm having trouble
getting an AjaxFallbackButton to work the way I would like it to.  I have
several fields for the user to fill out on my registration page, including
email, password, desired-username, etc.

What I want is to have an AjaxFallbackButton next to desired-username to see
if it is available and then display a label saying whether it is or isn't
available.  This works fine when AjaxFallbackButton's
setDefaultFormProcessing is set to true (as by default).  However, this runs
the onSubmit() of the form, not just the onSubmit() of the button itself as
I want it to.

If I do ajaxFallbackButton.setDefaultFormProcessing(false) then it gets
nothing from the model.


When I have used non-Ajax buttons in the past with Wicket, I called
textField.updateModel() and then called textField.getModelObject(), which
made it possible to retrieve values with defaultFormProcessing set to false
and therefore did not run the form's onSubmit() method.  However when I do
this with AjaxFallbackButton I get a null pointer execption :(.


If this is too incomprehensible, I can try to make a quickstart
demonstrating the problem.  I'm really not sure what appropriate behavior
with these forms/buttons is to begin with though, so I would really
appreciate help.  I have pasted my class which may help.

Thanks!
Jamie

-

package com.musictramp.wicket.pages.tests;

import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.Model;

@SuppressWarnings("unchecked")
public class TestPage extends WebPage{
private static final long serialVersionUID = 1L;

// *** INSTANCE VARS ***
private TextField textField;
private Label label;

// *** CONSTRUCTOR ***
public TestPage () {
this(null);
}
public TestPage(PageParameters params) {
Form form = new Form("form"){
@Override
protected void onSubmit() {
System.out.println(">> form onSubmit()");
}
};

textField = new TextField("textField", new Model(""));
textField.setOutputMarkupId(true);

label = new Label("label", new Model(""));
label.setOutputMarkupId(true);

AjaxFallbackButton ajaxFallbackButton = new
AjaxFallbackButton("button", form) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
System.out.println(">>> Ajax button submit:");

String s1 = textField.getModelObject().toString();
System.out.println("s1=" + s1);
label.setDefaultModelObject(s1);

if (target != null) {
target.addComponent(label);
}
}
};

// If this is uncommented, then s1 comes out blank:
//ajaxFallbackButton.setDefaultFormProcessing(false);

form.add(textField);
form.add(label);
form.add(ajaxFallbackButton);

add(form);


}


} // CLOSE CLASS.


-- 
View this message in context: 
http://www.nabble.com/AjaxFallbackButton-and-setDefaultFormProcessing%28false%29-tp20316060p20316060.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Dean Murray is out of the office.

2008-11-03 Thread Dean Murray

I will be out of the office starting  2008-11-03 and will not return until
2008-12-16.

I will not have access to my emails during this time.
For NDR concerns, please contact Bruce Yu or Steve Wechsler @(613)
948-2164 .  For other concerns please contact Les Poupore @ 613- 946-6451.


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



Re: Feedback/Error message.

2008-11-03 Thread Igor Vaynberg
On Mon, Nov 3, 2008 at 8:02 PM, Graeme Knight <[EMAIL PROTECTED]> wrote:
> 3) onSubmit authenticates against the database through a load on a
> LoadableDetachableModel, and returns the result as the model's object.

^ sounds interesting...paste your code.

-igor

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



Re: Feedback/Error message.

2008-11-03 Thread Igor Vaynberg
add(new feedbackpanel("feedback"));

onsubmit() {
  user u=authenticator.auth(username, password);
  if (u==null) {
  error("Invalid password");
  } else {
if (!continuetooriginaldestination) {
setresponsepage(application.get().gethomepage()); }
  }
}

-igor

On Mon, Nov 3, 2008 at 8:02 PM, Graeme Knight <[EMAIL PROTECTED]> wrote:
>
> Hi.
>
> Loving Wicket so far! I had a search and had trouble finding the answer to
> this one, if anyone can help:
>
> 1) I have a simple form with username/password and a submit button.
>
> 2) User enters username/password and hits submit.
>
> 3) onSubmit authenticates against the database through a load on a
> LoadableDetachableModel, and returns the result as the model's object.
>
> Let's say there is an error on authenticating against the database - what is
> the easiest way of giving the user feedback that his username/password was
> wrong? I naively thought I might be able to do some sort of conditional
> insert of a component into the page or form (similar to Tapestry).
>
> My solution was then to add a panel (regular not feedback) to the page which
> consists of an error icon and a custom message. I would like to update this
> component on the re-render so it doesn't display if there isn't a problem,
> but it does if there is a problem (couldn't get isVisible working this way).
>
> What's the Wicket way?
>
> Many thanks, Graeme.
> --
> View this message in context: 
> http://www.nabble.com/Feedback-Error-message.-tp20315444p20315444.html
> 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]



Feedback/Error message.

2008-11-03 Thread Graeme Knight

Hi.

Loving Wicket so far! I had a search and had trouble finding the answer to
this one, if anyone can help:

1) I have a simple form with username/password and a submit button.

2) User enters username/password and hits submit.

3) onSubmit authenticates against the database through a load on a
LoadableDetachableModel, and returns the result as the model's object.

Let's say there is an error on authenticating against the database - what is
the easiest way of giving the user feedback that his username/password was
wrong? I naively thought I might be able to do some sort of conditional
insert of a component into the page or form (similar to Tapestry).

My solution was then to add a panel (regular not feedback) to the page which
consists of an error icon and a custom message. I would like to update this
component on the re-render so it doesn't display if there isn't a problem,
but it does if there is a problem (couldn't get isVisible working this way). 

What's the Wicket way?

Many thanks, Graeme.
-- 
View this message in context: 
http://www.nabble.com/Feedback-Error-message.-tp20315444p20315444.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Maven Wicket 1.4-m3 can't install/build.

2008-11-03 Thread jpswain

Igor,

Thanks!  I just saw that a few minutes ago.  There was some weird stuff in
the quickstart java files where one had the page genericized as  and
some other stuff.

I appreciate the help.

J


-- 
View this message in context: 
http://www.nabble.com/Maven-Wicket-1.4-m3-can%27t-install-build.-tp20314685p20315307.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Maven Wicket 1.4-m3 can't install/build.

2008-11-03 Thread Igor Vaynberg
the version of archetype you used (1.4m3) had problems, try to
generate the project against 1.4-snapshot

mvn archetype:create -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart
-DarchetypeVersion=1.4-SNAPSHOT -DgroupId=com.mycompany
-DartifactId=myproject
-DremoteRepositories=http://wicketstuff.org/maven/repository/

-igor

On Mon, Nov 3, 2008 at 6:42 PM, jpswain <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> I've been working with Wicket using Ant for the last year with no big
> problems.  However, I am now trying to get maven working so I can build a
> quickstart to demonstrate a problem I'm having with AjaxFallbackButton.
>
> Anyways, sorry for the extremely long post, but maven is just driving me
> absolutely, completely nuts and would really appreciate any help on what I'm
> doing wrong here.
>
> I very much appreciate any help you guys can offer.  The Wicket community is
> really the best.
>
> Thanks,
> J
>
>
> ==
> This part seemed to work fine: (and as far as I know my local repo folder in
> ~/.m2 has everything downloaded that it needs.  The wicket jar and tons of
> other stuff is there.)
>
> lola:Java.NetBeans.Projects lola$ mvn archetype:create
> -DarchetypeGroupId=org.apache.wicket
> -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.4-m3
> -DgroupId=com.musictramp -DartifactId=myproject
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO]
> 
> [INFO] Building Maven Default Project
> [INFO]task-segment: [archetype:create] (aggregator-style)
> [INFO]
> 
> [INFO] Setting property: classpath.resource.loader.class =>
> 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] [archetype:create]
> [WARNING] This goal is deprecated. Please use mvn archetype:generate instead
> [INFO] Defaulting package to group ID: com.musictramp
> [INFO]
> 
> [INFO] Using following parameters for creating OldArchetype:
> wicket-archetype-quickstart:1.4-m3
> [INFO]
> 
> [INFO] Parameter: groupId, Value: com.musictramp
> [INFO] Parameter: packageName, Value: com.musictramp
> [INFO] Parameter: package, Value: com.musictramp
> [INFO] Parameter: artifactId, Value: myproject
> [INFO] Parameter: basedir, Value: /Users/lola/Java.NetBeans.Projects
> [INFO] Parameter: version, Value: 1.0-SNAPSHOT
> [INFO] * End of debug info from resources from generated
> POM ***
> [INFO] OldArchetype created in dir:
> /Users/lola/Java.NetBeans.Projects/myproject
> [INFO]
> 
> [INFO] BUILD SUCCESSFUL
> [INFO]
> 
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Mon Nov 03 19:11:38 CST 2008
> [INFO] Final Memory: 14M/490M
> [INFO]
> 
>
>
>
>
>
> ==
> It fails here:
>
> lola:myproject lola$ pwd
> /Users/lola/Java.NetBeans.Projects/myproject
>
> lola:myproject lola$ mvn package
> [INFO] Scanning for projects...
> [INFO]
> 
> [INFO] Building quickstart
> [INFO]task-segment: [package]
> [INFO]
> 
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [compiler:compile]
> [INFO] Compiling 2 source files to
> /Users/lola/Java.NetBeans.Projects/myproject/target/classes
> [INFO]
> 
> [ERROR] BUILD FAILURE
> [INFO]
> 
> [INFO] Compilation failure
>
> /Users/lola/Java.NetBeans.Projects/myproject/src/main/java/com/musictramp/HomePage.java:[10,37]
> generics are not supported in -source 1.3
> (use -source 5 or higher to enable generics)
> public class HomePage extends WebPage {
>
> /Users/lola/Java.NetBeans.Projects/myproject/src/main/java/com/musictramp/WicketApplication.java:[22,13]
> generics are not supported in -source 1.3
> (use -source 5 or higher to enable generics)
>public Class getHomePage()
>
> [INFO]
> 
> [INFO] For more information

Maven Wicket 1.4-m3 can't install/build.

2008-11-03 Thread jpswain

Hey guys,

I've been working with Wicket using Ant for the last year with no big
problems.  However, I am now trying to get maven working so I can build a
quickstart to demonstrate a problem I'm having with AjaxFallbackButton.

Anyways, sorry for the extremely long post, but maven is just driving me
absolutely, completely nuts and would really appreciate any help on what I'm
doing wrong here.

I very much appreciate any help you guys can offer.  The Wicket community is
really the best.

Thanks,
J


==
This part seemed to work fine: (and as far as I know my local repo folder in
~/.m2 has everything downloaded that it needs.  The wicket jar and tons of
other stuff is there.)

lola:Java.NetBeans.Projects lola$ mvn archetype:create
-DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.4-m3
-DgroupId=com.musictramp -DartifactId=myproject
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]

[INFO] Building Maven Default Project
[INFO]task-segment: [archetype:create] (aggregator-style)
[INFO]

[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:create]
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
[INFO] Defaulting package to group ID: com.musictramp
[INFO]

[INFO] Using following parameters for creating OldArchetype:
wicket-archetype-quickstart:1.4-m3
[INFO]

[INFO] Parameter: groupId, Value: com.musictramp
[INFO] Parameter: packageName, Value: com.musictramp
[INFO] Parameter: package, Value: com.musictramp
[INFO] Parameter: artifactId, Value: myproject
[INFO] Parameter: basedir, Value: /Users/lola/Java.NetBeans.Projects
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] * End of debug info from resources from generated
POM ***
[INFO] OldArchetype created in dir:
/Users/lola/Java.NetBeans.Projects/myproject
[INFO]

[INFO] BUILD SUCCESSFUL
[INFO]

[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Nov 03 19:11:38 CST 2008
[INFO] Final Memory: 14M/490M
[INFO]






==
It fails here:

lola:myproject lola$ pwd
/Users/lola/Java.NetBeans.Projects/myproject

lola:myproject lola$ mvn package
[INFO] Scanning for projects...
[INFO]

[INFO] Building quickstart
[INFO]task-segment: [package]
[INFO]

[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 2 source files to
/Users/lola/Java.NetBeans.Projects/myproject/target/classes
[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO] Compilation failure

/Users/lola/Java.NetBeans.Projects/myproject/src/main/java/com/musictramp/HomePage.java:[10,37]
generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
public class HomePage extends WebPage {

/Users/lola/Java.NetBeans.Projects/myproject/src/main/java/com/musictramp/WicketApplication.java:[22,13]
generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
public Class getHomePage()

[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: 1 second
[INFO] Finished at: Mon Nov 03 19:12:01 CST 2008
[INFO] Final Memory: 13M/490M
[INFO]

lola:myproject lola$ 





==
It's strange that it's complaining about "source 1.3" since I'm using Java
6.
See:
lola:Users lola$ mvn -v
Maven version: 2.0.9
Java version: 1.6.0_07
OS name: "mac os x" version: "10.5.5" arch: "x86_64" Family: "mac"
lola:Users lola$ 


Re: How does serialization work?

2008-11-03 Thread Igor Vaynberg
On Mon, Nov 3, 2008 at 5:09 PM, Graeme Knight <[EMAIL PROTECTED]> wrote:
> Where on disk are these serialized pages?

i would imagine in a tmp dir, i would have to look in code for the
exact location - you can do the same

> I remember reading you only cache
> the current page in memory. Is that correct?

yes, when using the diskstore only the current page is in httpsession.
the other pages are only needed if the user uses the back button.

> This serializing on disk - what
> is the strategy for keeping these files in sync in a clustered environment?

standard http session replication. when a node receives a page from
another node via session replication it adds it to its own local
diskstore.

-igor


>
> Appreciate the help very much! Graeme.
>
>
> igor.vaynberg wrote:
>>
>> it is cleaned up when the session expires. it used to be that we only
>> kept X last pages in the store, but now that we use disc that seems to
>> be redundant.
>>
>> -igor
>>
>> On Mon, Nov 3, 2008 at 4:08 PM, Graeme Knight <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> Hi.
>>>
>>> I wondered another thing - how and when are the serialized objects
>>> cleaned
>>> up? Is there a mechanism for making sure large amounts of memory or disk
>>> are
>>> not soaked up by long running sessions and lots of user interactions?
>>>
>>> Thanks again, Graeme.
>>>
>>>
>>> Graeme Knight wrote:

 Timo!

 Thanks for your answers - so you think its better NOT to have the
 components as private member variables? I may misunderstand...

 'Tapestry' in Action LOL! Sorry! I'm moving over from that world
 into
 the Wicket world...

 Wicket in Action - VERY readable and well written, but perhaps I didn't
 get far enough along to get to the serialization parts (I'm just
 beginning
 Part 2).

 Cheers, Graeme.

 Timo Rantalaiho wrote:
>
> On Mon, 03 Nov 2008, GK1971 wrote:
>> through the forum but couldn't find the answer. Couldn't find the
>> answers
>> from Tapestry in Action (I'm sure they are there if anyone can point
>> me
>> at a
>> page).
>
> You might want to have a look at Wicket in Action :--)
>
>> 1) Exactly WHAT is getting serialized and where and when?
>
> The page, which includes its whole Component tree.
>
>> 2) What are the main classes in the framework responsible for
>> serialization
>> that I can look at (I have the source)? I guess I am after
>> understanding
>> the
>> flow of logic.
>
> I find it easiest to start from Session.requestDetached().
> There you have
>
>   page.getPageMap().put(page);
>
>   =>
>
>   SecondLevelCacheSessionStore.put(Page)
>
>   =>
>
>   DiskPageStore.storePage(String sessionId, Page page)
>
> and there's already stuff about serialisation.
>
> I'm sure that someone can give you a more scientific answer :)
>
>> 3) What happens if I make userIdField and passwordField scoped to the
>> constructor only? Is it common not to have them as member objects and
>> why?
>> (I've not tried this yet, just wondered).
>
> In here
>
>> add( userIdField );
>> add( passwordField );
>
> you add them as children of the constructed component.
> You can always access them for example with a visitor, if
> needed, and holding references to them makes it harder to
> replace them if needed (though it shouldn't be a problem if
> they won't be replaced).
>
> Best wishes,
> Timo
>
> --
> Timo Rantalaiho
> Reaktor Innovations Oyhttp://www.ri.fi/ >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-does-serialization-work--tp20311180p20312968.html
>>> 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]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/How-does-serialization-work--tp20311180p20313794.html
> 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: [EMAI

Re: Issue with nested forms

2008-11-03 Thread Andrew Berman
Nevermind, error on my part.


On Mon, Nov 3, 2008 at 5:20 PM, Andrew Berman <[EMAIL PROTECTED]> wrote:

> So even if I do this, all child pages need to add their components to the
> body and not the direct page itself which to me doesn't seem right.  Is
> there a way to get around this or is there a better way to add a dynamic
> class to the body tag?
>
>
> On Fri, Oct 31, 2008 at 2:54 PM, Andrew Berman <[EMAIL PROTECTED]> wrote:
>
>> Awesome, thanks Igor!
>>
>>
>> On Fri, Oct 31, 2008 at 2:59 PM, Igor Vaynberg <[EMAIL PROTECTED]>wrote:
>>
>>> put the container back, override its istransparentresolver() and return
>>> true
>>>
>>> -igor
>>>
>>> On Fri, Oct 31, 2008 at 2:50 PM, Andrew Berman <[EMAIL PROTECTED]>
>>> wrote:
>>> > Actually, i had something more like this:
>>> >
>>> > 
>>> >  ...
>>> >  
>>> > 
>>> >
>>> > And in the child:
>>> >
>>> > 
>>> >
>>> > When I removed the WebMarkupContainer on the body tag, everything
>>> worked
>>> > perfectly.
>>> >
>>> > On Fri, Oct 31, 2008 at 2:48 PM, Andrew Berman <[EMAIL PROTECTED]>
>>> wrote:
>>> >
>>> >> I figured out why it was happening.  It was because I put a
>>> >> WebMarkupContainer on the body tag which includes the wicket:child.
>>> So I
>>> >> had:
>>> >>
>>> >> 
>>> >> 
>>> >> 
>>> >>
>>> >> I need to be able to dynamically update the class attribute on the
>>> body tag
>>> >> which exists in the parent page, how can I do this since the way I
>>> want to
>>> >> do it doesn't work?
>>> >>
>>> >>
>>> >> On Thu, Oct 30, 2008 at 11:28 PM, Nino Saturnino Martinez Vazquez Wael
>>> <
>>> >> [EMAIL PROTECTED]> wrote:
>>> >>
>>> >>> Really strange... I have something similar on 1.4, although never
>>> more
>>> >>> that 1 nested form.
>>> >>>
>>> >>> Could you show us some code and markup cut out?
>>> >>>
>>> >>>
>>> >>> Andrew Berman wrote:
>>> >>>
>>>  Hello,
>>> 
>>>  I am using Wicket 1.3.5 and I created a panel which contains a form.
>>> I
>>>  have
>>>  a parent template page and a child of the parent page, both of which
>>>  contain
>>>  an instance of the panel.  However, even if I give the panels two
>>>  different
>>>  ids, I get an error like:
>>> 
>>>  The component [MarkupContainer [Component id = emailLabel]] has the
>>>  same wicket:id as another component already added at the same level
>>> 
>>>  Why is this happening since I am putting them in a different part of
>>>  the hierarchy?
>>> 
>>>  Thanks,
>>> 
>>>  Andrew
>>> 
>>> 
>>> 
>>> >>>
>>> >>> --
>>> >>> -Wicket for love
>>> >>>
>>> >>> Nino Martinez Wael
>>> >>> Java Specialist @ Jayway DK
>>> >>> http://www.jayway.dk
>>> >>> +45 2936 7684
>>> >>>
>>> >>>
>>> >>>
>>> >>> -
>>> >>> 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: Issue with nested forms

2008-11-03 Thread Igor Vaynberg
the whole point of a transparent container is that they are
transparent, so your subclasses can add items directly to the page.

-igor

On Mon, Nov 3, 2008 at 6:20 PM, Andrew Berman <[EMAIL PROTECTED]> wrote:
> So even if I do this, all child pages need to add their components to the
> body and not the direct page itself which to me doesn't seem right.  Is
> there a way to get around this or is there a better way to add a dynamic
> class to the body tag?
>
> On Fri, Oct 31, 2008 at 2:54 PM, Andrew Berman <[EMAIL PROTECTED]> wrote:
>
>> Awesome, thanks Igor!
>>
>>
>> On Fri, Oct 31, 2008 at 2:59 PM, Igor Vaynberg <[EMAIL PROTECTED]>wrote:
>>
>>> put the container back, override its istransparentresolver() and return
>>> true
>>>
>>> -igor
>>>
>>> On Fri, Oct 31, 2008 at 2:50 PM, Andrew Berman <[EMAIL PROTECTED]>
>>> wrote:
>>> > Actually, i had something more like this:
>>> >
>>> > 
>>> >  ...
>>> >  
>>> > 
>>> >
>>> > And in the child:
>>> >
>>> > 
>>> >
>>> > When I removed the WebMarkupContainer on the body tag, everything worked
>>> > perfectly.
>>> >
>>> > On Fri, Oct 31, 2008 at 2:48 PM, Andrew Berman <[EMAIL PROTECTED]>
>>> wrote:
>>> >
>>> >> I figured out why it was happening.  It was because I put a
>>> >> WebMarkupContainer on the body tag which includes the wicket:child.
>>> So I
>>> >> had:
>>> >>
>>> >> 
>>> >> 
>>> >> 
>>> >>
>>> >> I need to be able to dynamically update the class attribute on the body
>>> tag
>>> >> which exists in the parent page, how can I do this since the way I want
>>> to
>>> >> do it doesn't work?
>>> >>
>>> >>
>>> >> On Thu, Oct 30, 2008 at 11:28 PM, Nino Saturnino Martinez Vazquez Wael
>>> <
>>> >> [EMAIL PROTECTED]> wrote:
>>> >>
>>> >>> Really strange... I have something similar on 1.4, although never more
>>> >>> that 1 nested form.
>>> >>>
>>> >>> Could you show us some code and markup cut out?
>>> >>>
>>> >>>
>>> >>> Andrew Berman wrote:
>>> >>>
>>>  Hello,
>>> 
>>>  I am using Wicket 1.3.5 and I created a panel which contains a form.
>>> I
>>>  have
>>>  a parent template page and a child of the parent page, both of which
>>>  contain
>>>  an instance of the panel.  However, even if I give the panels two
>>>  different
>>>  ids, I get an error like:
>>> 
>>>  The component [MarkupContainer [Component id = emailLabel]] has the
>>>  same wicket:id as another component already added at the same level
>>> 
>>>  Why is this happening since I am putting them in a different part of
>>>  the hierarchy?
>>> 
>>>  Thanks,
>>> 
>>>  Andrew
>>> 
>>> 
>>> 
>>> >>>
>>> >>> --
>>> >>> -Wicket for love
>>> >>>
>>> >>> Nino Martinez Wael
>>> >>> Java Specialist @ Jayway DK
>>> >>> http://www.jayway.dk
>>> >>> +45 2936 7684
>>> >>>
>>> >>>
>>> >>>
>>> >>> -
>>> >>> 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]



Re: Issue with nested forms

2008-11-03 Thread Andrew Berman
So even if I do this, all child pages need to add their components to the
body and not the direct page itself which to me doesn't seem right.  Is
there a way to get around this or is there a better way to add a dynamic
class to the body tag?

On Fri, Oct 31, 2008 at 2:54 PM, Andrew Berman <[EMAIL PROTECTED]> wrote:

> Awesome, thanks Igor!
>
>
> On Fri, Oct 31, 2008 at 2:59 PM, Igor Vaynberg <[EMAIL PROTECTED]>wrote:
>
>> put the container back, override its istransparentresolver() and return
>> true
>>
>> -igor
>>
>> On Fri, Oct 31, 2008 at 2:50 PM, Andrew Berman <[EMAIL PROTECTED]>
>> wrote:
>> > Actually, i had something more like this:
>> >
>> > 
>> >  ...
>> >  
>> > 
>> >
>> > And in the child:
>> >
>> > 
>> >
>> > When I removed the WebMarkupContainer on the body tag, everything worked
>> > perfectly.
>> >
>> > On Fri, Oct 31, 2008 at 2:48 PM, Andrew Berman <[EMAIL PROTECTED]>
>> wrote:
>> >
>> >> I figured out why it was happening.  It was because I put a
>> >> WebMarkupContainer on the body tag which includes the wicket:child.
>> So I
>> >> had:
>> >>
>> >> 
>> >> 
>> >> 
>> >>
>> >> I need to be able to dynamically update the class attribute on the body
>> tag
>> >> which exists in the parent page, how can I do this since the way I want
>> to
>> >> do it doesn't work?
>> >>
>> >>
>> >> On Thu, Oct 30, 2008 at 11:28 PM, Nino Saturnino Martinez Vazquez Wael
>> <
>> >> [EMAIL PROTECTED]> wrote:
>> >>
>> >>> Really strange... I have something similar on 1.4, although never more
>> >>> that 1 nested form.
>> >>>
>> >>> Could you show us some code and markup cut out?
>> >>>
>> >>>
>> >>> Andrew Berman wrote:
>> >>>
>>  Hello,
>> 
>>  I am using Wicket 1.3.5 and I created a panel which contains a form.
>> I
>>  have
>>  a parent template page and a child of the parent page, both of which
>>  contain
>>  an instance of the panel.  However, even if I give the panels two
>>  different
>>  ids, I get an error like:
>> 
>>  The component [MarkupContainer [Component id = emailLabel]] has the
>>  same wicket:id as another component already added at the same level
>> 
>>  Why is this happening since I am putting them in a different part of
>>  the hierarchy?
>> 
>>  Thanks,
>> 
>>  Andrew
>> 
>> 
>> 
>> >>>
>> >>> --
>> >>> -Wicket for love
>> >>>
>> >>> Nino Martinez Wael
>> >>> Java Specialist @ Jayway DK
>> >>> http://www.jayway.dk
>> >>> +45 2936 7684
>> >>>
>> >>>
>> >>>
>> >>> -
>> >>> 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: How does serialization work?

2008-11-03 Thread Graeme Knight

Thanks Igor! A great help! 

Where on disk are these serialized pages? I remember reading you only cache
the current page in memory. Is that correct? This serializing on disk - what
is the strategy for keeping these files in sync in a clustered environment?

Appreciate the help very much! Graeme.


igor.vaynberg wrote:
> 
> it is cleaned up when the session expires. it used to be that we only
> kept X last pages in the store, but now that we use disc that seems to
> be redundant.
> 
> -igor
> 
> On Mon, Nov 3, 2008 at 4:08 PM, Graeme Knight <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi.
>>
>> I wondered another thing - how and when are the serialized objects
>> cleaned
>> up? Is there a mechanism for making sure large amounts of memory or disk
>> are
>> not soaked up by long running sessions and lots of user interactions?
>>
>> Thanks again, Graeme.
>>
>>
>> Graeme Knight wrote:
>>>
>>> Timo!
>>>
>>> Thanks for your answers - so you think its better NOT to have the
>>> components as private member variables? I may misunderstand...
>>>
>>> 'Tapestry' in Action LOL! Sorry! I'm moving over from that world
>>> into
>>> the Wicket world...
>>>
>>> Wicket in Action - VERY readable and well written, but perhaps I didn't
>>> get far enough along to get to the serialization parts (I'm just
>>> beginning
>>> Part 2).
>>>
>>> Cheers, Graeme.
>>>
>>> Timo Rantalaiho wrote:

 On Mon, 03 Nov 2008, GK1971 wrote:
> through the forum but couldn't find the answer. Couldn't find the
> answers
> from Tapestry in Action (I'm sure they are there if anyone can point
> me
> at a
> page).

 You might want to have a look at Wicket in Action :--)

> 1) Exactly WHAT is getting serialized and where and when?

 The page, which includes its whole Component tree.

> 2) What are the main classes in the framework responsible for
> serialization
> that I can look at (I have the source)? I guess I am after
> understanding
> the
> flow of logic.

 I find it easiest to start from Session.requestDetached().
 There you have

   page.getPageMap().put(page);

   =>

   SecondLevelCacheSessionStore.put(Page)

   =>

   DiskPageStore.storePage(String sessionId, Page page)

 and there's already stuff about serialisation.

 I'm sure that someone can give you a more scientific answer :)

> 3) What happens if I make userIdField and passwordField scoped to the
> constructor only? Is it common not to have them as member objects and
> why?
> (I've not tried this yet, just wondered).

 In here

> add( userIdField );
> add( passwordField );

 you add them as children of the constructed component.
 You can always access them for example with a visitor, if
 needed, and holding references to them makes it harder to
 replace them if needed (though it shouldn't be a problem if
 they won't be replaced).

 Best wishes,
 Timo

 --
 Timo Rantalaiho
 Reaktor Innovations Oyhttp://www.ri.fi/ >

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



>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-does-serialization-work--tp20311180p20312968.html
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-does-serialization-work--tp20311180p20313794.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How does serialization work?

2008-11-03 Thread Igor Vaynberg
it is cleaned up when the session expires. it used to be that we only
kept X last pages in the store, but now that we use disc that seems to
be redundant.

-igor

On Mon, Nov 3, 2008 at 4:08 PM, Graeme Knight <[EMAIL PROTECTED]> wrote:
>
> Hi.
>
> I wondered another thing - how and when are the serialized objects cleaned
> up? Is there a mechanism for making sure large amounts of memory or disk are
> not soaked up by long running sessions and lots of user interactions?
>
> Thanks again, Graeme.
>
>
> Graeme Knight wrote:
>>
>> Timo!
>>
>> Thanks for your answers - so you think its better NOT to have the
>> components as private member variables? I may misunderstand...
>>
>> 'Tapestry' in Action LOL! Sorry! I'm moving over from that world into
>> the Wicket world...
>>
>> Wicket in Action - VERY readable and well written, but perhaps I didn't
>> get far enough along to get to the serialization parts (I'm just beginning
>> Part 2).
>>
>> Cheers, Graeme.
>>
>> Timo Rantalaiho wrote:
>>>
>>> On Mon, 03 Nov 2008, GK1971 wrote:
 through the forum but couldn't find the answer. Couldn't find the
 answers
 from Tapestry in Action (I'm sure they are there if anyone can point me
 at a
 page).
>>>
>>> You might want to have a look at Wicket in Action :--)
>>>
 1) Exactly WHAT is getting serialized and where and when?
>>>
>>> The page, which includes its whole Component tree.
>>>
 2) What are the main classes in the framework responsible for
 serialization
 that I can look at (I have the source)? I guess I am after understanding
 the
 flow of logic.
>>>
>>> I find it easiest to start from Session.requestDetached().
>>> There you have
>>>
>>>   page.getPageMap().put(page);
>>>
>>>   =>
>>>
>>>   SecondLevelCacheSessionStore.put(Page)
>>>
>>>   =>
>>>
>>>   DiskPageStore.storePage(String sessionId, Page page)
>>>
>>> and there's already stuff about serialisation.
>>>
>>> I'm sure that someone can give you a more scientific answer :)
>>>
 3) What happens if I make userIdField and passwordField scoped to the
 constructor only? Is it common not to have them as member objects and
 why?
 (I've not tried this yet, just wondered).
>>>
>>> In here
>>>
 add( userIdField );
 add( passwordField );
>>>
>>> you add them as children of the constructed component.
>>> You can always access them for example with a visitor, if
>>> needed, and holding references to them makes it harder to
>>> replace them if needed (though it shouldn't be a problem if
>>> they won't be replaced).
>>>
>>> Best wishes,
>>> Timo
>>>
>>> --
>>> Timo Rantalaiho
>>> Reaktor Innovations Oyhttp://www.ri.fi/ >
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/How-does-serialization-work--tp20311180p20312968.html
> 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: How does serialization work?

2008-11-03 Thread Igor Vaynberg
as far as serialization wicket uses default java serialization with a
few tweaks to optimize it.

> Thanks for your answers - so you think its better NOT to have the components
> as private member variables? I may misunderstand...

it doesnt matter if you do this. because the page object is serialized
and those components are fields of the page they are serialized only
once and further references are replaced with links, this is how
serialization works and it preserves proper references.

-igor

>
> 'Tapestry' in Action LOL! Sorry! I'm moving over from that world into
> the Wicket world...
>
> Wicket in Action - VERY readable and well written, but perhaps I didn't get
> far enough along to get to the serialization parts (I'm just beginning Part
> 2).
>
> Cheers, Graeme.
>
> Timo Rantalaiho wrote:
>>
>> On Mon, 03 Nov 2008, GK1971 wrote:
>>> through the forum but couldn't find the answer. Couldn't find the answers
>>> from Tapestry in Action (I'm sure they are there if anyone can point me
>>> at a
>>> page).
>>
>> You might want to have a look at Wicket in Action :--)
>>
>>> 1) Exactly WHAT is getting serialized and where and when?
>>
>> The page, which includes its whole Component tree.
>>
>>> 2) What are the main classes in the framework responsible for
>>> serialization
>>> that I can look at (I have the source)? I guess I am after understanding
>>> the
>>> flow of logic.
>>
>> I find it easiest to start from Session.requestDetached().
>> There you have
>>
>>   page.getPageMap().put(page);
>>
>>   =>
>>
>>   SecondLevelCacheSessionStore.put(Page)
>>
>>   =>
>>
>>   DiskPageStore.storePage(String sessionId, Page page)
>>
>> and there's already stuff about serialisation.
>>
>> I'm sure that someone can give you a more scientific answer :)
>>
>>> 3) What happens if I make userIdField and passwordField scoped to the
>>> constructor only? Is it common not to have them as member objects and
>>> why?
>>> (I've not tried this yet, just wondered).
>>
>> In here
>>
>>> add( userIdField );
>>> add( passwordField );
>>
>> you add them as children of the constructed component.
>> You can always access them for example with a visitor, if
>> needed, and holding references to them makes it harder to
>> replace them if needed (though it shouldn't be a problem if
>> they won't be replaced).
>>
>> Best wishes,
>> Timo
>>
>> --
>> Timo Rantalaiho
>> Reaktor Innovations Oyhttp://www.ri.fi/ >
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/How-does-serialization-work--tp20311180p20312172.html
> 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: Wicket + spring + jpa/ hibernate = lazy load exception

2008-11-03 Thread Igor Vaynberg
On Mon, Nov 3, 2008 at 2:09 PM, JulianS <[EMAIL PROTECTED]> wrote:
>
To answer your question, here's my
> implementation of dataprovider#model():
>
>public IModel model(Object object)
>{
>return new Model((Serializable) object);
>}
>
> Of course, it's very possible I'm missing a fundamental point about loadable
> detachable models...

yes, you are missing a very fundmental point about models and the
reason for your lazy init exception is that you are using Model. there
are quiet a lot of threads on this list that explain and show how to
fix your error. i suggest you search the archives, read the models
page on the wiki, and go to wicketinaction.com and search for "smart
entitymodel".

-igor


>
>
>
> igor.vaynberg wrote:
>>
>> what is your dataprovider#model() look like? are you using a loadable
>> detachable model?
>>
>> -igor
>>
>> On Mon, Nov 3, 2008 at 11:04 AM, JulianS <[EMAIL PROTECTED]> wrote:
>>>
>>> I am experiencing exactly the problem outlined in the subject of this
>>> post,
>>> and I would really appreciate any help I can get, as I am under a
>>> deadline.
>>> It's the first time I'm using Wicket with JPA, and I just don't
>>> understand
>>> why this isn't working.
>>>
>>> I have a Wicket dataprovider that looks like this (I've simplified it a
>>> bit):
>>>
>>> public abstract class FooDataProvider extends SortableDataProvider
>>> {
>>>private static final long serialVersionUID = 1L;
>>>
>>>@SpringBean
>>>protected MyAPI myApi;
>>>
>>>public FooDataProvider()
>>>{
>>>super();
>>>// Injects the spring bean
>>>InjectorHolder.getInjector().inject(this);
>>>}
>>>
>>>public Iterator iterator(final int first, final int count)
>>>{
>>>List bars = myApi.getBars();
>>>List foos = bars.getFoos();
>>>return foos.iterator();
>>>}
>>> }
>>>
>>> I am using a very standard Spring JPA setup, and my web.xml includes a
>>> OpenEntityManagerInViewFilter. The spring bean is being injected
>>> properly,
>>> and my list of Bar is returned correctly. But I get a
>>> LazyInitializationException no matter what I try. What am I doing wrong?
>>>
>>> Many thanks,
>>> Julian
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20308559.html
>>> 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]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20310904.html
> 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: How to plant dynamic data to the html

2008-11-03 Thread Igor Vaynberg
yes i know what it means literally, i just thought the maturity level
here was a little bit higher.

-igor

On Mon, Nov 3, 2008 at 1:53 PM, Tomasz Dziurko <[EMAIL PROTECTED]> wrote:
> I think:
>
> 10x = tenx ~ thanks :)
>
> Regards
> --
> Tomasz Dziurko
>
> -
> 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: How does serialization work?

2008-11-03 Thread Graeme Knight

Hi.

I wondered another thing - how and when are the serialized objects cleaned
up? Is there a mechanism for making sure large amounts of memory or disk are
not soaked up by long running sessions and lots of user interactions?

Thanks again, Graeme.


Graeme Knight wrote:
> 
> Timo!
> 
> Thanks for your answers - so you think its better NOT to have the
> components as private member variables? I may misunderstand...
> 
> 'Tapestry' in Action LOL! Sorry! I'm moving over from that world into
> the Wicket world... 
> 
> Wicket in Action - VERY readable and well written, but perhaps I didn't
> get far enough along to get to the serialization parts (I'm just beginning
> Part 2).
> 
> Cheers, Graeme.
> 
> Timo Rantalaiho wrote:
>> 
>> On Mon, 03 Nov 2008, GK1971 wrote:
>>> through the forum but couldn't find the answer. Couldn't find the
>>> answers
>>> from Tapestry in Action (I'm sure they are there if anyone can point me
>>> at a
>>> page).
>> 
>> You might want to have a look at Wicket in Action :--)
>> 
>>> 1) Exactly WHAT is getting serialized and where and when?
>> 
>> The page, which includes its whole Component tree.
>> 
>>> 2) What are the main classes in the framework responsible for
>>> serialization
>>> that I can look at (I have the source)? I guess I am after understanding
>>> the
>>> flow of logic.
>> 
>> I find it easiest to start from Session.requestDetached().
>> There you have
>> 
>>   page.getPageMap().put(page);
>> 
>>   =>
>> 
>>   SecondLevelCacheSessionStore.put(Page)
>> 
>>   =>
>> 
>>   DiskPageStore.storePage(String sessionId, Page page)
>> 
>> and there's already stuff about serialisation.
>> 
>> I'm sure that someone can give you a more scientific answer :)
>> 
>>> 3) What happens if I make userIdField and passwordField scoped to the
>>> constructor only? Is it common not to have them as member objects and
>>> why?
>>> (I've not tried this yet, just wondered).
>> 
>> In here
>> 
>>> add( userIdField );
>>> add( passwordField );
>> 
>> you add them as children of the constructed component. 
>> You can always access them for example with a visitor, if 
>> needed, and holding references to them makes it harder to 
>> replace them if needed (though it shouldn't be a problem if 
>> they won't be replaced).
>> 
>> Best wishes,
>> Timo
>> 
>> -- 
>> Timo Rantalaiho   
>> Reaktor Innovations Oyhttp://www.ri.fi/ >
>> 
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-does-serialization-work--tp20311180p20312968.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How does serialization work?

2008-11-03 Thread GK1971

Timo!

Thanks for your answers - so you think its better NOT to have the components
as private member variables? I may misunderstand...

'Tapestry' in Action LOL! Sorry! I'm moving over from that world into
the Wicket world... 

Wicket in Action - VERY readable and well written, but perhaps I didn't get
far enough along to get to the serialization parts (I'm just beginning Part
2).

Cheers, Graeme.

Timo Rantalaiho wrote:
> 
> On Mon, 03 Nov 2008, GK1971 wrote:
>> through the forum but couldn't find the answer. Couldn't find the answers
>> from Tapestry in Action (I'm sure they are there if anyone can point me
>> at a
>> page).
> 
> You might want to have a look at Wicket in Action :--)
> 
>> 1) Exactly WHAT is getting serialized and where and when?
> 
> The page, which includes its whole Component tree.
> 
>> 2) What are the main classes in the framework responsible for
>> serialization
>> that I can look at (I have the source)? I guess I am after understanding
>> the
>> flow of logic.
> 
> I find it easiest to start from Session.requestDetached().
> There you have
> 
>   page.getPageMap().put(page);
> 
>   =>
> 
>   SecondLevelCacheSessionStore.put(Page)
> 
>   =>
> 
>   DiskPageStore.storePage(String sessionId, Page page)
> 
> and there's already stuff about serialisation.
> 
> I'm sure that someone can give you a more scientific answer :)
> 
>> 3) What happens if I make userIdField and passwordField scoped to the
>> constructor only? Is it common not to have them as member objects and
>> why?
>> (I've not tried this yet, just wondered).
> 
> In here
> 
>> add( userIdField );
>> add( passwordField );
> 
> you add them as children of the constructed component. 
> You can always access them for example with a visitor, if 
> needed, and holding references to them makes it harder to 
> replace them if needed (though it shouldn't be a problem if 
> they won't be replaced).
> 
> Best wishes,
> Timo
> 
> -- 
> Timo Rantalaiho   
> Reaktor Innovations Oyhttp://www.ri.fi/ >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-does-serialization-work--tp20311180p20312172.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How does serialization work?

2008-11-03 Thread Timo Rantalaiho
On Mon, 03 Nov 2008, GK1971 wrote:
> through the forum but couldn't find the answer. Couldn't find the answers
> from Tapestry in Action (I'm sure they are there if anyone can point me at a
> page).

You might want to have a look at Wicket in Action :--)

> 1) Exactly WHAT is getting serialized and where and when?

The page, which includes its whole Component tree.

> 2) What are the main classes in the framework responsible for serialization
> that I can look at (I have the source)? I guess I am after understanding the
> flow of logic.

I find it easiest to start from Session.requestDetached().
There you have

  page.getPageMap().put(page);

  =>

  SecondLevelCacheSessionStore.put(Page)

  =>

  DiskPageStore.storePage(String sessionId, Page page)

and there's already stuff about serialisation.

I'm sure that someone can give you a more scientific answer :)

> 3) What happens if I make userIdField and passwordField scoped to the
> constructor only? Is it common not to have them as member objects and why?
> (I've not tried this yet, just wondered).

In here

> add( userIdField );
> add( passwordField );

you add them as children of the constructed component. 
You can always access them for example with a visitor, if 
needed, and holding references to them makes it harder to 
replace them if needed (though it shouldn't be a problem if 
they won't be replaced).

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



How does serialization work?

2008-11-03 Thread GK1971

Hi!

Again, I'm new, so hopefully I'm not posting in a bad way here. I've looked
through the forum but couldn't find the answer. Couldn't find the answers
from Tapestry in Action (I'm sure they are there if anyone can point me at a
page).

I have a simple page and form as below. The AuthenticationModel is a
LoadableDetatchableModel that queries the database for a username/password
based on a cookie id (I've cut all this code out for the example below).

My questions are perhaps super naive, but for some reason I am panicking
about serialized objects:

1) Exactly WHAT is getting serialized and where and when?

2) What are the main classes in the framework responsible for serialization
that I can look at (I have the source)? I guess I am after understanding the
flow of logic.

3) What happens if I make userIdField and passwordField scoped to the
constructor only? Is it common not to have them as member objects and why?
(I've not tried this yet, just wondered).

Many thanks for any help once again...

public class LoginPage extends AbstractWebPage
{
public LoginPage()
{
// create a login form and add it to the page
add( new LoginForm() );
}   
}

public class LoginForm extends Form
{
private static final long serialVersionUID = 3975327499669581927L;

private TextField userIdField;

private PasswordTextField passwordField;

public LoginForm()
{
super( "loginForm", new AuthenticationModel() );

userIdField = new TextField( "username", new PropertyModel(
authenticationModel, "username" ) );

passwordField = new PasswordTextField( "password", new
PropertyModel( authenticationModel, "password" ) );

 
// add the components to the form
add( userIdField );
add( passwordField );
}

@Override
protected void onSubmit()
{
// authenticate user
}
}
-- 
View this message in context: 
http://www.nabble.com/How-does-serialization-work--tp20311180p20311180.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket + spring + jpa/ hibernate = lazy load exception

2008-11-03 Thread JulianS

James, thanks for your reply. I've checked that my
OpenEntityManagerInViewFilter precedes the Wicket filter. And my debug log
indeed shows that it seems to be opening and closing the entity manager
before and after the wicket filter runs. I'm hoping to avoid the type of
query you suggest, but I'm realizing I may need to resort to it.

Julian


msc65jap wrote:
> 
> Firstly, your code is rather strange. That getFoos() method is not part of
> the List Interface API.
> 
> Two possible solutions:
> 
> The filter chain maybe incorrect in your web.xml. Your
> OpenEntityManagerInViewFilter might not be preceding the Wicket filter.
> Check that it does precede it.
> 
> If you have a deadline then I recommend having one query that retrieving
> both foos and bars in one hit. I've never touched JPQL but in Hibernate
> Query Language (HQL), one could write this:
> 
> "select f from Foo f inner join fetch f.boo b where b.id = :id"
> 
> Good luck,
> James.
> 
> On Mon, Nov 3, 2008 at 7:04 PM, JulianS <[EMAIL PROTECTED]> wrote:
> 
>>
>> I am experiencing exactly the problem outlined in the subject of this
>> post,
>> and I would really appreciate any help I can get, as I am under a
>> deadline.
>> It's the first time I'm using Wicket with JPA, and I just don't
>> understand
>> why this isn't working.
>>
>> I have a Wicket dataprovider that looks like this (I've simplified it a
>> bit):
>>
>> public abstract class FooDataProvider extends SortableDataProvider
>> {
>>private static final long serialVersionUID = 1L;
>>
>>@SpringBean
>>protected MyAPI myApi;
>>
>>public FooDataProvider()
>>{
>>super();
>>// Injects the spring bean
>>InjectorHolder.getInjector().inject(this);
>>}
>>
>>public Iterator iterator(final int first, final int count)
>>{
>>List bars = myApi.getBars();
>>List foos = bars.getFoos();
>>return foos.iterator();
>>}
>> }
>>
>> I am using a very standard Spring JPA setup, and my web.xml includes a
>> OpenEntityManagerInViewFilter. The spring bean is being injected
>> properly,
>> and my list of Bar is returned correctly. But I get a
>> LazyInitializationException no matter what I try. What am I doing wrong?
>>
>> Many thanks,
>> Julian
>>
>> --
>> View this message in context:
>> http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20308559.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20310970.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Dean Murray is out of the office.

2008-11-03 Thread Dean Murray

I will be out of the office starting  2008-11-03 and will not return until
2008-12-16.

I will not have access to my emails during this time.
For NDR concerns, please contact Bruce Yu or Steve Wechsler @(613)
948-2164 .  For other concerns please contact Les Poupore @ 613- 946-6451.


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



Re: Wicket + spring + jpa/ hibernate = lazy load exception

2008-11-03 Thread JulianS

Igor,

I'm not using a loadable detachable model because I was hoping to get the
list of foos directly from the Bar object, as opposed to having a dedicated
dao method to get the list of foos, which seems to defeat the benefit of
using JPA's object chaining. To answer your question, here's my
implementation of dataprovider#model():

public IModel model(Object object)
{
return new Model((Serializable) object);
}

Of course, it's very possible I'm missing a fundamental point about loadable
detachable models...



igor.vaynberg wrote:
> 
> what is your dataprovider#model() look like? are you using a loadable
> detachable model?
> 
> -igor
> 
> On Mon, Nov 3, 2008 at 11:04 AM, JulianS <[EMAIL PROTECTED]> wrote:
>>
>> I am experiencing exactly the problem outlined in the subject of this
>> post,
>> and I would really appreciate any help I can get, as I am under a
>> deadline.
>> It's the first time I'm using Wicket with JPA, and I just don't
>> understand
>> why this isn't working.
>>
>> I have a Wicket dataprovider that looks like this (I've simplified it a
>> bit):
>>
>> public abstract class FooDataProvider extends SortableDataProvider
>> {
>>private static final long serialVersionUID = 1L;
>>
>>@SpringBean
>>protected MyAPI myApi;
>>
>>public FooDataProvider()
>>{
>>super();
>>// Injects the spring bean
>>InjectorHolder.getInjector().inject(this);
>>}
>>
>>public Iterator iterator(final int first, final int count)
>>{
>>List bars = myApi.getBars();
>>List foos = bars.getFoos();
>>return foos.iterator();
>>}
>> }
>>
>> I am using a very standard Spring JPA setup, and my web.xml includes a
>> OpenEntityManagerInViewFilter. The spring bean is being injected
>> properly,
>> and my list of Bar is returned correctly. But I get a
>> LazyInitializationException no matter what I try. What am I doing wrong?
>>
>> Many thanks,
>> Julian
>>
>> --
>> View this message in context:
>> http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20308559.html
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20310904.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: How to plant dynamic data to the html

2008-11-03 Thread Tomasz Dziurko
I think:

10x = tenx ~ thanks :)

Regards
-- 
Tomasz Dziurko

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



Re: Should/Could ServletWebRequest.isAjax be cached?

2008-11-03 Thread Timo Rantalaiho
On Mon, 03 Nov 2008, Martin Makundi wrote:
> Not really, I have large chunks (containers.. actually a ListView...).

OK, it doesn't look like it's that then.

> Can you be more specific about this? In what context should the
> parsing results be cached?

Look at where IMarkupSettings.getMarkupCache() is being 
called. It seems that whenever a MarkupContainer is looking 
for its associated markup, it's using the markup cache, 
which in turn returns Markup objects that are already 
parsed markup.

> You could try ajax-updating a large web page, say having a table with
> 2000+ rows, and profile it. Do the results look ok for you?

It would be good if you could provide a minimal quickstart 
on which you can reproduce this. Also, 2000+ rows in a table 
on a web page does not sound like very handy to me :)

> I will have a look, but I am not yet very familiar with Wicket
> internals... the 'what should be''s and nots

Me neither, but luckily it's open source :)

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



attribute modifier on onclick

2008-11-03 Thread miro

I have a linkthis contains a label , now I want  to change the style of
the label   whenever user clicks on the link ,  to do this   I override  the
method onClick()  in  link component  I am retrieving the label  and adding 
simpleattributemodifier to the label , but there is no change , when I see
the generated html it does not include  the added style  , can I change the
style of a component in  any of the   events of a component ?
-- 
View this message in context: 
http://www.nabble.com/attribute-modifier-on-onclick-tp20310246p20310246.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Handling exceptions during render

2008-11-03 Thread Alex Objelean

Can you be more specific? What kind of unexpected runtime exceptions are you
talking about? I don't think I understood you correctly. 

Any runtime exception thrown by the wicket is caused by a programming
error... there is no sense to catch it without fixing the problem in your
code. 
Catching runtime exception could make sense if the runtime exception is
thrown by some business logic you are invoking inside wicket components
but this kind of issue is your responsibility..

Alex Objelean  


aditsu wrote:
> 
> Well, I'm specifically talking about unexpected runtime exceptions. I
> don't want those to destroy the whole page.
> They can kill a component, that's ok, but the rest of the page should
> work.
> And yes I want to "make sure that no exceptions are thrown", except that's
> not so simple when you're dealing with a complex site and lots of pages,
> components and models. If I missed any exceptions, I want those to be
> handled gracefully rather than redirecting to an error page.
> 
> renderAll is ONLY called on the page, all other components go through
> renderComponentTagBody to call renderNext, and both renderComponentTagBody
> and renderNext are final :(
> I tried overriding onComponentTagBody and wrapping the super invocation
> with try/catch, but then the markup gets broken because it doesn't close
> tags (i.e. advance in the markup stream?) after the exception is thrown in
> a child component, and I still get an error page :(
> renderComponent(MarkupStream) is final too, it seems that all "doors" are
> closed and locked...
> 
> 
> Erik van Oosten wrote:
>> 
>> It won't. I think you have to dig deeper into the request rendering.
>> 
>> Perhaps that overriding MarkupContainer#renderAll on all your Panels 
>> that have expected exceptions will help.
>> 
>> But then again, exceptions are intended for controlling the 
>> non-expected. You should not use exceptions for normal page flow. In 
>> other words: just make sure that no exceptions are thrown.
>> 
>> Regards,
>> Erik.
>> 
>> 
>> aditsu wrote:
>>> Ok, but how would that let me render the rest of the page?
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20310197.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Testing + IFrame

2008-11-03 Thread Timo Rantalaiho
On Mon, 03 Nov 2008, Nino Saturnino Martinez Vazquez Wael wrote:
> Argh really bad example, heres a better one:
> 
> tester.getComponent("basepath").getIframe().addvisitor or something?
> 
> And then visitor would have to sort out if the component probed were a 
> form etc?

Something like 

Form form = (Form) tester.getLastRenderedPage().visitChildren(Form.class, new 
Component.IVisitor() {
public Object component(Component component) {
return component;
});
FormTester = tester.newFormTester(form);

In jdave-wicket you have this bundled in and can do just

Form form = selectFirst(Form.class).from(context);

If there are more than one Form visible on the page, you have
to differentiate a bit more in the visitor and it gets more 
messy.

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: Wicket + spring + jpa/ hibernate = lazy load exception

2008-11-03 Thread Igor Vaynberg
what is your dataprovider#model() look like? are you using a loadable
detachable model?

-igor

On Mon, Nov 3, 2008 at 11:04 AM, JulianS <[EMAIL PROTECTED]> wrote:
>
> I am experiencing exactly the problem outlined in the subject of this post,
> and I would really appreciate any help I can get, as I am under a deadline.
> It's the first time I'm using Wicket with JPA, and I just don't understand
> why this isn't working.
>
> I have a Wicket dataprovider that looks like this (I've simplified it a
> bit):
>
> public abstract class FooDataProvider extends SortableDataProvider
> {
>private static final long serialVersionUID = 1L;
>
>@SpringBean
>protected MyAPI myApi;
>
>public FooDataProvider()
>{
>super();
>// Injects the spring bean
>InjectorHolder.getInjector().inject(this);
>}
>
>public Iterator iterator(final int first, final int count)
>{
>List bars = myApi.getBars();
>List foos = bars.getFoos();
>return foos.iterator();
>}
> }
>
> I am using a very standard Spring JPA setup, and my web.xml includes a
> OpenEntityManagerInViewFilter. The spring bean is being injected properly,
> and my list of Bar is returned correctly. But I get a
> LazyInitializationException no matter what I try. What am I doing wrong?
>
> Many thanks,
> Julian
>
> --
> View this message in context: 
> http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20308559.html
> 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: Losing session information

2008-11-03 Thread Igor Vaynberg
a couple of things to look into:

access to Session is not synchronized, so make sure you sync
everything yourself.

if you have a stateless page it will not store the session in
httpsession, you might have to do that manually by calling
session.bind()

-igor

On Mon, Nov 3, 2008 at 11:22 AM, Dane Laverty <[EMAIL PROTECTED]> wrote:
> My site has a form-based test on TestPage. Each question in the test has
> a Question object as its model. The Questions all sit in an ArrayList in
> a Test object. Each Question has a "markedAnswer" String, which stores
> the value of the selected answer. The problem is that, for some users,
> the "markedAnswer" fields are become null on the TestResultsPage after
> the test is submitted. This behavior is not consistent (I haven't been
> able to replicate it) but it happens dozens of times daily, so I know
> that it's a real problem.
>
>
>
> My question is, does anyone have any ideas why
> session.user.test.questions[i].markedAnswer becomes null for some users
> after they submit the test?
>
>
>
> Here's the relevant code. Important lines include:
>
> - TestPage, line 37. This inserts the test results into the database.
> Because this is happening correctly, I know that user.test.questions is
> still populated at this point.
>
> - TestResultsPage, line 12. This is where question.getMarkedAnswer()is
> null (and throws a NullPointerException).
>
>
>
> 1  public class TestPage extends...
>
> 2  {
>
> 3private User user;
>
> 4
>
> 5public TestPage()
>
> 6{
>
> 7 user = getSession().getUser();
>
> 8add(new TestForm("testForm"));
>
> 9}
>
> 10
>
> 11final class TestForm extends ApplicationForm
>
> 12{
>
> 13  public TestForm(final String id) {
>
> 14super(id);
>
> 15
>
> 16add(new ListView("questions", new PropertyModel(user,
> "test.questions")) {
>
> 17
>
> 18  protected void populateItem(ListItem item) {
>
> 19final Question question = (Question)
> item.getModelObject();
>
> 20
>
> 21// answersRadioGroup will be a group of radio
> buttons -- one for each possible answer (4, currently)
>
> 22RadioGroup answersRadioGroup = new
> RadioGroup("answers", new PropertyModel(question,
> "markedAnswerLetter"));
>
> 23
>
> 24// This loop will generate a radio button for
> letters A, B, C, and D. Those letter are hard-coded
>
> 25// into the database as answer selections, so
> we can't change them.
>
> 26for (char letter = 'A'; letter <= 'D';
> letter++) {
>
> 27Radio radio = new Radio(letter + "", new
> Model(letter + ""));
>
> 28answersRadioGroup.add(radio);
>
> 29}
>
> 30
>
> 31item.add(answersRadioGroup);
>
> 32}
>
> 33});
>
> 34  }
>
> 35
>
> 36  protected void onSubmit() {
>
> 37fhBD.uploadUserTestResults(user);
>
> 38setResponsePage(TestResultsPage.class);
>
> 39  }
>
> 40}
>
> 41 }
>
>
>
>
>
>
>
> 1  public class TestResultsPage extends...
>
> 2  {
>
> 3 private User user = getSession().getUser();
>
> 4
>
> 5  public TestResultsPage()
>
> 6  {
>
> 7   add(new ListView("resultsListView",
> user.getTest().getQuestions()) {
>
> 8
>
> 9 protected void populateItem(ListItem item) {
>
> 10  final Question question = (Question)
> item.getModelObject();
>
> 11
>
> 12  Label answerText = new Label("answerText", new
> Model(question.getMarkedAnswer().toString()));
>
> 13  answerText.setEscapeModelStrings(false);
>
> 14  item.add(answerText);
>
> 15
>
> 16  }
>
> 17  });
>
> 18 }
>
> 19 }
>
>

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



QueryStringUrlCodingStrategy question

2008-11-03 Thread jchappelle

I have the following code:

PageParameters parms = new PageParameters();
parms.put("answerId", Long.toString(answer.getEntityId()));
add(new BookmarkablePageLink("edit", EditBlogEntryPage.class, 
parms));

In my Application init method I have: 

mount(new QueryStringUrlCodingStrategy("answerdetails",
EditBlogEntryPage.class));

When I click the edit link to get to my page my URL looks like:

http://localhost/robojot/answerdetails/?x=SvX0Lakly72TaK8AnLyL*A

Can someone tell me why it doesn't look like the following:
/answerdetails?answerId=123

Thanks
-- 
View this message in context: 
http://www.nabble.com/QueryStringUrlCodingStrategy-question-tp20309566p20309566.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket + spring + jpa/ hibernate = lazy load exception

2008-11-03 Thread James Perry
Firstly, your code is rather strange. That getFoos() method is not part of
the List Interface API.

Two possible solutions:

The filter chain maybe incorrect in your web.xml. Your
OpenEntityManagerInViewFilter might not be preceding the Wicket filter.
Check that it does precede it.

If you have a deadline then I recommend having one query that retrieving
both foos and bars in one hit. I've never touched JPQL but in Hibernate
Query Language (HQL), one could write this:

"select f from Foo f inner join fetch f.boo b where b.id = :id"

Good luck,
James.

On Mon, Nov 3, 2008 at 7:04 PM, JulianS <[EMAIL PROTECTED]> wrote:

>
> I am experiencing exactly the problem outlined in the subject of this post,
> and I would really appreciate any help I can get, as I am under a deadline.
> It's the first time I'm using Wicket with JPA, and I just don't understand
> why this isn't working.
>
> I have a Wicket dataprovider that looks like this (I've simplified it a
> bit):
>
> public abstract class FooDataProvider extends SortableDataProvider
> {
>private static final long serialVersionUID = 1L;
>
>@SpringBean
>protected MyAPI myApi;
>
>public FooDataProvider()
>{
>super();
>// Injects the spring bean
>InjectorHolder.getInjector().inject(this);
>}
>
>public Iterator iterator(final int first, final int count)
>{
>List bars = myApi.getBars();
>List foos = bars.getFoos();
>return foos.iterator();
>}
> }
>
> I am using a very standard Spring JPA setup, and my web.xml includes a
> OpenEntityManagerInViewFilter. The spring bean is being injected properly,
> and my list of Bar is returned correctly. But I get a
> LazyInitializationException no matter what I try. What am I doing wrong?
>
> Many thanks,
> Julian
>
> --
> View this message in context:
> http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20308559.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Wicket + spring + jpa/ hibernate = lazy load exception

2008-11-03 Thread JulianS

Oops...I meant:

Bar bar = myApi.getBar();
List foos = bar.getFoos();


JulianS wrote:
> 
> I am experiencing exactly the problem outlined in the subject of this
> post, and I would really appreciate any help I can get, as I am under a
> deadline. It's the first time I'm using Wicket with JPA, and I just don't
> understand why this isn't working. 
> 
> I have a Wicket dataprovider that looks like this (I've simplified it a
> bit):
> 
> public abstract class FooDataProvider extends SortableDataProvider
> {
>   private static final long serialVersionUID = 1L;
> 
>   @SpringBean
>   protected MyAPI myApi;
>   
>   public FooDataProvider()
>   {
>   super();
>   // Injects the spring bean
>   InjectorHolder.getInjector().inject(this); 
>   }
> 
>   public Iterator iterator(final int first, final int count)
>   {
>   List bars = myApi.getBars();
>   List foos = bars.getFoos();
>   return foos.iterator();
>   }
> }
> 
> I am using a very standard Spring JPA setup, and my web.xml includes a
> OpenEntityManagerInViewFilter. The spring bean is being injected properly,
> and my list of Bar is returned correctly. But I get a
> LazyInitializationException no matter what I try. What am I doing wrong?
> 
> Many thanks,
> Julian
> 
> 

-- 
View this message in context: 
http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20309299.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Losing session information

2008-11-03 Thread Dane Laverty
My site has a form-based test on TestPage. Each question in the test has
a Question object as its model. The Questions all sit in an ArrayList in
a Test object. Each Question has a "markedAnswer" String, which stores
the value of the selected answer. The problem is that, for some users,
the "markedAnswer" fields are become null on the TestResultsPage after
the test is submitted. This behavior is not consistent (I haven't been
able to replicate it) but it happens dozens of times daily, so I know
that it's a real problem.

 

My question is, does anyone have any ideas why
session.user.test.questions[i].markedAnswer becomes null for some users
after they submit the test? 

 

Here's the relevant code. Important lines include:

- TestPage, line 37. This inserts the test results into the database.
Because this is happening correctly, I know that user.test.questions is
still populated at this point.

- TestResultsPage, line 12. This is where question.getMarkedAnswer()is
null (and throws a NullPointerException).

 

1  public class TestPage extends...

2  {  

3private User user;

4 

5public TestPage()

6{

7 user = getSession().getUser();

8add(new TestForm("testForm"));  

9}

10

11final class TestForm extends ApplicationForm

12{   

13  public TestForm(final String id) {

14super(id);

15

16add(new ListView("questions", new PropertyModel(user,
"test.questions")) {

17  

18  protected void populateItem(ListItem item) {

19final Question question = (Question)
item.getModelObject();

20

21// answersRadioGroup will be a group of radio
buttons -- one for each possible answer (4, currently)

22RadioGroup answersRadioGroup = new
RadioGroup("answers", new PropertyModel(question,
"markedAnswerLetter"));

23

24// This loop will generate a radio button for
letters A, B, C, and D. Those letter are hard-coded

25// into the database as answer selections, so
we can't change them.

26for (char letter = 'A'; letter <= 'D';
letter++) {

27Radio radio = new Radio(letter + "", new
Model(letter + ""));

28answersRadioGroup.add(radio); 

29}

30

31item.add(answersRadioGroup);

32}

33});

34  }

35  

36  protected void onSubmit() {

37fhBD.uploadUserTestResults(user); 

38setResponsePage(TestResultsPage.class);   

39  }

40}

41 }

 

 

 

1  public class TestResultsPage extends...

2  {

3 private User user = getSession().getUser();

4 

5  public TestResultsPage()

6  {

7   add(new ListView("resultsListView",
user.getTest().getQuestions()) {

8 

9 protected void populateItem(ListItem item) {

10  final Question question = (Question)
item.getModelObject();

11  

12  Label answerText = new Label("answerText", new
Model(question.getMarkedAnswer().toString()));

13  answerText.setEscapeModelStrings(false);

14  item.add(answerText);

15  

16  }

17  });

18 }

19 }



Wicket + spring + jpa/ hibernate = lazy load exception

2008-11-03 Thread JulianS

I am experiencing exactly the problem outlined in the subject of this post,
and I would really appreciate any help I can get, as I am under a deadline.
It's the first time I'm using Wicket with JPA, and I just don't understand
why this isn't working. 

I have a Wicket dataprovider that looks like this (I've simplified it a
bit):

public abstract class FooDataProvider extends SortableDataProvider
{
private static final long serialVersionUID = 1L;

@SpringBean
protected MyAPI myApi;

public FooDataProvider()
{
super();
// Injects the spring bean
InjectorHolder.getInjector().inject(this); 
}

public Iterator iterator(final int first, final int count)
{
List bars = myApi.getBars();
List foos = bars.getFoos();
return foos.iterator();
}
}

I am using a very standard Spring JPA setup, and my web.xml includes a
OpenEntityManagerInViewFilter. The spring bean is being injected properly,
and my list of Bar is returned correctly. But I get a
LazyInitializationException no matter what I try. What am I doing wrong?

Many thanks,
Julian

-- 
View this message in context: 
http://www.nabble.com/wicket-%2B-spring-%2B-jpa--hibernate-%3D-lazy-load-exception-tp19721199p20308559.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Add AJAX behaviour to embedded custom form component

2008-11-03 Thread Igor Vaynberg
a better way is to have a factory method for the internal components,
that way the user can do

component newcomponent(string id, imodel model) {
  component c=super.newcomponent(id, model);
  c.add(whateverbehavior);
  return c;
}

-igor

On Mon, Nov 3, 2008 at 6:02 AM, Gianni Doe <[EMAIL PROTECTED]> wrote:
> I've developed a custom form component (FormComponentPanel), a date picker,
> that makes use of 2 fields - a display TextField and a HiddenField for the
> model data. I'm then adding this to the page with a span tag:
> [dropoff date picker]
>
> Then in the java :
> DatePicker  dropoffDatePicker = new DatePicker("dropoffDate", new
> PropertyModel(this, "dropoffDate"),
>(new LocalDate()).minusDays(0), (new
> LocalDate()).plusYears(3));
>
> I'm after some advice on the best way to attach an AJAX behaviour to the
> component. If for example I add an AJAX behaviour directly to the date
> picker component then it's attached to the span tag and obviously doesn't
> work. The only way I've found to get around this is to expose the date
> display field with a public getter so I can then attach the onchange event.
>
> dropoffDatePicker.getDateDisplayField().add(new
> AjaxFormComponentUpdatingBehavior("onchange") {
>@Override
>protected void onUpdate(AjaxRequestTarget target) {
>..
>}
> });
>
> Any suggestions for a better way to do this that doesn't involve exposing
> the innards?
> -Gianni
>
>
> -
> 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: onclick event in a listview

2008-11-03 Thread Igor Vaynberg
it is as simple as composition, add a link to the list item. there are
examples in wicket-examples under repeaters.

-igor

On Mon, Nov 3, 2008 at 9:11 AM, miro <[EMAIL PROTECTED]> wrote:
>
> I have  two tables side by side  in my page .
> Table 1  has two columns name, age
>
> Table 2 has  details columnlike sex, address etc
>
> when user selects  a name in table 1 i want  to update table two with
> details of selected  name, is this possible , I was looking   for onClick on
> listView but did not find , I want the event onlick on a list item
>
>
> if it is not there how can I achieve this functionality?
> --
> View this message in context: 
> http://www.nabble.com/onclick---event-in-a-listview-tp20306627p20306627.html
> 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: Referencing Request in Spring bean definitions

2008-11-03 Thread Igor Vaynberg
you need to create a provider, eg:

interface requestprovider { request getrequest(); }

and class requestproviderimpl { request getrequest() { return
requestcycle.get().getrequest(); }}

then inject your beans with the requestprovider.

-igor

On Mon, Nov 3, 2008 at 8:52 AM, Ryan O'Hara <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Is there anyway to reference Wicket's request object in the Spring bean
> definitions XML?  I'm trying to define a session bean, which has two
> parameters in the contructor - a SwarmWebApplication and a Request.  Thanks
> in advance.
>
>  class="edu.chop.bic.cnv.CnvApplication">
>
>
>  class="some.request.location">
>
>
>  class="edu.chop.bic.cnv.session.MySession">
>
>
>
>
> Ryan
>
> -
> 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: onclick event in a listview

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael

Add a link to the list item and override onclick

miro wrote:
I have  two tables side by side  in my page .   
Table 1  has two columns name, age


Table 2 has  details columnlike sex, address etc

when user selects  a name in table 1 i want  to update table two with
details of selected  name, is this possible , I was looking   for onClick on
listView but did not find , I want the event onlick on a list item 



if it is not there how can I achieve this functionality?
  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: How to plant dynamic data to the html

2008-11-03 Thread Igor Vaynberg
10x?

-igor

On Mon, Nov 3, 2008 at 9:18 AM, itayh <[EMAIL PROTECTED]> wrote:
>
> 10x alot, it works
>
>
> Jeremy Thomerson-5 wrote:
>>
>> Try this:
>> http://www.nabble.com/Adding-Adobe-Media-Player-in-wicket-to19797690.html#a19827296
>>
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>> On Mon, Nov 3, 2008 at 10:52 AM, itayh <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> Hi all,
>>>
>>> I have a peace of html that looks like that:
>>>
>>> 
>>>
>>>
>>>  
>>>
>>>
>>>
>>>  img src="http://reshet.attractv.net/reshet/img/no_silverlight.jpg";
>>> usemap="#no_silverlight" border="0" />
>>>
>>>  
>>>  
>>>  >> href="http://go.microsoft.com/fwlink/?LinkID=124807"; />
>>>>> coords="593,492,406,526"
>>> href="javascript:
>>> loadBack()" />
>>>  
>>>
>>>  
>>> 
>>>
>>> I need to set the value of the initParams parameter in dynamic way from
>>> my
>>> java code. To be more accurate what I need is to set the next url
>>> m=
>>> http://SWITCH434-01.castup.net/cunet/gm.asp?ai=434&ar=08-09-18_22-00-30&ak=null
>>> "
>>> from the java code according to the url  I get from the user.
>>> Any simple way to do this in wicket?
>>>
>>> Thanks in advance,
>>>  Itay
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-plant-dynamic-data-to-the-html-tp20306256p20306256.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/How-to-plant-dynamic-data-to-the-html-tp20306256p20306752.html
> 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: Referencing Request in Spring bean definitions

2008-11-03 Thread Erik van Oosten

Creation of custom sessions is described here:
http://cwiki.apache.org/WICKET/newuserguide.html#Newuserguide-CustomSessions

I do think you can create a session through Spring.

Regards,
   Erik.

Ryan O'Hara wrote:

Hello,

Is there anyway to reference Wicket's request object in the Spring 
bean definitions XML?  I'm trying to define a session bean, which has 
two parameters in the contructor - a SwarmWebApplication and a 
Request.  Thanks in advance.













Ryan

-
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: How to plant dynamic data to the html

2008-11-03 Thread itayh

10x alot, it works


Jeremy Thomerson-5 wrote:
> 
> Try this:
> http://www.nabble.com/Adding-Adobe-Media-Player-in-wicket-to19797690.html#a19827296
> 
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> On Mon, Nov 3, 2008 at 10:52 AM, itayh <[EMAIL PROTECTED]> wrote:
> 
>>
>> Hi all,
>>
>> I have a peace of html that looks like that:
>>
>> 
>>
>>
>>  
>>
>>
>>
>>  img src="http://reshet.attractv.net/reshet/img/no_silverlight.jpg";
>> usemap="#no_silverlight" border="0" />
>>
>>  
>>  
>>  > href="http://go.microsoft.com/fwlink/?LinkID=124807"; />
>>> coords="593,492,406,526"
>> href="javascript:
>> loadBack()" />
>>  
>>
>>  
>> 
>>
>> I need to set the value of the initParams parameter in dynamic way from
>> my
>> java code. To be more accurate what I need is to set the next url
>> m=
>> http://SWITCH434-01.castup.net/cunet/gm.asp?ai=434&ar=08-09-18_22-00-30&ak=null
>> "
>> from the java code according to the url  I get from the user.
>> Any simple way to do this in wicket?
>>
>> Thanks in advance,
>>  Itay
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-plant-dynamic-data-to-the-html-tp20306256p20306256.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-plant-dynamic-data-to-the-html-tp20306256p20306752.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



onclick event in a listview

2008-11-03 Thread miro

I have  two tables side by side  in my page .   
Table 1  has two columns name, age

Table 2 has  details columnlike sex, address etc

when user selects  a name in table 1 i want  to update table two with
details of selected  name, is this possible , I was looking   for onClick on
listView but did not find , I want the event onlick on a list item 


if it is not there how can I achieve this functionality?
-- 
View this message in context: 
http://www.nabble.com/onclick---event-in-a-listview-tp20306627p20306627.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: example application for spring wicket hibernate

2008-11-03 Thread Yann PETIT
Hi Miro,

Did you receive my Wicket+Spring(via annotations) sample  application ? Any
feedback welcome :)

I can also provide a sample application with Wicket+Spring(via
annotations)+Hibernate(via annotations) that does nothing except showing a
way to configure the three to work together.
( I only have a big application using the three that I can't distribute,
but I planned to built this week a very light sample to reuse for other
projects ... ).
Just ask If you're interested.

Anyway the phonebook is a good way to start ;)

Yann.


2008/11/3 Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]>

> no need for that unless you want to commit
>
> miro wrote:
>
>> whats the username password for svn repositorty  ?
>>
>> Tomasz Dziurko wrote:
>>
>>
>>> Phonebook:
>>> http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook .
>>>
>>> If you need NetBeans project for it just tell me, I have it somewhere
>>> on the disc
>>>
>>> Regards
>>> --
>>> Tomasz Dziurko
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: How to plant dynamic data to the html

2008-11-03 Thread Jeremy Thomerson
Try this:
http://www.nabble.com/Adding-Adobe-Media-Player-in-wicket-to19797690.html#a19827296


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

On Mon, Nov 3, 2008 at 10:52 AM, itayh <[EMAIL PROTECTED]> wrote:

>
> Hi all,
>
> I have a peace of html that looks like that:
>
> 
>
>
>  
>
>
>
>  img src="http://reshet.attractv.net/reshet/img/no_silverlight.jpg";
> usemap="#no_silverlight" border="0" />
>
>  
>  
>   href="http://go.microsoft.com/fwlink/?LinkID=124807"; />
> href="javascript:
> loadBack()" />
>  
>
>  
> 
>
> I need to set the value of the initParams parameter in dynamic way from my
> java code. To be more accurate what I need is to set the next url
> m=
> http://SWITCH434-01.castup.net/cunet/gm.asp?ai=434&ar=08-09-18_22-00-30&ak=null
> "
> from the java code according to the url  I get from the user.
> Any simple way to do this in wicket?
>
> Thanks in advance,
>  Itay
> --
> View this message in context:
> http://www.nabble.com/How-to-plant-dynamic-data-to-the-html-tp20306256p20306256.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: How to plant dynamic data to the html

2008-11-03 Thread itayh

Sorry, My mistake.
Here is the html code:
< param name = "initParams"
value="autostart=false,res=1.333,medW=640,medH=480,m=http://SWITCH434-01.castup.net/cunet/gm.asp?ai=434&ar=08-09-18_22-00-30&ak=null";
/>

I need to set the value of the initParams parameter in dynamic way from my
java code. To be more accurate what I need is to set the next url
m=http://SWITCH434-01.castup.net/cunet/gm.asp?ai=434&ar=08-09-18_22-00-30&ak=null";
 
from the java code according to the url  I get from the user.
Any simple way to do this in wicket? 

Thanks in advance,
  Itay

itayh wrote:
> 
> Hi all,
> 
> I have a peace of html that looks like that:
> 
> 
>   
>   
>   
>   
>   
> 
>   img src="http://reshet.attractv.net/reshet/img/no_silverlight.jpg";
> usemap="#no_silverlight" border="0" />
> 
>   
>   
>href="http://go.microsoft.com/fwlink/?LinkID=124807"; />
>href="javascript:
> loadBack()" />
>   
>   
>   
> 
> 
> I need to set the value of the initParams parameter in dynamic way from my
> java code. To be more accurate what I need is to set the next url
> m=http://SWITCH434-01.castup.net/cunet/gm.asp?ai=434&ar=08-09-18_22-00-30&ak=null";
>  
> from the java code according to the url  I get from the user.
> Any simple way to do this in wicket?
> 
> Thanks in advance,
>   Itay
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-plant-dynamic-data-to-the-html-tp20306256p20306368.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



How to plant dynamic data to the html

2008-11-03 Thread itayh

Hi all,

I have a peace of html that looks like that:


  
  
  
  
  

  img src="http://reshet.attractv.net/reshet/img/no_silverlight.jpg";
usemap="#no_silverlight" border="0" />

  
  
  http://go.microsoft.com/fwlink/?LinkID=124807"; />

  
  
  


I need to set the value of the initParams parameter in dynamic way from my
java code. To be more accurate what I need is to set the next url
m=http://SWITCH434-01.castup.net/cunet/gm.asp?ai=434&ar=08-09-18_22-00-30&ak=null";
 
from the java code according to the url  I get from the user.
Any simple way to do this in wicket?

Thanks in advance,
  Itay
-- 
View this message in context: 
http://www.nabble.com/How-to-plant-dynamic-data-to-the-html-tp20306256p20306256.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Referencing Request in Spring bean definitions

2008-11-03 Thread Ryan O'Hara

Hello,

Is there anyway to reference Wicket's request object in the Spring  
bean definitions XML?  I'm trying to define a session bean, which has  
two parameters in the contructor - a SwarmWebApplication and a  
Request.  Thanks in advance.













Ryan

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



Re: Wicket 1.4-m3, wicket-auth-roles and Context Path

2008-11-03 Thread Igor Vaynberg
ah, yes. this is a know issue with tomcat. you need to remove index.jsp

-igor

On Mon, Nov 3, 2008 at 5:05 AM, Alan Romaniusc <[EMAIL PROTECTED]> wrote:
> More about the problem.
>
> This problem does not happen with jetty.
>
> This problem happens with tomcat (6.0.16, 6.0.18) when you have a
> index.jsp file and it is mapped in web.xml (welcome-file-list)
> (netbeans default web project).
>
> I will try to investigate more before open a bug...
>
>
>
>
> On Fri, Oct 31, 2008 at 4:38 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>> open a bug and provide a quickstart
>>
>> -igor
>>
>> On Fri, Oct 31, 2008 at 11:31 AM, Alan Romaniusc <[EMAIL PROTECTED]> wrote:
>>> Another question
>>>
>>> I can not find any bug reporting about it. Should I try to open a bug
>>> or 1.5 will have this fixed anyway?
>>>
>>> On 10/31/08, Alan Romaniusc <[EMAIL PROTECTED]> wrote:
 I found the problem!! No, I didn't, but I found the wrokaround.

  The problem happens with you configure the filter to use url-pattern = 
 "/*".
  If you change to something else, like "/x/*" the redirect will work as 
 expected!

  just a reference...






  On Thu, Oct 30, 2008 at 1:50 PM, Alan Romaniusc <[EMAIL PROTECTED]> wrote:
  > I mm trying to test the dumbest example of wicket auth roles, using
  > examples in 1.4 m3 zip, and just extends pages that can be found
  > there.
  >
  > Everytime that I log in, I was expected to be redirected from login to
  > page that I tried to access, but I am being redirected to the "correct
  > page", but without the context path, resulting in a page not found.
  >
  > Could it be a bug?
  >
  >
  > Dumb Code:
  >>>
  > RoomBookingApplication.java
  > public class RoomBookingApplication extends AuthenticatedWebApplication 
 {
  >
  >protected void init() {
  >super.init();
  >mountBookmarkablePage("admin", AdminPage.class);
  >}
  >
  >public Class getHomePage() {
  >return CalendarPage.class;
  >}
  >
  >protected Class 
 getWebSessionClass() {
  >return RoomBookingSession.class;
  >}
  >
  >protected Class getSignInPageClass() {
  >return BookingSignInPage.class;
  >}
  >
  > }
  >
  > RoomBookingSession.java
  > public class RoomBookingSession extends AuthenticatedWebSession {
  >
  >public RoomBookingSession(Request request) {
  >super(request);
  >}
  >
  >public boolean authenticate(String user, String pass) {
  >return (user.equals("test") && pass.equals("test"));
  >}
  >
  >public Roles getRoles() {
  >if (isSignedIn())
  >return new Roles(Roles.ADMIN);
  >return null;
  >}
  > }
  >
  > CalendarPage.java
  > public class CalendarPage extends WebPage {
  >public CalendarPage() {
  >add(new Label("helloWorld","itsworking"));
  >}
  > }
  >
  > @AuthorizeInstantiation(Roles.ADMIN)
  > public class AdminPage extends WebPage {
  > }
  > <<
  >
  > if I try to access http://localhost:8080/booking/admin , I am redirect
  > to login page. If I enter the correct login and pass, I am redirect to
  > http://localhost:8080/admin
  >
  >
  > --
  >




 --
  Alan R.

>>>
>>>
>>> --
>>> Albert
>>>
>>> -
>>> 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]
>>
>>
>
>
>
> --
> Albert
>
> -
> 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: Incremental migration from JSP-based applications to Wicket?

2008-11-03 Thread Martin Grigorov
Hi Susan,

I'm in the same situation. With the only difference I have few months
advance.
And I'd say the project works very good for now. Currently some of the
pages are backed by Wicket and the rest are still JSP ones and there is
no difference from a customer point of view. 
None of the Wicket pages does include any JSP chunks. They are made
entirely in the Wicket way. So we don't use AlMaw's solution at all. At
the beginning it was slow but now we started to reuse more and more
components and it's getting faster to migrate the next JSP page.

good luck
martin-g


On Mon, 2008-11-03 at 09:31 -0500, Susan Liebeskind wrote:
> Hi,
> 
> This helpful posting
> 
> http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree
> 
> is often cited as a guide whenever anyone asks about migrating from a 
> JSP-based web application to an equivalent JSP-free Wicket application.  
> 
> But...
> 
> the posting itself is >18 months old and describes work with a 
> pre-release version of 1.3. Wicket 1.3.5 is out as of Oct 2008, with 
> 1.4-M4 just around the corner. I also see that the posting clearly 
> states that this is not a boxed solution, or particularly 
> well-supported, buyer beware and all that.  Fair enough. So it is with 
> low expectations, but with hope for an answer nonetheless :-), that I 
> ask the question
> 
> "is there a newer/better solution available now for supporting JSPs in 
> Wicket 1.3 or the upcoming Wicket 1.4, one which is 
> cleaner/easier/addresses gotchas mentioned here. Or is the technique 
> referenced here still best practice?"
>  
> My guess is that Alistair's technique is still best practice, based on 
> newer postings I see on this list, but I'd like to ask the question 
> outright, just in case I've missed something.
> 
> 
> 
> Some thoughts about migrating a JSP based application to Wicket:
> 
> I know that in the long run, one would choose Wicket so as to be JSP 
> free.  And certainly there are issues with JSP development as we all 
> know.  I would almost say that to some developers,  JSPs are the high 
> fructose corn syrup of the web development world, very sweet (in some 
> ways), but bad for you in the long haul :-)  
> 
> Thing is, going JSP free is a transition if you have a legacy app.  
> There's where you are now, there's where you want to be, and a migration 
> path which involves some period of time where one would need to support 
> both JSP and Wicket pages in the same app.
> 
> In the case of our current project, we have some large Struts 1.x based 
> applications with many JSPs (nearly 900._ Some JSPs are simple, just 
> divs filled in by Ajax components, but other JSPs are complex and use 
> scriptlets, inline javascript, 3rd party and custom tags. There's more 
> work in recoding these JSPS (extracting the HTML template skeleton from 
> the JSPs, recoding the core/3rd party/custom tags from taglibs in Java, 
> replacing our simple use of Tiles 1 for page composition again with 
> Java, refactoring those scriptlets, calling out to a custom 3rd party 
> Ajax toolkit...etc. etc.).
> 
> The point is, we cannot simply stop, migrate the whole app over to 
> Wicket and bring it back up - a gradual migration is necessary, doing 
> JSP migration in bitesize chunks.
> 
> My colleague Rich Allen has been posting various questions to the this 
> list as we evaluate our replacement for Struts, and after looking at 
> Wicket some, I understand why he likes Wicket a lot.  It is a clean 
> division of application from presentation, and for a new development 
> effort, that would be really cool. But we have a large legacy 
> application to support - that's just the way it is.  So a 
> straightforward and incremental migration path from existing JSPs to 
> Wicket is something that would be critical for our team.
> 
> Costs to consider: We have a lot of developers, some experience and some 
> newbies, and we have a large code base.  Replacing JSPs is not an 
> inexpensive proposition, and we need to do it in small pieces, and 
> clearly spell out the approach for our team.  Indeed one argument for 
> choosing something like Spring MVC to replace Struts is that Spring MVC 
> is another MVC framework that, for better or worse (and I know the 
> community on this list would say "for worse" :-) , preserve our 
> investment in JSPs.  
> 
> Again, if this were a new development, starting with a clean slate, the 
> decision inputs are different. But when you have substantial investment 
> in JSPs, a valid question is "do we want to pay the cost of retooling 
> now vs. later or not at all? Can we simply be disciplined in our use of 
> JSPs, but continue to use them nonetheless, because the cost of 
> retooling is too high?"  
> 
> By choosing Wicket, we would be saying "enough with JSPs", but we have 
> to have a cost effective way of incrementally achieving that goal, where 
> cost is measured in how easy it is to retrain our de

Re: Should/Could ServletWebRequest.isAjax be cached?

2008-11-03 Thread Martin Makundi
I tried in deployment mode... no significant difference in the load
distribution.

**
Martin

2008/11/3 James Carman <[EMAIL PROTECTED]>:
> On Mon, Nov 3, 2008 at 12:17 AM, Martin Makundi
> <[EMAIL PROTECTED]> wrote:
>> Can you be more specific about this? In what context should the
>> parsing results be cached?
>>
>
> Are you running in deployment or development mode?  I would try your
> profiling in deployment mode to see how that helps.
>
> -
> 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: PageParameters in wicket 1.2.7 problem

2008-11-03 Thread Martijn Dashorst
IIRC You should pass in the page parameters all the way down to the Wicket page:

super(parameters, "Valideren gegevens")

Martijn

On Mon, Nov 3, 2008 at 8:41 AM, Rik Overvelde <[EMAIL PROTECTED]> wrote:
> Basically, the code that executes is:
>
> public ValidatePage(PageParameters parameters)
> {
>   super("Valideren gegevens");
>
>   String code = parameters.getString("code");
>  If I put a breakpoint right after this, I already get the incorrect
> code. The page that I use extends a page that contains the basic layout/menu
> from the page, but that page does no redirecting either.
>  I'm reading up on the session sharing, but from what I can see that is not
> recommended because of security issues. I didn't think about using cookies
> though, so thanks for that suggestion. That sounds like it would be the best
> solution.
>
> Nino Saturnino Martinez Vazquez Wael wrote:
>>
>> Strange, but as you said you had the idea that it could be a bug. But it
>> still strikes me a bit strange that the page are redirected, and results in
>> an modifified link.. Could you provide a cut out of the code?
>>
>> Otherwise the idea with the servlet should be fine, I think you can enable
>> shared sessions somewhere in tomcat at least... Otherwise you could do it
>> with an encrypted session cookie..
>>
>> Rik Overvelde wrote:
>>>
>>> Hi Nino,
>>>
>>> I don't link to the verification page from inside the application itself.
>>> Instead, the link is send in an email to the user when he changes his email
>>> adress. When they click the link, the page is opened. In a lot of cases the
>>> users are still logged in on the application, meaning that a second tab is
>>> opened. If that is the case, the url changes in the way that I described. If
>>> there is no other tab with the application open when the user clicks the
>>> link, the page works fine (meaning that the page parameters are being read).
>>> Also, when the bug occurs it triggers an error message which tells that the
>>> given code is incorrect, which means that the page parameters are read at
>>> that point as well.
>>>
>>>
>>>
>>> Nino Saturnino Martinez Vazquez Wael wrote:

 Hi Rik

 Im not sure about this, it's been some months(if not years) since i've
 touched 1.2.x.  How are you linking to verification page when logged in, 
 for
 me it looks like you are not using pageparameters at all but instead just
 instantiate the page with an other constructor..

 Rik Overvelde wrote:
>
> Hey everyone,
>
> I'm having a problem with page parameters in wicket 1.2.7 when multiple
> tabs are opened. I'm working on a verification system for email adresses,
> which sends a mail with an url containing a guid to a user. I've mounted 
> the
> page using a queryStringUrlCodingStrategy which results in an address 
> like:
> http://page.com/verificatie?code=0572f18d-a9b1-4b92-bb89-7243b9e35d24.
> When the link is opened while you're already logged in though, wicket
> changes the url while loading in something like this:
> http://page.com/verificatie?code=%5BLjava.lang.String%3B%4087bf0b&wicket:pageMapName=wicket-0
> From what I understand, this is a known issue with wicket 1.2 and is
> solved in wicket 1.3. The application I'm working on however is already
> fairly large and because of time constraints it is impossible right now to
> migrate to 1.3 so I'm looking for a workaround for this.
>
> One thing that I've been thinking about is to have the verification
> link point you to a non wicket servlet, which writes the guid to its
> session, then forwards you to a wicket page that retrieves the guid from 
> the
> other servlets session. Is there a way to get the other servlets session 
> in
> wicket?
>
> If anyone has another suggestions for getting around this problem I'd
> love to hear it.
>
> With regards,
>
> Rik Overvelde
>
>
> -
> 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]
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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



Re: example application for spring wicket hibernate

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael

no need for that unless you want to commit

miro wrote:

whats the username password for svn repositorty  ?

Tomasz Dziurko wrote:
  

Phonebook:
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook .

If you need NetBeans project for it just tell me, I have it somewhere
on the disc

Regards
--
Tomasz Dziurko

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






  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: example application for spring wicket hibernate

2008-11-03 Thread miro

whats the username password for svn repositorty  ?

Tomasz Dziurko wrote:
> 
> Phonebook:
> http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-phonebook .
> 
> If you need NetBeans project for it just tell me, I have it somewhere
> on the disc
> 
> Regards
> -- 
> Tomasz Dziurko
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/example-application-for-spring-wicket-hibernate-tp20293119p20304319.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: PageParameters in wicket 1.2.7 problem

2008-11-03 Thread Rik Overvelde

Basically, the code that executes is:

public ValidatePage(PageParameters parameters)
{
   super("Valideren gegevens");

   String code = parameters.getString("code");
  
If I put a breakpoint right after this, I already get the incorrect 
code. The page that I use extends a page that contains the basic 
layout/menu from the page, but that page does no redirecting either.
  
I'm reading up on the session sharing, but from what I can see that is 
not recommended because of security issues. I didn't think about using 
cookies though, so thanks for that suggestion. That sounds like it would 
be the best solution.


Nino Saturnino Martinez Vazquez Wael wrote:
Strange, but as you said you had the idea that it could be a bug. But 
it still strikes me a bit strange that the page are redirected, and 
results in an modifified link.. Could you provide a cut out of the code?


Otherwise the idea with the servlet should be fine, I think you can 
enable shared sessions somewhere in tomcat at least... Otherwise you 
could do it with an encrypted session cookie..


Rik Overvelde wrote:

Hi Nino,

I don't link to the verification page from inside the application 
itself. Instead, the link is send in an email to the user when he 
changes his email adress. When they click the link, the page is 
opened. In a lot of cases the users are still logged in on the 
application, meaning that a second tab is opened. If that is the 
case, the url changes in the way that I described. If there is no 
other tab with the application open when the user clicks the link, 
the page works fine (meaning that the page parameters are being 
read). Also, when the bug occurs it triggers an error message which 
tells that the given code is incorrect, which means that the page 
parameters are read at that point as well.




Nino Saturnino Martinez Vazquez Wael wrote:

Hi Rik

Im not sure about this, it's been some months(if not years) since 
i've touched 1.2.x.  How are you linking to verification page when 
logged in, for me it looks like you are not using pageparameters at 
all but instead just instantiate the page with an other constructor..


Rik Overvelde wrote:

Hey everyone,

I'm having a problem with page parameters in wicket 1.2.7 when 
multiple tabs are opened. I'm working on a verification system for 
email adresses, which sends a mail with an url containing a guid to 
a user. I've mounted the page using a queryStringUrlCodingStrategy 
which results in an address like: 
http://page.com/verificatie?code=0572f18d-a9b1-4b92-bb89-7243b9e35d24.
When the link is opened while you're already logged in though, 
wicket changes the url while loading in something like this: 
http://page.com/verificatie?code=%5BLjava.lang.String%3B%4087bf0b&wicket:pageMapName=wicket-0 

From what I understand, this is a known issue with wicket 1.2 and 
is solved in wicket 1.3. The application I'm working on however is 
already fairly large and because of time constraints it is 
impossible right now to migrate to 1.3 so I'm looking for a 
workaround for this.


One thing that I've been thinking about is to have the verification 
link point you to a non wicket servlet, which writes the guid to 
its session, then forwards you to a wicket page that retrieves the 
guid from the other servlets session. Is there a way to get the 
other servlets session in wicket?


If anyone has another suggestions for getting around this problem 
I'd love to hear it.


With regards,

Rik Overvelde


-
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]



Incremental migration from JSP-based applications to Wicket?

2008-11-03 Thread Susan Liebeskind

Hi,

This helpful posting

http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree

is often cited as a guide whenever anyone asks about migrating from a 
JSP-based web application to an equivalent JSP-free Wicket application.  


But...

the posting itself is >18 months old and describes work with a 
pre-release version of 1.3. Wicket 1.3.5 is out as of Oct 2008, with 
1.4-M4 just around the corner. I also see that the posting clearly 
states that this is not a boxed solution, or particularly 
well-supported, buyer beware and all that.  Fair enough. So it is with 
low expectations, but with hope for an answer nonetheless :-), that I 
ask the question


"is there a newer/better solution available now for supporting JSPs in 
Wicket 1.3 or the upcoming Wicket 1.4, one which is 
cleaner/easier/addresses gotchas mentioned here. Or is the technique 
referenced here still best practice?"


My guess is that Alistair's technique is still best practice, based on 
newer postings I see on this list, but I'd like to ask the question 
outright, just in case I've missed something.




Some thoughts about migrating a JSP based application to Wicket:

I know that in the long run, one would choose Wicket so as to be JSP 
free.  And certainly there are issues with JSP development as we all 
know.  I would almost say that to some developers,  JSPs are the high 
fructose corn syrup of the web development world, very sweet (in some 
ways), but bad for you in the long haul :-)  

Thing is, going JSP free is a transition if you have a legacy app.  
There's where you are now, there's where you want to be, and a migration 
path which involves some period of time where one would need to support 
both JSP and Wicket pages in the same app.


In the case of our current project, we have some large Struts 1.x based 
applications with many JSPs (nearly 900._ Some JSPs are simple, just 
divs filled in by Ajax components, but other JSPs are complex and use 
scriptlets, inline javascript, 3rd party and custom tags. There's more 
work in recoding these JSPS (extracting the HTML template skeleton from 
the JSPs, recoding the core/3rd party/custom tags from taglibs in Java, 
replacing our simple use of Tiles 1 for page composition again with 
Java, refactoring those scriptlets, calling out to a custom 3rd party 
Ajax toolkit...etc. etc.).


The point is, we cannot simply stop, migrate the whole app over to 
Wicket and bring it back up - a gradual migration is necessary, doing 
JSP migration in bitesize chunks.


My colleague Rich Allen has been posting various questions to the this 
list as we evaluate our replacement for Struts, and after looking at 
Wicket some, I understand why he likes Wicket a lot.  It is a clean 
division of application from presentation, and for a new development 
effort, that would be really cool. But we have a large legacy 
application to support - that's just the way it is.  So a 
straightforward and incremental migration path from existing JSPs to 
Wicket is something that would be critical for our team.


Costs to consider: We have a lot of developers, some experience and some 
newbies, and we have a large code base.  Replacing JSPs is not an 
inexpensive proposition, and we need to do it in small pieces, and 
clearly spell out the approach for our team.  Indeed one argument for 
choosing something like Spring MVC to replace Struts is that Spring MVC 
is another MVC framework that, for better or worse (and I know the 
community on this list would say "for worse" :-) , preserve our 
investment in JSPs.  

Again, if this were a new development, starting with a clean slate, the 
decision inputs are different. But when you have substantial investment 
in JSPs, a valid question is "do we want to pay the cost of retooling 
now vs. later or not at all? Can we simply be disciplined in our use of 
JSPs, but continue to use them nonetheless, because the cost of 
retooling is too high?"  

By choosing Wicket, we would be saying "enough with JSPs", but we have 
to have a cost effective way of incrementally achieving that goal, where 
cost is measured in how easy it is to retrain our developers and to 
migrate in small, manageable pieces.


Any advice/anecdotes are gratefully welcomed.

Thanks in advance.

Susan

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



Re: example application for spring wicket hibernate

2008-11-03 Thread Gwyn Evans
See at 
http://cwiki.apache.org/WICKET/documentation-index.html#DocumentationIndex-Codeasdocumentation

On Sun, Nov 2, 2008 at 7:45 PM, miro <[EMAIL PROTECTED]> wrote:
>
> are there any  examples for spring, wicket and hibernate ?
> --
> View this message in context: 
> http://www.nabble.com/example-application-for-spring-wicket-hibernate-tp20293119p20293119.html
> 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: PageParameters in wicket 1.2.7 problem

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael
Strange, but as you said you had the idea that it could be a bug. But it 
still strikes me a bit strange that the page are redirected, and results 
in an modifified link.. Could you provide a cut out of the code?


Otherwise the idea with the servlet should be fine, I think you can 
enable shared sessions somewhere in tomcat at least... Otherwise you 
could do it with an encrypted session cookie..


Rik Overvelde wrote:

Hi Nino,

I don't link to the verification page from inside the application 
itself. Instead, the link is send in an email to the user when he 
changes his email adress. When they click the link, the page is 
opened. In a lot of cases the users are still logged in on the 
application, meaning that a second tab is opened. If that is the case, 
the url changes in the way that I described. If there is no other tab 
with the application open when the user clicks the link, the page 
works fine (meaning that the page parameters are being read). Also, 
when the bug occurs it triggers an error message which tells that the 
given code is incorrect, which means that the page parameters are read 
at that point as well.




Nino Saturnino Martinez Vazquez Wael wrote:

Hi Rik

Im not sure about this, it's been some months(if not years) since 
i've touched 1.2.x.  How are you linking to verification page when 
logged in, for me it looks like you are not using pageparameters at 
all but instead just instantiate the page with an other constructor..


Rik Overvelde wrote:

Hey everyone,

I'm having a problem with page parameters in wicket 1.2.7 when 
multiple tabs are opened. I'm working on a verification system for 
email adresses, which sends a mail with an url containing a guid to 
a user. I've mounted the page using a queryStringUrlCodingStrategy 
which results in an address like: 
http://page.com/verificatie?code=0572f18d-a9b1-4b92-bb89-7243b9e35d24.
When the link is opened while you're already logged in though, 
wicket changes the url while loading in something like this: 
http://page.com/verificatie?code=%5BLjava.lang.String%3B%4087bf0b&wicket:pageMapName=wicket-0 

From what I understand, this is a known issue with wicket 1.2 and is 
solved in wicket 1.3. The application I'm working on however is 
already fairly large and because of time constraints it is 
impossible right now to migrate to 1.3 so I'm looking for a 
workaround for this.


One thing that I've been thinking about is to have the verification 
link point you to a non wicket servlet, which writes the guid to its 
session, then forwards you to a wicket page that retrieves the guid 
from the other servlets session. Is there a way to get the other 
servlets session in wicket?


If anyone has another suggestions for getting around this problem 
I'd love to hear it.


With regards,

Rik Overvelde


-
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]



--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: Handling exceptions during render

2008-11-03 Thread Erik van Oosten

Yeah, I was afraid it would come to that.
Sorry, you've apparently done some more research already...

Another thing I sometimes do is take the Wicket class and put it in the 
web-project's classpath but with my changes (e.g. remove a final). All 
servlet containers will load earlier from the WEB-INF/classes folder 
then from WEB-INF/lib. Its a huge hack, but it works most of the time.


Regards,
Erik.


aditsu wrote:

Well, I'm specifically talking about unexpected runtime exceptions. I don't
want those to destroy the whole page.
They can kill a component, that's ok, but the rest of the page should work.
And yes I want to "make sure that no exceptions are thrown", except that's
not so simple when you're dealing with a complex site and lots of pages,
components and models. If I missed any exceptions, I want those to be
handled gracefully rather than redirecting to an error page.

renderAll is ONLY called on the page, all other components go through
renderComponentTagBody to call renderNext, and both renderComponentTagBody
and renderNext are final :(
I tried overriding onComponentTagBody and wrapping the super invocation with
try/catch, but then the markup gets broken because it doesn't close tags
(i.e. advance in the markup stream?) after the exception is thrown in a
child component, and I still get an error page :(
renderComponent(MarkupStream) is final too, it seems that all "doors" are
closed and locked...


  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Add AJAX behaviour to embedded custom form component

2008-11-03 Thread Gianni Doe
I've developed a custom form component (FormComponentPanel), a date  
picker, that makes use of 2 fields - a display TextField and a  
HiddenField for the model data. I'm then adding this to the page with  
a span tag:

[dropoff date picker]

Then in the java :
DatePicker  dropoffDatePicker = new DatePicker("dropoffDate", new  
PropertyModel(this, "dropoffDate"),
(new LocalDate()).minusDays(0), (new  
LocalDate()).plusYears(3));


I'm after some advice on the best way to attach an AJAX behaviour to  
the component. If for example I add an AJAX behaviour directly to the  
date picker component then it's attached to the span tag and obviously  
doesn't work. The only way I've found to get around this is to expose  
the date display field with a public getter so I can then attach the  
onchange event.


dropoffDatePicker.getDateDisplayField().add(new  
AjaxFormComponentUpdatingBehavior("onchange") {

@Override
protected void onUpdate(AjaxRequestTarget target) {
..
}
});

Any suggestions for a better way to do this that doesn't involve  
exposing the innards?

-Gianni


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



Re: Handling exceptions during render

2008-11-03 Thread aditsu

Well, I'm specifically talking about unexpected runtime exceptions. I don't
want those to destroy the whole page.
They can kill a component, that's ok, but the rest of the page should work.
And yes I want to "make sure that no exceptions are thrown", except that's
not so simple when you're dealing with a complex site and lots of pages,
components and models. If I missed any exceptions, I want those to be
handled gracefully rather than redirecting to an error page.

renderAll is ONLY called on the page, all other components go through
renderComponentTagBody to call renderNext, and both renderComponentTagBody
and renderNext are final :(
I tried overriding onComponentTagBody and wrapping the super invocation with
try/catch, but then the markup gets broken because it doesn't close tags
(i.e. advance in the markup stream?) after the exception is thrown in a
child component, and I still get an error page :(
renderComponent(MarkupStream) is final too, it seems that all "doors" are
closed and locked...


Erik van Oosten wrote:
> 
> It won't. I think you have to dig deeper into the request rendering.
> 
> Perhaps that overriding MarkupContainer#renderAll on all your Panels 
> that have expected exceptions will help.
> 
> But then again, exceptions are intended for controlling the 
> non-expected. You should not use exceptions for normal page flow. In 
> other words: just make sure that no exceptions are thrown.
> 
> Regards,
> Erik.
> 
> 
> aditsu wrote:
>> Ok, but how would that let me render the rest of the page?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20303184.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Handling exceptions during render

2008-11-03 Thread Alex Objelean

If you return null in onRuntimeException -> the stack trace will be shown.
But if you will return a page instance, the application will redirect you to
this page. For instance:
[CODE]
@Override
  public Page onRuntimeException(final Page page, final RuntimeException
e) {
  //do something
  return new LoginPage();
  }
[/CODE]

The above example will redirect you to the LoginPage if any runtime
exception occures.


aditsu wrote:
> 
> Ok, but how would that let me render the rest of the page?
> 
> 
> Alex Objelean wrote:
>> 
>> There are more threads about this issue... 
>> 
>> In order to catch all runtime exception, you have to override default
>> RequestCycle (newRequestCycle method) in your application class and
>> override onRuntimeException method.
>> 
>> Example:
>> [CODE]
>> @Override
>> public RequestCycle newRequestCycle(final Request request, final Response
>> response) {
>> return new WebRequestCycle(this, (WebRequest) request,  (WebResponse)
>> response) {
>>   @Override
>>   public Page onRuntimeException(final Page page, final
>> RuntimeException e) {
>>   //do something
>>   return null;
>> }
>> }
>> }
>> [/CODE]
>> 
>> 
>> Alex Objelean
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20302777.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Handling exceptions during render

2008-11-03 Thread Erik van Oosten

It won't. I think you have to dig deeper into the request rendering.

Perhaps that overriding MarkupContainer#renderAll on all your Panels 
that have expected exceptions will help.


But then again, exceptions are intended for controlling the 
non-expected. You should not use exceptions for normal page flow. In 
other words: just make sure that no exceptions are thrown.


Regards,
   Erik.


aditsu wrote:

Ok, but how would that let me render the rest of the page?


Alex Objelean wrote:
  
There are more threads about this issue... 


In order to catch all runtime exception, you have to override default
RequestCycle (newRequestCycle method) in your application class and
override onRuntimeException method.

Example:
[CODE]
@Override
public RequestCycle newRequestCycle(final Request request, final Response
response) {
return new WebRequestCycle(this, (WebRequest) request,  (WebResponse)
response) {
  @Override
  public Page onRuntimeException(final Page page, final
RuntimeException e) {
  //do something
  return null;
}
}
}
[/CODE]


Alex Objelean




  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Handling exceptions during render

2008-11-03 Thread Alex Objelean

Sorry for mistake... I've updated the comment


aditsu wrote:
> 
> Thanks, but I can't find any handleRuntimeException method in any class.
> I'm using wicket 1.4-m3.
> Also, if the method is private, then how can I possibly override it?
> 
> 
> Alex Objelean wrote:
>> 
>> There are more threads about this issue... 
>> 
>> In order to catch all runtime exception, you have to override default
>> RequestCycle (newRequestCycle method) in your application class and
>> override > RuntimeException e)> method.
>> 
>> 
>> Alex Objelean
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20302752.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Handling exceptions during render

2008-11-03 Thread aditsu

Thanks, but I can't find any handleRuntimeException method in any class. I'm
using wicket 1.4-m3.
Also, if the method is private, then how can I possibly override it?


Alex Objelean wrote:
> 
> There are more threads about this issue... 
> 
> In order to catch all runtime exception, you have to override default
> RequestCycle (newRequestCycle method) in your application class and
> override  RuntimeException e)> method.
> 
> 
> Alex Objelean
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20302652.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Handling exceptions during render

2008-11-03 Thread aditsu

Ok, but how would that let me render the rest of the page?


Alex Objelean wrote:
> 
> There are more threads about this issue... 
> 
> In order to catch all runtime exception, you have to override default
> RequestCycle (newRequestCycle method) in your application class and
> override onRuntimeException method.
> 
> Example:
> [CODE]
> @Override
> public RequestCycle newRequestCycle(final Request request, final Response
> response) {
> return new WebRequestCycle(this, (WebRequest) request,  (WebResponse)
> response) {
>   @Override
>   public Page onRuntimeException(final Page page, final
> RuntimeException e) {
>   //do something
>   return null;
> }
> }
> }
> [/CODE]
> 
> 
> Alex Objelean
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20302703.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: PageParameters in wicket 1.2.7 problem

2008-11-03 Thread Rik Overvelde

Hi Nino,

I don't link to the verification page from inside the application 
itself. Instead, the link is send in an email to the user when he 
changes his email adress. When they click the link, the page is opened. 
In a lot of cases the users are still logged in on the application, 
meaning that a second tab is opened. If that is the case, the url 
changes in the way that I described. If there is no other tab with the 
application open when the user clicks the link, the page works fine 
(meaning that the page parameters are being read). Also, when the bug 
occurs it triggers an error message which tells that the given code is 
incorrect, which means that the page parameters are read at that point 
as well.




Nino Saturnino Martinez Vazquez Wael wrote:

Hi Rik

Im not sure about this, it's been some months(if not years) since i've 
touched 1.2.x.  How are you linking to verification page when logged 
in, for me it looks like you are not using pageparameters at all but 
instead just instantiate the page with an other constructor..


Rik Overvelde wrote:

Hey everyone,

I'm having a problem with page parameters in wicket 1.2.7 when 
multiple tabs are opened. I'm working on a verification system for 
email adresses, which sends a mail with an url containing a guid to a 
user. I've mounted the page using a queryStringUrlCodingStrategy 
which results in an address like: 
http://page.com/verificatie?code=0572f18d-a9b1-4b92-bb89-7243b9e35d24.
When the link is opened while you're already logged in though, wicket 
changes the url while loading in something like this: 
http://page.com/verificatie?code=%5BLjava.lang.String%3B%4087bf0b&wicket:pageMapName=wicket-0 

From what I understand, this is a known issue with wicket 1.2 and is 
solved in wicket 1.3. The application I'm working on however is 
already fairly large and because of time constraints it is impossible 
right now to migrate to 1.3 so I'm looking for a workaround for this.


One thing that I've been thinking about is to have the verification 
link point you to a non wicket servlet, which writes the guid to its 
session, then forwards you to a wicket page that retrieves the guid 
from the other servlets session. Is there a way to get the other 
servlets session in wicket?


If anyone has another suggestions for getting around this problem I'd 
love to hear it.


With regards,

Rik Overvelde


-
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: Handling exceptions during render

2008-11-03 Thread Alex Objelean

There are more threads about this issue... 

In order to catch all runtime exception, you have to override default
RequestCycle (newRequestCycle method) in your application class and override
 method.


Alex Objelean


aditsu wrote:
> 
> Hi, how can I catch any exception thrown while a component is rendering,
> and either hide the component or show an error message, but allow the rest
> of the page to render?
> Modifying or replacing each such component is not an option, I need a
> general way to handle exceptions while rendering any unknown component or
> child component. Such as a getObject method from a model throwing a
> runtime exception.
> 
> Adrian
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20302542.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Testing + IFrame

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael

Argh really bad example, heres a better one:

tester.getComponent("basepath").getIframe().addvisitor or something?

And then visitor would have to sort out if the component probed were a 
form etc?


Nino Saturnino Martinez Vazquez Wael wrote:

So in pseudo code you would:

tester.getForm.add(IVisitorImplementation) ???


Timo Rantalaiho wrote:

On Fri, 31 Oct 2008, Bert van Heukelom wrote:
 

I want to test an ajax upload component that uses an IFrame. I have
difficulties when trying to access Components via their path that are
contained in the IFrame. I manage to a reference of the Iframe but 
can not

find a path-string that accesses a component (namly a form) within the
Iframe.



Try doing wicketTester.debugComponentTrees() (or debugging the exact 
hierarchy by yourself).


 

FormTester f =
wicketTester.newFormTester("path:to:my:iframe:and:to:its:inner:form");



Long component paths like this are a bit problematic anyway.
You could try digging your Form up with a visitor to make it
less dependent on the path.

Best wishes,
Timo

  




--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: Testing + IFrame

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael

So in pseudo code you would:

tester.getForm.add(IVisitorImplementation) ???


Timo Rantalaiho wrote:

On Fri, 31 Oct 2008, Bert van Heukelom wrote:
  

I want to test an ajax upload component that uses an IFrame. I have
difficulties when trying to access Components via their path that are
contained in the IFrame. I manage to a reference of the Iframe but can not
find a path-string that accesses a component (namly a form) within the
Iframe.



Try doing wicketTester.debugComponentTrees() (or debugging 
the exact hierarchy by yourself).


  

FormTester f =
wicketTester.newFormTester("path:to:my:iframe:and:to:its:inner:form");



Long component paths like this are a bit problematic anyway.
You could try digging your Form up with a visitor to make it
less dependent on the path.

Best wishes,
Timo

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: PageParameters in wicket 1.2.7 problem

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael

Hi Rik

Im not sure about this, it's been some months(if not years) since i've 
touched 1.2.x.  How are you linking to verification page when logged in, 
for me it looks like you are not using pageparameters at all but instead 
just instantiate the page with an other constructor..


Rik Overvelde wrote:

Hey everyone,

I'm having a problem with page parameters in wicket 1.2.7 when 
multiple tabs are opened. I'm working on a verification system for 
email adresses, which sends a mail with an url containing a guid to a 
user. I've mounted the page using a queryStringUrlCodingStrategy which 
results in an address like: 
http://page.com/verificatie?code=0572f18d-a9b1-4b92-bb89-7243b9e35d24.
When the link is opened while you're already logged in though, wicket 
changes the url while loading in something like this: 
http://page.com/verificatie?code=%5BLjava.lang.String%3B%4087bf0b&wicket:pageMapName=wicket-0 

From what I understand, this is a known issue with wicket 1.2 and is 
solved in wicket 1.3. The application I'm working on however is 
already fairly large and because of time constraints it is impossible 
right now to migrate to 1.3 so I'm looking for a workaround for this.


One thing that I've been thinking about is to have the verification 
link point you to a non wicket servlet, which writes the guid to its 
session, then forwards you to a wicket page that retrieves the guid 
from the other servlets session. Is there a way to get the other 
servlets session in wicket?


If anyone has another suggestions for getting around this problem I'd 
love to hear it.


With regards,

Rik Overvelde


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



--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



PageParameters in wicket 1.2.7 problem

2008-11-03 Thread Rik Overvelde

Hey everyone,

I'm having a problem with page parameters in wicket 1.2.7 when multiple 
tabs are opened. I'm working on a verification system for email 
adresses, which sends a mail with an url containing a guid to a user. 
I've mounted the page using a queryStringUrlCodingStrategy which results 
in an address like: 
http://page.com/verificatie?code=0572f18d-a9b1-4b92-bb89-7243b9e35d24.
When the link is opened while you're already logged in though, wicket 
changes the url while loading in something like this: 
http://page.com/verificatie?code=%5BLjava.lang.String%3B%4087bf0b&wicket:pageMapName=wicket-0 

From what I understand, this is a known issue with wicket 1.2 and is 
solved in wicket 1.3. The application I'm working on however is already 
fairly large and because of time constraints it is impossible right now 
to migrate to 1.3 so I'm looking for a workaround for this.


One thing that I've been thinking about is to have the verification link 
point you to a non wicket servlet, which writes the guid to its session, 
then forwards you to a wicket page that retrieves the guid from the 
other servlets session. Is there a way to get the other servlets session 
in wicket?


If anyone has another suggestions for getting around this problem I'd 
love to hear it.


With regards,

Rik Overvelde


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



Handling exceptions during render

2008-11-03 Thread aditsu

Hi, how can I catch any exception thrown while a component is rendering, and
either hide the component or show an error message, but allow the rest of
the page to render?
Modifying or replacing each such component is not an option, I need a
general way to handle exceptions while rendering any unknown component or
child component. Such as a getObject method from a model throwing a runtime
exception.

Adrian
-- 
View this message in context: 
http://www.nabble.com/Handling-exceptions-during-render-tp20301737p20301737.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wicket 1.4-m3, wicket-auth-roles and Context Path

2008-11-03 Thread Alan Romaniusc
More about the problem.

This problem does not happen with jetty.

This problem happens with tomcat (6.0.16, 6.0.18) when you have a
index.jsp file and it is mapped in web.xml (welcome-file-list)
(netbeans default web project).

I will try to investigate more before open a bug...




On Fri, Oct 31, 2008 at 4:38 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> open a bug and provide a quickstart
>
> -igor
>
> On Fri, Oct 31, 2008 at 11:31 AM, Alan Romaniusc <[EMAIL PROTECTED]> wrote:
>> Another question
>>
>> I can not find any bug reporting about it. Should I try to open a bug
>> or 1.5 will have this fixed anyway?
>>
>> On 10/31/08, Alan Romaniusc <[EMAIL PROTECTED]> wrote:
>>> I found the problem!! No, I didn't, but I found the wrokaround.
>>>
>>>  The problem happens with you configure the filter to use url-pattern = 
>>> "/*".
>>>  If you change to something else, like "/x/*" the redirect will work as 
>>> expected!
>>>
>>>  just a reference...
>>>
>>>
>>>
>>>
>>>
>>>
>>>  On Thu, Oct 30, 2008 at 1:50 PM, Alan Romaniusc <[EMAIL PROTECTED]> wrote:
>>>  > I mm trying to test the dumbest example of wicket auth roles, using
>>>  > examples in 1.4 m3 zip, and just extends pages that can be found
>>>  > there.
>>>  >
>>>  > Everytime that I log in, I was expected to be redirected from login to
>>>  > page that I tried to access, but I am being redirected to the "correct
>>>  > page", but without the context path, resulting in a page not found.
>>>  >
>>>  > Could it be a bug?
>>>  >
>>>  >
>>>  > Dumb Code:
>>>  >>>
>>>  > RoomBookingApplication.java
>>>  > public class RoomBookingApplication extends AuthenticatedWebApplication {
>>>  >
>>>  >protected void init() {
>>>  >super.init();
>>>  >mountBookmarkablePage("admin", AdminPage.class);
>>>  >}
>>>  >
>>>  >public Class getHomePage() {
>>>  >return CalendarPage.class;
>>>  >}
>>>  >
>>>  >protected Class 
>>> getWebSessionClass() {
>>>  >return RoomBookingSession.class;
>>>  >}
>>>  >
>>>  >protected Class getSignInPageClass() {
>>>  >return BookingSignInPage.class;
>>>  >}
>>>  >
>>>  > }
>>>  >
>>>  > RoomBookingSession.java
>>>  > public class RoomBookingSession extends AuthenticatedWebSession {
>>>  >
>>>  >public RoomBookingSession(Request request) {
>>>  >super(request);
>>>  >}
>>>  >
>>>  >public boolean authenticate(String user, String pass) {
>>>  >return (user.equals("test") && pass.equals("test"));
>>>  >}
>>>  >
>>>  >public Roles getRoles() {
>>>  >if (isSignedIn())
>>>  >return new Roles(Roles.ADMIN);
>>>  >return null;
>>>  >}
>>>  > }
>>>  >
>>>  > CalendarPage.java
>>>  > public class CalendarPage extends WebPage {
>>>  >public CalendarPage() {
>>>  >add(new Label("helloWorld","itsworking"));
>>>  >}
>>>  > }
>>>  >
>>>  > @AuthorizeInstantiation(Roles.ADMIN)
>>>  > public class AdminPage extends WebPage {
>>>  > }
>>>  > <<
>>>  >
>>>  > if I try to access http://localhost:8080/booking/admin , I am redirect
>>>  > to login page. If I enter the correct login and pass, I am redirect to
>>>  > http://localhost:8080/admin
>>>  >
>>>  >
>>>  > --
>>>  >
>>>
>>>
>>>
>>>
>>> --
>>>  Alan R.
>>>
>>
>>
>> --
>> Albert
>>
>> -
>> 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]
>
>



-- 
Albert

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



Re: Repeater with checkbox

2008-11-03 Thread Hannes Schubert

Jurrie,

this goes very well. I use check boxes in repeaters for the same reason. 
Just have a look at the following snippets.



   dynamicContents.add(listView = new DataView("whatever", 
getDataProvider(), 15)

   {
   @Override
   protected void populateItem(Item listItem) {
   final Whatever whatever = 
(Whatever)listItem.getModelObject();


   //log.debug("populateItem() 
whatever="+whatever.getControlnumber()+" => 
"+selection.contains(whatever.getId()));
   final SelectionModel selectionModel = new 
SelectionModel(whatever, selection.contains(whatever.getId()));
   final CheckBox checkBox = new AjaxCheckBox("selected", 
selectionModel) {

   @Override
   public void onUpdate(AjaxRequestTarget target) {
   Boolean selected = selectionModel.getObject();
   Long id = selectionModel.getSelection().getId();
   if (selected)
   selection.add(id);
   else
   selection.remove(id);
  
   log.debug("selected.onUpdate: "+selected+" for 
id="+id);

   }
   };
   checkBox.setOutputMarkupId(true);
   checkBox.setVisible(selectionEnabled);
  
   selectionBoxes.put(selectionModel, checkBox);
  
   listItem.add(checkBox);   
  
   listItem.add(new Label("dmcControlnumber", new 
PropertyModel(whatever, "controlnumber")));

...

This requires a simple class what simply reflects the selection state of 
the selected/unselected rows collected in a map. It is a bit tricky if 
you start up with some rows already selected and dataproviders 
supporting lazy loads . Then you might have to setup the selection 
models on creation only for visible rows and merge afterwards.


Best regards
Hannes

Jurrie Overgoor wrote:

Hello everyone,

I'm currently creating a Wicket application, and for this I need a 
repeater that lets the user select multiple rows from a list of items. 
So basically a repeater that adds a checkbox in front of every item. 
Is this component available? I remember seeing this somewhere, but I 
forgot where, and I can't seem to find it again.




-
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: DropDownChoices where Model is different from Data

2008-11-03 Thread jensiator

Tanks Nino. Just checking if I was out in the blue. I'll try to do something
with my chained model. 
Jens


Nino.Martinez wrote:
> 
> Hi
> 
> since it's java development, the only limit are your mind (now all your 
> ruby guys dont hit me).. As you write yourself just create a 
> choicerenderer, then choicerenderer itself can decide howto display data..
> 
> And yes if you chain stuff and implement your own model etc you can do 
> it all your own way..
> 
> jensiator wrote:
>> Hi. 
>> I have a form model containing a idKey that is supposed to be selected
>> from
>> a dropdownchoice. Does anyone know if its possible have a complex data
>> type
>> in the dropdownchoice when the model is only a idKey? The dropdownchoice
>> wants to set the complex data type in the form model. 
>> For example in a dropdownconstructor:
>> public MyDropDown(String pId,PropertyModel pModel){
>> super(pId,new LoadableDetachableModel(){
>>
>>protected List load() 
>>{
>>return requestClasses();
>>}
>>
>> })
>> setChoiceRenderer(new ChoiceRenderer("displayName", "idKey"));
>>
>> would It be possible to link the pModel in another model (SpecialModel)
>> to
>> accomplish this? Like: setModel(new SpecialModel(pModel));
>>
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoices-where-Model-is-different-from-Data-tp20300450p20301347.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Should/Could ServletWebRequest.isAjax be cached?

2008-11-03 Thread James Carman
On Mon, Nov 3, 2008 at 12:17 AM, Martin Makundi
<[EMAIL PROTECTED]> wrote:
> Can you be more specific about this? In what context should the
> parsing results be cached?
>

Are you running in deployment or development mode?  I would try your
profiling in deployment mode to see how that helps.

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



Repeater with checkbox

2008-11-03 Thread Jurrie Overgoor

Hello everyone,

I'm currently creating a Wicket application, and for this I need a 
repeater that lets the user select multiple rows from a list of items. 
So basically a repeater that adds a checkbox in front of every item. Is 
this component available? I remember seeing this somewhere, but I forgot 
where, and I can't seem to find it again.


--
With kind regards,
Jurrie Overgoor
2go-mobile b.v.


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

Re: Browser file download complete callback

2008-11-03 Thread Erik van Oosten
Not sure about the close method, but you could always wrap the 
outputstream and count the number of streamed bytes.


Regards,
   Erik.


bjolletz wrote:

Is it at all possible to get a callback when a user is
finished downloading the bytearray?
  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: DropDownChoices where Model is different from Data

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael

Hi

since it's java development, the only limit are your mind (now all your 
ruby guys dont hit me).. As you write yourself just create a 
choicerenderer, then choicerenderer itself can decide howto display data..


And yes if you chain stuff and implement your own model etc you can do 
it all your own way..


jensiator wrote:
Hi. 
I have a form model containing a idKey that is supposed to be selected from

a dropdownchoice. Does anyone know if its possible have a complex data type
in the dropdownchoice when the model is only a idKey? The dropdownchoice
wants to set the complex data type in the form model. 
For example in a dropdownconstructor:

public MyDropDown(String pId,PropertyModel pModel){
super(pId,new LoadableDetachableModel(){

   protected List load() 
   {

   return requestClasses();
   }

})
setChoiceRenderer(new ChoiceRenderer("displayName", "idKey"));

would It be possible to link the pModel in another model (SpecialModel) to
accomplish this? Like: setModel(new SpecialModel(pModel));

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: Redirect from an AjaxSelfUpdatingTimerBehavior

2008-11-03 Thread Adriano dos Santos Fernandes

Done: https://issues.apache.org/jira/browse/WICKET-1911


Adriano


Igor Vaynberg escreveu:

yes

-igor

On Sat, Nov 1, 2008 at 11:25 AM, Adriano dos Santos Fernandes
<[EMAIL PROTECTED]> wrote:
  

Yes. Do you want a quickstart demonstrating the problem?




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



DropDownChoices where Model is different from Data

2008-11-03 Thread jensiator

Hi. 
I have a form model containing a idKey that is supposed to be selected from
a dropdownchoice. Does anyone know if its possible have a complex data type
in the dropdownchoice when the model is only a idKey? The dropdownchoice
wants to set the complex data type in the form model. 
For example in a dropdownconstructor:
public MyDropDown(String pId,PropertyModel pModel){
super(pId,new LoadableDetachableModel(){

   protected List load() 
   {
   return requestClasses();
   }

})
setChoiceRenderer(new ChoiceRenderer("displayName", "idKey"));

would It be possible to link the pModel in another model (SpecialModel) to
accomplish this? Like: setModel(new SpecialModel(pModel));

-- 
View this message in context: 
http://www.nabble.com/DropDownChoices-where-Model-is-different-from-Data-tp20300450p20300450.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Browser file download complete callback

2008-11-03 Thread bjolletz

Hi!

I would like to have a download link through which a user can download some
bytearray from my database. So far no problem, I accomplish this by creating
a new WebResource and implementing the getResourceStream method.

My problem is that I would like to be notified when the user is finished
downloading so that I can mark the downloaded item as downloaded in my
database. I'm using an AbstractResourceStream and I thought I would be able
to do this by overriding the close() method. However, the close method of
the AbstractResourceStream never seems to be called.

The implementation of the getResourceStream() method of my WebResource
object:

public IResourceStream getResourceStream() {
return new AbstractResourceStream() {
ByteArrayInputStream bais;
public InputStream getInputStream() throws
ResourceStreamNotFoundException {
bais = getByteArrayInputStreamFromDB();
return bais; 
}

public void close() throws IOException {
bais.close();
markByteArrayAsDownloadedInDB();
}
};
}


Why is it that the close() method is never called? Is there a better/other
way to do it? Is it at all possible to get a callback when a user is
finished downloading the bytearray?

Thanks in advance!

/Daniel
-- 
View this message in context: 
http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20300290.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: JavaScript Framework Dependencies / Wicket Stuff commit access

2008-11-03 Thread Nino Saturnino Martinez Vazquez Wael
Yup, just give an project name and I can setup jira and teamcity if you 
want?


Igor Vaynberg wrote:

you have svn. nino can set you up with the rest soon.

-igor

On Sun, Nov 2, 2008 at 1:33 PM, Uwe Schäfer <[EMAIL PROTECTED]> wrote:
  

Igor Vaynberg schrieb:



i´m just wondering why there isn´t a project like
org.wicketstuff.javascript.mootools/jquery/extjs/whatever


why? because you havent built it yet. wicketstuff is open for
participation, feel free.
  

the answer i was hoping for ;)

i´d like to ask for permission to commit org.wicketstuff.js.mootools project
then and maybe some simple behaviours using it afterwards.

sourceforge/teamcity/jira acount: "uweschaefer"

cu uwe

-
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]

  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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



Re: testing borders with WicketTester

2008-11-03 Thread Daniel Lipski

I still dont get it, maybe I miss something but I think that borders also
have everything they need to render them selves. 
When you provide empty body to border it will render itself and you will be
able to test it (the same way you test panel). 
I know that sometimes it will be nesessery to provide some expected body to
border to test it(and then probably you are forced to write some panel/page)
but there are cases when you could test it with some stub, static, hardcoded
body.
I know that now it is possible to test such borders so its not limitation of
WicketTester but it would be conveniently if WicketTester could support
testing borders with some predefined body easiler.
Its not about limitation of WicketTester ,its about providing functionality
to easier test such borders.
What do you think about it ?

I know that it is possible to create a generic panel/page to test borders
but it is also easy to create generic page to work with panels, but despite
this WicketTester provides method to test panels but doesnt provide similar
method to test borders(borders which you could test with some stub body). 


igor.vaynberg wrote:
> 
> self contained in that the page and panel has everything they need to
> render themselves. a border is meant to be embedded in a page or
> panel, not work independently. anyways, its really easy to create a
> generic panel to facilitate the testing of borders.
> 
> -igor
> 
> On Sun, Nov 2, 2008 at 2:57 AM, Daniel Lipski
> <[EMAIL PROTECTED]> wrote:
>>
>> Sorry, but I dont get your point...
>> What do you mean self contained (in terms of Wicket API) ?
>>
>> Im sure there is a lot of user created border components which contain a
>> lot
>> of surrounding markup and components and it is very desireble(at least
>> for
>> me :)) to be able to 'unit' test such components with Wicket tester,
>> regardles (i.e with empty) to border body.
>> Does method Im looking for was not provided because of technical problems
>> ?
>> If so what is the simplest way to test border components (surrounding
>> markup
>> and components) with i.e empty body ?
>>
>> Regards
>> Daniel Lipski
>>
>>
>> igor.vaynberg wrote:
>>>
>>> borders are not meant to be self-contained like panels. they are meant
>>> to be used within something that contains markup, eg page or panel.
>>>
>>> -igor
>>>
>>> On Fri, Oct 31, 2008 at 8:14 AM, dlipski <[EMAIL PROTECTED]>
>>> wrote:

 Hi

 Is it possible (if not why?) to test Border components in a way similar
 to
 testing Panels ?  -WicketTester.startPanel(TestPanelSource) ? Its
 strange
 but I cant find corresponding method for Borders.

 Thanks in advance.

 Daniel Lipski
 --
 View this message in context:
 http://www.nabble.com/testing-borders-with-WicketTester-tp20268028p20268028.html
 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]
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/testing-borders-with-WicketTester-tp20268028p20288374.html
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/testing-borders-with-WicketTester-tp20268028p20298543.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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