Re: Wicket creating a session for authorization even if no user signed in

2008-02-28 Thread Maurice Marrink
another caveat with stateless pages / temporary sessions is that if
you throw a restartResponseAtInterceptPageException, for example to
redirect from a secured page to your login page, the session will be
persisted to store the original target.

Maurice

On Thu, Feb 28, 2008 at 7:14 AM, Igor Vaynberg [EMAIL PROTECTED] wrote:
 On Wed, Feb 27, 2008 at 10:10 PM, Roberto Fasciolo

 [EMAIL PROTECTED] wrote:
  

   Based on this page in wiki:
http://cwiki.apache.org/WICKET/stateless-pages.html a page is stateless if
all the components in it are stateless.
My sign in page contains a SignInPanel (from wicket-auth-roles) and 2 
 links.
I can change the links to StatelessLink, but how can I make SignInPanel
(that contains a Form, not a StatelessForm) stateless? Is writing my own
version of it the only solution?

  yep. not sure signinpanel was meant for you to be used directly, its
  more of an example... in fact the entire wicket-auth-roles is more of
  an example rather then something to be used as a library.

  -igor




  
-Roberto
  
  
  
  
igor.vaynberg wrote:

 is your sign in page stateless? if its not it will need to be stored in
 session.

 re ddos attacks, its really the job of the application server to
 prevent an exorbitant amount of sessions opened from what looks like
 the same ip or however it decides to do that. ie there are plenty of
 jsp/struts applications that create a session on the first hit.

 what wicket does is provide a page eviction strategy so once created
 an attacker cannot grow the session infinitely

 -igor


 On Wed, Feb 27, 2008 at 11:10 AM, Roberto Fasciolo
 [EMAIL PROTECTED] wrote:

  Our application is totally hidden behind authentication, so in our 
 case
 the
  session (I'm talking about an object extending 
 AuthenticatedWebSession)
 is
  created without any page navigation, just by opening the sign in page.

  Anyway, how can you deal with DoS attacks? I mean, it'll be really 
 easy
 to
  write a small script continuously opening pages on a wicket site (or
  creating new sessions) until the site would die by OutOfMemoryError.

  But back in track, I don't see anything bad in, instead creating a new
  session just for calling getRoles() and getting null, returning 
 directly
  null (= user not in any role) if the user never signed in before.




  igor.vaynberg wrote:
  
   wicket uses session to store pages, so creating a session is
   orthogonal to authorizing/authenticating a user
  
   -igor
  
   On Wed, Feb 27, 2008 at 9:04 AM, Roberto Fasciolo
   [EMAIL PROTECTED] wrote:
  
Hi,
  
I noticed some strange behavior on my webapplication that has
   authorization
in place (by using Roles).
  
It seems that Wicket creates a session for checking the role of 
 the
 user
even the user has not logged in. I'd guess the preferred behavior
 would
   be
that wicket would in this occasion first check if there is a 
 session
 and
   if
not, then just let the authorization fail instead of creating
 session
   and
then checking if role is there.
  
I did simple trace to find what is calling MySession constructor:
  
public MySession(final AuthenticatedWebApplication application,
   final Request request) {
   super(application, request);
   this.logger.error(Created session, new Throwable());
}
  
18:56:16,634 (btpool0-5) ERROR [MySession] - Created session
java.lang.Throwable
   at MySession.init(MySession.java:39)
   at
 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
   at
  
  
 
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at
  
  
 
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at
   java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at
  
  
 
 org.apache.wicket.authentication.AuthenticatedWebApplication.newSession(AuthenticatedWebApplication.java:114)
  
   at org.apache.wicket.Session.findOrCreate(Session.java:225)
   at org.apache.wicket.Session.findOrCreate(Session.java:208)
--
View this message in context:
  
 
 http://www.nabble.com/Wicket-creating-a-session-for-authorization-even-if-no-user-signed-in-tp15717761p15717761.html
Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
  
 -
To unsubscribe, e-mail: [EMAIL 

wicket-datetime 1.3.1 css problem

2008-02-28 Thread Andrew Moore

I've just upgraded to wicket 1.3.1 and seem to be having a problem getting
the calendar to display correctly.
It works, but it's not picking up calendar css.

From having a quick look at the source of AbstractCalendar is seems to be
doing a:
add(HeaderContributor.forCss(AbstractCalendar.class,
assets/calendar.css));

but from what I can tell calendar.css doesn't seem to be under the assets
directory assets  it seems to be at assets/skins/sam.

Am I doing something wrong, or is the css resource path not correct?
Cheers
Andrew
-- 
View this message in context: 
http://www.nabble.com/wicket-datetime-1.3.1-css-problem-tp15731702p15731702.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



[MEETUP] Wicket Meetup @ ApacheCon Europe: 5 weeks to go

2008-02-28 Thread Arje Cahn
Hi all,
 
Here's a reminder that the Amsterdam Wicket Meetup is in slightly more than 5 
weeks
time!

It is meetup time again! Our last Amsterdam Meetup was a big  success and we 
want to continue that tradition. Over 80 Wicket developers attended the 
previous meetup and we had a blast. If you have missed the previous meetup from 
Nov 30th, 2007 you can see the pictures online [1], or enjoy the presentations 
[2].

Attending is simple: simply add your name to the wiki page and you're all set! 
http://cwiki.apache.org/WICKET/wicket-community-meetups-amsterdam.html

If you have an idea for a talk, presentation, demo, discussion, or whatever you 
feel like, be sure to add it to the Wiki page.

Please note that no fee has been set yet for attending, since we're still 
looking for some sponsors. But it'll be either free or extremely cheap - 25 
Euros or so. We'll still have to pay for the room you see :)

This Meetup will happen at the same time and in the same place as the ApacheCon 
Europe 2008, its bigger sister conference. Whereas the Meetup is purely about 
Wicket, run by the community, ApacheCon gives you an much bigger overview 
covering the entire Apache stack. There's no obligation to attend ApacheCon, 
but we're trying to get a good deal for Meetup attendees that want to visit 
ApacheCon too. For more info about ApacheCon, take a look at 
http://www.eu.apachecon.com/

Impress your boss with a deeper understanding of Wicket, or the new treasure 
chest of components that have been unveiled at the meetup. Meet other Wicket 
developers and share your hopes, victories and frustrations. Expand your 
network of Wicket developers!

See you all in Amsterdam beginning of April!

-- Arjé Cahn

---

Some background on the Wicket meetup: The Amsterdam meetup is meant for 
everyone interested in Wicket, on all different expertise levels. If you want 
to get started with Wicket, or you need
some more background information, are an expert committer, or even when you've 
never even touched a single line of code, you're more than welcome!

Last year's schedule:

12:00 Room opens, Wifi connection, power outlets and coffee available. Walk-in 
hackaton for whoever likes to join.
12:30 Q/A Ask the experts. Got a question for your Wicket project? Feel free to 
ask!
14:00 Terracotta: JVM-level clustering for Wicket - Jonas Bonér
15:00 Opening talk - Arjé Cahn
15:15 Apache Wicket: web applications with just Java - Martijn Dashorst
15:45 Wicket and Swing from one codebase - Johan Compagner
16:15 wicket-contrib-gmap2 - Martin Funk
16:30 Dynamic markup and on the fly components (on binding XML to Wicket) - 
Wouter Huijnink
17:00 Wicket Portlets primer - Ate Douma
17:30 Break / dinner pasta buffet
18:30 Introduction to Wicket Security - Maurice Marrink
19:00 A plugin architecture for Wicket - Niels van Kampenhout and Wander Grevink
19:30 SessionStores, Pagemaps and Pages.. What does wicket store (and where) - 
Johan Compagner
20:00 Wicket Live On Stage! A production case study (with lots of AJAX) - 
Martijn Dashorst
20:30 Closing - Arjé Cahn
20:35 Sponsored drinks!
23:00 Bar closes


Arjé Cahn
Martijn Dashorst

[1] Photos from previous meetup http://flickr.com/tags/wicketmeetup
[2] Slides from previous meetup http://www.slideshare.net/tag/wicket

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



Re: Dynamic form components and disabling them

2008-02-28 Thread Federico Fanton
On Wed, 27 Feb 2008 17:16:46 -0800
Igor Vaynberg [EMAIL PROTECTED] wrote:

 yes, you are correct. fixed in trunk.

Ok, thanks :)


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



RE: Does something happen other than what html is output?

2008-02-28 Thread David Leangen

Thank you for your reply.

 Depends how the container produces the output.

Well, like I say below, I'm just using a MarkupContainer to output pure html
for images, and a HeaderContributor for the CSS, nothing more.

This is the code for the CSS:

private void addCss( final Page page, final String cssLink )
{
final HeaderContributor cssHeaderContributor =
new HeaderContributor
(
new IHeaderContributor()
{
private static final long serialVersionUID = 1L;

public void renderHead( final IHeaderResponse
response )
{
response.renderString( cssLink );
}
}
);

page.add( cssHeaderContributor );
}

And this for the image:

final MarkupContainer container = new WebMarkupContainer( id );
final Model srcAttributeModel = new Model( imageUrl );
final AttributeModifier srcAttribute = new AttributeModifier(
src,
true,
srcAttributeModel );
container.add( srcAttribute );
add( container );

I think the html looks something like this:
  img wicket:id=blahIMAGE/img


 If oncomponenttag is used it should work.

Really? I don't see why I'd need onComponentTag for the approach I'm
using...


 if the tags are generated by a model you might want turn off
 setescapemodelstrings on the container.

The html is rendered just fine. If I copy the code and paste it in a static
html file, everything renders just fine.


Thanks!
Dave



 On Thu, Feb 28, 2008 at 4:16 AM, David Leangen [EMAIL PROTECTED] wrote:
 
   Hello,
 
   I am adding a MarkupContainer to my page that outputs something like
   this:
 
img wicket:id=logoImage src=file:///resources/images/logo.jpg
 
   or this:
 
   link rel=stylesheet type=text/css
   href=file:///resources/stylesheets/text.css /
   
 
   [Just in case this does not render because of html-based mail clients:
 
lt;img wicket:id=logoImage
   src=file:///resources/images/logo.jpggt;
 
   or this:
 
   lt;link rel=stylesheet type=text/css
   href=file:///resources/stylesheets/text.css /gt;
 
   ]
 
   Although this works from a static html page, it doesn't work
 when Wicket
   renders this page. The html shows up correctly when I view the source,
   but the image and CSS don't get rendered.
 
   Is something happening behind the scenes that I should be aware of?
 
 
   Thanks!
   Dave
 
 
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



Re: Can i add multiple lines to a node-link in tree?

2008-02-28 Thread Newgro

Thanks for your help,

firstly sorry if i brought you to the wrong way - i use a treetable, not a
tree. My effects on code below is that the nodes are diplayed only in one
row. The second row is not visible.

My html:
wicket:panel
  form wicket:id=treeform
div class=tree wicket:id=treeTable/div
  /form
/wicket:panel

My data code
public String getName() {
  StringBuilder sb= new StringBuilder();
  sb.append(EZ: ).append(getPrice(getRoomRate().getPrice())).append( €);
  sb.append( DZ: ).append(getPrice(getRoomRate().getPrice2())).append(
€\n); -- here the newline!!
  sb.append(  ().append(getDate(getRoomRate().getFromDate()));
  sb.append( - );
  sb.append(getDate(getRoomRate().getToDate())).append());
  return sb.toString();
}


Here is my code:

TreeTable tree = new TreeTable(treeTable, treeModel, columns) {

  /**
   * Represents a content of a cell in TreeColumn (column containing the
actual tree).
   * This has been copied to switch the label to a multiline instance.
   * @author Matej Knopp
   * @author r.dieckmann
   */
  class MyTreeFragment extends Fragment {

/**
 * Constructor.
 * @param id the wicket:id of component
 * @param node current 
 * @param level
 * @param renderNodeCallback
 *The call back for rendering nodes
 */
@SuppressWarnings(deprecation)
public MyTreeFragment(String id, final TreeNode node, int level,
final IRenderNodeCallback renderNodeCallback) {
  super(id, fragment);

  add(newIndentation(this, indent, node, level));
  add(newJunctionLink(this, link, image, node));

  MarkupContainer nodeLink = newNodeLink(this, nodeLink, node);
  nodeLink.add(newNodeIcon(nodeLink, icon, node));
  nodeLink.add(new MultiLineLabel(label, new
AbstractReadOnlyModel() {
/**
 * @see
org.apache.wicket.model.AbstractReadOnlyModel#getObject()
 */
public Object getObject() {
  return renderNodeCallback.renderNode(node);
}
  }));
  add(nodeLink);
}
  }

  /**
   * @see
org.apache.wicket.extensions.markup.html.tree.table.TreeTable#newTreePanel(org.apache.wicket.MarkupContainer,
java.lang.String, javax.swing.tree.TreeNode, int,
org.apache.wicket.extensions.markup.html.tree.table.TreeTable.IRenderNodeCallback)
   */
  @Override
  protected Component newTreePanel(MarkupContainer pParent, String pId,
TreeNode pNode, int pLevel, IRenderNodeCallback pRenderNodeCallback) {
return new MyTreeFragment(pId, pNode, pLevel, pRenderNodeCallback);
  }

  /**
   * @see
org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree#newNodeLink(org.apache.wicket.MarkupContainer,
java.lang.String, javax.swing.tree.TreeNode)
   */
  protected MarkupContainer newNodeLink(MarkupContainer pParent, String
pId, final TreeNode pNode) {
MarkupContainer m = newLink(pParent, pId, new ILinkCallback() {

  /**
   * @see
org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.ILinkCallback#onClick(org.apache.wicket.ajax.AjaxRequestTarget)
   */
  public void onClick(AjaxRequestTarget target) {
if (!getTreeState().isNodeSelected(pNode)) {
  getTreeState().selectNode(pNode, true);
  onNodeLinkClicked(target, pNode);
  updateTree(target);
}
  }
});
DefaultMutableTreeNode t = (DefaultMutableTreeNode) pNode;
if (t.getUserObject() instanceof TreeModelCategoryBean) {
  TreeModelCategoryBean c = (TreeModelCategoryBean)
t.getUserObject();
  ICategoryTO categoryTO = c.getCategory();
  m.setEnabled(categoryTO != null  categoryTO.isAvailable());
}
return m;
  }

  /**
   * @see
org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree#onNodeLinkClicked(org.apache.wicket.ajax.AjaxRequestTarget,
javax.swing.tree.TreeNode)
   */
  protected void onNodeLinkClicked(AjaxRequestTarget pTarget, TreeNode
pNode) {
super.onNodeLinkClicked(pTarget, pNode);
DefaultMutableTreeNode dnode = (DefaultMutableTreeNode) pNode;
ITreeModelBean current = (ITreeModelBean) dnode.getUserObject();
if (current instanceof TreeModelCategoryBean) {
  refreshNodes(pTarget, pNode);
} else if (current instanceof TreeModelPackageBean) {
  refreshNodes(pTarget, dnode.getParent());
}
  }

  private void refreshNodes(AjaxRequestTarget pTarget, TreeNode
pCategoryNode) {
DefaultMutableTreeNode dnode = (DefaultMutableTreeNode)
pCategoryNode;
ITreeModelBean current = (ITreeModelBean) dnode.getUserObject();
if (current instanceof TreeModelCategoryBean) {
  TreeModelCategoryBean c = (TreeModelCategoryBean) current;
  

Re: Adding full text search in wicket phonebook

2008-02-28 Thread Martin Makundi
Do you need to perform the filtering in the database (i.e.,
data-heavy) or is it enough to filter it just-in-time before display?

**
Martin

2008/2/28, Tauren Mills [EMAIL PROTECTED]:
 For the simple wicket-phonebook app, what I'm suggesting is definitely
  a cannon. ;)  But I'm using it as an example for a much more
  complicated app.  If I can get it working for the phonebook app, then
  I can get it working for my app.  I mention the phonebook because many
  wicket developers are familiar with it, so it provides a good starting
  point.

  On the other hand, if there are other ideas that don't involve Lucene,
  I'm certainly willing to listen.


  Tauren




  On Wed, Feb 27, 2008 at 8:33 PM, Martin Makundi
  [EMAIL PROTECTED] wrote:
   Aren't you trying to killa a mouse with a cannon? Or is the cannon
(Hibernate, Lucene, Complexity) just for fun?
  
2008/2/27, Tauren Mills [EMAIL PROTECTED]:
  
  
I'm trying to determine the best way to add full text search
  capabilities to the default wicket-phonebook application.  Basically,
  I want a single search textbox on the page that allows the user to
  search for any data in any field of the data table.  So it would
  search through all contact's first name, last name, email, and phone
  number fields.  Doing the search should repopulate the data table with
  only records that match the search.  The resulting table should still
  be able to be paginated, filtered, and sorted.

  Igor suggested that I use Hibernate Search (which uses Lucene behind
  the scenes).  I've looked into that and it looks like the right way to
  go.  I've already integrated it into a clean copy of wicket-phonebook
  by converting the app to use hibernate annotations, adding hibernate
  search annotations, and updating the appropriate xml files.

  I found a helpful resouce, but it seems like doing it the way
  suggested would result in a separate data set that wouldn't work with
  the sorting/filtering/paging of the datatable:
  http://www.jreactor.com/2008/02/18/wicket-and-hibernate-search/

  So now I'm stuck and am not sure the best way to go forward.  I know
  that I need to add the search feature to ContactsDataProvider and
  ContactDao.  I'd welcome any suggestions, advice, and especially
  example code!

  Thanks,
  Tauren

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


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

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



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



Re: Does something happen other than what html is output?

2008-02-28 Thread Edward Yakop
On Thu, Feb 28, 2008 at 5:33 PM, David Leangen [EMAIL PROTECTED] wrote:
 public void renderHead( final IHeaderResponse
  response )
 {
 response.renderString( cssLink );
 }

Shouldn't this read

response.renderCssReference( cssLink ),

instead of

response.renderString( cssLink );

 If I read the javadoc properly, #renderString( cssLink ), will just
print the cssLink verbatim.

  And this for the image:

 final MarkupContainer container = new WebMarkupContainer( id );
 final Model srcAttributeModel = new Model( imageUrl );
 final AttributeModifier srcAttribute = new AttributeModifier(
 src,
 true,
 srcAttributeModel );
 container.add( srcAttribute );
 add( container );

  I think the html looks something like this:
   img wicket:id=blahIMAGE/img

I wonder why this doesn't work. To me, this should work, is it because
of the IMAGE string?

Regards,
Edward Yakop

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



Re: Does something happen other than what html is output?

2008-02-28 Thread Maurice Marrink

   If oncomponenttag is used it should work.

  Really? I don't see why I'd need onComponentTag for the approach I'm
  using...

I misunderstood, i though that sometimes the container was to render
as an image tag and sometimes as a link tag, hence the oncomponenttag
method :)

Maurice

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



Re: wicket-datetime 1.3.1 css problem

2008-02-28 Thread Gerolf Seitz
this should be fixed in trunk.

  Gerolf

On Thu, Feb 28, 2008 at 9:21 AM, Andrew Moore [EMAIL PROTECTED]
wrote:


 I've just upgraded to wicket 1.3.1 and seem to be having a problem getting
 the calendar to display correctly.
 It works, but it's not picking up calendar css.

 From having a quick look at the source of AbstractCalendar is seems to be
 doing a:
 add(HeaderContributor.forCss(AbstractCalendar.class,
 assets/calendar.css));

 but from what I can tell calendar.css doesn't seem to be under the assets
 directory assets  it seems to be at assets/skins/sam.

 Am I doing something wrong, or is the css resource path not correct?
 Cheers
 Andrew
 --
 View this message in context:
 http://www.nabble.com/wicket-datetime-1.3.1-css-problem-tp15731702p15731702.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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




remember last visited page

2008-02-28 Thread freak182

Hello,
Is there a way to remember the last page i visited after i lose the session.
What i mean that for example if im going to checkout but i forgot to login
first, When i click checkout button, it will redirect me to the login page
first then when authenticated it will go directly to checkout page. Any
codes will help :)

Thanks a lot.

Cheers.
-- 
View this message in context: 
http://www.nabble.com/remember-last-visited-page-tp15733923p15733923.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Strict XHTML validation

2008-02-28 Thread Kaspar Fischer

I am trying to validate my page using http://validator.w3.org/.
My page markup is:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http:// 
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http:// 
svn.apache.org/repos/asf/wicket/trunk/jdk-1.4/wicket/wicket-xhtml1- 
strict.dtd xml:lang=en lang=en

head
	meta http-equiv=Content-Type content=text/html;  
charset=utf-8 /

titleWicket Quickstart Archetype Homepage/title
/head
body
p
strongWicket Quickstart Archetype Homepage223/strong
/p
p
span wicket:id=messagemessage will be here/span
  /p
/body
/html

The validator complains that there is no attribute wicket:id. I am
not sure where exactly the problem lies: does the second xmlns violate
the standard, is the validator incorrect, ...?

Any ideas how to resolve this? I see work in progress at

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

but the markup there is basically mine but I cannot get it to validate.
Thanks,
Kaspar

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



Re: remember last visited page

2008-02-28 Thread Vitaly Tsaplin
   You can probably look at this
http://cwiki.apache.org/WICKET/using-intercept-pages.html

On Thu, Feb 28, 2008 at 11:51 AM, freak182 [EMAIL PROTECTED] wrote:

  Hello,
  Is there a way to remember the last page i visited after i lose the session.
  What i mean that for example if im going to checkout but i forgot to login
  first, When i click checkout button, it will redirect me to the login page
  first then when authenticated it will go directly to checkout page. Any
  codes will help :)

  Thanks a lot.

  Cheers.
  --
  View this message in context: 
 http://www.nabble.com/remember-last-visited-page-tp15733923p15733923.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Can i add multiple lines to a node-link in tree?

2008-02-28 Thread Thomas Kappler
On Thu, Feb 28, 2008 at 10:54 AM, Newgro [EMAIL PROTECTED] wrote:

  firstly sorry if i brought you to the wrong way - i use a treetable, not a
  tree. My effects on code below is that the nodes are diplayed only in one
  row. The second row is not visible.

OK, I have never used TreeTable, and I cannot test it right now, but
it should not affect the MultiLineLabel where it appears.  Perhaps
it's that the \n is the last character, try adding something after it.
 Other than that, no idea.

Thomas


  My html:
  wicket:panel
   form wicket:id=treeform
 div class=tree wicket:id=treeTable/div
   /form
  /wicket:panel

  My data code
  public String getName() {
   StringBuilder sb= new StringBuilder();
   sb.append(EZ: ).append(getPrice(getRoomRate().getPrice())).append( €);
   sb.append( DZ: ).append(getPrice(getRoomRate().getPrice2())).append(
  €\n); -- here the newline!!
   sb.append(  ().append(getDate(getRoomRate().getFromDate()));
   sb.append( - );
   sb.append(getDate(getRoomRate().getToDate())).append());
   return sb.toString();
  }


  Here is my code:

 TreeTable tree = new TreeTable(treeTable, treeModel, columns) {

   /**
* Represents a content of a cell in TreeColumn (column containing the
  actual tree).
* This has been copied to switch the label to a multiline instance.
* @author Matej Knopp
* @author r.dieckmann
*/
   class MyTreeFragment extends Fragment {

 /**
  * Constructor.
  * @param id the wicket:id of component
  * @param node current
  * @param level
  * @param renderNodeCallback
  *The call back for rendering nodes
  */
 @SuppressWarnings(deprecation)
 public MyTreeFragment(String id, final TreeNode node, int level,
  final IRenderNodeCallback renderNodeCallback) {
   super(id, fragment);

   add(newIndentation(this, indent, node, level));
   add(newJunctionLink(this, link, image, node));

   MarkupContainer nodeLink = newNodeLink(this, nodeLink, node);
   nodeLink.add(newNodeIcon(nodeLink, icon, node));
   nodeLink.add(new MultiLineLabel(label, new
  AbstractReadOnlyModel() {
 /**
  * @see
  org.apache.wicket.model.AbstractReadOnlyModel#getObject()
  */
 public Object getObject() {
   return renderNodeCallback.renderNode(node);
 }
   }));
   add(nodeLink);
 }
   }

   /**
* @see
  
 org.apache.wicket.extensions.markup.html.tree.table.TreeTable#newTreePanel(org.apache.wicket.MarkupContainer,
  java.lang.String, javax.swing.tree.TreeNode, int,
  
 org.apache.wicket.extensions.markup.html.tree.table.TreeTable.IRenderNodeCallback)
*/
   @Override
   protected Component newTreePanel(MarkupContainer pParent, String pId,
  TreeNode pNode, int pLevel, IRenderNodeCallback pRenderNodeCallback) {
 return new MyTreeFragment(pId, pNode, pLevel, pRenderNodeCallback);
   }

   /**
* @see
  
 org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree#newNodeLink(org.apache.wicket.MarkupContainer,
  java.lang.String, javax.swing.tree.TreeNode)
*/
   protected MarkupContainer newNodeLink(MarkupContainer pParent, String
  pId, final TreeNode pNode) {
 MarkupContainer m = newLink(pParent, pId, new ILinkCallback() {

   /**
* @see
  
 org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree.ILinkCallback#onClick(org.apache.wicket.ajax.AjaxRequestTarget)
*/
   public void onClick(AjaxRequestTarget target) {
 if (!getTreeState().isNodeSelected(pNode)) {
   getTreeState().selectNode(pNode, true);
   onNodeLinkClicked(target, pNode);
   updateTree(target);
 }
   }
 });
 DefaultMutableTreeNode t = (DefaultMutableTreeNode) pNode;
 if (t.getUserObject() instanceof TreeModelCategoryBean) {
   TreeModelCategoryBean c = (TreeModelCategoryBean)
  t.getUserObject();
   ICategoryTO categoryTO = c.getCategory();
   m.setEnabled(categoryTO != null  categoryTO.isAvailable());
 }
 return m;
   }

   /**
* @see
  
 org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree#onNodeLinkClicked(org.apache.wicket.ajax.AjaxRequestTarget,
  javax.swing.tree.TreeNode)
*/
   protected void onNodeLinkClicked(AjaxRequestTarget pTarget, TreeNode
  pNode) {
 super.onNodeLinkClicked(pTarget, pNode);
 DefaultMutableTreeNode dnode = (DefaultMutableTreeNode) pNode;
 ITreeModelBean current = (ITreeModelBean) dnode.getUserObject();
 if (current instanceof TreeModelCategoryBean) {
   refreshNodes(pTarget, pNode);
 } else if (current instanceof TreeModelPackageBean) {
   refreshNodes(pTarget, 

Page markup caching

2008-02-28 Thread Kaspar Fischer
Has anybody implemented page caching for Wicket? If possible, I'd  
like to

store the markup of a page in ehcache so that subsequent requests can be
served without invoking the rendering mechanism of the framework at all.

Being a wicket newbie, I am not sure whether such an approach might  
at all
be compatible with the framework? I understand that Wicket serializes  
pages

at some points, so if a page where handled from the page cache (without
informing Wicket), this might be a problem. Any experiences?

Background: I am porting a Tapestry 4 application to Wicket. In our old
application, we use two layers of caching, one at the application level
and one at the web presentation level. The former already exists and can
be reused without problems. The latter cache stores the generated markup
in ehcache and returns it -- without invoking the Tapestry rendering at
all -- on subsequent requests. (The cache activates only when the user
is not logged in, to make sure that the page content is static.)

Provided Wicket is fast enough, we can of course go without the page  
cache

but I have not enough experience with Wicket. In Tapestry, we saw quite
a difference in timing (20ms vs 300ms) for larger pages, but that might
be because we used lots of OGNL expressions in our Tapestry markup  
(which

is not Tapestry's but our fault, of course).

Many thanks for hints,
Kaspar

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



RE: Does something happen other than what html is output?

2008-02-28 Thread David Leangen

Hello.

  public void renderHead( final IHeaderResponse
   response )
  {
  response.renderString( cssLink );
  }

 Shouldn't this read

 response.renderCssReference( cssLink ),

 instead of

 response.renderString( cssLink );

  If I read the javadoc properly, #renderString( cssLink ), will just
 print the cssLink verbatim.

Yes, that's the whole point.

In my initial post, I mentioned that I wanted to render a file:// link.
IHeaderResponse.rednerCssReference( String ) only works for http:// and
https://.

The only way I could see to do this was to copy the way HeaderResponse
renders http and emulate this with file://.


The problem I'm encountering is that although the html is correct when I
view the source, my browser for some reason does not render the image or
css. If I copy the source and paste into a static html file, it works.


Cheers,
Dave



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



RE: Does something happen other than what html is output?

2008-02-28 Thread David Leangen

If oncomponenttag is used it should work.
 
   Really? I don't see why I'd need onComponentTag for the approach I'm
   using...
 
 I misunderstood, i though that sometimes the container was to render
 as an image tag and sometimes as a link tag, hence the oncomponenttag
 method :)

Oh, ok. I must not have explained well. Sorry.

Thank you very much for chiming in. :-)


Cheers,
Dave



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



Submitting an ajaxform with multipart/form-data

2008-02-28 Thread Michael Sparer

Hi, 

it's a known limitation that one cannot submit an ajaxform with multipart
enabled. but as i'd like to upload files without reloading the page i've
been looking for an elegant solution for this problem. 
a possible solution (it's even called an AJAX-pattern) is to post the form
data to a hidden inlineframe (iframe) and let the iframe submit the form.
but passing the values to the iframe, let the iframe submit the values, get
the state of the upload from the iframe and displaying results in the
regular form would result in a fair hack.

my question: has anybody a better solution to go about this problem or has
anyone any experience with the above scenario using an iframe? maybe wicket
already offers an easy way to do this that i haven't found yet?

regards, 
Michael

-
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/Submitting-an-ajaxform-with-multipart-form-data-tp15734375p15734375.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Does something happen other than what html is output?

2008-02-28 Thread Maurice Marrink
is the /resources/ path local to the user or to the server?
in the first case it could be the browser preventing a site from
accessing your local file system, which might be allowed if it sees it
is a local html file.
in the second case the server might prevent the browser from getting
that resource.

Maybe i missed an earlier post about this but why do you use file:// ?

Maurice

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



Re: remember last visited page

2008-02-28 Thread Maurice Marrink
Just like the RestartResponseAtInterceptPageExcpetion that will create
a new session or bind an already existing session, that might be ok,
but you mentioned Is there a way to remember the last page i visited
after i lose the session.
Which conflicts with your example where you keep the existing session
and add a user object of some sort.
If the intercept pages are not sufficient for you then maybe you could
give us a more detailed explanation of your app and what it should do.
For instance do you use stateless pages, do you use a subclass of
WebSession, etc.

Maurice

On Thu, Feb 28, 2008 at 11:56 AM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
You can probably look at this
  http://cwiki.apache.org/WICKET/using-intercept-pages.html



  On Thu, Feb 28, 2008 at 11:51 AM, freak182 [EMAIL PROTECTED] wrote:
  
Hello,
Is there a way to remember the last page i visited after i lose the 
 session.
What i mean that for example if im going to checkout but i forgot to login
first, When i click checkout button, it will redirect me to the login page
first then when authenticated it will go directly to checkout page. Any
codes will help :)
  
Thanks a lot.
  
Cheers.
--
View this message in context: 
 http://www.nabble.com/remember-last-visited-page-tp15733923p15733923.html
Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  

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



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



Re: CompoundModel based on proxies

2008-02-28 Thread Johan Compagner
Serialization is not a problem for what we have build now because we
dont keep references to the proxies in the session. We just use them
at construction time

On 2/27/08, James Carman [EMAIL PROTECTED] wrote:
 On 2/26/08, Johan Compagner [EMAIL PROTECTED] wrote:
  Yes i would like to have something like commons proxy because i dont
   want if possible a direct dependency on cglib. It would be coool that
   we have a default impl that is based on jdk itself (so only interface
   support). Then drop in cglib and you have support for also classes
 

 As soon as the mirrors pick up the release and it's available in the
 maven2 repository, I'll send out the 1.0 release announcement email.
 If you just can't wait, you can grab the distribution files from:

 http://www.apache.org/dist/commons/proxy/

 The website has already been updated:

 http://commons.apache.org/proxy/

 One thing that I think you'll be missing is serialization of the
 proxies.  After I thought about it a bit, I don't think I made all
 proxies serializable.  I'll put in a JIRA for that and get that out in
 a 1.1 release.

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



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



RE: Strict XHTML validation

2008-02-28 Thread Hoover, William
Add getMarkupSettings().setStripWicketTags(true); to your WebApplication class

-Original Message-
From: Kaspar Fischer [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 28, 2008 5:25 AM
To: users@wicket.apache.org
Subject: Strict XHTML validation


I am trying to validate my page using http://validator.w3.org/.
My page markup is:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http:// 
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http:// 
svn.apache.org/repos/asf/wicket/trunk/jdk-1.4/wicket/wicket-xhtml1- 
strict.dtd xml:lang=en lang=en
 head
meta http-equiv=Content-Type content=text/html;  
charset=utf-8 /
 titleWicket Quickstart Archetype Homepage/title
 /head
 body
p
 strongWicket Quickstart Archetype Homepage223/strong
/p
p
 span wicket:id=messagemessage will be here/span
   /p
 /body
/html

The validator complains that there is no attribute wicket:id. I am
not sure where exactly the problem lies: does the second xmlns violate
the standard, is the validator incorrect, ...?

Any ideas how to resolve this? I see work in progress at

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

but the markup there is basically mine but I cannot get it to validate.
Thanks,
Kaspar

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



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



RE: Does something happen other than what html is output?

2008-02-28 Thread David Leangen

 is the /resources/ path local to the user or to the server?

The url is a file:/// type url that points to a file on the local
filesystem.

 in the first case it could be the browser preventing a site from
 accessing your local file system, which might be allowed if it
 sees it is a local html file.

Ah... maybe you're right!

That could explain why it works with a local file (which could allow the
browser to assume that it is granted permissions to use files on the local
filesystem) but not from a file served remotely. H... interesting idea.

When I get back into the office tomorrow (I'm in Asia time), I'll try
serving up a static file remotely to test this theory.

If this is a permission problem, I wonder if there is a way around it...


 Maybe i missed an earlier post about this but why do you use file:// ?

Because my designer wants to be able to play around with the CSS without
having to mount an entire development version of Wicket. It is especially
tricky for us, since we are using it with OSGi, and the development setup is
not trivial for a non-programmer.

So, he can just do something like:

  http://www.blah.com/top/index.html?css=file:///path/to/css

And wicket will use this.

This system works perfectly well for a http:// url. I'm trying to simply
things for the designer by making it work with file:/// urls.


Thank you all for your ideas!


Cheers,
Dave



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



What about the FormComponentFragment?

2008-02-28 Thread Vitaly Tsaplin
 Hi!

Just one thought about a composite form components. The
FormComponentPanel is a perfect choice but sometimes writing a
component which has no complex markup it would be better choice to
have something like the FormComponentFragment... because often writing
a new components I am using some existing one as a base but I would
rather include it as a field then to subslass. Reasons can be
different including the fact that some methods like getModel defined
as final.

Thanks,
Vitaly

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



Re: [newbie question] How to refresh Image using an AjaxLink

2008-02-28 Thread Karol Wrzesniewski

Thanks for all your help.

NonCachingImage is exacly what I wanted.

It works fine but only after I open modal window, call setImageResource,  
close modal and reopen it again.


After first call of modal window default image is created, when I'm trying  
to change it nothing happens exacly like with plain Image objects. But  
when I close modal and open it again everything works as intended to,  
pictures are refreshing using chosen resources.


regards,
Zyx




Dnia 28-02-2008 o 10:22:40 Nino Saturnino Martinez Vazquez Wael  
[EMAIL PROTECTED] napisał(a):


:) I think thats the point of noncaching image thats already there, it's  
just that people gets confused by this...


Bernard Niset wrote:

Hi,
I had the same issue yesterday and found a solution somewhere else in  
this mailing list. Adding some random query to the url forces the  
browser not to reuse a cached image. To achieve that you have to  
subclass Image and override onComponentTag like this:


   @Override
   protected void onComponentTag(ComponentTag tag)
   {
   super.onComponentTag(tag);
   String src = (String) tag.getAttributes().get(src);
   src = src + rand= + Math.random();
   tag.getAttributes().put(src, src);
   }

Bernard.


Igor Vaynberg wrote:

most people want stable urls for their images i would imagine, so they
can be cached by the browser.

in case of ajax this doesnt work because the url has to change so that
browser needs to know to refresh it.

maybe image can know if its requested within an ajax request and
automatically add random noise to the url...there maybe room for
improvement here.

please add an rfe

-igor


On Wed, Feb 27, 2008 at 11:12 AM, Nino Saturnino Martinez Vazquez Wael
[EMAIL PROTECTED] wrote:

Should nocachingImage be default, and then have a cachingImage? Or  
would

 that result in the same amount of confusion? WDYT?

 As a couple of people has been confused by this...

 regards Nino



 Igor Vaynberg wrote:
  use NonCachingImage
 
  -igor
 
 
  On Wed, Feb 27, 2008 at 2:43 AM, Karol Wrzesniewski
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
   I'm having problems with refreshing an Image using AjaxLink.
 
   I have a ModalWindow. On it's left side theres a ListView  
containing Ajax

   links:
 
   --
   add(listaObrazow = new ListView(pics, obrazki) {
   public void populateItem(final ListItem listItem) {
   final String obr =  
(String)listItem.getModelObject();

   listItem.add(new Label(pic,new Model(obr)));
 
   listItem.add(new AjaxLink(picAjaxLink) {
   public void onClick(AjaxRequestTarget
   ajaxRequestTarget) {
 
   imgPreview.setImageResource(
   EbokTools.getImageResource(
   (String)listItem.getModelObject()
   )
   );
 

ajaxRequestTarget.addComponent(imgPreview);

 
 

myModal.setObraz((String)listItem.getModelObject());

ajaxRequestTarget.addComponent(wyborObrazow);

   }});
   }
   });
   --
 
 
 
   imgPreview is an Image object, placed on the same modal Window.  
What Im
   trying to achieve is to refresh this image after the AjaxLink is  
clicked.
   Unfortunately it doesn't. After I click on AjaxLink content of  
form

   wyborObrazow is refreshed, but image stays unchanged.
 
   Image resource is being changed - i know that because after i  
close modal
   and open it again imgPreview is showing me  the right  
Resource.

 
   The problem is that calling  
ajaxRequestTarget.addComponent(imgPreview);

   after changing imageResource doesn't seem to be enough.
 
   I would be very grateful for some hints.
 
   best regards,
   Zyx
 
   --
 

-

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

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

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




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





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











--
___
Karol Wrześniewski, pokój: SSE III F3.5, GG:3494610

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



Re: IllegalStateException with AjaxFallbackDefaultDataTable

2008-02-28 Thread Antoine van Wel
Any updates on this one?

I think I'm experiencing the same issue; I'm building a DataView, in
its nodes there's a TextField with an OnChangeAjaxBehavior added to
it.

Then, from the RequestCycle, an error occurs when cleaning up the
AjaxRequestTarget, followed by an IllegalStateException: no page found
for component ... referring to this textfield.


Thanks,
Antoine.


On Sat, Feb 9, 2008 at 12:59 AM, jwray [EMAIL PROTECTED] wrote:


  Igor,

  thanks for the help, I'll have to look at in detail next week.

  What is odd to me is that I'm not doing anything out of the ordinary. I add
  the table to the ajax target, and I don't remove any components myself.

  Jonny




  igor.vaynberg wrote:
  
   hm, i still dont see the problem spot
  
   the error is apparent
  
   you are adding something to the ajax request target that is then
   removed from the page, so when ajaxrequesttarget is trying to detach
   the page it cant, because it does
  
   component.getPage().detach();
  
   apparently the component is removed from the page, so getpage() throws
   that error you see.
  
   if i were you i would set a breakpoint at that line, and see what
   component exactly is removed from the page, and then try to figure out
   why it is removed from the page and yet is added to the ajax target.
  
   -igor
  
  
   On Feb 8, 2008 9:47 AM, jwray [EMAIL PROTECTED] wrote:
  
   Hi Igor,
  
   I was hoping it would be an obvious problem. Here's my table construction
   code (is there a better way of posting code?)
  
   ListIColumn columns = new ArrayListIColumn();
   PostOnSubmitAction peptideUpdateAction = new PostOnSubmitAction();
   columns.add(new AjaxEditablePropertyColumn(peptideUpdateAction, new
   Model(Comments), comments, comments, REQUIRED_ROLE));
   PeptideDataProvider dataProvider = new PeptideDataProvider(service);
   peptideViewTable = new AjaxFallbackDefaultDataTable(dataTable, columns,
   dataProvider, 25);
  
  
   where the PostOnSubmitAction below is called from the onSubmit method of
   the
   AjaxEditableLabel within the AjaxEditablePropertyColumn. I'm attempting
   to
   refresh the table when an OptimisticLockingFailureException occurs (and
   so
   load the data altered by another user).
  
   private class PostOnSubmitAction implements
   AjaxEditablePropertyColumn.PostOnSubmitAction{
  
   public void postOnSubmit(AjaxRequestTarget target, Object value)
   {
   target.addComponent(getStatusPanel());
   Peptide peptide = (Peptide)value;
   try{
   peptideServices.updatePeptide(peptide);
   }
   catch(AccessDeniedException e){
   String message = You don't have permission to
   perform this operation;
   PeptidePage.this.error(message);
   }
   catch(OptimisticLockingFailureException e){
   String message = Another user modified this data
   before you. Review the
   new data and resubmit changes if needed.;
   PeptidePage.this.error(message);
   target.addComponent(peptideViewTable);
   }
   catch(RuntimeException e){
   String message = An unexpected error occured.
   +e.getMessage();
   PeptidePage.this.error(message);
   }
   }
   }
  
   thanks
   Jonny
  
  
  
   igor.vaynberg wrote:
   
some code would help us help you...
   
-igor
   
  
   --
   View this message in context:
   
 http://www.nabble.com/IllegalStateException-with-AjaxFallbackDefaultDataTable-tp15347366p15360512.html
  
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/IllegalStateException-with-AjaxFallbackDefaultDataTable-tp15347366p15366611.html


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


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





-- 
Antoine van Wel
http://www.wellawaretech.com

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



Re: Small shared resource question...

2008-02-28 Thread Kent Tong

Try:

public class P1 extends WebPage {
private ResourceReference resourceRef;

static {
WebApplication app = (WebApplication) Application.get();
mount(app, Locale.ENGLISH);
mount(app, Locale.CHINESE);
}

private static void mount(WebApplication app, Locale locale) {
ResourceReference resourceRef = makeResourceReference();
resourceRef.setLocale(locale);
app.mountSharedResource(/download/cvs_ + locale + .pdf, 
resourceRef
.getSharedResourceKey());
}

@Override
protected void onBeforeRender() {
super.onBeforeRender();
resourceRef.setLocale(getLocale());
}

public P1() {
resourceRef = makeResourceReference();
ResourceLink link = new ResourceLink(link, resourceRef);
add(link);
Link changeLocale = new Link(changeLocale) {
private int n = 0;

@Override
public void onClick() {
n++;
Locale newLocale = (n % 2 == 0) ? Locale.ENGLISH
: Locale.CHINESE;
getSession().setLocale(newLocale);
}
};
add(changeLocale);
}

private static ResourceReference makeResourceReference() {
return new ResourceReference(cvs.pdf) {
@Override
protected Resource newResource() {
return new PDFResource(getLocale());
}
};
}

}
public class PDFResource extends DynamicWebResource {

public PDFResource(Locale locale) {
super(locale);
}

@Override
protected ResourceState getResourceState() {
ResourceState state = new ResourceState() {

@Override
public byte[] getData() {
return readPDF();
}

@Override
public String getContentType() {
return application/pdf;
}

};
return state;
}

protected byte[] readPDF() {
try {
File f = new File(c:/tmp/cvs_+getLocale()+.pdf);
FileInputStream s = new FileInputStream(f);
byte[] content = new byte[(int) f.length()];
s.read(content);
s.close();
return content;
} catch (IOException e) {
throw new RuntimeException(e);
}
}

}


-
--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA
-- 
View this message in context: 
http://www.nabble.com/Re%3A-Small-shared-resource-question...-tp15663443p15737491.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Strict XHTML validation

2008-02-28 Thread Kaspar Fischer


On 28.02.2008, at 13:47, Hoover, William wrote:


getMarkupSettings().setStripWicketTags(true);


Great! Thanks a lot.

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



New quy question on converting input data

2008-02-28 Thread rmattler

If a phone number is input as (330) 555-1212 on the form when the form is
saved I want the data stored as 3305551212 in the database and when
displayed again on the form as (330) 555-1212.

As a bonus how do I would like data entered as 3305551212 and converted to
(330) 555-1212 on the onBlur event.  

What is the Wicket Way to do this.
-- 
View this message in context: 
http://www.nabble.com/New-quy-question-on-converting-input-data-tp15738847p15738847.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Security Features offered by Wicket

2008-02-28 Thread Arthur Ahiceh
Hi guys,

I have a very critical application in a banking environment and I wanted to
resolve the following questions over Security. This points are questioned
after read some documentation from mailing lists (webappsec, struts, wicket,
etc.) and projects like HDIV[2].

1. ESCAPING CHARACTERS: I have read in wicket's mailing list that all wicket
components escape values. I have done some tests in wicket-examples
application distributed in wicket-1.3.1 release and I have modified, in
FormInput.properties file, value of key string with this value
scriptalert(xss);/script and I see that this script is executed when
I load the page with this message key. So, i don't know if all components
escape or not values!

2. INTEGRITY: Actualy in my bank application we have hidden fileds in our
forms to store critical values and I want to know if wicket by default
guarantees data integrity or not. I want to guarantee integrity like HDIV
does in Struts and Spring MVC apps... is it possible in wicket?

I have read in wicket's documentation that it is possible to encrypt urls
ensuring integrity (
http://cwiki.apache.org/WICKET/url-coding-strategies.html) but is it
possible to apply this strategy to forms? Or data tampering attacks are
possible in wicket forms with hidden fields?

So, can Wicket ensure data integrity?

3. CONFIDENTIALITY: After read HDIV's reference document I have see that in
our application data base identifiers are presented in html pages as combo
values ids and now we want to hide these values. I thought about
implementing a common renderer for all my wicket components to be
responsible for returning a value relative to the original values, but I do
not like it because it is probably that my programmers don't use it in all
cases and it is a risk that I don't want to run. Is there any wicket
functionality to return confidential data, by default, for  form's values? I
do not want to rely on developers...

4. RANDOM TOKENS: I want to avoid CSRF attacks and I have read (
http://www.owasp.org/index.php/Top_10_2007-A5) that a possible solution is
to add random tokens to all requests. Is it possible to add a random
parameter to requests automatically in wicket?

I need your help to answer this questions, pls!

thanks!

[1]
http://www.nabble.com/Shout-more-about-security-advantages-of-Wicket--to14800934.html#a14816425
[2] http://www.hdiv.org/docs/hdiv-reference.pdf


Testing (Ajax)TabbedPanel

2008-02-28 Thread Sven Schliesing

Hey,

I've written a test for a page which contains an AjaxTabbedPanel. 
Right now I'm testing the click on the second tab like this:


AjaxTabbedPanel tabbedPanel = (AjaxTabbedPanel)
  tester.getComponentFromLastRenderedPage(panel:tabPanel);
WebMarkupContainer tabs = (WebMarkupContainer)
  tabbedPanel.get(tabs-container:tabs);

WebMarkupContainer siteTab = (WebMarkupContainer) tabs.get(1);
AjaxFallbackLink sitesTabLink = (AjaxFallbackLink) siteTab.get(link);

tester.clickLink(sitesTabLink.getPageRelativePath(), true);


This works quite good. But I'm having problems with using too much 
internal knowledge (e.g. the tabs-container id) of the AjaxTabbedPanel.


Sure, this is more an academically problem. But I'd like to know if 
there's a better approach.



Thanks in advance!


Sven

--
subshell GmbH
Sven Schliesing
Margaretenstraße 43at +49.40.431 362-23
20357 Hamburg   f +49.40.431 362-29
http://www.subshell.com [EMAIL PROTECTED]

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



Re: Security Features offered by Wicket

2008-02-28 Thread Nick Heudecker
Hi Arthur,

While I can't address all of your concerns, I can address a couple.


 1. ESCAPING CHARACTERS: I have read in wicket's mailing list that all
 wicket
 components escape values. I have done some tests in wicket-examples
 application distributed in wicket-1.3.1 release and I have modified, in
 FormInput.properties file, value of key string with this value
 scriptalert(xss);/script and I see that this script is executed
 when
 I load the page with this message key. So, i don't know if all components
 escape or not values!


I'm not familiar with that example, but from my experience, Wicket
components escape HTML unless specifically told otherwise.




 2. INTEGRITY: Actualy in my bank application we have hidden fileds in our
 forms to store critical values and I want to know if wicket by default
 guarantees data integrity or not. I want to guarantee integrity like HDIV
 does in Struts and Spring MVC apps... is it possible in wicket?


Hidden fields are not required with Wicket applications since the data that
was formerly stored in hidden fields in other frameworks is maintained in
Wicket's model classes.  I had a hard time understanding this at first as
well, but the essential element is you don't need hidden fields in Wicket
applications.




 I have read in wicket's documentation that it is possible to encrypt urls
 ensuring integrity (
 http://cwiki.apache.org/WICKET/url-coding-strategies.html) but is it
 possible to apply this strategy to forms? Or data tampering attacks are
 possible in wicket forms with hidden fields?

 So, can Wicket ensure data integrity?

 3. CONFIDENTIALITY: After read HDIV's reference document I have see that
 in
 our application data base identifiers are presented in html pages as combo
 values ids and now we want to hide these values. I thought about
 implementing a common renderer for all my wicket components to be
 responsible for returning a value relative to the original values, but I
 do
 not like it because it is probably that my programmers don't use it in all
 cases and it is a risk that I don't want to run. Is there any wicket
 functionality to return confidential data, by default, for  form's values?
 I
 do not want to rely on developers...


This goes alone with my earlier response.  Unless you explicitly present
them to the user, there is no need to expose internal identifiers.




 4. RANDOM TOKENS: I want to avoid CSRF attacks and I have read (
 http://www.owasp.org/index.php/Top_10_2007-A5) that a possible solution is
 to add random tokens to all requests. Is it possible to add a random
 parameter to requests automatically in wicket?


Perhaps someone else can chime in here, but I don't think this is a problem
with Wicket applications.




 I need your help to answer this questions, pls!

 thanks!

 [1]

 http://www.nabble.com/Shout-more-about-security-advantages-of-Wicket--to14800934.html#a14816425
 [2] http://www.hdiv.org/docs/hdiv-reference.pdf




-- 
Nick Heudecker
Professional Wicket Training  Consulting
http://www.systemmobile.com

Eventful - Intelligent Event Management
http://www.eventfulhq.com


Re: focusComponent

2008-02-28 Thread Johan Compagner
I think we do already something like that in the wicket code, setting
the focus after we touch the document. So i am curious why you have to
do that

On 2/27/08, NateBot20002 [EMAIL PROTECTED] wrote:


 NateBot2000 wrote:
 
  I'm trying to use AjaxRequestTarget.focusComponent(Component) to set the
  focus in a form that is returned by Ajax.
 

 I found that if I use setTimeout to add a 500ms delay before focusing it
 works fine.  You might try that if you ever come across this problem...

 NateBot2000
 --
 View this message in context:
 http://www.nabble.com/focusComponent-tp15680648p15716401.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Security Features offered by Wicket

2008-02-28 Thread Igor Vaynberg
On Thu, Feb 28, 2008 at 7:53 AM, Nick Heudecker [EMAIL PROTECTED] wrote:
 Hi Arthur,

  While I can't address all of your concerns, I can address a couple.

   1. ESCAPING CHARACTERS: I have read in wicket's mailing list that all
   wicket
   components escape values. I have done some tests in wicket-examples
   application distributed in wicket-1.3.1 release and I have modified, in
   FormInput.properties file, value of key string with this value
   scriptalert(xss);/script and I see that this script is executed
   when
   I load the page with this message key. So, i don't know if all components
   escape or not values!


  I'm not familiar with that example, but from my experience, Wicket
  components escape HTML unless specifically told otherwise.

I dont think we escape certain values that come from .properties
files. These files are maintained by programmers and are never written
to by users, so whats the point of escaping them?

   2. INTEGRITY: Actualy in my bank application we have hidden fileds in our
   forms to store critical values and I want to know if wicket by default
   guarantees data integrity or not. I want to guarantee integrity like HDIV
   does in Struts and Spring MVC apps... is it possible in wicket?

  Hidden fields are not required with Wicket applications since the data that
  was formerly stored in hidden fields in other frameworks is maintained in
  Wicket's model classes.  I had a hard time understanding this at first as
  well, but the essential element is you don't need hidden fields in Wicket
  applications.

right. to put it simpler - what used to be in hidden fields is now
stored in session

   I have read in wicket's documentation that it is possible to encrypt urls
   ensuring integrity (
   http://cwiki.apache.org/WICKET/url-coding-strategies.html) but is it
   possible to apply this strategy to forms? Or data tampering attacks are
   possible in wicket forms with hidden fields?
  
   So, can Wicket ensure data integrity?

Since hidden values are stored in session instead - yes. Users cannot
temper with things you do not explicitly expose.

   4. RANDOM TOKENS: I want to avoid CSRF attacks and I have read (
   http://www.owasp.org/index.php/Top_10_2007-A5) that a possible solution is
   to add random tokens to all requests. Is it possible to add a random
   parameter to requests automatically in wicket?

Wicket urls are already session-relative and somewhat random (depend
on the path you take through the application), so I am not sure if
anything more needs to be done...

-igor




  Perhaps someone else can chime in here, but I don't think this is a problem
  with Wicket applications.




  
  
   I need your help to answer this questions, pls!
  
   thanks!
  
   [1]
  
   
 http://www.nabble.com/Shout-more-about-security-advantages-of-Wicket--to14800934.html#a14816425
   [2] http://www.hdiv.org/docs/hdiv-reference.pdf
  



  --
  Nick Heudecker
  Professional Wicket Training  Consulting
  http://www.systemmobile.com

  Eventful - Intelligent Event Management
  http://www.eventfulhq.com


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



Re: IllegalStateException with AjaxFallbackDefaultDataTable

2008-02-28 Thread jwray

Antoine,

I actually approached the problem from a different direction in the end and
avoided this error.

But, before I did that I tracked it down to calling super.onSubmit call in
the overridden onSubmit method of the AjaxEditableLabel. I didn't get any
further than that I'm afraid.

hope it helps,

Jonny


Antoine van Wel wrote:
 
 Any updates on this one?
 
 I think I'm experiencing the same issue; I'm building a DataView, in
 its nodes there's a TextField with an OnChangeAjaxBehavior added to
 it.
 
 Then, from the RequestCycle, an error occurs when cleaning up the
 AjaxRequestTarget, followed by an IllegalStateException: no page found
 for component ... referring to this textfield.
 
 
 Thanks,
 Antoine.
 
 

-- 
View this message in context: 
http://www.nabble.com/IllegalStateException-with-AjaxFallbackDefaultDataTable-tp15347366p15741718.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Security Features offered by Wicket

2008-02-28 Thread Arthur Ahiceh
First, thank you for your quick reply!


1. ESCAPING CHARACTERS: I have read in wicket's mailing list that all
wicket
components escape values. I have done some tests in wicket-examples
application distributed in wicket-1.3.1 release and I have modified,
 in
FormInput.properties file, value of key string with this value
scriptalert(xss);/script and I see that this script is
 executed
when
I load the page with this message key. So, i don't know if all
 components
escape or not values!
 
 
   I'm not familiar with that example, but from my experience, Wicket
   components escape HTML unless specifically told otherwise.


 I dont think we escape certain values that come from .properties
 files. These files are maintained by programmers and are never written
 to by users, so whats the point of escaping them?



right. I was thinking that wicket:message component could be abble to read
data from Wicket's models. I confused with Struts' tag bean:message. I
have seen that components like FeedbackPanel escapes messages so XSS attacks
like commented here (http://shh.thathost.com/secadv/spring-form-xss/) are
resolved in Wicket!



   2. INTEGRITY: Actualy in my bank application we have hidden fileds in
 our
forms to store critical values and I want to know if wicket by
 default
guarantees data integrity or not. I want to guarantee integrity like
 HDIV
does in Struts and Spring MVC apps... is it possible in wicket?
 
   Hidden fields are not required with Wicket applications since the data
 that
   was formerly stored in hidden fields in other frameworks is maintained
 in
   Wicket's model classes.  I had a hard time understanding this at first
 as
   well, but the essential element is you don't need hidden fields in
 Wicket
   applications.


 right. to put it simpler - what used to be in hidden fields is now
 stored in session


I have read in wicket's documentation that it is possible to encrypt
 urls
ensuring integrity (
http://cwiki.apache.org/WICKET/url-coding-strategies.html) but is it
possible to apply this strategy to forms? Or data tampering attacks
 are
possible in wicket forms with hidden fields?
   
So, can Wicket ensure data integrity?


 Since hidden values are stored in session instead - yes. Users cannot
 temper with things you do not explicitly expose.



right. Wicket's models will have these hiddens' information so is not
possible to tamper these data values. ok!


   4. RANDOM TOKENS: I want to avoid CSRF attacks and I have read (
http://www.owasp.org/index.php/Top_10_2007-A5) that a possible
 solution is
to add random tokens to all requests. Is it possible to add a random
parameter to requests automatically in wicket?


 Wicket urls are already session-relative and somewhat random (depend
 on the path you take through the application), so I am not sure if
 anything more needs to be done...


To prevent CSRF attacks you must to add some random values to all requests
because session-relative values could be hit it, you have to think that
wicket urls allways have the same format
(?wicket:interface=:0:goGerman::ILinkListener::) and it is simple to
construct requests for CSRF attacks.

Arthur.


OT: Wicket web.xml configuration settings and maven

2008-02-28 Thread Doug Leeper

This is slightly off topic but it has todo with our wicket app and utilizing
maven to create the builds.

Maven is new to us and slightly understand the profiling concept in maven
but not sure how to the following...on our production build, we would like
to have the web.xml configuration setting changed from development to
production without checking out and manually modifying before building.

Is there any easy way to do this in maven or do we have have set the java
runtime parameter -Dwicket.configuration=production

Any suggestion or best practice?

TIA,

- Doug


-- 
View this message in context: 
http://www.nabble.com/OT%3A-Wicket-web.xml-configuration-settings-and-maven-tp15744999p15744999.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: get Form information after submit

2008-02-28 Thread taygolf

hey igor thanks for all the help I really am learning a lot here.

I am having an issue forwarding the model tp my textfiled in my panel and I
wanted to show you my code and see what you thought the issue is. I am sure
it is something simple I have overlooked.

Template.java
public class Template extends WebPage {
private String teststring;
Form form = new Form(myform) {
protected void onSubmit() {
callDatabase(teststring);//this is always coming back null and 
I am not
sure why.
};
};
form.setMarkupId(myform);
form.setOutputMarkupId(true);
add(form);
form.add(new FeedbackPanel(feedback));
form.add(new TextFieldPanel(textfield, new PropertyModel(this,
teststring)));
}


Template.html
body
form wicket:id=myform
  all feedback messages go here!
  TextFieldPanel go here
/form
/body

TextFieldPanel.java

public TextFieldPanel(String id, PropertyModel pm) {
  super(id, pm);
  add(new RequiredTextField(textField1, pm));
}


TextFieldPanel.html
wicket:panel
input wicket:id=textField1 type=text/
/wicket:panel


Now I was thinking that since I sent the PropertyModel to the TextFieldPanel
it should work but it did not. Is there an inheritance that i need to do to
get this to work? The goal here is to create a bunch of textFields on the
fly but first I would like to get this working so I know what I am doing
hince the simple example of my code.

Thanks again for the help

T


igor.vaynberg wrote:
 
 no, it wont change, just have the panel forward the model to the
 textfield.
 
 -igor
 
 
 On Wed, Feb 27, 2008 at 1:50 PM, taygolf [EMAIL PROTECTED] wrote:

  Thanks igor I really appreciate the help. My code was really close but I
 was
  not creating:

 private object selection1;
   private object selection2;

  which was giving me my issues of getting the object in the onSubmit
  override. I do not know why I did not see something that simple I think
 I
  was just blocked.

  Will the code change at all if the textfield on page 2 is created in
 nested
  panels. Since I am creating my form on the fly the textfield will be in
 a
  panel nested in a panel. I might be able to change my code to allow just
 one
  panel but I am not sure yet.

  Thanks again

  T



  igor.vaynberg wrote:
  
   class page1 {
 private object selection1;
 private object selection2;
  
 public page1() {
 form form=new form(form) {
onsubmit() { setresponsepage(new
 page2(selection1,selection2)); }
 }
 form.add(new dropdownchoice(s1, new propertymodel(this,
   selection1), ...));
 form.add(new dropdownchoice(s2, new propertymodel(this,
   selection2), ...));
 }
   }
  
   class page2 {
  private final object selection1;
  private final object selection2;
  private final String text;
  
  public page2(object selection1, object selection2) {
 this.selection1=selection1; this.selection2=selection2;
 form=new form(form) {
 onsubmit() {
 sendemails(selection1,selection2,text);
 savetodb(selection1,selection2,text);
  setresponsepage(donepage.class);
  }
  }
  form.add(new textfield(tf, new propertymodel(this,text)));
}
   }
  
   -igor
  
   On Wed, Feb 27, 2008 at 11:16 AM, taygolf [EMAIL PROTECTED]
   wrote:
  
yes all of my experiance is in JSP so I guess I am just confused
 about
   how
forms work in wicket compared to JSP.  Maybe you can help me
 understand
   and
suggest a way to accomplish what I am looking to do.
  
I have a form that takes in 2 dropdown chioces. When selected these
dropdownchoices are set to session variables. I then set the
 response
   page
to a new page with a form. that form is created off of a query based
 on
   what
was selected in the 2 dropdown choices. I have all of this working
   today.
  
Now when the form is filled out I want to save the information to
 the
database, make a few other calls to push the data to outside
   applications
and databases and send emails and things like that. Then I simply
 want
   to
display that the form was submitted properly.
  
There is no need to see the form once it is submitted so that is why
 I
   want
to push it to another page but if I can override onSubmit to insert
 the
   data
in the database then all I would have to do is set the response page
 to
   a
simple html page that said your work is done or something like that.
  
I guess that would work perfect.
  
The one question I still have is how can I get the fileds from the
 panel
   in
the onsubmit call? say my panel has a textfield in it and I set the
   markupId
to test. how can I get that in the onsubmit call so I can create
 my
   new
record in the database?
  
I am sorry that i have so many questions. I am very new to wicket.
 only
about 2 weeks worth of looking at it and 

Re: Pickup up new markup without restarting webapp

2008-02-28 Thread Jay Hogan
Chris,

Generating static markup files is not really the Wicket way of doing
things. Couldn't you just use multiple panels and dynamically add/replace as
needed (see
http://cwiki.apache.org/WICKET/create-dynamic-markup-hierarchies-using-panels.html)?
Or maybe variations will work for you (see
http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?

If neither of these fits th bill, you could try using a
ReloadingWicketFilter:
http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/protocol/http/ReloadingWicketFilter.html

Cheers,
Jay
On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman [EMAIL PROTECTED]
wrote:

 Is there a wicket mode I can configure in which new markup (eg., new
 markup variations) can be picked up at run time without restarting the
 app?

 In our app we can create/generate new markup at runtime. We don't want
 to have to force a bounce of the web app for wicket to 'see' this new
 markup.

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




-- 

Computer Science: solving today's problems tomorrow.


div close tag error

2008-02-28 Thread Michael Mehrle
I have div like this:

div wicket:id=somePanel
a wicket:id=someModal
wicket:message key=label.link /
/a
/div

My code is:

SomePanel somePanel - new SomePanel(somePanel, someModel);
..
somePanel.add(new AjaxLink(openModal) {
..
}

I keep getting an error message: WicketMessage: close tag not found for
tag: div wicket:id=somePanel

Anyone any idea what I am doing wrong?

Thanks!

Michael


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



Re: Pickup up new markup without restarting webapp

2008-02-28 Thread Jay Hogan
Chris,

Have you looked at subclassing MarkupCache? I'm just a Wicket user so one of
the devs might want to weigh in but that is where I would start looking.

http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/markup/MarkupCache.html

Cheers,
Jay

On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman [EMAIL PROTECTED]
wrote:

  Chris,
 
  Generating static markup files is not really the Wicket way of doing
  things. Couldn't you just use multiple panels and dynamically
 add/replace
  as needed ...create-dynamic-markup-hierarchies-using-panels.html?

 The scope of different markup we use involves massive changes to the
 whole page, not just a few panels so this solution won't work well for
 us.

  Or maybe variations will work for you (see
  http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?

 We do use variations - therein lies the problem: A new variation is
 generated to the file system by the web app but when wicket tries to
 render the page using that new variation the variation's markup will be
 ignored until after we bounce the web app.

  If neither of these fits th bill, you could try using a
  ReloadingWicketFilter:
 
 http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/protohttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/proto
 co
  l/http/ReloadingWicketFilter.html

 Does this solution cause a reloading of the entire web app when a new
 markup is detected? If so, ouch! The markup files can be regenerated
 quite frequently and we can't afford to bounce the whole web app each
 time.

 Is there an interface used to provide the markup to wicket for which we
 can provide our own implementation and do the loading and caching of
 markup and checking for new markup ourselves?

 
  Cheers,
  Jay
  On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
  [EMAIL PROTECTED]
  wrote:
 
   Is there a wicket mode I can configure in which new markup (eg., new
   markup variations) can be picked up at run time without restarting
 the
   app?
  
   In our app we can create/generate new markup at runtime. We don't
 want
   to have to force a bounce of the web app for wicket to 'see' this
 new
   markup.
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  
  Computer Science: solving today's problems tomorrow.

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




-- 

Computer Science: solving today's problems tomorrow.


RE: div close tag error

2008-02-28 Thread Michael Mehrle
Oh, I just typed this as a simplified example - it's properly done in my real 
code.

Any other suggestions?

-Original Message-
From: Thijs [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 28, 2008 12:56 PM
To: users@wicket.apache.org
Subject: Re: div close tag error

Wicket:id=someModal is missing a 

Michael Mehrle wrote:
 I have div like this:

 div wicket:id=somePanel
   a wicket:id=someModal
   wicket:message key=label.link /
   /a
 /div

 My code is:

 SomePanel somePanel - new SomePanel(somePanel, someModel);
 ..
 somePanel.add(new AjaxLink(openModal) {
   ..
 }

 I keep getting an error message: WicketMessage: close tag not found for
 tag: div wicket:id=somePanel

 Anyone any idea what I am doing wrong?

 Thanks!

 Michael


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

   


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



RE: Pickup up new markup without restarting webapp

2008-02-28 Thread Chris Colman
I wonder which of the methods I need to override:

protected  IMarkupLoader getMarkupLoader() 
  In case there is a need  

In my app I already override ResourceStreamLocator to tell wicket where
to find the markup (as it can't be in the web app itself for our app).

Are there any other methods in that class which would be appropriate for
overriding? 

 Chris,
 
 Have you looked at subclassing MarkupCache? I'm just a Wicket user so
one
 of
 the devs might want to weigh in but that is where I would start
looking.
 

http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/marku
p/
 MarkupCache.html
 
 Cheers,
 Jay
 
 On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman
 [EMAIL PROTECTED]
 wrote:
 
   Chris,
  
   Generating static markup files is not really the Wicket way of
doing
   things. Couldn't you just use multiple panels and dynamically
  add/replace
   as needed ...create-dynamic-markup-hierarchies-using-panels.html?
 
  The scope of different markup we use involves massive changes to the
  whole page, not just a few panels so this solution won't work well
for
  us.
 
   Or maybe variations will work for you (see
   http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?
 
  We do use variations - therein lies the problem: A new variation is
  generated to the file system by the web app but when wicket tries to
  render the page using that new variation the variation's markup will
be
  ignored until after we bounce the web app.
 
   If neither of these fits th bill, you could try using a
   ReloadingWicketFilter:
  
 

http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/proto
h

ttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/prot
o
  co
   l/http/ReloadingWicketFilter.html
 
  Does this solution cause a reloading of the entire web app when a
new
  markup is detected? If so, ouch! The markup files can be regenerated
  quite frequently and we can't afford to bounce the whole web app
each
  time.
 
  Is there an interface used to provide the markup to wicket for which
we
  can provide our own implementation and do the loading and caching of
  markup and checking for new markup ourselves?
 
  
   Cheers,
   Jay
   On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
   [EMAIL PROTECTED]
   wrote:
  
Is there a wicket mode I can configure in which new markup (eg.,
new
markup variations) can be picked up at run time without
restarting
  the
app?
   
In our app we can create/generate new markup at runtime. We
don't
  want
to have to force a bounce of the web app for wicket to 'see'
this
  new
markup.
   
   
 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
   --
   
   Computer Science: solving today's problems tomorrow.
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 --
 
 Computer Science: solving today's problems tomorrow.

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



Wicket Wizard form need to add custom validation to each panel

2008-02-28 Thread AshleyAbraham

Hi everyone, 
   I am working on a wicket wizard component, I am trying to add an
AbstractFormValidation to each wizardStep, so when the wizardStep is
added/replaced the wizard form will know how to custom validate that
particular wizardStep.

Since I am not able to find or access the wizard form directly inside the
wizardStep I am overriding the getForm() in Wizard.class and instantiating
the form in my class's constructor so that getForm() wouldn't be null. The
problem which comes by doing that is all the validators are added to the
form and now it validates all the wizardSteps every time the form is
submitted. 

Can someone help me??? Also, Please point me if my approach is wrong. 

Basically what I would like is when the form is submitted I want the
activeWizardSteps validation to be validated.

Thanks
Ashley
-- 
View this message in context: 
http://www.nabble.com/Wicket-Wizard-form-need-to-add-custom-validation-to-each-panel-tp15746917p15746917.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Pickup up new markup without restarting webapp

2008-02-28 Thread Jay Hogan
Chris,

I'm not that familiar with the inner workings of the API but based on the
description in the Javadoc, I think you are going to need to provide a
custom implementation of IMarkupCache.

If you are looking for a simpler solution, you could enter an RFE for new
property on iMarkupSettings that replicates the DEV mode markup reload
functionality.

Good luck,
Jay
On Thu, Feb 28, 2008 at 4:50 PM, Chris Colman [EMAIL PROTECTED]
wrote:

 The interesting thing is that a bounce of the app reads the new variants
 without a problem. This seems to indicate to me that there must be some
 initial 'markup discovery' operation when wicket starts up and only
 those markup files found during that discovery operation can be loaded,
 ever.

 It is interesting that in development mode changed markups will be
 detected and the latest markup will be used - this is a development mode
 feature we definitely need in production so that we can change markup
 without requiring an app bounce.

 If wicket can detect changed markup when in development mode there must
 be some 'flag' or 'switch' that we can turn on to tell wicket to detect
 new markup as well. How hard would this be to add?

 Is not looking for new markups a performance based design decision?

 It's not like wicket would have to poll the markup directories
 constantly - it only needs to check for the existence of a markup file
 when requested and only if it's not already found in the cache so a
 check of the file system would only occur the very first time a new page
 was requested because then it would not exist in the cache. Further
 requests would merely return the cached version. I would think that this
 would have negligible affect on performance.



  -Original Message-
  From: Jay Hogan [mailto:[EMAIL PROTECTED]
  Sent: Friday, 29 February 2008 8:23 AM
  To: users@wicket.apache.org
  Subject: Re: Pickup up new markup without restarting webapp
 
  Chris,
 
  Have you looked at subclassing MarkupCache? I'm just a Wicket user so
 one
  of
  the devs might want to weigh in but that is where I would start
 looking.
 
 
 http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/marku
 p/http://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/markup/
  MarkupCache.html
 
  Cheers,
  Jay
 
  On Thu, Feb 28, 2008 at 4:01 PM, Chris Colman
  [EMAIL PROTECTED]
  wrote:
 
Chris,
   
Generating static markup files is not really the Wicket way of
 doing
things. Couldn't you just use multiple panels and dynamically
   add/replace
as needed ...create-dynamic-markup-hierarchies-using-panels.html?
  
   The scope of different markup we use involves massive changes to the
   whole page, not just a few panels so this solution won't work well
 for
   us.
  
Or maybe variations will work for you (see
http://cwiki.apache.org/WICKET/multiple-markups-per-page.html)?
  
   We do use variations - therein lies the problem: A new variation is
   generated to the file system by the web app but when wicket tries to
   render the page using that new variation the variation's markup will
 be
   ignored until after we bounce the web app.
  
If neither of these fits th bill, you could try using a
ReloadingWicketFilter:
   
  
 
 http://people.apache.org/~tobrien/wicket/apidocs/org/apache/wicket/protohttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/proto
 h
 
 ttp://people.apache.org/%7Etobrien/wicket/apidocs/org/apache/wicket/prot
 o
   co
l/http/ReloadingWicketFilter.html
  
   Does this solution cause a reloading of the entire web app when a
 new
   markup is detected? If so, ouch! The markup files can be regenerated
   quite frequently and we can't afford to bounce the whole web app
 each
   time.
  
   Is there an interface used to provide the markup to wicket for which
 we
   can provide our own implementation and do the loading and caching of
   markup and checking for new markup ourselves?
  
   
Cheers,
Jay
On Thu, Feb 28, 2008 at 2:40 PM, Chris Colman
[EMAIL PROTECTED]
wrote:
   
 Is there a wicket mode I can configure in which new markup (eg.,
 new
 markup variations) can be picked up at run time without
 restarting
   the
 app?

 In our app we can create/generate new markup at runtime. We
 don't
   want
 to have to force a bounce of the web app for wicket to 'see'
 this
   new
 markup.


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


   
   
--

Computer Science: solving today's problems tomorrow.
  
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  --
  
  Computer Science: 

Re: AutoCompleteTextField user selection

2008-02-28 Thread Ryan Gravener
Try adding setting the outputMarkupPlaceholderTag.

 patientAutoCompleteTextField.setOutputMarkupId( true );
 patientAutoCompleteTextField.setVisible( false );
 patient.setOutputMarkupPlaceholderTag(true);

and in your onUpdate

target.addComponent(patient)

that way you will not have to add the whole panel.

On 28/02/2008, Martin Funk [EMAIL PROTECTED] wrote:
 H...

  not quit sure if I understood you. Just for the fun of it I rehacked a
  quickstart that might simulate you problem.

  But even if it does I'm not quite sure if its bug, or a feature.
  You add an AjaxFormComponentUpdatingBehavior to an AutoCompleteTextField.
  As long as the keyboard is used to select the value or to leave the
  TextField everything is fine its just that when the mouse is used to select
  an element in the dropdown the AjaxFormComponentUpdatingBehavior gets called
  twice.

  That's not without some plausibility.
  First a value is typed, so the field is changed and a dropdown is shown.
  Then the mouse clicks on an element in the dropdown, the textfield looses
  focus, so the first 'onchange' is fired.
  Then the pulldown value is inserted into the textfield, it is changed agan
  and possibly retains focus.
  Finally as the mouse clicked on the dropdown, so outside of the textfield it
  looses the focus again, second 'onchange' fired.

  Maybe someone else has more insight, and maybe something can be done in
  /wicket-autocomplete.js

  mf

   svn diff jdk-1.4/wicket-quickstart/src/
  Index: jdk-1.4
  /wicket-quickstart/src/main/java/org/apache/wicket/quickstart/Index.java
  ===
  --- 
 jdk-1.4/wicket-quickstart/src/main/java/org/apache/wicket/quickstart/Index.java
  (Revision 632116)
  +++ 
 jdk-1.4/wicket-quickstart/src/main/java/org/apache/wicket/quickstart/Index.java
  (Arbeitskopie)
  @@ -16,7 +16,17 @@
   */
   package org.apache.wicket.quickstart;

  +import java.util.ArrayList;
  +import java.util.Arrays;
  +import java.util.Iterator;
  +
   import org.apache.wicket.PageParameters;
  +import org.apache.wicket.ajax.AjaxRequestTarget;
  +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
  +import
  
 org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField
  ;
  +import org.apache.wicket.markup.html.basic.Label;
  +import org.apache.wicket.markup.html.form.Form;
  +import org.apache.wicket.model.Model;

   /**
   * Basic bookmarkable index page.
  @@ -34,5 +44,36 @@
  */
 public Index(final PageParameters parameters)
 {
  +   Form form = new Form(form)
  +   {
  +   protected void onSubmit()
  +   {
  +   System.out.println(submit);
  +   }
  +   };
  +   add(form);
  +   final AutoCompleteTextField af = new
  AutoCompleteTextField(field, new Model())
  +   {
  +   protected Iterator getChoices(String input)
  +   {
  +   String[] args = { a, b, c };
  +   return new ArrayList(Arrays.asList
  (args)).iterator();
  +   }
  +   };
  +   final Label label = new Label(label, );
  +   label.setOutputMarkupId(true);
  +   add(label);
  +   af.add(new AjaxFormComponentUpdatingBehavior(onchange)

 +   {
  +   private static final long serialVersionUID = 1L;
  +
  +   public void onUpdate(AjaxRequestTarget target)

 +   {
  +   System.out.println(updated :  +  :  +
  af.getModelObjectAsString());
  +   label.setModelObject(af.getModelObject());
  +   target.addComponent(label);
  +   }
  +   });
  +   form.add(af);
 }
   }
  Index: jdk-1.4
  /wicket-quickstart/src/main/java/org/apache/wicket/quickstart/Index.html
  ===
  --- 
 jdk-1.4/wicket-quickstart/src/main/java/org/apache/wicket/quickstart/Index.html
  (Revision 632116)
  +++ 
 jdk-1.4/wicket-quickstart/src/main/java/org/apache/wicket/quickstart/Index.html
  (Arbeitskopie)
  @@ -5,6 +5,11 @@
  body
  h1QuickStart/h1
  pThis is your first Wicket application./p
  +p wicket:id=label/p
  +form wicket:id=form
  +   Text field: input type=text wicket:id=field /br/
  +   input type=submit value=Send
  to server /
  +   /form
  /body
   /html

  2008/2/26, Bushby [EMAIL PROTECTED]:

 
  
   I have a panel which is backed by an over all CompoundPropertyModel.  It
   has
   an inner panel which is my search panel and Labels.  Here is the 

How to make Eclipse 3.3 run JUnit4 Test?

2008-02-28 Thread MYoung

Sorry for being way off topic here but I couldn't find the answer with my
search.  I would be very grateful if someone give me some help with this.

Basically I have the JUnit 4.4 jar in my Build Path, I decorated my test
methods with @Test, code compile with no error.  But when I try to run as a
JUnit test, Eclipse complaints:

No test found with test runner 'JUnit 3'.

What do I need to do to make Eclipse run JUnit4?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/How-to-make-Eclipse-3.3-run-JUnit4-Test--tp15748485p15748485.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: Pickup up new markup without restarting webapp

2008-02-28 Thread Chris Colman
 Chris,
 
 I'm not that familiar with the inner workings of the API but based on
the
 description in the Javadoc, I think you are going to need to provide a
 custom implementation of IMarkupCache.
 
 If you are looking for a simpler solution, you could enter an RFE for
new
 property on iMarkupSettings that replicates the DEV mode markup reload
 functionality.

Yeah, that would be excellent - a setting that causes the markup loader
to check for the existence of a piece of markup (possibly a variant) in
the file system if it can not be found in the cache.


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



Re: What about the FormComponentFragment?

2008-02-28 Thread Igor Vaynberg
add an rfe...

-igor


On Thu, Feb 28, 2008 at 5:18 AM, Vitaly Tsaplin
[EMAIL PROTECTED] wrote:
  Hi!

 Just one thought about a composite form components. The
  FormComponentPanel is a perfect choice but sometimes writing a
  component which has no complex markup it would be better choice to
  have something like the FormComponentFragment... because often writing
  a new components I am using some existing one as a base but I would
  rather include it as a field then to subslass. Reasons can be
  different including the fact that some methods like getModel defined
  as final.

 Thanks,
 Vitaly

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



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



Re: New quy question on converting input data

2008-02-28 Thread Igor Vaynberg
you can use a converter for serverside stuff. see
formcomponent.setconverter() and iconverter. for clientside you can
either create a behavior or subclass textfield, override
oncomponenttag and do tag.put(onblur, myjavascript);

-igor


On Thu, Feb 28, 2008 at 7:26 AM, rmattler [EMAIL PROTECTED] wrote:

  If a phone number is input as (330) 555-1212 on the form when the form is
  saved I want the data stored as 3305551212 in the database and when
  displayed again on the form as (330) 555-1212.

  As a bonus how do I would like data entered as 3305551212 and converted to
  (330) 555-1212 on the onBlur event.

  What is the Wicket Way to do this.
  --
  View this message in context: 
 http://www.nabble.com/New-quy-question-on-converting-input-data-tp15738847p15738847.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Dynamicaly add new tab to an existing AjaxTabbedPanel

2008-02-28 Thread Igor Vaynberg
tab.gettabs().add(newtab);
followed by an ajax repaint of the entire tabbed panel

-igor

On Thu, Feb 28, 2008 at 9:11 AM, Charly [EMAIL PROTECTED] wrote:
 Hi,
  I would like to know if it's possible to add dynamicaly new tab to an
  existing AjaxTabbedPanel.
  (I want to open and close tabs like in eclipse, when you open a file for
  example)

  I don't find any way to do it.

  Can you tell me if it is possible or if I have to create this  component
  and witch way to take ?

  Thank's
  Charly


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



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



Re: Security Features offered by Wicket

2008-02-28 Thread Igor Vaynberg
On Thu, Feb 28, 2008 at 9:43 AM, Arthur Ahiceh [EMAIL PROTECTED] wrote:
   Wicket urls are already session-relative and somewhat random (depend
   on the path you take through the application), so I am not sure if
   anything more needs to be done...
  

  To prevent CSRF attacks you must to add some random values to all requests
  because session-relative values could be hit it, you have to think that
  wicket urls allways have the same format
  (?wicket:interface=:0:goGerman::ILinkListener::) and it is simple to
  construct requests for CSRF attacks.

first you would have to hijack the session...
then in order for you to hit

?wicket:interface=:0:goGerman::ILinkListener::

a few things have to be true:
a) attacker has to hijack the session
b) page id (the 0 part of the url) has to match with the link path in
the user's session. this depends on the order user has visited the
pages
c) user had to actually have visited the page previously

even if thats not enough it is trivial to write your own coding
strategy that appends the random token and stores its mirror in
session

-igor


  Arthur.


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



Re: AjaxSelfUpdatingTimerBehavior on home page gives session expired

2008-02-28 Thread Igor Vaynberg
clock examples works just fine for me

-igor


On Thu, Feb 28, 2008 at 9:49 AM, okrohne [EMAIL PROTECTED] wrote:

  Hi,

  if I use AjaxSelfUpdatingTimerBehavior on that page which is declared as
  home page of the application
  I get session expired after the first update.

  I could also reproduce it with clock example :
  http://www.wicket-library.com/wicket-examples/ajax

  Do I need to configure anything?

  Thanks,
  Oliver
  --
  View this message in context: 
 http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-on-home-page-gives-session-expired-tp15742011p15742011.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: OT: Wicket web.xml configuration settings and maven

2008-02-28 Thread Igor Vaynberg
see maven resource filtering

-igor


On Thu, Feb 28, 2008 at 12:15 PM, Doug Leeper [EMAIL PROTECTED] wrote:

  This is slightly off topic but it has todo with our wicket app and utilizing
  maven to create the builds.

  Maven is new to us and slightly understand the profiling concept in maven
  but not sure how to the following...on our production build, we would like
  to have the web.xml configuration setting changed from development to
  production without checking out and manually modifying before building.

  Is there any easy way to do this in maven or do we have have set the java
  runtime parameter -Dwicket.configuration=production

  Any suggestion or best practice?

  TIA,

  - Doug


  --
  View this message in context: 
 http://www.nabble.com/OT%3A-Wicket-web.xml-configuration-settings-and-maven-tp15744999p15744999.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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



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



Re: Wicket as a front controller ?

2008-02-28 Thread smallufo



 To redirect, try:

 public class P1 extends WebPage {
@Override
protected void onBeforeRender() {
super.onBeforeRender();
throw new RestartResponseException(P2.class);
}

 }


Hi
I want to handle a POST request , and output custom messages , but

In onBeroereRenderer()  , I write the following codes :

HttpServletResponse res = ((WebResponse)
getWebRequestCycle().getResponse()).getHttpServletResponse();
PrintWriter out = res.getWriter();
out.print(responseText);

But wicket seems pre-output HTML's DOCTYPE , that makes the remote site
can't parse...:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

I've already deleted the corresponding HTML file.

How to make wicket not pre-output any HTML header/doctype ?


about servlet and wicket-spring sequence

2008-02-28 Thread Mead Lai

Hi,
I have a Servlet ViewSurvey.do, it access the Spring Context from wicket 
Application.
MyApplication app = (MyApplication) RequestCycle.get().getApplication();

but there is some thing strange:
1,if I visit the Servlet ViewSurvey.do first, It will cause some error, and 
all the application is down
2,if I visit the Wicket application first, It's OK, and then I visit the  the 
Servlet ViewSurvey.do, the servlet is OK

Maybe it's relation about the servlet start-up sequence. I really couldn't find 
the reason at all.






the following is my web.xml file






CMS Message System




applicationBean
wicketApplication


contextConfigLocation


/WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,



encodingFilter

org.springframework.web.filter.CharacterEncodingFilter


encoding
GB2312


forceEncoding
false



encodingFilter
*.*


org.springframework.web.context.ContextLoaderListener


WicketApplication

org.apache.wicket.protocol.http.WicketServlet


applicationFactoryClassName
org.apache.wicket.spring.SpringWebApplicationFactory


1




SurveyAction

cn.meadlai.cms.servlet.survey.SurveyAction

3



ViewSurvey

cn.meadlai.cms.servlet.survey.ViewSurvey

3




SurveyAction
/surveyAction.do


ViewSurvey
/viewSurvey.do




WicketApplication
/manage/*.html



index.html



_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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



Re: Wicket as a front controller ?

2008-02-28 Thread smallufo
Oops , sorry , I found what went wrong
Because the Server page inherits another Parent Page.
So it output the header of its parent page...


2008/2/29 smallufo [EMAIL PROTECTED]:


 
  To redirect, try:
 
  public class P1 extends WebPage {
 @Override
 protected void onBeforeRender() {
 super.onBeforeRender();
 throw new RestartResponseException(P2.class);
 }
 
  }
 

 Hi
 I want to handle a POST request , and output custom messages , but

 In onBeroereRenderer()  , I write the following codes :

 HttpServletResponse res = ((WebResponse)
 getWebRequestCycle().getResponse()).getHttpServletResponse();
 PrintWriter out = res.getWriter();
 out.print(responseText);

 But wicket seems pre-output HTML's DOCTYPE , that makes the remote site
 can't parse...:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

 I've already deleted the corresponding HTML file.

 How to make wicket not pre-output any HTML header/doctype ?



RE: about servlet and wicket-spring sequence

2008-02-28 Thread Mead Lai

sorry, the xml had been Escaped. I send it again
?xml version=1.0 encoding=UTF-8?!DOCTYPE web-app  PUBLIC -//Sun 
Microsystems, Inc.//DTD Web Application 2.3//EN  
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app display-nameCMS Message System/display-name
 !-- The following should be deleted at last! --
 context-param  param-nameapplicationBean/param-name  
param-valuewicketApplication/param-value /context-param context-param  
param-namecontextConfigLocation/param-name  param-value   
/WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,  /param-value 
/context-param filter  filter-nameencodingFilter/filter-name  
filter-class   org.springframework.web.filter.CharacterEncodingFilter  
/filter-class  init-param   param-nameencoding/param-name   
param-valueGB2312/param-value  /init-param  init-param   
param-nameforceEncoding/param-name   param-valuefalse/param-value  
/init-param /filter filter-mapping  
filter-nameencodingFilter/filter-name  url-pattern*.*/url-pattern 
/filter-mapping listener  
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
 /listener !--  Spring context  servlet  
servlet-namecontext/servlet-name  servlet-class  
org.springframework.web.conte
 xt.ContextLoaderServlet  /servlet-class  
load-on-startup1/load-on-startup  /servlet -- servlet  
servlet-nameWicketApplication/servlet-name  servlet-class   
org.apache.wicket.protocol.http.WicketServlet  /servlet-class  init-param   
param-nameapplicationFactoryClassName/param-name   
param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value 
  !--param-valuecn.meadlai.may.main.MyApplication/param-value  --  
/init-param  load-on-startup0/load-on-startup /servlet !-- 
SurveyAction Here --
 servlet  servlet-nameSurveyAction/servlet-name  servlet-class   
cn.meadlai.cms.servlet.survey.SurveyAction  /servlet-class  
load-on-startup4/load-on-startup /servlet
 servlet  servlet-nameViewSurvey/servlet-name  servlet-class   
cn.meadlai.cms.servlet.survey.ViewSurvey  /servlet-class  
load-on-startup3/load-on-startup /servlet
 !-- SurveyAction End -- !--FCK config start--
 servlet  servlet-nameConnector/servlet-name  servlet-class   
com.fredck.FCKeditor.connector.ConnectorServlet  /servlet-class  init-param 
  param-namebaseDir/param-name   param-value/UserFiles//param-value  
/init-param  init-param   param-namedebug/param-name   
param-valuetrue/param-value  /init-param  
load-on-startup1/load-on-startup /servlet
 servlet  servlet-nameSimpleUploader/servlet-name  servlet-class   
com.fredck.FCKeditor.uploader.SimpleUploaderServlet  /servlet-class  
init-param   param-namebaseDir/param-name   
param-value/UserFiles//param-value  /init-param  init-param   
param-namedebug/param-name   param-valuetrue/param-value  /init-param 
 init-param   param-nameenabled/param-name   
param-valuetrue/param-value  /init-param  init-param   
param-nameAllowedExtensionsFile/param-name   
param-valuejpg|gif|jpeg|png|bmp|swf|fla/param-value  /init-param  
init-param   param-nameDeniedExtensionsFile/param-name   
param-value/param-value  /init-param  init-param   
param-nameAllowedExtensionsImage/param-name   
param-valuejpg|gif|jpeg|png|bmp/param-value  /init-param  init-param   
param-nameDeniedExtensionsImage/param-name   param-value/param-value  
/init-param  init-param   param-nameAllowedExtensionsFlash/param-name   
 param-valueswf|fla/param-value  /init-param  init-param   
param-nameDeniedExtensionsFlash/param-name   param-value/param-value  
/init-param  load-on-startup1/load-on-startup /servlet
 servlet-mapping  servlet-nameConnector/servlet-name  url-pattern   
/editor/filemanager/browser/default/connectors/jsp/connector  /url-pattern 
/servlet-mapping
 servlet-mapping  servlet-nameSimpleUploader/servlet-name  url-pattern  
 /editor/filemanager/upload/simpleuploader  /url-pattern /servlet-mapping
 !--FCK config end-- servlet-mapping  
servlet-nameSurveyAction/servlet-name  
url-pattern/surveyAction.do/url-pattern /servlet-mapping 
servlet-mapping  servlet-nameViewSurvey/servlet-name  
url-pattern/viewSurvey.do/url-pattern /servlet-mapping  !-- wicket 
mapping here -- servlet-mapping  
servlet-nameWicketApplication/servlet-name  
url-pattern/manage/*.html/url-pattern /servlet-mapping
 welcome-file-list  welcome-file/manage/index.html/welcome-file 
/welcome-file-list/web-app From: [EMAIL PROTECTED] To: 
users@wicket.apache.org Subject: about servlet and wicket-spring sequence 
Date: Fri, 29 Feb 2008 10:10:16 +0800   Hi, I have a Servlet 
ViewSurvey.do, it access the Spring Context from wicket Application. 
MyApplication app = (MyApplication) RequestCycle.get().getApplication();  but 
there is some thing strange: 1,if I visit the Servlet ViewSurvey.do first, 
It will cause some error, and all the application is down 2,if I visit the 
Wicket application first, It's OK, and then I visit the the Servlet 
ViewSurvey.do, the servlet is OK  Maybe it's relation about the servlet 
start-up sequence. I 

Re: about servlet and wicket-spring sequence

2008-02-28 Thread James Carman
The context loader listener will put the Spring context into the
ServletContext at application startup.  You can access it via the
org.springframework.web.context.support.WebApplicationContextUtils
class.  You don't need Wicket at all for this.


On 2/28/08, Mead Lai [EMAIL PROTECTED] wrote:

  Hi,
 I have a Servlet ViewSurvey.do, it access the Spring Context from 
 wicket Application.
  MyApplication app = (MyApplication) RequestCycle.get().getApplication();

  but there is some thing strange:
  1,if I visit the Servlet ViewSurvey.do first, It will cause some error, 
 and all the application is down
  2,if I visit the Wicket application first, It's OK, and then I visit the  
 the Servlet ViewSurvey.do, the servlet is OK

  Maybe it's relation about the servlet start-up sequence. I really couldn't 
 find the reason at all.






  the following is my web.xml file






 CMS Message System




 applicationBean
 wicketApplication


 contextConfigLocation

 
 /WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,



 encodingFilter

 org.springframework.web.filter.CharacterEncodingFilter


 encoding
 GB2312


 forceEncoding
 false



 encodingFilter
 *.*


 org.springframework.web.context.ContextLoaderListener


 WicketApplication

 org.apache.wicket.protocol.http.WicketServlet


 applicationFactoryClassName
 org.apache.wicket.spring.SpringWebApplicationFactory


 1




 SurveyAction

 cn.meadlai.cms.servlet.survey.SurveyAction

 3



 ViewSurvey

 cn.meadlai.cms.servlet.survey.ViewSurvey

 3




 SurveyAction
 /surveyAction.do


 ViewSurvey
 /viewSurvey.do




 WicketApplication
 /manage/*.html



 index.html



  _
  Express yourself instantly with MSN Messenger! Download today it's FREE!
  http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

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



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



Re: Dynamicaly add new tab to an existing AjaxTabbedPanel

2008-02-28 Thread Charly

Thank you Igor, it works perfectly !

Charly

Igor Vaynberg a écrit :

tab.gettabs().add(newtab);
followed by an ajax repaint of the entire tabbed panel

-igor

On Thu, Feb 28, 2008 at 9:11 AM, Charly [EMAIL PROTECTED] wrote:

Hi,
 I would like to know if it's possible to add dynamicaly new tab to an
 existing AjaxTabbedPanel.
 (I want to open and close tabs like in eclipse, when you open a file for
 example)

 I don't find any way to do it.

 Can you tell me if it is possible or if I have to create this  component
 and witch way to take ?

 Thank's
 Charly


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




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



Location of wicket-ajax.js

2008-02-28 Thread Chris Colman
When using AJAX with wicket where are the instructions on where and how
to make the .js available to the browser?

Eg., resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js

Do we have to create a directory under project/web called
resources/org.apache.wicket.ajax.WicketAjaxReference ? into which we
copy the .js?


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



Re: How to make Eclipse 3.3 run JUnit4 Test?

2008-02-28 Thread MYoung

Never mind. I found the answer.  RunOpen Run Dialog... and change to JUnit4
runner.
-- 
View this message in context: 
http://www.nabble.com/How-to-make-Eclipse-3.3-run-JUnit4-Test--tp15748485p15752427.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Location of wicket-ajax.js

2008-02-28 Thread Igor Vaynberg
no, resources is a path that is owned by wicket resources. so what
that url tells wicket is to look for wicket-ajax.js under
classes/org/apache/wicket/ajax

-igor


On Thu, Feb 28, 2008 at 9:47 PM, Chris Colman
[EMAIL PROTECTED] wrote:
 When using AJAX with wicket where are the instructions on where and how
  to make the .js available to the browser?

  Eg., resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js

  Do we have to create a directory under project/web called
  resources/org.apache.wicket.ajax.WicketAjaxReference ? into which we
  copy the .js?


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



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



Re: Location of wicket-ajax.js

2008-02-28 Thread Igor Vaynberg
it will find them in the jar
-igor


On Thu, Feb 28, 2008 at 10:00 PM, Chris Colman
[EMAIL PROTECTED] wrote:
 Do we have to explicitly unpack the .js files from the wicket-1.3.x.jar
  and move them into that directory or should it find them while resident
  in the wicket jar ?



   no, resources is a path that is owned by wicket resources. so what
   that url tells wicket is to look for wicket-ajax.js under
   classes/org/apache/wicket/ajax
  
   -igor
  
  
   On Thu, Feb 28, 2008 at 9:47 PM, Chris Colman
   [EMAIL PROTECTED] wrote:
When using AJAX with wicket where are the instructions on where and
  how
 to make the .js available to the browser?
   
 Eg., resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-
   ajax.js
   
 Do we have to create a directory under project/web called
 resources/org.apache.wicket.ajax.WicketAjaxReference ? into which
  we
 copy the .js?
   
   
   
  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]


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



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



RE: Location of wicket-ajax.js

2008-02-28 Thread Chris Colman
Do we have to explicitly unpack the .js files from the wicket-1.3.x.jar
and move them into that directory or should it find them while resident
in the wicket jar ?

 no, resources is a path that is owned by wicket resources. so what
 that url tells wicket is to look for wicket-ajax.js under
 classes/org/apache/wicket/ajax
 
 -igor
 
 
 On Thu, Feb 28, 2008 at 9:47 PM, Chris Colman
 [EMAIL PROTECTED] wrote:
  When using AJAX with wicket where are the instructions on where and
how
   to make the .js available to the browser?
 
   Eg., resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-
 ajax.js
 
   Do we have to create a directory under project/web called
   resources/org.apache.wicket.ajax.WicketAjaxReference ? into which
we
   copy the .js?
 
 
 
-
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: AjaxSelfUpdatingTimerBehavior on home page gives session expired

2008-02-28 Thread okrohne

Hi,

sorry maybe it was not clear what I did with the clock example.
As I got this error with my page I
copied the clock example to my project and set it as home page
to check If I also get the error with another page which uses
AjaxSelfUpdatingTimerBehavior. Running my project with
the clock example as home page also gives that error.

Thanks,
Oliver


igor.vaynberg wrote:
 
 clock examples works just fine for me
 
 -igor
 
 
 On Thu, Feb 28, 2008 at 9:49 AM, okrohne [EMAIL PROTECTED] wrote:

  Hi,

  if I use AjaxSelfUpdatingTimerBehavior on that page which is declared as
  home page of the application
  I get session expired after the first update.

  I could also reproduce it with clock example :
  http://www.wicket-library.com/wicket-examples/ajax

  Do I need to configure anything?

  Thanks,
  Oliver
  --
  View this message in context:
 http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-on-home-page-gives-session-expired-tp15742011p15742011.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


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


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

-- 
View this message in context: 
http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-on-home-page-gives-session-expired-tp15742011p15753154.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



RE: Location of wicket-ajax.js

2008-02-28 Thread Chris Colman
Problem found: Was a problem with script import lines not being added,
not that the .js files were not reachable.

Apparently we need to have a stateful component somewhere in the page in
order for wicket to auto inject the script lines into the HTML for us.

Is there a way of telling wicket to inject the script lines without
having a stateful component on the page - currently everything on the
page is stateless - we just have buttons on each item that, when
pressed, need to bring up an AJAX modal dialog box to display some info
on the items.

Or do we need to add an invisible edit control or something to get the
script injection happening?


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



Re: remember last visited page

2008-02-28 Thread Jon Laidler

Assuming you keep the user credentials (user ID, password etc) in a
persistent layer - database table flat file etc, you could simply add a
field to store the Java class name of the page when the user loads it. Then
if the session ends the last page can be referenced from the field after the
user has logged on and loaded. 




freak182 wrote:
 
 Hello,
 Is there a way to remember the last page i visited after i lose the
 session. What i mean that for example if im going to checkout but i forgot
 to login first, When i click checkout button, it will redirect me to the
 login page first then when authenticated it will go directly to checkout
 page. Any codes will help :)
 
 Thanks a lot.
 
 Cheers.
 

-- 
View this message in context: 
http://www.nabble.com/remember-last-visited-page-tp15733923p15753353.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Location of wicket-ajax.js

2008-02-28 Thread Igor Vaynberg
this should happen automatically, please file a bug report

-igor


On Thu, Feb 28, 2008 at 11:26 PM, Chris Colman
[EMAIL PROTECTED] wrote:
 Problem found: Was a problem with script import lines not being added,
  not that the .js files were not reachable.

  Apparently we need to have a stateful component somewhere in the page in
  order for wicket to auto inject the script lines into the HTML for us.

  Is there a way of telling wicket to inject the script lines without
  having a stateful component on the page - currently everything on the
  page is stateless - we just have buttons on each item that, when
  pressed, need to bring up an AJAX modal dialog box to display some info
  on the items.

  Or do we need to add an invisible edit control or something to get the
  script injection happening?




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



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