Re: [Wicket-user] OpenSessionInViewFilter and Wicket Resources

2007-06-28 Thread John Krasnay
On Thu, Jun 28, 2007 at 09:16:13AM -0700, Igor Vaynberg wrote:
On 6/28/07, Huergo Perez [EMAIL PROTECTED] wrote:
 
  One possible solution would be to move the static resources away from my
  JAR file directly into the WAR (as most Java web MVC apps usually have),
  however I would not like to take this approach -- Wicket is a component
  framework after all and I want my resources packaged together with my
  components in a JAR file.
 
not sure if there is a clean and simple way to do this. what i would do is
subclass the spring filter delegate and manually filter the urls that
contain /resources/ url fragment.
 

One thing you can try is to put a caching web server in front of your
app server and have it cache your images. Then most of the image
requests will never even hit your app server.

jk


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How to get HTML source code from a wicket page

2007-06-24 Thread John Krasnay
OK, so WicketTester is the way to go. JBQ's response implied that there
was a more direct way to do it, but I'll give WicketTester a try.

Thanks,

jk

On Sat, Jun 23, 2007 at 08:05:58PM -0700, Igor Vaynberg wrote:
 
see our tests. all the mock setup is done for you. our tests simply call a
few methods and get a page rendered into a string that is then compared to
another file.
 
-igor


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How to get HTML source code from a wicket page

2007-06-24 Thread John Krasnay
Ah, that makes more sense. Thanks for the clarification and example.

jk

On Sun, Jun 24, 2007 at 05:15:14PM +0200, Jean-Baptiste Quenot wrote:
 
 Yes there is a more direct way.  I'm sorry I made an error, I
 meant StringResponse, not StringRequestTarget.  I spent a few
 minutes writing the example, as this is a recurring question, here
 it is:
 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How to get HTML source code from a wicket page

2007-06-23 Thread John Krasnay
Thanks for the tip, but could you give us a little more of a clue? For
example, from where should we get the RequestCycle? Using
RequestCycle.get() doesn't sound right, since that's for the response
we're sending to the browser, not for the HTML we want to render into
the email.

I looked into the WicketTester, as suggested by a previous response. It
creates a WebRequestCycle, but it needs quite a bit of plumbing like
a mock session, request, response, application, etc. Is this what we
really have to do, in addition to using the StringRequestTarget?

jk

On Sat, Jun 23, 2007 at 04:30:23PM +0200, Jean-Baptiste Quenot wrote:
 * Srinu Sunkara:
 
  Hi - I am trying to get the  HTML source code of a web page with
  in the program  (so that I can send this  in an email). Can some
  one tell me how can I get the HTML source.
 
 Sure.  Processing a Wicket page and sending the result to a buffer
 can be achieved through  StringRequestTarget, thus allowing you to
 use the buffer contents for sending email.
 
 See RequestCycle.setRequestTarget() 
 
 You can find the full answer on this thread:
 http://www.nabble.com/Sending-Emails-Via-Wicket--t3639601.html
 
 Hope this helps,
 -- 
  Jean-Baptiste Quenot
 aka  John Banana   Qwerty
 http://caraldi.com/jbq/
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] SimpleConverterAdapter and primitive fields

2007-06-09 Thread John Krasnay
My application stores money amounts as an integer number of cents. I've
written a converter to handle this as follows:

public class MoneyConverter extends SimpleConverterAdapter {
public Object toObject(String value) {
try {
return Math.round(Float.parseFloat(value) * 100);
} catch (NumberFormatException e) {
throw new ConversionException().setSourceValue(value);
}
}
public String toString(Object value) {
float amount = ((Number) value).floatValue() / 100;
return String.format(%.2f, amount);
}
}

When attached to a TextField, this converter is called twice, once
before calling the field validators, and again when saving to the model.
This second call is failing in this part of SimpleConverterAdapter:

  else if (value != null  (!value.getClass().isAssignableFrom(c)))
  {
throw new IllegalArgumentException(unable to convert  +
  value +  to type  + c);
  }

...because value.getClass() is Integer while c is int, and the two
are not assignable from one another (apparently, Java 5 autoboxing does
not apply here). The error message is an unhelpful unable to convert 1
to type int.

So it seems that SimpleAdapterConverter cannot be used with
primitive-typed properties. Does this sound right? Will this limitation
exist in 1.3 (I'm using 1.2.6)? Can anyone think of a workaround other
that implementing IConverter directly and checking explicitly for
Integer - int?

jk


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wicket did not make the grade.

2007-06-06 Thread John Krasnay
On Tue, Jun 05, 2007 at 09:40:33PM -0700, JonLaidler wrote:
 
 I would be interested to hear how many companies are usng Wicket, and how
 many of those companies switched to Wicket from other frameworks.

Here's my Wicket story. Our team is a small internal development group
inside a large bank. We decided to look for alternatives to Struts 1
earlier this year. Initially we looked at Spring MVC and Struts 2 but
felt that these were only incremental improvements on Struts 1. We had a
quick look at Wicket, based on the buzz we'd noticed in various forums,
and were very impressed. After a more thorough review, we selected
Wicket and are now developing two fairly complex Wicket-based apps.

Amongst Wicket's many advantages, the following stand out for me:

- The ability to encapsulate UI components, including all required
  markup, CSS, Javascript, and localization files, into shared JARs on
  the classpath. Having a shared component library is key to our team,
  since we tend to develop many small Web apps.

- The ability to aggregate smaller components into larger and more
  complex ones. This allows us to create much richer pages, since we can
  think at an appropriate level of abstraction: I can just throw our
  standard page banner component on a page without thinking about the
  fact that it contains a logo, the app title, and a list of global
  navigation links. (In fact, it's even simpler than that. The banner is
  added by the base page that each app page extends.)

- The fact that the same principles of a component tree and markup
  inheritance work from the smallest components right up to the entire
  page. This is very different from most Model2 frameworks, where you
  need something like SiteMesh or Tiles to add common banners and
  navbars to pages, and from JSF, where the internal structure of
  components is very different that the way they are composed into
  pages.

Unfortunately, these are subtle points that can be difficult to sell,
especially since evaluations tend to involve toy examples.

jk

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] wicket did not make the grade.

2007-06-05 Thread John Krasnay
Hear, hear...well said, Jim!

jk

On Tue, Jun 05, 2007 at 10:42:16AM -0500, James McLaughlin wrote:
 Hi Florian,
 To be honest, you should have titled this post My team did not make
 the grade. There are many developers in the world whose skill and
 ambition rise little above cut and paste robot, and many burned out
 managers who have decided employees will never be capable of much
 else. Struts is a perfect framework choice where such conditions
 coincide. If you are in such a place right now, then for the love of
 all things holy, move on before your soul, and skills, languish. On
 the other hand, if you work for a place where the power of OOP is
 understood, and developer creativity is required and appreciated,
 Wicket will be the most natural choice.
 
 jim

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Implementing a PopupPanel

2007-05-30 Thread John Krasnay
One way to solve the abstract method from the constructor problem (or
more precisely, the non-final method from the constructor problem) is
to use a Model, e.g...

public class PopupPanel extends Panel {
public abstract String getTitle();
public PopupPanel(String id) {
add(new Label(foo, new AbstractReadOnlyModel() {
public Object getObject(Component component) {
return getTitle();
}
}
}
}

The model's getObject is only called some time after the object has
been constructed.

jk


On Tue, May 29, 2007 at 07:36:59AM -0400, Ravindra Wankar wrote:
 
 This looks more like a design question but I think there must be a 
 better, Wicket way.
 
 I wrote a PopupPanel that allows you to have a div popup in a page by 
 clicking a link. The contents of the div can be static/loaded via Ajax. 
 The popup part with Ajax is working. The link that activates the popup 
 can either have an image or text label. So I have...
 
   PopupPanel
   | abstract getTitle() and getContent()
   | constructor calls getTitle() and 
 getContents()
   | 
 --
 ||
LabelLinkedPopupPanelImageLinkedPopupPanel
implements getTitle()  implements getTitle()
 
 
 To use it, new LabelLinkedPopupPanel(...) and override the getContent() 
 method. I can't get the title to work because of abstract method from 
 the constructor problem. My options then are
 
 1. Have a setTitle() and setContent() method that is called by the 
 subclasses but failing to call them won't be caught till runtime.
 2. Have PopupPanel constructor take in components for title and content. 
 The sub classes then just act as wrappers.
 3. Replace the subclasses with PopupPanelFactory with 2 methods 
 newLabelLinkedPopup() and newImageLinkedPopup.
 
 I don't think a border suits this requirement but I'm not sure. Is there 
 a better way?
 
 Thanks
 Ravi
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Nuub] Best practise: Navigation Component

2007-05-30 Thread John Krasnay
One idea would be to create a class that represents the logical idea of
a link, e.g

public class NavEntry {
private String title;
private Class pageClass;
private PageParameters parameters;
...
}

Pass a list of these to the constructor of your panel, which then
renders these into actual links and labels.

If this is too restrictive, e.g. if you want different kinds of links,
not just BookmarkablePageLinks, you can defer creation of the link to
the NavEntry object:

public class NavEntry {
...
public abstract WebMarkupContainer createLink(String id);
}

public class BookmarkablePageNavEntry extends NavEntry {
private Class pageClass;
private PageParameters parameters;
public WebMarkupContainer createLink(String id) {
return new BookmarkablePageLink(pageClass, parameters);
}
}

A similar technique is used in the tabs package in wicket-extensions.

jk

On Tue, May 29, 2007 at 07:55:48PM +0200, Johannes Schneider wrote:
 Hi,
 
 I am new to Wicket and I really like the things I have seen so far. But 
 I also have a few questions.
 At the moment I create a small page. Therefore I have created a 
 NavigationComponent (extends Panel) with its own markup file and some 
 other resources (css, images).
 
 Can anybody describe me the best way to add Links (most of them are 
 BookmarkableLinks) and the corresponding Labels to this component?
 At the moment I create a List of Links. Each of those links has a Label 
 added. Those links are then provided to a DataView and given to the 
 NavigationComponent.
 I don't like this because I have to create the components manually 
 (Links and Labels) with the correct ids. What approach would a wicket 
 expert take?
 
 Later I might reuse the NavigationComponent within another application. 
 But therefore I would like to modify/replace the CSS and replace some 
 images. What is the Wicket way to achive this?
 
 
 Thanks in advance,
 
 
 Johannes Schneider
 -- 
 Johannes Schneider
 Im Lindenwasen 15
 72810 Gomaringen
 
 Fon +49 7072 9229972
 Fax +49 7072 50
 Mobil +49 178 1364488
 
 [EMAIL PROTECTED]
 http://www.johannes-schneider.info



 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Implementing a PopupPanel

2007-05-30 Thread John Krasnay
Ah, I see.

If your popup functionality is pure client-side Javascript, couldn't you
just turn it into a Behavior that you attach to a Label, Image, or
whatever, that sets the onclick attribute of whatever you attached it
to?

jk

On Wed, May 30, 2007 at 10:13:40AM -0400, Ravindra Wankar wrote:
Thanks John. I was suspecting no one to reply to a long mail.
 
Unfortunately, in my case the getTitle() returns a component not the label
text. The component returned by the child can either be a label or an
image component. The derived class gets the label text in its
constructor which it uses to construct the label but the parent calls
getTitle() too soon.
 
As there are 2 components within the parent (title and contents) that the
child needs to fill, I could not use markup inheritance.
 
Thanks,
Ravi.
 
John Krasnay wrote:
 
  One way to solve the abstract method from the constructor problem (or
  more precisely, the non-final method from the constructor problem) is
  to use a Model, e.g...
 
  public class PopupPanel extends Panel {
  public abstract String getTitle();
  public PopupPanel(String id) {
  add(new Label(foo, new AbstractReadOnlyModel() {
  public Object getObject(Component component) {
  return getTitle();
  }
  }
  }
  }
 
  The model's getObject is only called some time after the object has
  been constructed.
 
  jk
 
 
  On Tue, May 29, 2007 at 07:36:59AM -0400, Ravindra Wankar wrote:
   
 
  This looks more like a design question but I think there must be a
  better, Wicket way.
 
  I wrote a PopupPanel that allows you to have a div popup in a page by
  clicking a link. The contents of the div can be static/loaded via Ajax.
  The popup part with Ajax is working. The link that activates the popup
  can either have an image or text label. So I have...
 
PopupPanel
| abstract getTitle() and getContent()
| constructor calls getTitle() and 
 getContents()
|
  --
  ||
 LabelLinkedPopupPanelImageLinkedPopupPanel
 implements getTitle()  implements getTitle()
 
 
  To use it, new LabelLinkedPopupPanel(...) and override the getContent()
  method. I can't get the title to work because of abstract method from
  the constructor problem. My options then are
 
  1. Have a setTitle() and setContent() method that is called by the
  subclasses but failing to call them won't be caught till runtime.
  2. Have PopupPanel constructor take in components for title and content.
  The sub classes then just act as wrappers.
  3. Replace the subclasses with PopupPanelFactory with 2 methods
  newLabelLinkedPopup() and newImageLinkedPopup.
 
  I don't think a border suits this requirement but I'm not sure. Is there
  a better way?
 
  Thanks
  Ravi
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
   

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Multiple wicket:child tags in the same page

2007-05-18 Thread John Krasnay
This question does come up quite a bit on the list, though. I admit
thinking the same thing when I was coming to grips with Wicket not so
long ago. I think the problem is not that markup extension is hard to
understand, but rather that it's very intuitive, so much so that new
Wicket users want to use it to solve related problems.

jk

On Fri, May 18, 2007 at 06:37:11AM -0700, Alex Objelean wrote:
 
 You should read wicket:child tag  as extends keyword... This way wicket
 works. Why are you looking for different solution when there are many more
 which works great?
 
 
 Chris Colman wrote:
  
  As Alex says, wicket:child tags can't solve this because that's not
  the way they're intended to be used.
  
  I can't see why wicket could not be easily enhanced to support multiple
  overridden child sections. Just like the astract methods of a class -
  there is no limit on the number of them: a class can have any number
  abstract methods and they can be overridden by any derived class - not
  just immediate descendents and they don't have to all be overridden in
  the same class - just so long as an implementation is provided somewhere
  in the inheritance hierarchy for any concrete class.
  
  In wicket the wicket:child is just a placeholder for content that will
  be implemented/provided in a derived class. It just seems strange that
  the number of possible placeholders, n, was arbitrarily set to n = 1 in
  the architecture.
  
  Having only 1 alleviates the need to identify the placeholder in a
  derived class but that is the only reason I can see why the maximum
  number of placeholders should have been limited to just 1.
  
  I can see many uses for providing implementations of different child
  sections at different levels of the hierarchy. You could have navigation
  column, main column and footer being child sections. With a deep
  hierarchy you could provide 'extend' sections that provide the content
  for the child sections at various points in the hierarchy. You might
  provide footer markup via one common base class and then in classes that
  extend that class provide different navigation and main column markup
  but they all share a common footer. Another class might provide a
  different footer and have other classes extending it that provide
  different navigation and main column markup.
  
  For backwards compatibility with the current system you could say that
  if there is only one child section then no label is required but if you
  choose to add more than one child section then you must label them (just
  like providing an abstract method signature).
  
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Multiple-wicket%3Achild-tags-in-the-same-page-tf3775143.html#a10682394
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Vertical Tabs

2007-05-17 Thread John Krasnay
I tried to explain this in an earlier thread, but I'm afraid I wasn't
too successful. I'll give it another shot. Suppose your outer tabs are
defined on a page like this:

  div wicket:id=outerTabs class=outerTabs/div

When you attached the TabbedPanel component to it, it renders like this:

  div class=outerTabs
div class=tab-row
  ul
lia href=.../li
  /ul
/div
span class=tab-panel...your panel.../span
  /div

You can make them horizontal by doing something like this in CSS:

  div.outerTabs li { display: inline; }

Now, suppose your panel has a set of inner tabs, with this markup:

  div wicket:id=innerTabs class=innerTabs/div

The rendered HTML now looks like this:

  div class=outerTabs
div class=tab-row
  ul
lia href=.../li
  /ul
/div
span class=tab-panel
  div class=innerTabs
div class=tab-row
  ul
lia href=.../li
  /ul
/div
span class=tab-panel
  your inner panel
/span
  /div
/span
  /div

To make the inner ones vertical, you'll want to float the inner tab row
left and render it's li's as blocks:

  div.innerTabs div.tab-row { float: left; }
  div.innerTabs li { display: block; }

You'll have to play a bit with the CSS to get it nice, but that's the
general idea.

The only tricky part is that the inner li elements are styled by both
the (div.outerTabs li) and (div.innerTabs li) elements, so you have to
make sure of the following:

1. put the (div.innerTabs li) later in the stylesheet, so that it's
properties override those from (div.outerTabs li).

2. anything you do in (div.outerTabs li) that you don't want for the
inner tabs, you have to explicitly undo in (div.innerTabs li), for
example:

  div.outerTabs li { font-weight: bold; }

  /* Have to do this, or the inner tabs will be bold too */
  div.innerTabs li { font-weight: normal; }

Does this help?

jk

On Thu, May 17, 2007 at 01:30:24PM -0700, eddmosphere wrote:
 
 How would I do that? Not sure I understood..
 
 Thanks, Edd
 
 
 igor.vaynberg wrote:
  
  if you set a class on the tab panel then you can use that class to scope
  the
  css styles properly
  
  -igor
  
  
  On 2/20/07, burnayev [EMAIL PROTECTED] wrote:
 
 
  Thank you Igor.
 
  I'm trying to implement nested tabs - basic navigation pattern where you
  have horizontal tabs on top and vertical tabs at left within a particular
  tab panel.
 
  I fiddled a little with styling the inner tabs and haven't come to a
  satisfactory result so far. The problem seems to be the fact that both
  tab
  panels internally use the same CSS classes for styling, namely tab-row
  and
  tab-panel.
 
  Is there a way to dynamically change the associated classes?
 
  Thanks,
  Borys
 
 
  igor.vaynberg wrote:
  
   you can style tabbedpanel in extensions
  
   the tabs are just a ul
  
   -igor
  
  
   On 2/19/07, burnayev [EMAIL PROTECTED] wrote:
  
  
   How do I create vertically stacked tabs? Is it possible to style
  and/or
   extend the extensions tab component or do I have to create my own?
   --
  
 
  --
  View this message in context:
  http://www.nabble.com/Vertical-Tabs-tf3254943.html#a9062788
  Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
  -
  Take Surveys. Earn Cash. Influence the Future of IT
  Join SourceForge.net's Techsay panel and you'll get the chance to share
  your
  opinions on IT  business topics through brief surveys-and earn cash
  http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
  
  -
  Take Surveys. Earn Cash. Influence the Future of IT
  Join SourceForge.net's Techsay panel and you'll get the chance to share
  your
  opinions on IT  business topics through brief surveys-and earn cash
  http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Vertical-Tabs-tf3254943.html#a10671840
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Request for enhancement] TabbedPanel

2007-05-16 Thread John Krasnay
Hi Alex,

The way I've tackled this is to have a wrapper div around the entire tab
panel, like so...

div class=mytabs
  div class=tab-row
ul
  ...
/ul
  /div
/div

You just need to add the wrapper div to your CSS selector:

div.mytabs li {
  background-color: green;
}

Then you can have different wrapper divs for different styling:

div.othertabs li {
  background-color: purple;
}

If you need to dynamically manipulate the wrapper div, simply attach a
WebMarkupContainer to it.

HTH

jk

On Wed, May 16, 2007 at 04:33:37AM -0700, Alex Objelean wrote:
 
 Currently, the markup generated for the tabbedPanel component looks like
 this:
 
 [code]
 wicket:panel
 div class=tab-row
 ul
   li wicket:id=tabs
# [[tab title]] 
   /li
 /ul
 /div
 [panel]
 /wicket:panel
 [/code]
 
 I think that it would be more useful to add a container to the existing
 tabs, so the resulted markup would look like this:
 
 [code]
 wicket:panel
 div wicket:id=tabsContainer class=tab-row
 ul
   li wicket:id=tabs
# [[tab title]] 
   /li
 /ul
 /div
 [panel]
 /wicket:panel
 [/code]
 
 This way you can append a new css class to this container (using
 AttributeAppender behavior) and can control the specific visual appearance
 of the tabbed panel... It is not enough to have only tab-row class,
 because if you have nested tabbed panels (which have different styling) it
 is hard to style them as you want... And finally, you give the developer a
 freedom to do what he wants with this container...
 
 What do you think?
 
 Thank you!
 
 
 -- 
 View this message in context: 
 http://www.nabble.com/-Request-for-enhancement--TabbedPanel-tf3764064.html#a10640047
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Request for enhancement] TabbedPanel

2007-05-16 Thread John Krasnay
In fact now that I think of it, you don't even need the wrapper div.
Remember that the TabbedPanel renders the tabs *inside* the tag to
which it's attached. That tag can contain the CSS class that makes that
set of tabs unique:

  div wicket:id=tabs class=greentabs/div

  add(new TabbedPanel(tabs, tabs));

The result is like this:

  div class=greentabs
div class=tab-row
...
/div
  /div

If you need to determine the class dynamically, just add an appropriate
behaviour to the TabbedPanel:

  add(new TabbedPanel(tabs, tabs)
.add(new AttributeModifier(class, new Model(purpletabs;

jk

On Wed, May 16, 2007 at 06:28:57AM -0700, Alex Objelean wrote:
 
 That is the problem. How can I attach a WebMarkupContainer to a tab-row
 container?
 The markup is generated by TabbedPanel and I cannot manipulate it's
 markup... :(
 
 
 Hi Alex,
 
 The way I've tackled this is to have a wrapper div around the entire tab
 panel, like so...
 
 div class=mytabs
   div class=tab-row
 ul
   ...
 /ul
   /div
 /div
 
 You just need to add the wrapper div to your CSS selector:
 
 div.mytabs li {
   background-color: green;
 }
 
 Then you can have different wrapper divs for different styling:
 
 div.othertabs li {
   background-color: purple;
 }
 
 If you need to dynamically manipulate the wrapper div, simply attach a
 WebMarkupContainer to it.
 
 HTH
 
 jk
 
 On Wed, May 16, 2007 at 04:33:37AM -0700, Alex Objelean wrote:
  
  Currently, the markup generated for the tabbedPanel component looks like
  this:
  
  [code]
  wicket:panel
  div class=tab-row
  ul
  li wicket:id=tabs
   # [[tab title]] 
  /li
  /ul
  /div
  [panel]
  /wicket:panel
  [/code]
  
  I think that it would be more useful to add a container to the existing
  tabs, so the resulted markup would look like this:
  
  [code]
  wicket:panel
  div wicket:id=tabsContainer class=tab-row
  ul
  li wicket:id=tabs
   # [[tab title]] 
  /li
  /ul
  /div
  [panel]
  /wicket:panel
  [/code]
  
  This way you can append a new css class to this container (using
  AttributeAppender behavior) and can control the specific visual appearance
  of the tabbed panel... It is not enough to have only tab-row class,
  because if you have nested tabbed panels (which have different styling) it
  is hard to style them as you want... And finally, you give the developer a
  freedom to do what he wants with this container...
  
  What do you think?
  
  Thank you!
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/-Request-for-enhancement--TabbedPanel-tf3764064.html#a10641787
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] [Request for enhancement] TabbedPanel

2007-05-16 Thread John Krasnay
Ahh, I see...the problem is *nested* tabs. Sorry for not picking that up
earlier. However, I think the same principle applies, no? Just give the
inner tab panel a different CSS class than the outer one.

jk

On Wed, May 16, 2007 at 07:39:04AM -0700, Alex Objelean wrote:
 
 This solution adds the css class the the entire tabbedPanel container,
 subsequently all nested tabbedPanels will be treated the same way What I
 need is to identify the tab-row container
 
 
 John Krasnay wrote:
  
  In fact now that I think of it, you don't even need the wrapper div.
  Remember that the TabbedPanel renders the tabs *inside* the tag to
  which it's attached. That tag can contain the CSS class that makes that
  set of tabs unique:
  
div wicket:id=tabs class=greentabs/div
  
add(new TabbedPanel(tabs, tabs));
  
  The result is like this:
  
div class=greentabs
  div class=tab-row
  ...
  /div
/div
  
  If you need to determine the class dynamically, just add an appropriate
  behaviour to the TabbedPanel:
  
add(new TabbedPanel(tabs, tabs)
  .add(new AttributeModifier(class, new Model(purpletabs;
  
  jk
  
  On Wed, May 16, 2007 at 06:28:57AM -0700, Alex Objelean wrote:
  
  That is the problem. How can I attach a WebMarkupContainer to a tab-row
  container?
  The markup is generated by TabbedPanel and I cannot manipulate it's
  markup... :(
  
  
  Hi Alex,
  
  The way I've tackled this is to have a wrapper div around the entire tab
  panel, like so...
  
  div class=mytabs
div class=tab-row
  ul
...
  /ul
/div
  /div
  
  You just need to add the wrapper div to your CSS selector:
  
  div.mytabs li {
background-color: green;
  }
  
  Then you can have different wrapper divs for different styling:
  
  div.othertabs li {
background-color: purple;
  }
  
  If you need to dynamically manipulate the wrapper div, simply attach a
  WebMarkupContainer to it.
  
  HTH
  
  jk
  
  On Wed, May 16, 2007 at 04:33:37AM -0700, Alex Objelean wrote:
   
   Currently, the markup generated for the tabbedPanel component looks
  like
   this:
   
   [code]
   wicket:panel
   div class=tab-row
   ul
li wicket:id=tabs
 # [[tab title]] 
/li
   /ul
   /div
   [panel]
   /wicket:panel
   [/code]
   
   I think that it would be more useful to add a container to the existing
   tabs, so the resulted markup would look like this:
   
   [code]
   wicket:panel
   div wicket:id=tabsContainer class=tab-row
   ul
li wicket:id=tabs
 # [[tab title]] 
/li
   /ul
   /div
   [panel]
   /wicket:panel
   [/code]
   
   This way you can append a new css class to this container (using
   AttributeAppender behavior) and can control the specific visual
  appearance
   of the tabbed panel... It is not enough to have only tab-row class,
   because if you have nested tabbed panels (which have different styling)
  it
   is hard to style them as you want... And finally, you give the
  developer a
   freedom to do what he wants with this container...
   
   What do you think?
   
   Thank you!
   
  
  -- 
  View this message in context:
  http://www.nabble.com/-Request-for-enhancement--TabbedPanel-tf3764064.html#a10641787
  Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/-Request-for-enhancement--TabbedPanel-tf3764064.html#a10642947
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

[Wicket-user] [EMAIL PROTECTED]: [jira] Resolved: (WICKET-527) Panel header contribution breaks AJAX update in Internet Explorer]

2007-05-13 Thread John Krasnay
Thanks Matej. I guess I was thrown off by a couple of things, first that
it worked in Firefox, and second that Wicket didn't complain about the
tag not being well-formed as it does for components.

Would it be a good idea to have wicket:head check the well-formedness
of its contents? Should I raise a JIRA?

jk

- Forwarded message from Matej Knopp (JIRA) [EMAIL PROTECTED] -

Envelope-to: [EMAIL PROTECTED]
Delivery-date: Sat, 12 May 2007 10:45:18 -0400
From: Matej Knopp (JIRA) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
X-SA-Exim-Connect-IP: 140.211.11.4
X-SA-Exim-Mail-From: [EMAIL PROTECTED]
Subject: [jira] Resolved: (WICKET-527) Panel header contribution breaks AJAX
 update in Internet Explorer
X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on 
mercury.effectiveregistration.com
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
version=3.0.3
X-SA-Exim-Version: 4.2 (built Thu, 03 Mar 2005 10:44:12 +0100)
X-SA-Exim-Scanned: Yes (on mercury.effectiveregistration.com)


 [ 
https://issues.apache.org/jira/browse/WICKET-527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matej Knopp resolved WICKET-527.


Resolution: Invalid

Of course this doesn't work. Markup for header contribution must be well formed 
(xhtml valid). In your example you have 

link rel=stylesheet type=text/css href=SubComponent.css

Which is wrong - without closing tag. If you change it to 

link rel=stylesheet type=text/css href=SubComponent.css/

Everything works.

 Panel header contribution breaks AJAX update in Internet Explorer
 -

 Key: WICKET-527
 URL: https://issues.apache.org/jira/browse/WICKET-527
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.2.6
Reporter: John Krasnay
 Assigned To: Matej Knopp
 Attachments: quickstart.zip


 If a Panel subclass makes a header contribution via wicket:head, and the 
 panel code attempts to refresh itself in response to an AjaxLink click, the 
 refresh does not work on IE. The debug window shows the following error:
 INFO:
 INFO: Initiating Ajax GET request on
 /arp/?wicket:interface=:0:subComponent:link::IBehaviorListenerwicket:behaviorId=0random=0.8818904450460203
 INFO: Invoking pre-call handler(s)...
 INFO: Received ajax response (656 characters)
 INFO:
 ?xml version=1.0
 encoding=UTF-8?ajax-responseheader-contribution![CDATA[head
 xmlns:wicket=http://wicket.sourceforge.net;
 link
 href=/arp/resources/com.td.idcs.arp.dev.SubComponent/SubComponent_en_US.css
 rel=stylesheet type=text/css
 /head]]/header-contributioncomponent id=subComponent
 ![CDATA[div id=subComponent
 a href=# onclick=var
 wcall=wicketAjaxGet('/arp/?wicket:interface=:0:subComponent:link::IBehaviorListenerwicket:behaviorId=0',
 function() { }, function() { });return !wcall;
 id=subComponent_linkClick Me/a
 span3/span
 /div]]/component/ajax-response
 ERROR: Error while parsing response: Object required
 INFO: Invoking post-call handler(s)...
 INFO: Invoking failure handler(s)...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


- End forwarded message -

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Wicket requiring one of my Spring managed beans to have a default constructor

2007-05-13 Thread John Krasnay
Not directly related to your question, but you might like to know that
the name property of @SpringBean defaults to your field name, so you
could have written it like this...

@SpringBean
private ContentSettings contentSettings;
 
@SpringBean
private LearningItemRepository learningItemRepository;

jk

On Wed, May 09, 2007 at 05:36:52PM -0500, Matt Welch wrote:
 I am using the @SpringBean annotation to instantiate Spring dependencies in
 my wicket pages but I have one page that is giving me a error that I'm
 having trouble dealing with. Here's an example.
 
 The Wicket page class:
 
 public class Viewer extends WebPage {
 
@SpringBean(name = contentSettings)
private ContentSettings contentSettings;
 
@SpringBean(name = learningItemRepository)
private LearningItemRepository learningItemRepository;
 
public Viewer() {
 
//add some simple components to the page
 
}
 }
 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Header contributions and AjaxLink

2007-05-03 Thread John Krasnay
I think I may have found a bug with header contributions, AjaxLink, and
Internet Explorer. Here's a test page:

html
  body
div wicket:id=subComponent/div
  /body
/html

---8---

public class TestPage extends WebPage {
public TestPage() {
add(new SubComponent(subComponent));
}
}



SubComponent is defined as follows:

html
  head
wicket:head
  wicket:link
link rel=stylesheet type=text/css href=SubComponent.css
  /wicket:link
/wicket:head
  /head
  body
  
wicket:panel
a wicket:id=link href=#Click Me/a
span wicket:id=label/span
/wicket:panel

  /body
/html

---8---

public class SubComponent extends Panel {

private int count = 0;

public SubComponent(String id) {
super(id);

add(new AjaxLink(link) {
@Override
public void onClick(AjaxRequestTarget target) {
count++;
target.addComponent(SubComponent.this);
}
});

add(new Label(label, new PropertyModel(this, count)));

setOutputMarkupId(true);
}

public int getCount() {
return count;
}

}




Under Firefox this works fine: clicking the Click Me link causes the
count to increment on the page. But under IE, the number does not get
updated on the page (even though the count is being incremented on the
server). The debug window gives the following error:

INFO: 
INFO: Initiating Ajax GET request on
/arp/?wicket:interface=:0:subComponent:link::IBehaviorListenerwicket:behaviorId=0random=0.8818904450460203
INFO: Invoking pre-call handler(s)...
INFO: Received ajax response (656 characters)
INFO: 
?xml version=1.0
encoding=UTF-8?ajax-responseheader-contribution![CDATA[head
xmlns:wicket=http://wicket.sourceforge.net; 
   
link
href=/arp/resources/com.td.idcs.arp.dev.SubComponent/SubComponent_en_US.css
rel=stylesheet type=text/css 
   
/head]]/header-contributioncomponent id=subComponent
![CDATA[div id=subComponent 
a href=# onclick=var
wcall=wicketAjaxGet('/arp/?wicket:interface=:0:subComponent:link::IBehaviorListenerwicket:behaviorId=0',
function() { }, function() { });return !wcall;
id=subComponent_linkClick Me/a 
span3/span 
/div]]/component/ajax-response
ERROR: Error while parsing response: Object required
INFO: Invoking post-call handler(s)...
INFO: Invoking failure handler(s)...




The problem appears to be the wicket:head portion of the SubComponent.
Comment this out and it works correctly on both IE and Firefox. Note
that SubComponent.css is empty. I've tried this on Wicket 1.2.4 and 1.2.6.

Any thoughts?

jk


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Header contributions and AjaxLink

2007-05-03 Thread John Krasnay
https://issues.apache.org/jira/browse/WICKET-527

Quickstart attached to the JIRA.

Thanks!

jk

On Thu, May 03, 2007 at 06:48:14PM +0200, Matej Knopp wrote:
 I can look into it if you provide a quick start.
 
 -Matej
 
 On 5/3/07, Igor Vaynberg [EMAIL PROTECTED] wrote:
  please create a jira issue.
 
  -igor
 
 
 
  On 5/3/07, John Krasnay [EMAIL PROTECTED] wrote:
   I think I may have found a bug with header contributions, AjaxLink, and
   Internet Explorer. Here's a test page:
  
   html
 body
   div wicket:id=subComponent/div
 /body
   /html
  
   ---8---
  
   public class TestPage extends WebPage {
   public TestPage() {
   add(new SubComponent(subComponent));
   }
   }
  
  
  
   SubComponent is defined as follows:
  
   html
 head
   wicket:head
 wicket:link
   link rel=stylesheet type=text/css href=SubComponent.css
 /wicket:link
   /wicket:head
 /head
 body
  
   wicket:panel
   a wicket:id=link href=#Click Me/a
   span wicket:id=label/span
   /wicket:panel
  
 /body
   /html
  
   ---8---
  
   public class SubComponent extends Panel {
  
   private int count = 0;
  
   public SubComponent(String id) {
   super(id);
  
   add(new AjaxLink(link) {
   @Override
   public void onClick(AjaxRequestTarget target) {
   count++;
   target.addComponent(SubComponent.this );
   }
   });
  
   add(new Label(label, new PropertyModel(this, count)));
  
   setOutputMarkupId(true);
   }
  
   public int getCount() {
   return count;
   }
  
   }
  
  
  
  
   Under Firefox this works fine: clicking the Click Me link causes the
   count to increment on the page. But under IE, the number does not get
   updated on the page (even though the count is being incremented on the
   server). The debug window gives the following error:
  
   INFO:
   INFO: Initiating Ajax GET request on
  
  /arp/?wicket:interface=:0:subComponent:link::IBehaviorListenerwicket:behaviorId=0random=0.8818904450460203
   INFO: Invoking pre-call handler(s)...
   INFO: Received ajax response (656 characters)
   INFO:
   ?xml version=1.0
  
  encoding=UTF-8?ajax-responseheader-contribution![CDATA[head
   xmlns:wicket=http://wicket.sourceforge.net;
  
   link
  
  href=/arp/resources/com.td.idcs.arp.dev.SubComponent/SubComponent_en_US.css
   rel=stylesheet type=text/css
  
   /head]]/header-contributioncomponent
  id=subComponent
   ![CDATA[div id=subComponent
   a href=# onclick=var
  
  wcall=wicketAjaxGet('/arp/?wicket:interface=:0:subComponent:link::IBehaviorListenerwicket:behaviorId=0',
   function() { }, function() { });return !wcall;
   id=subComponent_linkClick Me/a
   span3/span
   /div]]/component/ajax-response
   ERROR: Error while parsing response: Object required
   INFO: Invoking post-call handler(s)...
   INFO: Invoking failure handler(s)...
  
  
  
  
   The problem appears to be the wicket:head portion of the SubComponent.
   Comment this out and it works correctly on both IE and Firefox. Note
   that SubComponent.css is empty. I've tried this on Wicket 1.2.4 and 1.2.6.
  
   Any thoughts?
  
   jk
  
  
  
  -
   This SF.net email is sponsored by DB2 Express
   Download DB2 Express C - the FREE version of DB2 express and take
   control of your XML. No limits. Just data. Click to get it now.
   http://sourceforge.net/powerbar/db2/
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2

Re: [Wicket-user] question on localization

2007-04-24 Thread John Krasnay
You might want to make it so you can dynamically generate a page title
where you need to, instead of always requiring a static page title. The
trick is to return an IModel from the getPageTitle method in your base
page. Here's how I've done it:

title wicket:id=pageHeaderTitleFoo/title

public class BasePage extends WebPage {

public BasePage() {
add(new Label(pageHeaderTitle, getPageTitle()));
}

public IModel getPageTitle() {
return new ResourceModel(page.title);
}
}

jk

On Tue, Apr 24, 2007 at 10:33:54AM +0900, David Leangen wrote:
  i tried to use Label() with PropertyModel(pageTitle) but didn't work for 
  me.  it rendered Home string all the time, no matter what the locale was.
  any ideas how to do this?
 
 You can do something like this:
 
 new Label( componentId, new StringResourceModel( pageTitle, this, new
 Model() ) );
 
 In your properties file:
 pageTitle=Home
 
 In your html:
 span wicket:id=componentIdDummy text/span
 
 
 Look for StringResourceModel in ProWicket or in the API docs.
 
 
 HTH
 Dave
 
 
 
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] question on localization

2007-04-24 Thread John Krasnay
Ah, yes, this is much better. It bothered me enough to put a warning in
the Javadoc, but that's a poor substitute for something that just works.
I'll be fixing our code in the morning. Thanks Igor.

jk

On Tue, Apr 24, 2007 at 11:00:05AM -0700, Igor Vaynberg wrote:
 this is bad. getpagetitle() might get called from a partially constructed
 object
 
 it should be
 
public BasePage() {
add(new Label(pageHeaderTitle, new pagetitlemodel()));
}
 
private class pagetitlemodel extends abstractreadonlymodel {
object getobject() { return getpagetitle().getobject(); }
void detach() { getpagetitle().detach(); }
 }
 
 -igor
 
 On 4/24/07, John Krasnay [EMAIL PROTECTED] wrote:
 
 You might want to make it so you can dynamically generate a page title
 where you need to, instead of always requiring a static page title. The
 trick is to return an IModel from the getPageTitle method in your base
 page. Here's how I've done it:
 
 title wicket:id=pageHeaderTitleFoo/title
 
 public class BasePage extends WebPage {
 
 public BasePage() {
 add(new Label(pageHeaderTitle, getPageTitle()));
 }
 
 public IModel getPageTitle() {
 return new ResourceModel(page.title);
 }
 }
 
 jk
 
 On Tue, Apr 24, 2007 at 10:33:54AM +0900, David Leangen wrote:
   i tried to use Label() with PropertyModel(pageTitle) but didn't work
 for
   me.  it rendered Home string all the time, no matter what the locale
 was.
   any ideas how to do this?
 
  You can do something like this:
 
  new Label( componentId, new StringResourceModel( pageTitle, this, new
  Model() ) );
 
  In your properties file:
  pageTitle=Home
 
  In your html:
  span wicket:id=componentIdDummy text/span
 
 
  Look for StringResourceModel in ProWicket or in the API docs.
 
 
  HTH
  Dave
 
 
 
 
 
 -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user
 

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Where to place images

2007-04-19 Thread John Krasnay
You might consider referencing the image from a Panel, then just using
the panel everywhere. In that case the image only needs to be kept in
the package that defines the Panel.

If it's something like a logo that appears at the top of every page, you
could also define a base page that renders the logo, then have every
other page extend your base page. In that case the image only needs to
be in same package as the base page.

In both cases, however, you do lose the ability to preview beyond the
panel or base page. As with any web framework, there's only so far you
can push previews. For me, though, the ability to package
Java+html+images+css+javascript into one re-usable component far
outweighs this limitation.

jk

On Thu, Apr 19, 2007 at 12:22:53AM -0700, nlif wrote:
 
 Let me make sure I understand: you suggest that I place the img files along
 with the html and java files?
 But what if I have images that are used in many places in the application?
 Do I keep multiple copies of that gif files?
 This seems hard to maintain...
 
 Naaman

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] AbstractAjaxTimerBehavior on a page not possible ?

2007-04-17 Thread John Krasnay
I see. In that case, you could just render the following script along
with your Registration Successful panel:

script type=text/javascript
window.setTimeout('window.location=/welcome', 5000);
/script

jk

On Tue, Apr 17, 2007 at 02:50:33PM +0200, ZedroS Schwart wrote:
 As it's on the page where the registration form is presented, I would
 have to update the page with this meta after successful submit, is
 that correct ? If so, is it possible to update the meta through ajax ?
 
 Thanks again
 ZedroS
 
 On 4/17/07, John Krasnay [EMAIL PROTECTED] wrote:
  How about doing this the old-fashioned way?
 
  meta http-equiv=refresh content=5;url=/welcome
 
  jk
 
 
  On Tue, Apr 17, 2007 at 02:16:57PM +0200, ZedroS Schwart wrote:
   First of all, thanks for your answer.
  
   Regarding this form, in fact it's the registration one. On successful
   form filling (having check that the login is unique), I would like a
   feedback message to be rendered saying Registration succesfull,
   you'll be redirected to the login page in a few seconds.
  
   Technically speaking, it means that, when the submit is ok, I want to
   hide the form and add an ajax timer to redirect the page after a short
   while.
  
   I hide the form and add the timer in the onSubmit of my form.
  
   Cheers,
   ZedroS
   On 4/17/07, Johan Compagner [EMAIL PROTECTED] wrote:
What should that submit do?
   
Set the form to none visible and then also add an timer that redirects 
after
5 seconds?
Why not directly redirect? Do you want to show a none visible form for 5
seconds and then move on?
   
But do you add the parent of the form to the to render components? So 
that
the parent of the form
is now rerendered without the form?
   
johan
   
   
   
On 4/17/07, ZedroS Schwart [EMAIL PROTECTED] wrote:

 I'm not really familiar wih junit but I'm willing to do the test.

 I just would like to be sure the perimeter I'm considering is valid in
Wicket.

 In fact, I'm using an AjaxForm, meaning I got the submit through an
 AjaxSubmitButton.

 Then, on the onSubmit of the form, I try to do
 - form.setVisible(false);
 -  add(new
AbstractAjaxTimerBehavior(Duration.seconds(5)) {
 protected void
onTimer(AjaxRequestTarget target) {

setRedirect(true);

setResponsePage(WelcomePage.class);
 }
 });

 Should it be at least possible ?

 If so, I'll do the junit test.

 Cheers,
 ZedroS

 On 4/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
  If you please could prepare a reproducable junit test for it and add
  it to JIRA, we can fix it and keep it fixed.
 
  Eelco
 
 
  On 4/12/07, ZedroS [EMAIL PROTECTED] wrote:
  
   Hi
  
   I'm now on 1.3 and I've tried to use setVisible inside a form 
   onSubmit
and
   it doesn't work...
  
   I've tried many syntaxes, like :
   @Override
   public void onSubmit() {
   this.setVisible(false);
   setVisible(false);
   }
  
   I even made the form as an attribut of the page class, using then 
   :
   @Override
   public void onSubmit() {
   form.setVisible(false);
   }
  
   but it doesn't work.
  
   I've as well noticed that my AjaxIndicator doesn't work anymore...
  
   Do you have a clue what's going on ?
  
   BR
   ZedroS
  
   ZedroS wrote:
   
Hi
   
Thanks for your answer.
   
That's what I had done but I wondered whether there would be a
better way.
   
1.3 looks even further interesting I see ;)
   
Cheers
ZedroS
   
On 4/4/07, Johan Compagner [EMAIL PROTECTED] wrote:
in 1.2 you need to work around it by having a component.
   
in 1.3 this is fixed and it will work on a page.
   
johan
   
   
On 4/4/07, ZedroS Schwart  [EMAIL PROTECTED] wrote:

 I use wicket 1.2.5...

 How shall I do ?

 Thanks in advance
 ZedroS


   
-
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net 's Techsay panel and you'll get the 
 chance
to
share
your
 opinions on IT  business topics through brief surveys-and 
 earn
cash

   
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/wicket-user

Re: [Wicket-user] AbstractAjaxTimerBehavior on a page not possible ?

2007-04-17 Thread John Krasnay
How about doing this the old-fashioned way?

meta http-equiv=refresh content=5;url=/welcome

jk


On Tue, Apr 17, 2007 at 02:16:57PM +0200, ZedroS Schwart wrote:
 First of all, thanks for your answer.
 
 Regarding this form, in fact it's the registration one. On successful
 form filling (having check that the login is unique), I would like a
 feedback message to be rendered saying Registration succesfull,
 you'll be redirected to the login page in a few seconds.
 
 Technically speaking, it means that, when the submit is ok, I want to
 hide the form and add an ajax timer to redirect the page after a short
 while.
 
 I hide the form and add the timer in the onSubmit of my form.
 
 Cheers,
 ZedroS
 On 4/17/07, Johan Compagner [EMAIL PROTECTED] wrote:
  What should that submit do?
 
  Set the form to none visible and then also add an timer that redirects after
  5 seconds?
  Why not directly redirect? Do you want to show a none visible form for 5
  seconds and then move on?
 
  But do you add the parent of the form to the to render components? So that
  the parent of the form
  is now rerendered without the form?
 
  johan
 
 
 
  On 4/17/07, ZedroS Schwart [EMAIL PROTECTED] wrote:
  
   I'm not really familiar wih junit but I'm willing to do the test.
  
   I just would like to be sure the perimeter I'm considering is valid in
  Wicket.
  
   In fact, I'm using an AjaxForm, meaning I got the submit through an
   AjaxSubmitButton.
  
   Then, on the onSubmit of the form, I try to do
   - form.setVisible(false);
   -  add(new
  AbstractAjaxTimerBehavior(Duration.seconds(5)) {
   protected void
  onTimer(AjaxRequestTarget target) {
  
  setRedirect(true);
  
  setResponsePage(WelcomePage.class);
   }
   });
  
   Should it be at least possible ?
  
   If so, I'll do the junit test.
  
   Cheers,
   ZedroS
  
   On 4/14/07, Eelco Hillenius [EMAIL PROTECTED] wrote:
If you please could prepare a reproducable junit test for it and add
it to JIRA, we can fix it and keep it fixed.
   
Eelco
   
   
On 4/12/07, ZedroS [EMAIL PROTECTED] wrote:

 Hi

 I'm now on 1.3 and I've tried to use setVisible inside a form onSubmit
  and
 it doesn't work...

 I've tried many syntaxes, like :
 @Override
 public void onSubmit() {
 this.setVisible(false);
 setVisible(false);
 }

 I even made the form as an attribut of the page class, using then :
 @Override
 public void onSubmit() {
 form.setVisible(false);
 }

 but it doesn't work.

 I've as well noticed that my AjaxIndicator doesn't work anymore...

 Do you have a clue what's going on ?

 BR
 ZedroS

 ZedroS wrote:
 
  Hi
 
  Thanks for your answer.
 
  That's what I had done but I wondered whether there would be a
  better way.
 
  1.3 looks even further interesting I see ;)
 
  Cheers
  ZedroS
 
  On 4/4/07, Johan Compagner [EMAIL PROTECTED] wrote:
  in 1.2 you need to work around it by having a component.
 
  in 1.3 this is fixed and it will work on a page.
 
  johan
 
 
  On 4/4/07, ZedroS Schwart  [EMAIL PROTECTED] wrote:
  
   I use wicket 1.2.5...
  
   How shall I do ?
  
   Thanks in advance
   ZedroS
  
  
 
  -
   Take Surveys. Earn Cash. Influence the Future of IT
   Join SourceForge.net 's Techsay panel and you'll get the chance
  to
  share
  your
   opinions on IT  business topics through brief surveys-and earn
  cash
  
 
  http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
   ___
   Wicket-user mailing list
   Wicket-user@lists.sourceforge.net
  
  https://lists.sourceforge.net/lists/listinfo/wicket-user
  
 
 
 
  -
  Take Surveys. Earn Cash. Influence the Future of IT
  Join SourceForge.net's Techsay panel and you'll get the chance to
  share
  your
  opinions on IT  business topics through brief surveys-and earn
  cash
 
  http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
 
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 
 
 
 
  -
  Take Surveys. Earn Cash. Influence the Future of IT
  Join SourceForge.net's Techsay panel and you'll get the chance to
  share
  your
  opinions on IT  business topics through brief surveys-and earn cash
 
  

Re: [Wicket-user] Input focus

2007-04-04 Thread John Krasnay
Thanks, guys.

I think I was over-thinking this. I've decided to do this with pure
Javascript included on every page, just giving focus to the first
non-disabled input element. Igor's comment about metadata made me realize
I was already tagging invalid fields with invalid in the class
attribute, so I keyed off that to give those fields priority. I also use
the CSS class name nofocus to avoid always giving focus to a search
input at the top of each page.

I've attached the JS if anyone's interested. It won't give focus to a
select or textarea, but I don't need that just now.

jk


On Tue, April 3, 2007 2:04 am, Peter Thomas said:
 You may already know the quick un-generic way to do this - but for example
 this is what I have on a login page where I set focus to the password
 field
 in case the user-id field is already filled in.

 getBodyContainer().addOnLoadModifier(new AbstractReadOnlyModel() {
 public Object getObject() {
 String markupId;
 if(loginName.getConvertedInput() == null) {
 markupId = loginName.getMarkupId();
 } else {
 markupId = password.getMarkupId();
 }
 return document.getElementById(' + markupId + ').focus();
 }
 }, password);


 On 4/3/07, Igor Vaynberg [EMAIL PROTECTED] wrote:

 you can set some metadata into these components. have your page/form
 subclass implement iheaderresponse, traverse the hierararchy in
 renderhead
 and set focus to the first component with the right metadata through the
 header response that is passed in.

 sounds like a mouthful, but should be pretty simple to implement.

 -igor


 On 4/2/07, John Krasnay  [EMAIL PROTECTED] wrote:
 
  Hi folks,
 
  I'm new to Wicket and I'm wondering if there's a Wicket way to have
  input focus set to the first form component on the page. I could
 always
  code up some
  Javascript to do this but it would be nice if I could flag certain
 form
  components as wanting focus, then have the page set the focus to the
  first of these. Ideally, if any form components had failed validation,
  the
  page would ignore the wanting focus flag and give focus to the first
  invalid field.
 
  Any ideas?
 
  jk
 
 
 
 
  -
  Take Surveys. Earn Cash. Influence the Future of IT
  Join SourceForge.net's Techsay panel and you'll get the chance to
 share
  your
  opinions on IT  business topics through brief surveys-and earn cash
 
  http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user
 


 -
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the chance to share
 your
 opinions on IT  business topics through brief surveys-and earn cash
 http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user


 -
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the chance to share
 your
 opinions on IT  business topics through brief surveys-and earn cash
 http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



focus.js
Description: JavaScript source
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Input focus

2007-04-02 Thread John Krasnay
Hi folks,

I'm new to Wicket and I'm wondering if there's a Wicket way to have
input focus set to the first form component on the page. I could always
code up some
Javascript to do this but it would be nice if I could flag certain form
components as wanting focus, then have the page set the focus to the
first of these. Ideally, if any form components had failed validation, the
page would ignore the wanting focus flag and give focus to the first
invalid field.

Any ideas?

jk



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user