Re: [Wicket-user] What about Wicket Javascript and Browser errors?

2006-03-16 Thread Ayodeji Aladejebi
well IE6 on Windows 2003 running tomcat 5.5.9
On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] wrote:

what browser/version do you use?
-Igor
On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED]
 wrote: 


i get your point right igor but my headache is is even more of the fact that i always get this 
Error : Object Expected 
from browser _javascript_ console even when i reused the example source letter for letter. This is error is common not just with AJAX but also with most other wicket extensions that use _javascript_s




On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] 
 wrote: 

you cannot add a new component via an ajax call because wicket will not know where to put its markup. via ajax you can only replace components that have been previously renderered.so in your case if you wanted to replace the Label you would do something like this 

final Label label;
add(label=new Label(a, A));
label.setOutputMarkupId (true); === this is important if you want to rerender this component via ajax

add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B);


 label.getparent().replace(b);
 ajaxRequestTarget.addComponent (label); }});
-Igor

On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent
 (b); }});
is there some configuration i am not putting in place?


Re: [Wicket-user] Overriding onRender() for BookmarkablePageLink

2006-03-16 Thread Gili


	Playing devil's advocate here: so what's the point/benefit of 
preventing a call to setEnabled() if one can override isEnabled and 
modify the hierarchy beyind Wicket's back anyway?


	I personally prefer explicit calls to setEnabled() from onRender() than 
subclassing because it allows me to know upfront exactly where its value 
is being changed (plus you don't have to recalculate the value if it 
hasn't been changed).


Gili

Eelco Hillenius wrote:

Just override isEnabled. That's why it's not final.

Eelco


On 3/15/06, David Leangen [EMAIL PROTECTED] wrote:

This approach used to work for me under 1.1, but no longer in 1.2.

I have a BookmarkablePageLink that I want to disable when its target is
a subclass of a given page.

I used to do something like this:

  protected void onRender( final MarkupStream markupStream )
  {
  setEnabled( ! m_parentClass.isAssignableFrom(
   getPage().getClass() ) );
  super.onRender( markupStream );
  }


But this now throws an exception:

wicket.WicketRuntimeException: Cannot modify component hierarchy during
render phase
 at wicket.Page.checkHierarchyChange(Page.java:1001)
 at wicket.Page.componentStateChanging(Page.java:934)
 at wicket.Component.addStateChange(Component.java:2118)
 at wicket.Component.setEnabled(Component.java:1732)

...


How should I go about creating the same effect? Where should I set the link's 
enabled value based on the above criterion?


Thanks!
Dave





---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=kkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
http://www.desktopbeautifier.com/


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Overriding onRender() for BookmarkablePageLink

2006-03-16 Thread Johan Compagner
you can use setEnabled just fine.But not in the render phase. That should be done in the onclick or something like that.johanOn 3/16/06, Gili
 [EMAIL PROTECTED] wrote:
Playing devil's advocate here: so what's the point/benefit ofpreventing a call to setEnabled() if one can override isEnabled andmodify the hierarchy beyind Wicket's back anyway?I personally prefer explicit calls to setEnabled() from onRender() than
subclassing because it allows me to know upfront exactly where its valueis being changed (plus you don't have to recalculate the value if ithasn't been changed).GiliEelco Hillenius wrote: Just override isEnabled. That's why it's not final.
 Eelco On 3/15/06, David Leangen [EMAIL PROTECTED] wrote: This approach used to work for me under 1.1, but no longer in 
1.2. I have a BookmarkablePageLink that I want to disable when its target is a subclass of a given page. I used to do something like this: protected void onRender( final MarkupStream markupStream )
 { setEnabled( ! m_parentClass.isAssignableFrom(getPage().getClass() ) ); super.onRender( markupStream ); }
 But this now throws an exception: wicket.WicketRuntimeException: Cannot modify component hierarchy during render phaseat wicket.Page.checkHierarchyChange
(Page.java:1001)at wicket.Page.componentStateChanging(Page.java:934)at wicket.Component.addStateChange(Component.java:2118)at wicket.Component.setEnabled(Component.java
:1732) ... How should I go about creating the same effect? Where should I set the link's enabled value based on the above criterion? Thanks!
 Dave --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! 
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ Wicket-user mailing list 
Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmd=kkid0944bid$1720dat1642 ___
 Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
--http://www.desktopbeautifier.com/---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Wicket Tree Usage

2006-03-16 Thread Ayodeji Aladejebi
Please can does any one have sample on how to make use to the Wicket Tree 


add(new Tree(tree, new DefaultTreeModel(rootTreeNode)){ public Image getJunctionImage(DefaultMutableTreeNode node){ return new Image(Tree.JUNCTION_IMAGE_NAME
, Knob.gif); } public Image getNodeImage(DefaultMutableTreeNode node){ return new Image(Tree.NODE_IMAGE_NAME, Knob.gif); } }
 );
in HTML 
span wicket:id=tree/span

but i get Unable to find package resource [path = wicket/markup/html/tree/com/health/Knob.gif

Alright where should i position my image and what should i return in those two methods...thanks

-- 


[Wicket-user] link behaviour for area tag.

2006-03-16 Thread karthik Guru
I have the following html tag in my template and I need link like behaviour. wicket Link doesn't check for 'area' tag. So s'd i just have a simple WebmarkupContainer that adds the href attribute like wicket link and use that instead?
 map name=mymap  area alt=hello coords=72,2,280,250 href="" wicket:id=areatag1 shape=RECT/
thanks, -- karthik -- 


Re: [Wicket-user] Wicket Tree Usage

2006-03-16 Thread Ingram Chen
try this:PackageResourceReference ref = new PackageResourceReference(MyPage.class, Knob.gif) ;return new Image(Tree.JUNCTION_IMAGE_NAME, ref) ;Knob.gif and MyPage.class should place at the same directory .
 On 3/16/06, Ayodeji Aladejebi [EMAIL PROTECTED] wrote:
Please can does any one have sample on how to make use to the Wicket Tree 


add(new Tree(tree, new DefaultTreeModel(rootTreeNode)){ public Image getJunctionImage(DefaultMutableTreeNode node){ return new Image(Tree.JUNCTION_IMAGE_NAME

, Knob.gif); } public Image getNodeImage(DefaultMutableTreeNode node){ return new Image(Tree.NODE_IMAGE_NAME, Knob.gif); } }
 );
in HTML 
span wicket:id=tree/span

but i get Unable to find package resource [path = wicket/markup/html/tree/com/health/Knob.gif

Alright where should i position my image and what should i return in those two methods...thanks

-- 

-- Ingram ChenJava [EMAIL PROTECTED]Institue of BioMedical Sciences Academia Sinica Taiwanblog: 
http://www.javaworld.com.tw/roller/page/ingramchen


Re: [Wicket-user] Overriding onRender() for BookmarkablePageLink

2006-03-16 Thread Eelco Hillenius
 Playing devil's advocate here: so what's the point/benefit of
 preventing a call to setEnabled() if one can override isEnabled and
 modify the hierarchy beyind Wicket's back anyway?


That setEnabled method records a change and is thus useful for a
visibility flag that has to roll back with back button clicks. For
instance, when you have a user action (e.g. a button) for enabling/
disabling the visibility of the component. But when you calculate
whether a component should be displayed or not, it might actually be a
better idea to override getEnabled, as that will guarantee the
behavior based on the current application state and will thus not be
stale.

From an API point of view, this one is less tight, and we discussed a
couple of times whether we should make getEnabled final or not. We
concluded that having that method overridable is just too useful, so
we didn't make it final.

On 3/16/06, Gili [EMAIL PROTECTED] wrote:


 I personally prefer explicit calls to setEnabled() from onRender() 
 than
 subclassing because it allows me to know upfront exactly where its value
 is being changed (plus you don't have to recalculate the value if it
 hasn't been changed).

You can still achieve te same by overriding onBeginRequest. We are
still discussing whether that method shouldn't be called onBeginRender
btw.

Eelco


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] link behaviour for area tag.

2006-03-16 Thread Eelco Hillenius
Did you check out wicket.markup.html.link.ImageMap? If I understand
you correctly, that's the component you are looking for.

Eelco

On 3/16/06, karthik Guru [EMAIL PROTECTED] wrote:
 I have the following html tag in my template and I need link like behaviour.
 wicket Link doesn't check for 'area' tag. So s'd i just have a simple
 WebmarkupContainer that adds the href attribute like wicket link and use
 that instead?

   map name=mymap
   area alt=hello coords=72,2,280,250 href=
 wicket:id=areatag1 shape=RECT/

  thanks,
  -- karthik --


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] What about Wicket Javascript and Browser errors?

2006-03-16 Thread Igor Vaynberg
its been tested on IE6 and worked fine. so must be something weird. can you package a distilled example into a quickstart project so i can start it locally and take a look?-Igor
On 3/16/06, Ayodeji Aladejebi [EMAIL PROTECTED] wrote:
well IE6 on Windows 2003 running tomcat 5.5.9
On 3/15/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

what browser/version do you use?
-Igor
On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED]
 wrote: 


i get your point right igor but my headache is is even more of the fact that i always get this 
Error : Object Expected 
from browser _javascript_ console even when i reused the example source letter for letter. This is error is common not just with AJAX but also with most other wicket extensions that use _javascript_s




On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] 
 wrote: 

you cannot add a new component via an ajax call because wicket will not know where to put its markup. via ajax you can only replace components that have been previously renderered.so in your case if you wanted to replace the Label you would do something like this 

final Label label;
add(label=new Label(a, A));
label.setOutputMarkupId (true); === this is important if you want to rerender this component via ajax

add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B);



 label.getparent().replace(b);
 ajaxRequestTarget.addComponent (label); }});
-Igor

On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent

 (b); }});
is there some configuration i am not putting in place?




Re: [Wicket-user] Overriding onRender() for BookmarkablePageLink

2006-03-16 Thread Gili


	Absolutely, I can see why it would be useful to override getEnabled() 
when your state depends on many factors (some of which you cannot hook). 
I can also see the case where setEnabled() is simply easier to use for 
more static or hookable factors. Anyway, good to know.


Gili

Eelco Hillenius wrote:

Playing devil's advocate here: so what's the point/benefit of
preventing a call to setEnabled() if one can override isEnabled and
modify the hierarchy beyind Wicket's back anyway?



That setEnabled method records a change and is thus useful for a
visibility flag that has to roll back with back button clicks. For
instance, when you have a user action (e.g. a button) for enabling/
disabling the visibility of the component. But when you calculate
whether a component should be displayed or not, it might actually be a
better idea to override getEnabled, as that will guarantee the
behavior based on the current application state and will thus not be
stale.


From an API point of view, this one is less tight, and we discussed a

couple of times whether we should make getEnabled final or not. We
concluded that having that method overridable is just too useful, so
we didn't make it final.

On 3/16/06, Gili [EMAIL PROTECTED] wrote:


I personally prefer explicit calls to setEnabled() from onRender() than
subclassing because it allows me to know upfront exactly where its value
is being changed (plus you don't have to recalculate the value if it
hasn't been changed).


You can still achieve te same by overriding onBeginRequest. We are
still discussing whether that method shouldn't be called onBeginRender
btw.

Eelco


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=kkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
http://www.desktopbeautifier.com/


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Wicket Tree Usage

2006-03-16 Thread Ayodeji Aladejebi
great works fine..thanks
On 3/16/06, Ingram Chen [EMAIL PROTECTED] wrote:

try this:PackageResourceReference ref = new PackageResourceReference(MyPage.class, Knob.gif) ;return new Image(Tree.JUNCTION_IMAGE_NAME, ref) ;Knob.gif and MyPage.class
 should place at the same directory . 

On 3/16/06, Ayodeji Aladejebi [EMAIL PROTECTED]
 wrote: 


Please can does any one have sample on how to make use to the Wicket Tree 


add(new Tree(tree, new DefaultTreeModel(rootTreeNode)){ public Image getJunctionImage(DefaultMutableTreeNode node){ return new Image(Tree.JUNCTION_IMAGE_NAME
 , Knob.gif); } public Image getNodeImage(DefaultMutableTreeNode node){ return new Image(Tree.NODE_IMAGE_NAME, Knob.gif); } } 
 );
in HTML 
span wicket:id=tree/span

but i get Unable to find package resource [path = wicket/markup/html/tree/com/health/Knob.gif

Alright where should i position my image and what should i return in those two methods...thanks

-- 
-- Ingram ChenJava [EMAIL PROTECTED]Institue of BioMedical Sciences Academia Sinica Taiwanblog: 
http://www.javaworld.com.tw/roller/page/ingramchen 


Re: [Wicket-user] What about Wicket Javascript and Browser errors?

2006-03-16 Thread Ayodeji Aladejebi
igor,

I work with Netbeans 5.0 bundled with tomcat 5.5.9

so i have uploaded the tinyest netbeans project sample as i copied it code for code in the ajax example
My headache is that most of my applications involving _javascript_ likedojo-contribsworks fine under wicket 1.1.1.

but when i switch development to wicket 1.2 (excluding all 1.1.1 related contribs) i still get the browser problem.

When i deploy the example WAR, the Ajax runs fine but when i deploy my own WAR from Netbeans of my application, the browser gives _javascript_ errors and Even when i use PackageResourceReference 
objectgenerally to reference _javascript_ or image, i dont get that reference item working inside the browser even though wicket never throws any exception.

could it be netbeans?
On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:

its been tested on IE6 and worked fine. so must be something weird. can you package a distilled example into a quickstart project so i can start it locally and take a look?
-Igor

On 3/16/06, Ayodeji Aladejebi [EMAIL PROTECTED]
 wrote: 

well IE6 on Windows 2003 running tomcat 5.5.9

On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] 
 wrote: 

what browser/version do you use?
-Igor
On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


i get your point right igor but my headache is is even more of the fact that i always get this 
Error : Object Expected 
from browser _javascript_ console even when i reused the example source letter for letter. This is error is common not just with AJAX but also with most other wicket extensions that use _javascript_s




On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] 
 wrote: 

you cannot add a new component via an ajax call because wicket will not know where to put its markup. via ajax you can only replace components that have been previously renderered.so in your case if you wanted to replace the Label you would do something like this 

final Label label;
add(label=new Label(a, A));
label.setOutputMarkupId (true); === this is important if you want to rerender this component via ajax

add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B);


 label.getparent().replace(b);
 ajaxRequestTarget.addComponent (label); }});
-Igor

On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent
 (b); }});
is there some configuration i am not putting in place?



testscript.rar
Description: application/rar-compressed


Re: [Wicket-user] What about Wicket Javascript and Browser errors?

2006-03-16 Thread Igor Vaynberg
i dont use netbeans, and the ant build fails, so i cant build a war and check it out. this is why i asked you to reproduce the problem in wicket-quickstart project - so that i can quickly launch it. if you cant do that then maybe someone who uses netbeans can help you.
-IgorOn 3/16/06, Ayodeji Aladejebi [EMAIL PROTECTED] wrote:
igor,

I work with Netbeans 5.0 bundled with tomcat 5.5.9

so i have uploaded the tinyest netbeans project sample as i copied it code for code in the ajax example
My headache is that most of my applications involving _javascript_ likedojo-contribsworks fine under wicket 1.1.1.

but when i switch development to wicket 1.2 (excluding all 1.1.1 related contribs) i still get the browser problem.

When i deploy the example WAR, the Ajax runs fine but when i deploy my own WAR from Netbeans of my application, the browser gives _javascript_ errors and Even when i use PackageResourceReference 
objectgenerally to reference _javascript_ or image, i dont get that reference item working inside the browser even though wicket never throws any exception.

could it be netbeans?
On 3/16/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote:

its been tested on IE6 and worked fine. so must be something weird. can you package a distilled example into a quickstart project so i can start it locally and take a look?
-Igor

On 3/16/06, Ayodeji Aladejebi [EMAIL PROTECTED]
 wrote: 

well IE6 on Windows 2003 running tomcat 5.5.9

On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] 
 wrote: 

what browser/version do you use?
-Igor
On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


i get your point right igor but my headache is is even more of the fact that i always get this 
Error : Object Expected 
from browser _javascript_ console even when i reused the example source letter for letter. This is error is common not just with AJAX but also with most other wicket extensions that use _javascript_s




On 3/15/06, Igor Vaynberg [EMAIL PROTECTED] 
 wrote: 

you cannot add a new component via an ajax call because wicket will not know where to put its markup. via ajax you can only replace components that have been previously renderered.so in your case if you wanted to replace the Label you would do something like this 

final Label label;
add(label=new Label(a, A));
label.setOutputMarkupId (true); === this is important if you want to rerender this component via ajax

add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B);



 label.getparent().replace(b);
 ajaxRequestTarget.addComponent (label); }});
-Igor

On 3/15/06, Ayodeji Aladejebi [EMAIL PROTECTED] 
 wrote: 


Please someone should tell me why i can deploy the Ajax examples in Wicket-examples and it runs fine in tomcatand when i repeat the same approach in my own application, the browser gives me error?
I have been fighting with these _javascript_ problem for some time but no much progress

please please guys what can be wrongisnt it as basic as
add(new Label(a, A));
add(new AjaxLink(link) { public void onClick(AjaxRequestTarget ajaxRequestTarget) { Label b = new Label(a,B); ajaxRequestTarget.addComponent

 (b); }});
is there some configuration i am not putting in place?






[Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Andrew Berman
I have a requirement where I need to parse the URL to extract a username on session creation. For example, http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,Andrew


Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Igor Vaynberg
you can try: ((WebRequest)RequestCycle.get().getRequest()).-IgorOn 3/16/06, Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,
Andrew




Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Andrew Berman
I should've mentioned that I already tried that and when I call RequestCycle.get(), I get a null.On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you can try: ((WebRequest)RequestCycle.get().getRequest()).
-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,

Andrew






Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Andrew Berman
It looks like the RequestCycle is not filled in until RequestCycle cycle = session.newRequestCycle(request, response); in WicketServlet (line 209 for Wicket 1.2 Beta 1)On 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:
I should've mentioned that I already tried that and when I call RequestCycle.get(), I get a null.
On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you can try: ((WebRequest)RequestCycle.get().getRequest()).
-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,


Andrew








[Wicket-user] Javascript error when using AjaxCheckBox - Wicket-1.2-beta1

2006-03-16 Thread Mark Southern








Im getting a _javascript_ error: Error:
Object expected when clicking on a checkbox in a form. The server request
is not sent. 



The java code and rendered html are shown below. I
note that wicket adds a js script to the page and that the path for this doesnt
exist.





Any help would be greatly appreciated.



Thank you.









script language=_javascript_
type=text/_javascript_
src="">



tdinput type=checkbox
wicket:id=checkbox checked=checked
name=rows:4:checkbox
>



final AjaxCheckBox checkBox = new
AjaxCheckBox(checkbox, new
PropertyModel(value,Selected))

 
{

 
 public void onUpdate(AjaxRequestTarget target)

 
 {

 
 System.out.println(Ajax update);

 
 value.setSelected(
! value.getSelected() );

 
 target.addComponent(this);

 
 }

 
};

 
listItem.add(checkBox);








Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Igor Vaynberg
instead of using a session factory try using a request cycle factory and setting the style into the created websession there.-IgorOn 3/16/06, Andrew Berman
 [EMAIL PROTECTED] wrote:
It looks like the RequestCycle is not filled in until RequestCycle cycle = session.newRequestCycle(request, response); in WicketServlet (line 209 for Wicket 1.2 Beta 1)
On 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:

I should've mentioned that I already tried that and when I call RequestCycle.get(), I get a null.
On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you can try: ((WebRequest)RequestCycle.get().getRequest()).
-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,



Andrew










Re: [Wicket-user] Javascript error when using AjaxCheckBox - Wicket-1.2-beta1

2006-03-16 Thread Igor Vaynberg
i think the problem is that you didnt call checkbox.setOutputMarkupId(true) so its markup id never made it into the markup.i made the ajax behavior smarter, it will now call that for you whenever it is attached.
so either do the call yourself, or update to trunk.-IgorOn 3/16/06, 
Mark Southern [EMAIL PROTECTED] wrote:

















I'm getting a _javascript_ error: Error:
Object expected when clicking on a checkbox in a form. The server request
is not sent. 



The java code and rendered html are shown below. I
note that wicket adds a js script to the page and that the path for this doesn't
exist.





Any help would be greatly appreciated.



Thank you.









script language=_javascript_
type=text/_javascript_
src="">



tdinput type=checkbox
wicket:id=checkbox checked=checked
name=rows:4:checkbox
>



final AjaxCheckBox checkBox = new
AjaxCheckBox(checkbox, new
PropertyModel(value,Selected))

 
{

 
 public void onUpdate(AjaxRequestTarget target)

 
 {

 
 System.out.println(Ajax update);

 
 value.setSelected(
! value.getSelected() );

 
 target.addComponent(this);

 
 }

 
};

 
listItem.add(checkBox);











Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Andrew Berman
Cool. Thanks Igor.On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
instead of using a session factory try using a request cycle factory and setting the style into the created websession there.
-IgorOn 3/16/06, Andrew Berman
 [EMAIL PROTECTED] wrote:

It looks like the RequestCycle is not filled in until RequestCycle cycle = session.newRequestCycle(request, response); in WicketServlet (line 209 for Wicket 1.2 Beta 1)
On 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:


I should've mentioned that I already tried that and when I call RequestCycle.get(), I get a null.
On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you can try: ((WebRequest)RequestCycle.get().getRequest()).
-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,




Andrew












Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Igor Vaynberg
let me know if that worked.-IgorOn 3/16/06, Andrew Berman [EMAIL PROTECTED] wrote:
Cool. Thanks Igor.On 3/16/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:

instead of using a session factory try using a request cycle factory and setting the style into the created websession there.
-IgorOn 3/16/06, Andrew Berman
 [EMAIL PROTECTED] wrote:


It looks like the RequestCycle is not filled in until RequestCycle cycle = session.newRequestCycle(request, response); in WicketServlet (line 209 for Wicket 1.2 Beta 1)
On 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:



I should've mentioned that I already tried that and when I call RequestCycle.get(), I get a null.
On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you can try: ((WebRequest)RequestCycle.get().getRequest()).
-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,





Andrew














[Wicket-user] 优惠代开发票!

2006-03-16 Thread 腾达实业有限公司
您好!

腾达实业有限公司因进项较多,每月有部分结余发票可优惠对外代开.

普通发票,运输发票(税率0.8%-1.5%左右).增值发票(税率6%左右),可验证

后付款.

联系电话:13927434328(张先生)


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Resource not found: Enable debug messages?

2006-03-16 Thread Matthias Albert
Could anyone give me a hint how to enable debug messages for 
wicket. package, please?


I found log4j in the dependencies, looked on the website of log4j, tried 
to edit a sample properties file, but without success.


The error message on my console is:

ERROR - RequestCycle   - Markup of type 'html' for component 
'content.MasterPage' not found. Enable debug messages for 
wicket.util.resource.Resource to get a list of all filenames tried:


I am sure this is a matter of one line of the right initialisation 
setting. Any help is welcome.


Thanks
Matthias Albert



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Resource not found: Enable debug messages?

2006-03-16 Thread Igor Vaynberg
the error means that wicket could not find the markup file for your page or panel. make sure it is named propely.as far as logging goes, usually you need to add wicket=debug, stdout == that stdout is the name of the logger defined. see the log4j webpage for details.
-IgorOn 3/16/06, Matthias Albert [EMAIL PROTECTED] wrote:
Could anyone give me a hint how to enable debug messages forwicket. package, please?I found log4j in the dependencies, looked on the website of log4j, triedto edit a sample properties file, but without success.
The error message on my console is:ERROR - RequestCycle - Markup of type 'html' for component'content.MasterPage' not found. Enable debug messages forwicket.util.resource.Resource to get a list of all filenames tried:
I am sure this is a matter of one line of the right initialisationsetting. Any help is welcome.ThanksMatthias Albert---This SF.Net
 email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___
Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user



RE: [Wicket-user] Javascript error when using AjaxCheckBox - Wicket-1.2-beta1

2006-03-16 Thread Mark Southern








Im now using the latest source from
the repository. That doesnt appear to be the answer.



After testing in FireFox and using the
_javascript_ console there I get the error message: WicketAjaxPost is not
defined.



Thanks for the continuing help!











From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Igor Vaynberg
Sent: Thursday, March 16, 2006
3:28 PM
To:
wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user]
_javascript_ error when using AjaxCheckBox - Wicket-1.2-beta1





i think the problem is
that you didnt call checkbox.setOutputMarkupId(true) so its markup id never
made it into the markup.

i made the ajax
behavior smarter, it will now call that for you whenever it is attached.

so either do the call yourself, or update to trunk.

-Igor





On 3/16/06, Mark Southern [EMAIL PROTECTED]
wrote:





I'm getting a _javascript_ error: Error: Object
expected when clicking on a checkbox in a form. The server request is not
sent. 



The java code and rendered html are shown below. I note that
wicket adds a js script to the page and that the path for this doesn't exist.





Any help would be greatly appreciated.



Thank you.









script language=_javascript_ type=text/_javascript_
src="">



tdinput type=checkbox
wicket:id=checkbox checked=checked
name=rows:4:checkbox
>



final AjaxCheckBox checkBox = new
AjaxCheckBox(checkbox, new
PropertyModel(value,Selected))



{



 public void onUpdate(AjaxRequestTarget target)




{



 System.out.println(Ajax update);




value.setSelected( ! value.getSelected() );




target.addComponent(this);




}



};



listItem.add(checkBox);
















Re: [Wicket-user] Resource not found: Enable debug messages?

2006-03-16 Thread Matthias Albert
Thanks, that helped. I changed the wrong file. Now I still have to 
analyse the messages. I moved the html file from the classpath to a 
different folder content and configured that as


WebApplicationPath wpath =
   new  WebApplicationPath( getWicketServlet().getServletContext());
wpath.add(content);

Apparently the HTML pages cannot be found.

Matthias


Igor Vaynberg schrieb:
the error means that wicket could not find the markup file for your page 
or panel. make sure it is named propely.


as far as logging goes, usually you need to add wicket=debug, stdout == 
that stdout is the name of the logger defined. see the log4j webpage for 
details.


-Igor


On 3/16/06, *Matthias Albert* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:

Could anyone give me a hint how to enable debug messages for
wicket. package, please?

I found log4j in the dependencies, looked on the website of log4j, tried
to edit a sample properties file, but without success.

The error message on my console is:

ERROR - RequestCycle   - Markup of type 'html' for component
'content.MasterPage' not found. Enable debug messages for
wicket.util.resource.Resource to get a list of all filenames tried:

I am sure this is a matter of one line of the right initialisation
setting. Any help is welcome.

Thanks
Matthias Albert



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
mailto:Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
https://lists.sourceforge.net/lists/listinfo/wicket-user







---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Javascript error when using AjaxCheckBox - Wicket-1.2-beta1

2006-03-16 Thread Igor Vaynberg
is that verbatim? i dont see anywhere in our code WicketAjaxPost which should in fact be wicketAjaxPost. could you please attach the generated html and the complete output of the debug console.
-IgorOn 3/16/06, Mark Southern [EMAIL PROTECTED] wrote:

















I'm now using the latest source from
the repository. That doesn't appear to be the answer.



After testing in FireFox and using the
_javascript_ console there I get the error message: "WicketAjaxPost is not
defined".



Thanks for the continuing help!











From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of 
Igor Vaynberg
Sent: Thursday, March 16, 2006
3:28 PM
To:
wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user]
_javascript_ error when using AjaxCheckBox - Wicket-1.2-beta1





i think the problem is
that you didnt call checkbox.setOutputMarkupId(true) so its markup id never
made it into the markup.

i made the ajax
behavior smarter, it will now call that for you whenever it is attached.

so either do the call yourself, or update to trunk.

-Igor





On 3/16/06, Mark Southern 
[EMAIL PROTECTED]
wrote:





I'm getting a _javascript_ error: Error: Object
expected when clicking on a checkbox in a form. The server request is not
sent. 



The java code and rendered html are shown below. I note that
wicket adds a js script to the page and that the path for this doesn't exist.





Any help would be greatly appreciated.



Thank you.









script language=_javascript_ type=text/_javascript_
src="">



tdinput type=checkbox
wicket:id=checkbox checked=checked
name=rows:4:checkbox
>



final AjaxCheckBox checkBox = new
AjaxCheckBox(checkbox, new
PropertyModel(value,Selected))



{



 public void onUpdate(AjaxRequestTarget target)




{



 System.out.println(Ajax update);




value.setSelected( ! value.getSelected() );




target.addComponent(this);




}



};



listItem.add(checkBox);


















Re: [Wicket-user] Resource not found: Enable debug messages?

2006-03-16 Thread Johan Compagner
you still have the package structure in the content dir?That is still a requirement or else you have to do the resource loading completely yourselfjohanOn 3/16/06, 
Matthias Albert [EMAIL PROTECTED] wrote:Thanks, that helped. I changed the wrong file. Now I still have to
analyse the messages. I moved the html file from the classpath to adifferent folder content and configured that asWebApplicationPath wpath =newWebApplicationPath( getWicketServlet().getServletContext());
wpath.add(content);Apparently the HTML pages cannot be found.MatthiasIgor Vaynberg schrieb: the error means that wicket could not find the markup file for your page or panel. make sure it is named propely.
 as far as logging goes, usually you need to add wicket=debug, stdout == that stdout is the name of the logger defined. see the log4j webpage for details. -Igor
 On 3/16/06, *Matthias Albert* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Could anyone give me a hint how to enable debug messages for
 wicket. package, please? I found log4j in the dependencies, looked on the website of log4j, tried to edit a sample properties file, but without success. The error message on my console is:
 ERROR - RequestCycle - Markup of type 'html' for component 'content.MasterPage' not found. Enable debug messages for wicket.util.resource.Resource to get a list of all filenames tried:
 I am sure this is a matter of one line of the right initialisation setting. Any help is welcome. Thanks Matthias Albert ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding
 territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___
 Wicket-user mailing list Wicket-user@lists.sourceforge.net mailto:Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user 
https://lists.sourceforge.net/lists/listinfo/wicket-user---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Examples of model decorators

2006-03-16 Thread Frank Silbermann








Are there any examples of model decorators
I could look at? I have a model that
consists of one of several code values, and I would like a label to
automatically display a text string associated with the code value.








[Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
If objects used in a page are stored in a session, how do I access those objects when I redirect to a new page? Say I have public users who login and I want to display their name on pages and keep their user info in-session...on each page, how would I call those values?
Thanks!


Re: [Wicket-user] Resource not found: Enable debug messages?

2006-03-16 Thread Igor Vaynberg
do you call getResourceSettings().getResourceFinder(wpath).add(wpath) ?-IgorOn 3/16/06, Matthias Albert 
[EMAIL PROTECTED] wrote:Thanks, that helped. I changed the wrong file. Now I still have to
analyse the messages. I moved the html file from the classpath to adifferent folder content and configured that asWebApplicationPath wpath =newWebApplicationPath( getWicketServlet().getServletContext());
wpath.add(content);Apparently the HTML pages cannot be found.MatthiasIgor Vaynberg schrieb: the error means that wicket could not find the markup file for your page or panel. make sure it is named propely.
 as far as logging goes, usually you need to add wicket=debug, stdout == that stdout is the name of the logger defined. see the log4j webpage for details. -Igor
 On 3/16/06, *Matthias Albert* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Could anyone give me a hint how to enable debug messages for
 wicket. package, please? I found log4j in the dependencies, looked on the website of log4j, tried to edit a sample properties file, but without success. The error message on my console is:
 ERROR - RequestCycle - Markup of type 'html' for component 'content.MasterPage' not found. Enable debug messages for wicket.util.resource.Resource to get a list of all filenames tried:
 I am sure this is a matter of one line of the right initialisation setting. Any help is welcome. Thanks Matthias Albert ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding
 territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___
 Wicket-user mailing list Wicket-user@lists.sourceforge.net mailto:Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user 
https://lists.sourceforge.net/lists/listinfo/wicket-user---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] objects in session

2006-03-16 Thread Igor Vaynberg
create a WebSession subclass and instead fo storing it in your page stored it there instead. then you can get to it from anywhere.-IgorOn 3/16/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:
If objects used in a page are stored in a session, how do I access those objects when I redirect to a new page? Say I have public users who login and I want to display their name on pages and keep their user info in-session...on each page, how would I call those values?
Thanks!




Re: [Wicket-user] Examples of model decorators

2006-03-16 Thread Igor Vaynberg
not really sure what you mean...but here is a simple decorator that does uppercase on the model object, assuming of course its a string.class UpperCaseModel implements IModel { private IModel delegate;
  public UpperCaseModel(IModel delegate) { this.delegate=delegate; }  Object getObject(Component c) { return ((String)delegate.getObject(c)).toUpperCase(); } void setObject(Component c, Object o) { 
delegate.setObject(c, o); } void detach() { delegate.detach(); } IModel getNestedModel() { return null; }}hope this helps,-IgorOn 3/16/06, 
Frank Silbermann [EMAIL PROTECTED] wrote:



















Are there any examples of model decorators
I could look at? I have a model that
consists of one of several code values, and I would like a label to
automatically display a text string associated with the code value.









Re: [Wicket-user] objects in session

2006-03-16 Thread Jonathan Cone



Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?


  - Original Message - 
  From: 
  Vincent Jenks 
  To: wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006


Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Andrew Berman
Yeah it works. However, since the new request cycle is called on every request I had to put in an if statement to test for session.isNew(). On 3/16/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:
let me know if that worked.-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:

Cool. Thanks Igor.On 3/16/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:


instead of using a session factory try using a request cycle factory and setting the style into the created websession there.
-IgorOn 3/16/06, Andrew Berman
 [EMAIL PROTECTED] wrote:



It looks like the RequestCycle is not filled in until RequestCycle cycle = session.newRequestCycle(request, response); in WicketServlet (line 209 for Wicket 1.2 Beta 1)
On 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:




I should've mentioned that I already tried that and when I call RequestCycle.get(), I get a null.
On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you can try: ((WebRequest)RequestCycle.get().getRequest()).
-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,






Andrew
















Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Igor Vaynberg
great.On 3/16/06, Andrew Berman [EMAIL PROTECTED] wrote:
Yeah it works. However, since the new request cycle is called on every request I had to put in an if statement to test for session.isNew(). 
On 3/16/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:

let me know if that worked.-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:


Cool. Thanks Igor.On 3/16/06, Igor Vaynberg
 [EMAIL PROTECTED] wrote:



instead of using a session factory try using a request cycle factory and setting the style into the created websession there.
-IgorOn 3/16/06, Andrew Berman
 [EMAIL PROTECTED] wrote:




It looks like the RequestCycle is not filled in until RequestCycle cycle = session.newRequestCycle(request, response); in WicketServlet (line 209 for Wicket 1.2 Beta 1)
On 3/16/06, 
Andrew Berman [EMAIL PROTECTED] wrote:





I should've mentioned that I already tried that and when I call RequestCycle.get(), I get a null.
On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:you can try: ((WebRequest)RequestCycle.get().getRequest()).
-IgorOn 3/16/06, 
Andrew Berman [EMAIL PROTECTED]
 wrote:I have a requirement where I need to parse the URL to extract a username on session creation. For example, 
http://username.foo.com/..., I need to pull out the username and set a style in the session. So, I figured that upon session creation I could parse the request and set the style. In my application class I have:
protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L; public Session newSession() {  
 return new FooSession(); } }; }So in the newSession method how can I get the URL or request object?Thanks,







Andrew


















Re: [Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
MySessionObject being a class you created subclassing WebSession?On 3/16/06, Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  
From: 
  Vincent Jenks 
  To: 
wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006




Re: [Wicket-user] objects in session

2006-03-16 Thread Jonathan Cone



Yep - so then any instance variables you put in 
that class will be stored in the session.

  - Original Message - 
  From: 
  Vincent Jenks 
  To: wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:26 
  PM
  Subject: Re: [Wicket-user] objects in 
  session
  MySessionObject being a class you created subclassing 
  WebSession?
  On 3/16/06, Jonathan 
  Cone [EMAIL PROTECTED] 
   wrote: 
  

Hey Vincent,

What I would do is override getSessionFactory 
in your application class, something like this:

@Overrideprotected 
ISessionFactory getSessionFactory() {return new 
ISessionFactory() {
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do 
something like:
((MySessionObject)getSession()).getUsername();

Make sense?



- 
Original Message - 
From: 
Vincent Jenks 

To: 
wicket-user@lists.sourceforge.net 
Sent: 
Thursday, March 16, 2006 5:01 PM
Subject: 
[Wicket-user] objects in session
If objects used in a page are stored in a session, how do I 
access those objects when I redirect to a new page? Say I have public 
users who login and I want to display their name on pages and keep their 
user info in-session...on each page, how would I call those values? 
Thanks!




No virus found in this incoming message.Checked by AVG Free 
Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
3/14/2006

  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006


Re: [Wicket-user] objects in session

2006-03-16 Thread Igor Vaynberg
yep.-IgorOn 3/16/06, Vincent Jenks [EMAIL PROTECTED] wrote:
MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  

From: 
  Vincent Jenks 
  To: 

wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006






[Wicket-user] Difference between Panel and Border

2006-03-16 Thread Tom van Zummeren
Hi,

A beginners question, what is the difference between a Panel and a border
component? I tried to use them both and I couldn't tell the difference
between the two.

I found this description on wicket-wiki:

|The Panel component is a component that groups together a collection of
other components and have an |associated markup. It is the basic building
block for reusable site elements. 
|The Border component provides a way of wrapping a set of markup around a
markup container. Typically the most |common use to to provide a common site
template (e.g. header, footer, menu etc.) that gets wrapped around
|individual content pages. The result being that top level site layout only
needs to be maintained in one |markup file. However, the Border component is
much more powerful than this simple use case as it can be used |to achieve
exactly the same functionality for individual elements on a page. 

Ok, so they both are containers for other components and they can have
markup.
They say the difference is that the Border component is more powerful.
so why does a Panel even exist then?
I am confused.

Thanks,

Tom van Zummeren




---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.
I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:

MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  


From: 
  Vincent Jenks 
  To: 


wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006








Re: [Wicket-user] objects in session

2006-03-16 Thread Igor Vaynberg
we do not provide that get/setObject() method because we want to encourage type safety.furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks [EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.

I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 

[EMAIL PROTECTED] wrote:


MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  



From: 
  Vincent Jenks 
  To: 



wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006










Re: [Wicket-user] objects in session

2006-03-16 Thread Jonathan Cone



One thing to keep in mind is that you could put a 
method in your page subclass like:

public class MyWebPageSubclass extends Webpage 
{
public User getUser() {
 return 
((MySessionObject)getSession()).getUser();
}}

this would allow you to abstract some of the 
chained invocations if that's what you're referring to. Aside from that 
javax.servlet.http.HttpSession is not typesafe. Wicket is doing you a 
favor by insulating this from you, be happy not frustrated! :)

  - Original Message - 
  From: 
  Vincent Jenks 
  To: wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:48 
  PM
  Subject: Re: [Wicket-user] objects in 
  session
  Just as an observation, this seems a bit cumbersome to simply 
  add/access/remove objects from the HttpSession (but that's just my 
  opinion.)It make sense, it just seems like a lot of work to tap into 
  session values.I suppose if I had a single getter/setter that used an 
  Object parameter I could make something that behaved more like the HttpSession 
  when used in JSP/Servlets...but then I've got to override getSessionFactory() 
  in every Application class I want to use it in. Anyhow, thanks for 
  your help!


Re: [Wicket-user] objects in session

2006-03-16 Thread Vincent Jenks
I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket is worlds easier than JSP + Servlets. Perhaps there needs to exist a sub-implementation of WebSession that is global and easy to access  use...just for those of us who don't need to use it for much.
Anyhow I seem to be having a problem getting it working...here's what I've got so far.Here's my session class:public class UserSession extends WebSession{ private User user; public UserSession(Application application)
 {  super(application); } public User getUser() {  return this.user; } public void setUser(User user) {  this.user = user; }
  public boolean authenticate() {  if (this.getUser() == null)   return false;  else   return true; }}I modified my EditProductApp class to include the overridden method:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(EditProductApp.this
);   }  }; }In the page, I check to see if the user exists:  UserSession us = new UserSession(EditProductApp.get());if (!us.authenticate())   setResponsePage(new Login());
...if not, I send them back to the login page...the problem is; they *always* get redirected...so to continue w/ the login page:the login app class overrides the getSessionFactory() method: public ISessionFactory getSessionFactory()
 {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(LoginApp.this);   }  }; }
the login page submit action looks like this:  //event handler  public void onSubmit()  {   //authenticate user   User formUser = (User)getModelObject();
   User dbUser = UserProxy.getAuthUser(formUser.getUsername(), formUser.getPassword());  UserSession us = new UserSession(LoginApp.get());   us.setUser(dbUser);   
   if (dbUser == null)   {setResponsePage(new Login()); //login failed   }   else if (dbUser.isActive())   {if (dbUser.getUserGroup
().getAccessLevel() == 1) setResponsePage(new Home());else setResponsePage(new ProductCatalog());   }   else   {
setResponsePage(new InactiveAccount());   }  }So, I login (that part works fine) and then go to the EditProduct page and get redirected to the Login page...the value was apparently *not* stored in session.
What am I missing?Thanks!!On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
we do not provide that get/setObject() method because we want to encourage type safety.
furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.

I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg 

[EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:



MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  




From: 
  Vincent Jenks 
  To: 




wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006












Re: [Wicket-user] Difference between Panel and Border

2006-03-16 Thread Eelco Hillenius
The description is a bit whacky. A panel is a container that replaces
any contents. I.e. you can draw a box on your screen and if that was a
panel, that whole box would be replaced by the contents of the panel.
A box is kind of te opposite. It is meant to decorate a component; it
draws around it. Please check out the component reference in
wicket-examples.

Eelco


On 3/16/06, Tom van Zummeren [EMAIL PROTECTED] wrote:
 Hi,

 A beginners question, what is the difference between a Panel and a border
 component? I tried to use them both and I couldn't tell the difference
 between the two.

 I found this description on wicket-wiki:

 |The Panel component is a component that groups together a collection of
 other components and have an |associated markup. It is the basic building
 block for reusable site elements.
 |The Border component provides a way of wrapping a set of markup around a
 markup container. Typically the most |common use to to provide a common site
 template (e.g. header, footer, menu etc.) that gets wrapped around
 |individual content pages. The result being that top level site layout only
 needs to be maintained in one |markup file. However, the Border component is
 much more powerful than this simple use case as it can be used |to achieve
 exactly the same functionality for individual elements on a page.

 Ok, so they both are containers for other components and they can have
 markup.
 They say the difference is that the Border component is more powerful.
 so why does a Panel even exist then?
 I am confused.

 Thanks,

 Tom van Zummeren




 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] objects in session

2006-03-16 Thread Igor Vaynberg
UserSession us = new UserSession(EditProductApp.get());this is wrong, you dont create the session yourself, you let wicket create it for you (thats why you return a factory)so in your page:UserSession session=(UserSession)getSession();
sometimes nice to have this wrapped in a basepage.-IgorOn 3/16/06, Vincent Jenks [EMAIL PROTECTED]
 wrote:I see, well I'm not complaining but my point is; it's just not simple to use and in most other aspects...wicket is worlds easier than JSP + Servlets. Perhaps there needs to exist a sub-implementation of WebSession that is global and easy to access  use...just for those of us who don't need to use it for much.
Anyhow I seem to be having a problem getting it working...here's what I've got so far.Here's my session class:public class UserSession extends WebSession{ private User user; public UserSession(Application application)
 {  super(application); } public User getUser() {  return this.user; } public void setUser(User user) {  this.user = user; }

  public boolean authenticate() {  if (this.getUser() == null)   return false;  else   return true; }}I modified my EditProductApp class to include the overridden method:
 public ISessionFactory getSessionFactory() {  return new ISessionFactory()  {   public Session newSession()   {
return new UserSession(EditProductApp.this
);   }  }; }In the page, I check to see if the user exists:  UserSession us = new UserSession(EditProductApp.get());if (!us.authenticate())   setResponsePage(new Login());
...if not, I send them back to the login page...the problem is; they *always* get redirected...so to continue w/ the login page:the login app class overrides the getSessionFactory() method: public ISessionFactory getSessionFactory()
 {  return new ISessionFactory()  {   public Session newSession()   {return new UserSession(
LoginApp.this);   }  }; }
the login page submit action looks like this:  //event handler  public void onSubmit()  {   //authenticate user   User formUser = (User)getModelObject();

   User dbUser = UserProxy.getAuthUser(formUser.getUsername(), formUser.getPassword());  UserSession us = new UserSession(LoginApp.get());   us.setUser(dbUser);   
   if (dbUser == null)   {setResponsePage(new Login()); //login failed   }   else if (dbUser.isActive())   {if (dbUser.getUserGroup

().getAccessLevel() == 1) setResponsePage(new Home());else setResponsePage(new ProductCatalog());   }   else   {

setResponsePage(new InactiveAccount());   }  }So, I login (that part works fine) and then go to the EditProduct page and get redirected to the Login page...the value was apparently *not* stored in session.
What am I missing?Thanks!!On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:
we do not provide that get/setObject() method because we want to encourage type safety.
furthermore the session is also used to store application logic, like logic related to authentication/authorization or anything else youd like. it is not a simple MapString,Object like http session, it can be much much more.
-IgorOn 3/16/06, Vincent Jenks 

[EMAIL PROTECTED] wrote:
Just as an observation, this seems a bit cumbersome to simply add/access/remove objects from the HttpSession (but that's just my opinion.)It make sense, it just seems like a lot of work to tap into session values.

I suppose if I had a single getter/setter that used an Object parameter I could make something that behaved more like the HttpSession when used in JSP/Servlets...but then I've got to override getSessionFactory() in every Application class I want to use it in.
Anyhow, thanks for your help!On 3/16/06, Igor Vaynberg 


[EMAIL PROTECTED] wrote:
yep.
-IgorOn 3/16/06, Vincent Jenks 



[EMAIL PROTECTED] wrote:




MySessionObject being a class you created subclassing WebSession?On 3/16/06, 
Jonathan Cone [EMAIL PROTECTED]
 wrote:






Hey Vincent,

What I would do is override getSessionFactory in 
your application class, something like this:

@Overrideprotected ISessionFactory 
getSessionFactory() {return new ISessionFactory() 
{
public Session newSession() 
{return new 
MySessionObject(YourApplicationClass.this);}};}

Now MySessionObject is a subclass of WebSession 
(You'll want to look at this class). In your pages you would do something 
like:
((MySessionObject)getSession()).getUsername();

Make sense?



  - Original Message - 
  





From: 
  Vincent Jenks 
  To: 





wicket-user@lists.sourceforge.net 
  
  Sent: Thursday, March 16, 2006 5:01 
  PM
  Subject: [Wicket-user] objects in 
  session
  If objects used in a page are stored in a session, how do I 
  access those objects when I redirect to a new page? Say I have public 
  users who login and I want to display their name on pages and keep their user 
  info in-session...on each page, how would I call those values? 
  Thanks!
  
  

  No virus found in this incoming message.Checked by AVG Free 
  Edition.Version: 7.1.385 / Virus Database: 268.2.3/281 - Release Date: 
  3/14/2006



Re: [Wicket-user] objects in session

2006-03-16 Thread Eelco Hillenius
It is a major goal of Wicket to simplify things. But not the only/
utmost. There are a couple of good reasons for the way we implemented
session:
1) Discourage direct usage of HttpSession.
   - If you play by the rules and use the Wicket Session, you may
later decide to store the session e.g. in a database instead of the
actual HttpSession object.
   - you have a central session object that you are in control of and
that you can enhance with things like auditing etc.
2) Promote type safety. Just look at your session object to see what
is (potentially) in there. Much better than a hashmap.
3) Enforce an explicit contract. As you can't just put anything in it
(unless you provide your own hashmap based implementation of course),
you have to think about it better, and make concesious decissions
about what you want to support as session scoped data. In other words,
we let you define an explicit contract for your application/ API
users, which is one of the key concepts of object orientation after
all.

Now, like I said, you can break out of this by implementing your own
hashmap based implementation, maybe combined with some utility methods
to make accessing it easier:

public static void put(Object key, Object value) {
  ((MyUglyHashmapSession)Session.get()).put(key, value);
}

public static Object get(Object key) {
  return ((MyUglyHashmapSession)Session.get()).get(key);
}

But I am definitively not recommending it.

Hope this helps,

Eelco

On 3/16/06, Vincent Jenks [EMAIL PROTECTED] wrote:
 I see, well I'm not complaining but my point is; it's just not simple to use
 and in most other aspects...wicket is worlds easier than JSP + Servlets.
 Perhaps there needs to exist a sub-implementation of WebSession that is
 global and easy to access  use...just for those of us who don't need to use
 it for much.



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Eelco Hillenius
It's actually pretty awfull. I don't really see the point of having to
create the session upfront AND delegating the creation of the request
cycle to the session which in turn delegates it to the factory which
is set in the application. The problems I have with the current
handling:
1) It seems to stem from an optimization (RequestCycle sets the
Session as a final field so it doesn't have to use the thread local)
only. I don't think we need the optimization and besides the same
could have been accomplished by just lazy loading it.
2) I find it illogical that the session is there before the
request(cycle). The other way around would be more initiutive and
useful.
3) All that that one-liner delegation method does is tighten coupling.
The factory method in session is meant for internal use only. We
should loose it.

What I propose:
1) Create RequestCycle before the session.
2) Use the Application's factory directly instead of passing via
Session, and remove the method in Session.
3) The session is lazily created in getSession of Application. I
propose to 'touch' that method in RequestCycle's constructor to ensure
it is available for any user that wants to access it in the
constructor of any custom RequestCycle.
4) Make the change ASAP/ before beta 2.

Eelco


On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 great.


 On 3/16/06, Andrew Berman [EMAIL PROTECTED] wrote:
 
  Yeah it works.  However, since the new request cycle is called on every
 request I had to put in an if statement to test for session.isNew().
 
 
 
  On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
  
   let me know if that worked.
  
  
   -Igor
  
  
  
   On 3/16/06, Andrew Berman [EMAIL PROTECTED] wrote:
   
Cool.  Thanks Igor.
   
   
   
On 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:

 instead of using a session factory try using a request cycle factory
 and setting the style into the created websession there.


 -Igor



 On 3/16/06, Andrew Berman [EMAIL PROTECTED] wrote:
 
  It looks like the RequestCycle is not filled in until RequestCycle
 cycle = session.newRequestCycle(request, response); in WicketServlet (line
 209 for Wicket 1.2 Beta 1)
 
 
 
  On 3/16/06, Andrew Berman [EMAIL PROTECTED] wrote:
  
   I should've mentioned that I already tried that and when I call
 RequestCycle.get(), I get a null.
  
  
  
   On 3/16/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
   
you can try:
 ((WebRequest)RequestCycle.get().getRequest()).
   
   
-Igor
   
   
   
   
On 3/16/06, Andrew Berman [EMAIL PROTECTED]  wrote:

 I have a requirement where I need to parse the URL to
 extract a username on session creation.  For example,
 http://username.foo.com/..., I need to pull out the username and set a style
 in the session.  So, I figured that upon session creation I could parse the
 request and set the style.  In my application class I have:

 protected ISessionFactory getSessionFactory() {
 return new ISessionFactory() {
 private static final long serialVersionUID = 1L;

 public Session newSession() {
 return new FooSession();
 }
 };
 }

 So in the newSession method how can I get the URL or request
 object?

 Thanks,


 Andrew

   
   
  
  
 
 


   
   
  
  
 
 




---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Difference between Panel and Border

2006-03-16 Thread Gwyn Evans
Looks like it's from
http://www.wicket-wiki.org.uk/wiki/index.php/Panels_and_borders if you
want to edit it!

/Gwyn


On 17/03/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
 The description is a bit whacky. A panel is a container that replaces
 any contents. I.e. you can draw a box on your screen and if that was a
 panel, that whole box would be replaced by the contents of the panel.
 A box is kind of te opposite. It is meant to decorate a component; it
 draws around it. Please check out the component reference in
 wicket-examples.

 Eelco


 On 3/16/06, Tom van Zummeren [EMAIL PROTECTED] wrote:
  Hi,
 
  A beginners question, what is the difference between a Panel and a border
  component? I tried to use them both and I couldn't tell the difference
  between the two.
 
  I found this description on wicket-wiki:
 
  |The Panel component is a component that groups together a collection of
  other components and have an |associated markup. It is the basic building
  block for reusable site elements.
  |The Border component provides a way of wrapping a set of markup around a
  markup container. Typically the most |common use to to provide a common site
  template (e.g. header, footer, menu etc.) that gets wrapped around
  |individual content pages. The result being that top level site layout only
  needs to be maintained in one |markup file. However, the Border component is
  much more powerful than this simple use case as it can be used |to achieve
  exactly the same functionality for individual elements on a page.
 
  Ok, so they both are containers for other components and they can have
  markup.
  They say the difference is that the Border component is more powerful.
  so why does a Panel even exist then?
  I am confused.
 
  Thanks,
 
  Tom van Zummeren
 
 
 
 
  ---
  This SF.Net email is sponsored by xPML, a groundbreaking scripting language
  that extends applications into web and mobile media. Attend the live webcast
  and join the prime developer group breaking into this new coding territory!
  http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Difference between Panel and Border

2006-03-16 Thread Eelco Hillenius
Heh. Maybe I should restate that. The description isn't whacky on
second read. I thought I wrote it myself :)

Eelco

On 3/16/06, Gwyn Evans [EMAIL PROTECTED] wrote:
 Looks like it's from
 http://www.wicket-wiki.org.uk/wiki/index.php/Panels_and_borders if you
 want to edit it!

 /Gwyn


 On 17/03/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
  The description is a bit whacky. A panel is a container that replaces
  any contents. I.e. you can draw a box on your screen and if that was a
  panel, that whole box would be replaced by the contents of the panel.
  A box is kind of te opposite. It is meant to decorate a component; it
  draws around it. Please check out the component reference in
  wicket-examples.
 
  Eelco
 
 
  On 3/16/06, Tom van Zummeren [EMAIL PROTECTED] wrote:
   Hi,
  
   A beginners question, what is the difference between a Panel and a border
   component? I tried to use them both and I couldn't tell the difference
   between the two.
  
   I found this description on wicket-wiki:
  
   |The Panel component is a component that groups together a collection of
   other components and have an |associated markup. It is the basic building
   block for reusable site elements.
   |The Border component provides a way of wrapping a set of markup around a
   markup container. Typically the most |common use to to provide a common 
   site
   template (e.g. header, footer, menu etc.) that gets wrapped around
   |individual content pages. The result being that top level site layout 
   only
   needs to be maintained in one |markup file. However, the Border component 
   is
   much more powerful than this simple use case as it can be used |to achieve
   exactly the same functionality for individual elements on a page.
  
   Ok, so they both are containers for other components and they can have
   markup.
   They say the difference is that the Border component is more powerful.
   so why does a Panel even exist then?
   I am confused.
  
   Thanks,
  
   Tom van Zummeren
  
  
  
  
   ---
   This SF.Net email is sponsored by xPML, a groundbreaking scripting 
   language
   that extends applications into web and mobile media. Attend the live 
   webcast
   and join the prime developer group breaking into this new coding 
   territory!
   http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 
  ---
  This SF.Net email is sponsored by xPML, a groundbreaking scripting language
  that extends applications into web and mobile media. Attend the live webcast
  and join the prime developer group breaking into this new coding territory!
  http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language
 that extends applications into web and mobile media. Attend the live webcast
 and join the prime developer group breaking into this new coding territory!
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Starting download after form submission [Wicket 1.1.1]

2006-03-16 Thread Timo Stamm

Hi,


I have a filterable table (based on DataView - nice work, thanks Igor) 
and need a button to export selected entries as CVS.


After form submission, I can simply get the selected entries from an 
extended IDataProvider implementation and generate the CSV data.


But how do I get the data to the client?


I searched the wiki, the mailing list and the API-docs, but couldn't 
find a solution. It would be great to be able to redirect to a resource 
just like it is possible with pages:


  setResponseResource(new MyResource(myData));

A less elegant solution would be sufficient. It would be fine to store 
the data on disk or in the session and redirect to a servlet to 
download. But I can't find any way to do this, either.


Am I missing something?


Timo


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Re: Re: Get version of Wicket from program

2006-03-16 Thread shumbola
What about using Package interface?

 Class cls = Class.forName(wicket.Application);
 Package pkg = cls.getPackage();

 String name = pkg.getName();

 String specTitle   = pkg.getSpecificationTitle();
 String specVendor  = pkg.getSpecificationVendor();
 String specVersion = pkg.getSpecificationVersion();

 String implTitle   = pkg.getImplementationTitle();
 String implVendor  = pkg.getImplementationVendor();
 String implVersion = pkg.getImplementationVersion();

implVersion holds the wicket version, e.g., 1.2-SNAPSHOT


 Finally this works for me:
  
   URL url = 
 WicketServlet.class.getProtectionDomain().getCodeSource().getLocation();
   url  = new URL(jar, , url.toString() + !/META-INF/MANIFEST.MF);
  
   Manifest manifest = new  Manifest(url.openStream());

 Jan
  
 Martijn Dashorst [EMAIL PROTECTED]wrote in
 message
 news:[EMAIL PROTECTED]
 wecould check the manifest ourselves in wicket servlet orapplication.

 Martijn


  
 On 3/7/06, EelcoHillenius  [EMAIL PROTECTED] wrote:  
 Yeah,  it wouldn't hurt to have version info available *easy* some way :)

 Eelco


 On 3/7/06, Igor Vaynberg [EMAIL PROTECTED]  wrote:
 heh, easier to let maven filter it into some static variablein some 
 class i
 think :)

  -Igor



 On 3/7/06, jan_bar  [EMAIL PROTECTED] wrote:
  
 
  Hi,
 
  for me  that
 
 WicketServlet.class.getResourceAsStream(/META-INF/MANIFEST.MF)
  returns MANIFEST.MF from the JRE. How can I get Wicket manifest?
  
  Is this method safe even if the Wicket.jar is part of  WAR/EAR?
 
  Jan
 
  Martijn  Dashorst [EMAIL PROTECTED]  wrote in message
 news:[EMAIL PROTECTED]
  ...
  Basically the way Johan said is the way we retrieve the  version of 
  our own
 application.
 
  Our own  application tries to retrieve the version number of the war
 archive,  so that is a different usecase.
 
  Martijn
  
  
 
  On 3/7/06, Maurice Marrink  [EMAIL PROTECTED]  wrote:
   Codesource should never be null, if you class is in  a jar file,
   codesource points to the jar. 
else it might point to a directory where your class files can be
found
   (or in subdirs thereof). if none of the above is  available it will
   point to the classfile itself. 
   
   But perhaps Martijn can tell you how he did it,  i know he did it for
   our project but can't seem to find  where.
  
   Maurice
   
   On 3/7/06, Joni Suominen  [EMAIL PROTECTED] wrote:
 On Tue, 2006-03-07 at 10:27 +0100, Juergen Donnerstag  wrote:
 Do you know how to access that  information?  How do you get the 
 jar
  file name a specific class has been loaded from?

   
  getClass().getProtectionDomain().getCodeSource().getLocation()
 gives  you
the location where the class was loaded from. I  don't know in 
which
situations the CodeSource may be  null, though.
   
Joni

   
   

 --- 
This SF.Net email is sponsored by xPML, a  groundbreaking scripting
 language
that  extends applications into web and mobile media. Attend the 
live
  webcast
and join the prime developer group breaking  into this new coding
 territory!
   
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
 ___
 Wicket-user mailing list
Wicket-user@lists.sourceforge.net 
   
 https://lists.sourceforge.net/lists/listinfo/wicket-user

  
   
---
This SF.Net email is sponsored by xPML, a groundbreaking scripting
  language
   that extends applications into web and mobile  media. Attend the live
 webcast
   and join the prime  developer group breaking into this new coding
 territory!
   
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___
Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   
 https://lists.sourceforge.net/lists/listinfo/wicket-user
   
  
 
 
  --
   Living a wicket life...
 
  Martijn Dashorst - http://www.jroller.com/page/dashorst
   
  Wicket 1.1.1 is out:
 http://wicket.sourceforge.net/wicket-1.1
  




 --- 
 This SF.Net email is sponsored by xPML, a groundbreaking scripting  
 language
 that extends applications into web and mobile media. Attend the   live webcast
 and join the prime developer group breaking into this new  coding 
 territory!
 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
 ___ 
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user 








-- 
 shumbola  

Re: [Wicket-user] Parsing URL upon session creation

2006-03-16 Thread Andrew Berman
That would be awesome Eelco if that happens. It does make more sense to have the request available before the session is created. Please let me know if and when you make this change so I can change my code and/or test this for you.
On 3/16/06, Eelco Hillenius [EMAIL PROTECTED] wrote:
It's actually pretty awfull. I don't really see the point of having tocreate the session upfront AND delegating the creation of the requestcycle to the session which in turn delegates it to the factory whichis set in the application. The problems I have with the current
handling:1) It seems to stem from an optimization (RequestCycle sets theSession as a final field so it doesn't have to use the thread local)only. I don't think we need the optimization and besides the same
could have been accomplished by just lazy loading it.2) I find it illogical that the session is there before therequest(cycle). The other way around would be more initiutive anduseful.3) All that that one-liner delegation method does is tighten coupling.
The factory method in session is meant for internal use only. Weshould loose it.What I propose:1) Create RequestCycle before the session.2) Use the Application's factory directly instead of passing via
Session, and remove the method in Session.3) The session is lazily created in getSession of Application. Ipropose to 'touch' that method in RequestCycle's constructor to ensureit is available for any user that wants to access it in the
constructor of any custom RequestCycle.4) Make the change ASAP/ before beta 2.EelcoOn 3/16/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
 great. On 3/16/06, Andrew Berman [EMAIL PROTECTED] wrote:   Yeah it works.However, since the new request cycle is called on every
 request I had to put in an if statement to test for session.isNew(). On 3/16/06, Igor Vaynberg [EMAIL PROTECTED]
 wrote: let me know if that worked.   -Igor On 3/16/06, Andrew Berman 
[EMAIL PROTECTED] wrote:   Cool.Thanks Igor. On 3/16/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote: instead of using a session factory try using a request cycle factory and setting the style into the created websession there.
 -Igor On 3/16/06, Andrew Berman 
[EMAIL PROTECTED] wrote:   It looks like the RequestCycle is not filled in until RequestCycle cycle = session.newRequestCycle
(request, response); in WicketServlet (line 209 for Wicket 1.2 Beta 1) On 3/16/06, Andrew Berman 
[EMAIL PROTECTED] wrote: I should've mentioned that I already tried that and when I call RequestCycle.get
(), I get a null. On 3/16/06, Igor Vaynberg  
[EMAIL PROTECTED] wrote:   you can try: ((WebRequest)RequestCycle.get().getRequest()).   
   -Igor 
   On 3/16/06, Andrew Berman [EMAIL PROTECTED]  wrote:
 I have a requirement where I need to parse the URL to extract a username on session creation.For example, http://username.foo.com/..
., I need to pull out the username and set a style in the session.So, I figured that upon session creation I could parse the request and set the style.In my application class I have:
 protected ISessionFactory getSessionFactory() { return new ISessionFactory() { private static final long serialVersionUID = 1L;
 public Session newSession() { return new FooSession();
 } }; }
 So in the newSession method how can I get the URL or request object? Thanks,
 Andrew   
 
---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Starting download after form submission [Wicket 1.1.1]

2006-03-16 Thread Igor Vaynberg
hi Timo,please see this thread for a way to do it:http://www.nabble.com/Rendering-DataTable-or-DataView-%28or-model%29-as-Excel-sheet-t1042760.html#a2711299
-IgorOn 3/16/06, Timo Stamm [EMAIL PROTECTED] wrote:
Hi,I have a filterable table (based on DataView - nice work, thanks Igor)and need a button to export selected entries as CVS.After form submission, I can simply get the selected entries from an
extended IDataProvider implementation and generate the CSV data.But how do I get the data to the client?I searched the wiki, the mailing list and the API-docs, but couldn'tfind a solution. It would be great to be able to redirect to a resource
just like it is possible with pages: setResponseResource(new MyResource(myData));A less elegant solution would be sufficient. It would be fine to storethe data on disk or in the session and redirect to a servlet to
download. But I can't find any way to do this, either.Am I missing something?Timo---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Starting download after form submission [Wicket 1.1.1]

2006-03-16 Thread Timo Stamm

Thanks Igor, I like this suggestion:


add(new Link(export-link) {
   onclick() {
   getRequestCycle().setRequestTarget(new ComponentRequestTarget(dt));
   WebResponse wr=(WebResponse)getResponse();
   wr.setHeader(blah);
   }
}


But it requires wicket 1.2.


I tried to use a simple Page that outputs CSV instead of HTML, but I am 
unable to set the proper headers in the response. They are simply ignored.


public class DownloadPage extends WebPage {
//...
public void onRequest() {
  WebResponse r = getWebRequestCycle().getWebResponse();
  r.setHeader(Content-Disposition, attachment; filename=\x.csv\);
  r.setHeader(Content-Type, application/octet-stream);
}


I would have a look at the jasperreports project (though I doubt that it 
solves my problem), but I can't connect to the servers.



I could even live with putting the information in the session and 
redirecting to a servlet that outputs CSV. But wicket tries to modify 
the headers after I set redirect headers, resulting in 
WicketRuntimeExceptions.



Is there no solution? I really just want to return textual data with my 
own content-type and content-disposition headers after a form submission.



Timo



Igor Vaynberg schrieb:

hi Timo,
please see this thread for a way to do it:

http://www.nabble.com/Rendering-DataTable-or-DataView-%28or-model%29-as-Excel-sheet-t1042760.html#a2711299


-Igor

On 3/16/06, Timo Stamm [EMAIL PROTECTED] wrote:

Hi,


I have a filterable table (based on DataView - nice work, thanks Igor)
and need a button to export selected entries as CVS.

After form submission, I can simply get the selected entries from an
extended IDataProvider implementation and generate the CSV data.

But how do I get the data to the client?


I searched the wiki, the mailing list and the API-docs, but couldn't
find a solution. It would be great to be able to redirect to a resource
just like it is possible with pages:

   setResponseResource(new MyResource(myData));

A less elegant solution would be sufficient. It would be fine to store
the data on disk or in the session and redirect to a servlet to
download. But I can't find any way to do this, either.

Am I missing something?


Timo


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language
that extends applications into web and mobile media. Attend the live
webcast
and join the prime developer group breaking into this new coding
territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user







---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Starting download after form submission [Wicket 1.1.1]

2006-03-16 Thread Igor Vaynberg
ah, if you are on 1.1 then we already have examples that do this.check out wicket-examples under display tag examples. there should be an export example there.-Igor
On 3/16/06, Timo Stamm [EMAIL PROTECTED] wrote:
Thanks Igor, I like this suggestion:add(new Link(export-link) {onclick() {getRequestCycle().setRequestTarget(new ComponentRequestTarget(dt));WebResponse wr=(WebResponse)getResponse();
wr.setHeader(blah);}}But it requires wicket 1.2.I tried to use a simple Page that outputs CSV instead of HTML, but I amunable to set the proper headers in the response. They are simply ignored.
public class DownloadPage extends WebPage {//...public void onRequest() { WebResponse r = getWebRequestCycle().getWebResponse(); r.setHeader(Content-Disposition, attachment; filename=\
x.csv\); r.setHeader(Content-Type, application/octet-stream);}I would have a look at the jasperreports project (though I doubt that itsolves my problem), but I can't connect to the servers.
I could even live with putting the information in the session andredirecting to a servlet that outputs CSV. But wicket tries to modifythe headers after I set redirect headers, resulting inWicketRuntimeExceptions.
Is there no solution? I really just want to return textual data with myown content-type and content-disposition headers after a form submission.TimoIgor Vaynberg schrieb: hi Timo,
 please see this thread for a way to do it: http://www.nabble.com/Rendering-DataTable-or-DataView-%28or-model%29-as-Excel-sheet-t1042760.html#a2711299
 -Igor On 3/16/06, Timo Stamm [EMAIL PROTECTED] wrote: Hi, I have a filterable table (based on DataView - nice work, thanks Igor)
 and need a button to export selected entries as CVS. After form submission, I can simply get the selected entries from an extended IDataProvider implementation and generate the CSV data.
 But how do I get the data to the client? I searched the wiki, the mailing list and the API-docs, but couldn't find a solution. It would be great to be able to redirect to a resource
 just like it is possible with pages:setResponseResource(new MyResource(myData)); A less elegant solution would be sufficient. It would be fine to store the data on disk or in the session and redirect to a servlet to
 download. But I can't find any way to do this, either. Am I missing something? Timo ---
 This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding
 territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/wicket-user---This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___Wicket-user mailing list
Wicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] wicket 1.1.1:radiochoice default selected value?

2006-03-16 Thread Nino Wael
Title: wicket 1.1.1:radiochoice default  selected value?






Hi

I need to have a default value selected when rendering a radiochoice, should I overide getdefault choice for to do this?

-regards Nino