Re: image from outside web application directory

2012-07-05 Thread Scott Swank
This is what I've done.

https://cwiki.apache.org/WICKET/how-to-load-an-external-image.html

Scott

On Thu, Jul 5, 2012 at 6:18 AM, lang  wrote:
> Martin could you give me an example of this?
> I my website i want to upload jpgt pictures from clients. I already store
> them on another location but i can't show the pictures on my website
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/image-from-outside-web-application-directory-tp4650379p4650393.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



off-topic: developer for hire

2012-07-02 Thread Scott Swank
Sorry for the quick note that is unrelated to Wicket development.

I am looking for work involving either Java or Oracle development.
Wicket would of course be preferable as a web ui. :)

Contact me directly if you are interested instead of posting to the list please.

Cheers,
Scott

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



Re: Components do not re-render when page is refreshed...

2012-06-29 Thread Scott Swank
It is rendered, but the existing page is reused so you do not see the
constructor called again. That's what Dan meant when he said, "That's
how Wicket manages stateful pages: it constructs it once, and
subsequent actions (including re-rendering all or part) are handled by
the
same instance."

You could override beforeRender() and/or afterRender() and add logging
there if you want to verify that rendering occurs.

That said, it's clear that you have some problem because you say that
"nothing happens" when the page is refreshed. So what you expect to
happen? What change do you not see?

Scott

On Fri, Jun 29, 2012 at 12:09 PM, kshitiz  wrote:
> Hi,
>
> Thanks for the reply. Just to clarify, like if I am adding a panel:
>
> *add(new PostPanel("postPanel", pageParameters, userTypeDomain,
>                                userDomain));*
>
> So, how do I make it render at every page refresh...?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Components-do-not-re-render-when-page-is-refreshed-tp4650290p4650294.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Components do not re-render when page is refreshed...

2012-06-29 Thread Scott Swank
How do you construct your panels? This sounds like a model issue...

Scott

On Fri, Jun 29, 2012 at 9:02 AM, kshitiz  wrote:
> Hi,
>
> In my wicket application, each page carries many panels. *Now every panel is
> rendered when the page is loaded but when it is refreshed, nothing happens.
> * No panel is getting rendered again, not even sysouts are printing
> anything. *Now this is a good thing for performance but I want them to be
> re-rendered.Is there any way to make it happen...??*
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Components-do-not-re-render-when-page-is-refreshed-tp4650290.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: What does this syntax say?

2011-07-29 Thread Scott Swank
This is called a "generic method", and you're just giving the type
signature of the method. Here's an example from our code.

public static > NumberField
withMinimum(String id, T min) {
NumberField f = new NumberField(id);
f.add(new MinimumValidator(min));
return f;
}

Which allows:

NumberField adultAge = NumberField.withMinimum("bar", 18);
NumberField rating = NumberField.withinRange("foo", 0.0, 5.0);

Scott





On Thu, Jul 28, 2011 at 11:55 PM, Wilhelmsen Tor Iver
 wrote:
>> public  IWrapModel wrapOnInheritance(Component component,Class
>> type)
>
> The Class parameter is only needed if you intend to do "new W();" or the 
> like in the method (the Class is then something the compiler can grab hold of 
> for calling the constructor). For just passing the type parameter to other 
> generic classes it is not needed. The compiler sees the context (i.e. the 
> left-hand side of an assignment) and if it cannot determine the type it will 
> say "needs a cast" as a warning, but the code will compile since it's all 
> Object anyway.
>
> - Tor Iver
>

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



Re: RFC: Ten things every Wicket programmer must know?

2011-07-27 Thread Scott Swank
Jeremy,

I just threw together the following, which indicates that at least to
me Models are worth 3 of your 10 items.

1. Most components have a backing object of some sort. This object is
referenced via a Model. Significantly, the type of the component and
the model match (e.g. Label has an IModel).
2. These objects live in the session and are managed in the session by
wicket, so that when the component goes out of scope the object is
removed from the session by wicket.
3. Because domain objects are often too large to store in the session
there is a LoadableDetachableModel that is responsible for loading the
object whenever it is needed in a request and then flushing it at the
end of the request via detach().

Cheers,
Scott

On Wed, Jul 27, 2011 at 3:29 PM, Jeremy Thomerson
 wrote:
> Hello all,
>
>  I'm writing an article for a Java magazine and would like to include in it
> a list of "ten things every Wicket programmer must know".  Of course, I have
> my list, but I'd be very curious to see what you think should be on that
> list from your own experience.  Or, put another way, maybe the question
> would be "what I wished I knew when I started Wicket" - what tripped you up
> or what made you kick yourself later?
>
>  Please reply back if you have input.  Please note that by replying, you
> are granting me full permission to use your response as part of my article
> without any attribution or payment.  If you disagree with those terms,
> please respond anyway but in your response mention your own terms.
>
> Best regards,
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

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



Re: Scala DSL for Wicket

2011-07-27 Thread Scott Swank
I think you do want Unit, which as I understand it is closest
equivalent to "void" in Scala.

http://www.scala-lang.org/api/current/scala/Unit.html

Scott

On Wed, Jul 27, 2011 at 10:14 AM, Bruno Borges  wrote:
> No, the function must return void, not another function (unit).
>
> But there's also the option of () => Nothing. Which one should I use for
> this case?
>
> *Bruno Borges*
> www.brunoborges.com.br
> +55 21 76727099
>
>
>
> On Wed, Jul 27, 2011 at 12:54 PM, Martin Grigorov wrote:
>
>>  def button(id: String, submit: () => Void): Button = {
>>
>> it should be () => Unit, no ?
>>
>> On Wed, Jul 27, 2011 at 6:51 PM, Martin Grigorov 
>> wrote:
>> > Adding some usage examples at the bottom will help us evaluate it.
>> >
>> > Why not add type to
>> > def textField(id: String): TextField[_] = { val field = new
>> > TextField(id); add(field); field }
>> > to become
>> > def textField[T](id: String): TextField[T] = { val field = new
>> > TextField[T](id); add(field); field }
>> >
>> > usage: textField[Int](someId)
>> >
>> > with using implicit Manifest for T you can also can automatically set
>> > the type: field.setType(m.erasure)
>> >
>> > On Wed, Jul 27, 2011 at 6:26 PM, Bruno Borges 
>> wrote:
>> >> I've been playing with Wicket and Scala and I thought this could be
>> added to
>> >> the wicket-scala project at WicketStuff.
>> >>
>> >> What do you guys think?
>> >>
>> >> https://gist.github.com/1109603
>> >>
>> >>
>> >> *Bruno Borges*
>> >> www.brunoborges.com.br
>> >> +55 21 76727099
>> >>
>> >
>> >
>> >
>> > --
>> > Martin Grigorov
>> > jWeekend
>> > Training, Consulting, Development
>> > http://jWeekend.com
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: Handling futures

2011-07-23 Thread Scott Swank
Perhaps a transient Future would work for you after all. If the user
navigates away the Page is serialized and the Future is thrown away.

If you do put futures in a Map, perhaps in the Session, I'd wrap that
in an AbstractReadonlyModel. Then you could use have a
Map> (assuming your key is an Integer)
if you're still concerned about memory usage getting out of hand.

Scott

On Sat, Jul 23, 2011 at 8:02 AM, Bertrand Guay-Paquet
 wrote:
> I haven't actually done it yet, but the 3 steps you list are what I have in
> mind.
>
> After these, I plan to use a javascript timer that polls the status of the
> request and updates a label (or icon). That ajax behavior would be the one
> polling the Future.
>
> What I can't wrap my head around is this: the ajax behavior can't directly
> hold a reference to the Future because it can be serialized with the page.
> On the other hand, if I store the Future in a map somewhere and keep a
> serializable handle in the behavior, there is a possibility that the user
> will navigate to another page before get() is called on the Future. To avoid
> running out of memory, this means that I would need to have a daemon that
> periodically nulls stale Futures from the map so they can be garbage
> collected.
>
> This kind of operation (submit + polling asynchronous result) seems rather
> common so I'm sure there's some (easy) way to handle it...
>
> On 23/07/2011 9:14 AM, Scott Swank wrote:
>>
>> What does your workflow look like?
>>
>> 1. submit form (or ajax event)
>> 2. create Future
>> 3. return response page (or ajax response)
>>
>> Now who checks the Future and what sort of UI result occurs?
>>
>> Scott
>>
>> On Fri, Jul 22, 2011 at 8:55 PM, Bertrand Guay-Paquet
>>   wrote:
>>>
>>> Hello,
>>>
>>> I can't find the correct way to handle java.util.concurrent.Future
>>> instances
>>> returned from asynchronous methods in Wicket. This interface does not
>>> extend
>>> Serializable so its instances can't be stored in components or pages. So
>>> what do you do with them?
>>>
>>> Do you store them in a map in the application and keep a handle (e.g. an
>>> int) in the Wicket component?
>>>
>>> I saw code on a github repository that implemented an ajax timer behavior
>>> that keeps a reference to a Future in a transient field to update a
>>> status.
>>> However, I can't understand how that would work. Wouldn't the transient
>>> field be nulled out if the behavior is serialized with the page and then
>>> deserialized?
>>>
>>> Essentially, my question is: what is the standard way to handle Futures
>>> in
>>> Wicket that run longer than the page rendering? (like processing an order
>>> or
>>> sending emails)
>>>
>>> I hope I'm not missing something obvious, but that might be the case...
>>>
>>> Regards,
>>> Bertrand
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Handling futures

2011-07-23 Thread Scott Swank
What does your workflow look like?

1. submit form (or ajax event)
2. create Future
3. return response page (or ajax response)

Now who checks the Future and what sort of UI result occurs?

Scott

On Fri, Jul 22, 2011 at 8:55 PM, Bertrand Guay-Paquet
 wrote:
> Hello,
>
> I can't find the correct way to handle java.util.concurrent.Future instances
> returned from asynchronous methods in Wicket. This interface does not extend
> Serializable so its instances can't be stored in components or pages. So
> what do you do with them?
>
> Do you store them in a map in the application and keep a handle (e.g. an
> int) in the Wicket component?
>
> I saw code on a github repository that implemented an ajax timer behavior
> that keeps a reference to a Future in a transient field to update a status.
> However, I can't understand how that would work. Wouldn't the transient
> field be nulled out if the behavior is serialized with the page and then
> deserialized?
>
> Essentially, my question is: what is the standard way to handle Futures in
> Wicket that run longer than the page rendering? (like processing an order or
> sending emails)
>
> I hope I'm not missing something obvious, but that might be the case...
>
> Regards,
> Bertrand
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: ListView inside a ListView

2011-05-25 Thread Scott Swank
For clarity, I would rename the ListItems:

protected void populateItem(final ListItem assetItem) {
   assetItem.add(new Label(...));
   assetItem.add(new ListView(...) {
  protected void populateItem(ListItem allocationItem) {
 allocationItem.add(new Label(...));
  }
   }
}


On Wed, May 25, 2011 at 10:39 AM, Peter Karich  wrote:
>
>>                               add(new ListView("allocation", 
>> allocationListModel) {
> shouldn't this be item.add ?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: model help

2011-03-29 Thread Scott Swank
This is a good reference.

https://cwiki.apache.org/WICKET/working-with-wicket-models.html

Scott

On Tue, Mar 29, 2011 at 11:50 AM, mlabs  wrote:
> 1. first I'd like to ask if there is any good reading material out there
> regarding models. In particular I want to figure out all the nifty things
> you can do with them via nesting/chaining etc. I've read Wicket in Action ..
> but it seemed to gloss over the advanced stuff you can do with them .. and
> I've read the docs.. and just from reading those, well it's not obvious what
> you can do with them and why...
>
> 2. I have a specific problem and I'm looking for some hints. I have a foo
> bean that I get from a DAO layer. The foo bean has the usual name,
> description String properties. It also has an array of 'widget' beans called
> 'widgets'. The widget beans also have a name and description properties ans
> well as various others.
> So I have a form and I map the foo.name, foo.description properties to
> TextField components using a compundpropertymodel. The 3rd component is a
> ListView, which I want to use to display the widgets.
> First problem I run into is that the ListView model needs to be a List, not
> an array of Widget. So the compoundpropertymodel barfs at this point. I
> don't have any control over the beans and I'd rather not wrap them .. I want
> to bind the components directly to the bean properties.
>
> I'm wondering if there is a neat trick I can use involving model nesting or
> something like that to solve this problem? Or maybe there is a way to tell
> the CPM that for property 'widgets' .. do something different.. like
> array-to-List conversion ..
>
> I'm a wicket newbie and the model-penny hasn't quite dropped yet.. so any
> help would be most appreciated.
> TIA
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/model-help-tp3415833p3415833.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: [VOTE] WICKET-3218 - Component#onInitialize is broken for Pages

2011-03-10 Thread Scott Swank
+1 for keeping calls to add() in the Component constructor.  This
makes upgrading as painless as possible.

+1 also for having onInitialize() mimic:

private boolean initialized = false;
/// etc
protected void onBeforeRender() {
  if (!initialized) {
onInitialize();
initialized = true;
  }
  // other onBeforeRender stuff
}

Thank you all,
Scott

On Thu, Mar 10, 2011 at 2:54 PM, Coleman, Chris
 wrote:
> +1 for the approach you mention where onInitialize is called from the 
> framework and not as a surprise side effect of calling page#add().
>
> From: Maarten Billemont [mailto:lhun...@gmail.com]
>
> On 10 Mar 2011, at 00:42, Igor Vaynberg wrote:
>>> i am +0 for refactoring the code so that oninitialize() cascade is not
>>> started from page#add() but from somewhere before page#onconfigure().
>>> this way oninitialize() is safe to override in pages because it will
>>> not be invoked from page's constructor but from some framework code at
>>> a later time.
>
>>Then I think that's the only actual solution that has positive votes.  
>>Without any further feedback, can we agree to leave constructors as they are, 
>>make onInitialize >overridable and do it this way?
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
>
> DISCLAIMER:---
> This e-mail transmission and any documents, files and previous e-mail messages
> attached to it are private and confidential. They may contain proprietary or 
> copyright
> material or information that is subject to legal professional privilege. They 
> are for
> the use of the intended recipient only.  Any unauthorised viewing, use, 
> disclosure,
> copying, alteration, storage or distribution of, or reliance on, this message 
> is
> strictly prohibited. No part may be reproduced, adapted or transmitted 
> without the
> written permission of the owner. If you have received this transmission in 
> error, or
> are not an authorised recipient, please immediately notify the sender by 
> return email,
> delete this message and all copies from your e-mail system, and destroy any 
> printed
> copies. Receipt by anyone other than the intended recipient should not be 
> deemed a
> waiver of any privilege or protection. Thales Australia does not warrant or 
> represent
> that this e-mail or any documents, files and previous e-mail messages 
> attached are
> error or virus free.
> --
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



ajax refresh of ListItems

2011-02-28 Thread Scott Swank
I have an html table with a ListView generating the rows.  Certain
rows in the middle of the table are initially hidden via
setVisible(false), but then displayed later when an AjaxLink is
clicked.  In order to effect this I have had tenclose the table in a
div with wicket:id="tableContainer", and then choose the component to
update in an odd manner.

onClick(AjaxRequestTarget target) {
  // for each relevant ListItem
  item.setVisible(toggleValue);

  // why?
  if (item.isVisible())
target.addComponent(item);
  else
target.addComponent(tableContainer);
}

The rows will only be made visible if the specific ListItems are added
to the AjaxRequestTarget.  Refreshing the entire tableContainer does
not display them, even though they have setVisible(true).  Conversely,
to hide them I have to refresh tableContainer, refreshing each
ListItem does not hide them.

While I have this working, after a fair bit of trial & error, I am
unsure why my earlier approaches failed: 1. always refreshing the
ListItem will not hide them, 2. always refreshing the tableContainer
will not display them.

Is this related to a bug, or am I missing something about ListViews & ajax?

Thank you,
Scott

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



Re: multiple markup files for on panel

2011-02-18 Thread Scott Swank
...and this too

https://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html

Scott

On Fri, Feb 18, 2011 at 11:52 AM, Scott Swank  wrote:
> Check out variations and styles.
>
> https://cwiki.apache.org/WICKET/multiple-markups-per-page.html
>
> Scott
>
> On Fri, Feb 18, 2011 at 11:46 AM, splitshade
>  wrote:
>>
>> Hi,
>>
>> why dont you just extend your Panel and just add another Markup?
>> The extended Panel doesnt do anything, but can have another Markup. We
>> have done this often.
>>
>> Regards
>>
>> Martin
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/multiple-markup-files-for-on-panel-tp3313413p3313427.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: multiple markup files for on panel

2011-02-18 Thread Scott Swank
Check out variations and styles.

https://cwiki.apache.org/WICKET/multiple-markups-per-page.html

Scott

On Fri, Feb 18, 2011 at 11:46 AM, splitshade
 wrote:
>
> Hi,
>
> why dont you just extend your Panel and just add another Markup?
> The extended Panel doesnt do anything, but can have another Markup. We
> have done this often.
>
> Regards
>
> Martin
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/multiple-markup-files-for-on-panel-tp3313413p3313427.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Unfriendly Model.ofList etc. methods; can anything be done?

2011-02-13 Thread Scott Swank
A simpler API would be:

public static  IModel> ofList(final List list)

or even:

public static  IModel> ofList(final List list)

since you are calling this method with a specific List, and hence the
type of the List is known.

Scott


On Sun, Feb 13, 2011 at 11:32 AM, Jeremy Thomerson
 wrote:
> On Sat, Feb 12, 2011 at 8:49 AM, Willis Blackburn  wrote:
>
>> jer...@wickettraining.com wrote:
>> >
>> > On Sat, Feb 12, 2011 at 7:56 AM, Willis Blackburn 
>> > wrote:
>> >
>> > As a side note, rarely should you ever use Model class for a list of
>> > things,
>> > especially things loaded from a database.  If you then pass that model to
>> > a
>> > component, all the things in it will be serialized.
>> >
>> >
>>
>> I'm sorry that I said that I loaded the list from a database, since that
>> has
>> apparently created a distraction from my key point, which is that if you
>> start with a List and pass it to Model.listOf, you get back something
>> that is not a List, which is undesirable and perhaps unnecessary.
>>
>
> I understood your key point, which is why I said "as a side note" but my
> point still remains.  Loading a list and then sticking it into Model class
> is in almost all cases a *bad* idea.
>
>
>> > So use the Model constructors instead.  The factory methods are just
>> there
>> > to help remove some verbosity related to generics.
>> >
>>
>> Have you tried this yourself?  Because it doesn't work.  You can only
>> instantiate Model with a Serializable instance, and java.util.List does not
>> implement Serializable.  The whole point of the ofList method is to
>> generate
>> serializable lists, and the documentation even says so: "This factory
>> method
>> will automatically rebuild a nonserializable list into a serializable one."
>> You're confusing Model.listOf with Model.of.
>>
>
> Sorry, yes, it was early and I wasn't paying attention.  Hadn't had my
> Wheaties yet :)  Have you looked at the ListModel class?  It may help with
> what you're looking for.
>
> Do you have a suggestion for a better method signature for that method?  The
> problem you are describing, if I understand your description correctly, is a
> problem with Java generics, not with Wicket's use of them.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

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



Re: Oracle & Wicket Starter Application Project

2010-12-22 Thread Scott Swank
Not only that, but fine-grained data access allows a user to simply
"select * from some_table" and get the data to which they are allowed
access.  E.g. each sales person can see the data for their region
while an administrator or manager can see all of the regions.

You can also build 6 apps that work with the same data and they will
all have the same permissions when you log in as jthomerson.

Scott

On Tue, Dec 21, 2010 at 9:22 PM, Jeremy Thomerson
 wrote:
> On Tue, Dec 21, 2010 at 6:12 PM, Eelco Hillenius
> wrote:
>
>> > - using database roles to restrict access to data, and not relying wholly
>> on application enforced security
>>
>> So if you want to determine whether user X can see button Y, you have
>> to query the database for particular role membership?
>
>
> Since he says "wholly", I'm assuming he means that the DB stands as the
> "last resort" security.  Ideally your application rules will apply the
> security constraints correctly.  But, if someone finds a way to punch a hole
> in that security (i.e. change a primary key in the URL, which shouldn't be
> there anyway without security around it, but sometimes people do this, which
> leaves an app-level security vulnerability), the DB rules should kick in and
> disallow what you were trying (hacking) to do.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>

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



Re: Oracle & Wicket Starter Application Project

2010-12-21 Thread Scott Swank
You shouldn't need a connection per user with Oracle's "Universal
Connection Pool" jar.  e.g. in his AbstractOracleDAO

   UCPMgr.getLabelledConnection( pUsername , pPassword );

Scott


On Tue, Dec 21, 2010 at 4:12 PM, Eelco Hillenius
 wrote:
>> - using individual database users to represent real users - giving 
>> end-to-end authentication & allowing the use of features such as SQL Trace & 
>> fine grained auditing
>
> Does that mean that the number of open connections always equals the
> number of signed in users?
>
>> - using database roles to restrict access to data, and not relying wholly on 
>> application enforced security
>
> So if you want to determine whether user X can see button Y, you have
> to query the database for particular role membership?
>
> Cheers,
>
> Eelco
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: repaint a fragment

2010-10-11 Thread Scott Swank
Exactly.

On Mon, Oct 11, 2010 at 7:24 PM, fachhoch  wrote:
>
> you mean If I put this fragment inside a webmarkupcontainer and add this
> webmarkupcontainer to target this will repaint my fragmnet ?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/repaint-a-fragment-tp2990937p2991045.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: repaint a fragment

2010-10-11 Thread Scott Swank
No html is rendered to represent a fragment.  You will have to wrap it
with a div and then refresh the div.

Scott

On Mon, Oct 11, 2010 at 5:06 PM, fachhoch  wrote:
>
> I have a fragment I want to  repaint when user click on ajax link
>
> here is my fragment
>
>        private class  ProgramFragment  extends  Fragment {
>                Long sysAuditProgId;
>                public ProgramFragment( final ProgramStatusDTO  
> programStatusDTO) {
>                        super("program", 
> "programFragment",ProgramStatusPanel.this);
>                        
> this.sysAuditProgId=programStatusDTO.eaAuditProgram.getSysAuditProgId();
>                        setOutputMarkupId(true);
>
>                        add(new Label("programAcronym",
> programStatusDTO.eaAuditProgram.getInfGrantProgram().getProgAcronym()));
>                        EaAuditProgramAmednment amendment=
> programStatusDTO.eaAuditProgram.getAmednment();
>                        add(new Label("modifier",amendment==null ? "" 
> :"(Amend)"));
>                        add(new Label("status",programStatusDTO.getName()));
>                        add(new
> Label("daysPassed",programStatusDTO.getDaysPassed()==0?"-":String.valueOf(programStatusDTO.getDaysPassed(;
>                }
>        }
>
>
> in onClick I am calling
>
>
> target.addComponent(getPage().get("program")));
>
>
>
> when I click on the link nothing happens, a refreshing view or ListView
> onPopulate method is called for repaint, for a Fragment or
> WebMarkupContainer what method is called ?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/repaint-a-fragment-tp2990937p2990937.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Estimated number of developers in the Wicket community

2010-09-28 Thread Scott Swank
A couple that come to mind, but aren't on that list are:

www.springer.com - publisher
mobile.walmart.com - retailer

Scott

On Tue, Sep 28, 2010 at 12:53 PM, Jeremy Thomerson
 wrote:
> On Tue, Sep 28, 2010 at 2:41 PM, Chris Colman
> wrote:
>
>> The 'popularity' test is very vague but I understand it's purpose, they
>> want to ensure that they use products that are widely used and have an
>> active user community: which is very true of Wicket. Does anyone have
>> some numbers on this? Like how many Wicket developers there are, or how
>> many websites are Wicket driven? Is there a page on the wicket website
>> that contains a list of the companies/products that use Wicket - if not,
>> should we add one?
>>
>
> There's no way to quantify this metric.  And don't let them use the false
> "job search" *technique* to think that they know.  There are too many
> reasons that you don't get accurate numbers from this.  There is a page on
> the wiki that lists a fraction of the sites using Wicket.
> https://cwiki.apache.org/WICKET/websites-based-on-wicket.html
>
> Ultimately, I would direct them away from this.  It doesn't *actually*
> matter.  What matters is this (in roughly this order):
>
>   1. Pick a technology that fits your needs
>   2. Pick a technology that is productive
>   3. Pick a technology that, when you hit a stumbling block, you can get
>   help with.
>
> You've already demonstrated one and two.  Number three can be demonstrated
> by asking them to subscribe to the dev and users lists here for a week.
>  Then dare them to find an open source web framework that has better
> community support.  I haven't seen one.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

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



Re: Question about embedded labels

2010-07-29 Thread Scott Swank
You can just use:

new AttributeModifier("class", true, Model.of("the-class-name"));

On Thu, Jul 29, 2010 at 4:57 PM, jverstry  wrote:
>
> I just tried to add your code in my code:
>
> WebMarkupContainer mydiv = new WebMarkupContainer("MyDiv");
> mydiv.add(new AttributeModifier("class", true, "the-class-name"));
> add(mydiv);
>
> but it won't compile because the "the-class-name" parameter cannot be a
> string.
>
> I checked the doc and saw that it should be an IModel. This interface is
> implemented by many classes.
>
> Which one should I use?
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Question-about-embedded-labels-tp2307332p2307380.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Frustrating behavior ... same browser, same war, same tomcat version - different behavior!!!

2010-06-04 Thread Scott Swank
Do you have apache or a load balancer or anything else in the network?
 Is there maybe a simple difference in your httpd.conf pertaining to
sessions?

On Fri, Jun 4, 2010 at 1:32 PM, Bryan Montgomery  wrote:
> Thanks for the ideas. Still no joy.
>
> The behavior is consistent between three different clients, all running
> different versions of IE (6,7 and 8).
> I was able to use the debugging feature built in to IE 8 to see that the
> wicket ajax javascript was gettting called. At some point in that process it
> lost the value of the field and it got set to an empty field.
>
> I have the feeling that there is something different with the environment on
> this particular server - but I have no idea what at this point.
>
> On Fri, Jun 4, 2010 at 1:32 PM, gnul  wrote:
>
>> >
>> > Essentially, part of the process generates dynamic web forms based on xml
>> > configuration files. We noticed that on one of our servers when we
>> deployed
>> > the war file that the fields would not hold their values, and as soon as
>> you
>> > tabbed out, the entry would disappear. Taking the same war file and
>> > deploying it to another server the form acts as expected.
>> >
>>
>> If it works on one server, but not the other, and they are configured
>> the same (meaning same appserver/tomcat version, same jvm, same
>> user/group/perms, etc.), the first thing I do is "clean" the appserver
>> and do a fresh deploy.
>>
>> For example, say you are deploying to /var/lib/tomcat/webapps/, I
>> would shutdown both tomcats, remove the exploded directories (e.g.
>> myapp.war => myapp/ ) and re-deploy the war files to each server.  I
>> would also clean out tomcat's temp directory (e.g.
>> /var/cache/tomcat5/temp), then restart them both.
>>
>>  -gnul
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: Best practises question

2010-05-17 Thread Scott Swank
Page someBigPage = new YourBigPage(...);
PageReference bigPageRef = someBigPage.getPageReference();

Now you just keep a hold of bigPageRef.  When you want to go back to
that page you just ask it for the page:

Page reconstitutedBigPage = bigPageRef.getPage();



On Mon, May 17, 2010 at 10:35 AM, Zilvinas Vilutis  wrote:
> Are there any patterns described how to use PageReference efficiently?
>
>
> Žilvinas Vilutis
>
> Mobile:   (+370) 652 38353
> E-mail:   cika...@gmail.com
>
>
> On Mon, May 17, 2010 at 9:55 AM, Jeremy Thomerson > wrote:
>
>> You should use PageReference (Page#getPageReference()).
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Sun, May 16, 2010 at 11:52 PM, Rik van der Kleij > >wrote:
>>
>> > Hi Jeremy,
>> >
>> > So an instance field inside a page that points to another page is also
>> > something you should avoid? In our application we using this pattern a
>> lot
>> > (for going back to previous page) but it never seems to be any problem.
>> So
>> > probably because our pages don't consume a lot of memory.
>> >
>> > Regards,
>> > Rik
>> >
>> > On 17 mei 2010, at 06:13, Jeremy Thomerson wrote:
>> >
>> > > In general, you should not pass references to components to other
>> pages.
>> > > That section on anonymous inner classes is telling you that when you
>> > create
>> > > an anonymous inner class and pass it to another page, you
>> > > will inadvertently be passing a reference to the outer class, which is
>> > > typically a page.  This builds up memory and you will get a OOM.
>>  Passing
>> > > models between pages is absolutely fine - as long as you're not
>> > accidentally
>> > > passing a bunch of other stuff with it (including large domain objects
>> -
>> > > which should be detached by using a detachable model).  The page linked
>> > to
>> > > even says that you will often pass models between pages.
>> > >
>> > > --
>> > > Jeremy Thomerson
>> > > http://www.wickettraining.com
>> > >
>> > >
>> > >
>> > > On Sun, May 16, 2010 at 11:05 PM, Rik van der Kleij <
>> > rikvdkl...@gmail.com>wrote:
>> > >
>> > >> Hi Bernard and Mike,
>> > >>
>> > >> According to
>> > >>
>> >
>> https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html#BestPracticesandGotchas-AnonymousInnerclassessharingmodelscould
>>  eventually lead to Out of memory error.
>> > >>
>> > >> Holding a page reference in an instance field that points to another
>> > page
>> > >> looks the same but it is doesn't seems to be a problem. What's the
>> > >> difference?
>> > >>
>> > >> Regards,
>> > >> Rik
>> > >>
>> > >>
>> > >> On 16 mei 2010, at 04:39, Michael O'Cleirigh wrote:
>> > >>
>> > >>> Hello,
>> > >>>
>> > >>> I'm not sure on the answer to your question about the anonymous inner
>> > >> class but in general sharing models between pages can be a bad idea.
>> > >>>
>> > >>> The memory issues comes into play if the IModel is like Model and the
>> > >> contained object is not transient (it is serialized as part of the
>> > page).
>> > >>>
>> > >>> While Pages are serialized each page is serialized independently so
>> on
>> > >> page reload the IModel from the first page is no longer the same
>> object
>> > >> instance as the IModel from the second page.  At deserialization time
>> > the
>> > >> page1.model.getObject().equals page2.model.getObject() but
>> > >> page1.model.getObject() != page2.model.getObject(); so any changes to
>> > either
>> > >> model are not shared between then.
>> > >>>
>> > >>> This is not a problem if the model is loadable since the memory of
>> the
>> > >> page it is contained in doesn't matter as the value is loaded from the
>> > >> backend db or some other independent data source like the httpsession,
>> > or
>> > >> with wicketApplication.
>> > >>>
>> > >>> You can see the same effect if you try and share a model between a
>> > panel
>> > >> and a ModelWindow that uses a PageCreator
>> > >>>
>> > >>> Hope this helps,
>> > >>>
>> > >>> Mike
>> >  Hi,
>> > 
>> >  Can someone explain me why it is a memory issue when an instance of
>> an
>> > >> anonymous IModel class is passed to another page to be shared, but it
>> > seems
>> > >> to be no problem when a page reference is passed to another page and
>> is
>> > put
>> > >> in an instance field (for example to be used in a button to navigate
>> > back to
>> > >> previous page)?
>> > 
>> >  Many thanks.
>> > 
>> >  Regards,
>> >  Rik
>> > 
>> > 
>> > 
>> > 
>> -
>> >  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >  For additional commands, e-mail: users-h...@wicket.apache.org
>> > 
>> > 
>> > >>>
>> > >>>
>> > >>> -
>> > >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > >>> For additional commands, e-mail: users-h...@wicket.apache.org
>> > >>>
>> > >>
>> > >>
>> > >> -

Re: mexico.com

2010-04-30 Thread Scott Swank
Thanks, though I was only involved early on with this project.  Only
the initial page is stateless, after that search results are in your
session.

On Fri, Apr 30, 2010 at 9:06 AM, robert.mcguinness
 wrote:
>
> site looks great.  i'm curious, how did you approach the stateless pages
> using Wicket?

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



mexico.com

2010-04-30 Thread Scott Swank
Wicketeers,

We at Vegas.com have been able to re-purpose our Wicket-based
air/hotel search application and purchase/checkout application.  This
is the new Mexico.com.

www.mexico.com

Thank you again.  The re-use of components and abstract pages was tremendous.

Best,
Scott

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



Re: Hibernate - OSIV

2010-04-01 Thread Scott Swank
Perhaps you want to use the survey object that you retrieve via
Hibernate as a prototype, and never fill in its "transient" members.

http://en.wikipedia.org/wiki/Prototype_pattern

Scott

On Thu, Apr 1, 2010 at 2:11 PM, Jeffrey Schneller
 wrote:
> Because the objects have transient properties on them that are set by another 
> process.  Basically the object is pulled from the db to create a 
> shell/container and the transient properties are filled in at a later time 
> and may be different.  Not a great example but, the object is a survey and 
> the transient properties are the answers that a user will provide.  I want to 
> get the same survey twice but allow the transient properties to have 
> different values. If it is the same object, I can't do this.
>
> The following setting seems to do the trick.  The problem is that after some 
> amount of time, everything locks up.  It appears I am out of db connections.
>
>    
>        opensessioninview
>        
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>        
>                singleSession
>                false
>        
>    
>
> -Original Message-
> From: James Carman [mailto:jcar...@carmanconsulting.com]
> Sent: Thursday, April 01, 2010 4:37 PM
> To: users@wicket.apache.org
> Subject: Re: Hibernate - OSIV
>
> Why do you need different objects?
>
> On Thu, Apr 1, 2010 at 4:25 PM, Jeffrey Schneller
>  wrote:
>> So by using the OSIV, I am out of luck?  Any ideas?
>>
>>
>>
>> -Original Message-
>> From: James Carman [mailto:jcar...@carmanconsulting.com]
>> Sent: Thursday, April 01, 2010 3:59 PM
>> To: users@wicket.apache.org
>> Subject: Re: Hibernate - OSIV
>>
>> They have to be different sessions.  Hibernate's cache (the first
>> level) guarantees that you get the same object for any given entity
>> within the same session.
>>
>> On Thu, Apr 1, 2010 at 3:47 PM, Jeffrey Schneller
>>  wrote:
>>> The issue was the object was being evicted from the Hibernate session.
>>> getSession().evict(object).  I had forgot that the object was being
>>> evicted from the session.
>>>
>>> If I do not evict the object from the session then lazy loading worked.
>>> This is more of a Hibernate question but, how can I get unique object
>>> from a hibernate query for each query and have each object be tied to
>>> the session?
>>>
>>> example:
>>> select * from  Product where sku = ?
>>>
>>> I want to select the same sku but get two different java objects from
>>> Hibernate so the objects are not the same.
>>>
>>> Thanks.
>>>
>>>
>>>
>>>
>>> -Original Message-
>>> From: Josh Chappelle [mailto:jchappe...@4redi.com]
>>> Sent: Wednesday, March 31, 2010 7:01 PM
>>> To: users@wicket.apache.org
>>> Subject: RE: Hibernate - OSIV
>>>
>>> What error are you getting?
>>>
>>> -Original Message-
>>> From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com]
>>> Sent: Wednesday, March 31, 2010 4:47 PM
>>> To: users@wicket.apache.org
>>> Subject: Hibernate - OSIV
>>>
>>> I think I have the OSIV filter setup correctly but I can't access any
>>> lazy
>>> loaded properties of my objects.  I am not even between requests when
>>> this
>>> is happening.  Does anyone have any ideas?  I can't seem to figure this
>>> out.
>>> I have looked at OSIV in Spring and OSIV in Wicket.  I can't seem to
>>> find
>>> any examples that will help me to determine the problem.  I have
>>> included
>>> all the code and xml configuration that I believe is relevant.  Any help
>>> would be appreciated.  Also a clean example of how to setup Spring +
>>> Hibernate OSIV in the wiki would be a big help.
>>>
>>>
>>>
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Generic solution for tabindex?

2010-03-10 Thread Scott Swank
We have created a bad solution.  The core problem is ajax.  Say you
have five fields: A, B, C, D & E.  Now you want to insert X & Y
between A & B.  No static numbering system will allow an unknown
number of fields to be inserted in between the existing fields.

On top of that you need to have the boundaries of the numbering ranges
well-defined.  Say you have two columns, numbered as follows:

A(10)  D(40)
B(20)  E(50)
C(30)  F(60)

Now let's say you insert a new row (our old friends X & Y) after the
first, you want to end up with something like:

A(10)  D(40)
X(15)  Y(45)
B(20)  E(50)
C(30)  F(60)

But it is not a simple matter to accomplish this.  So here's what we
have, which as I said has problems with corner cases.

For various FormComponents we have subclasses such as the following:

public class TabIndexTextField extends TextField implements TabIndexable {
  private Model tabIndexModel = new Model(0);

  public TabIndexTextField(String id) {
super(id);
add(new AttributeModifier("tabindex", true, tabIndexModel));
  }

  @Override
  protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
// call a parent WebMarkupContainer that implements TabIndexed
// and knows how to examine 
// ValueMap vMap = c.getMarkupAttributes();
// if (vMap.containsKey("tabindex"))
//tabIndex = vMap.getInt("tabindex");
// to set the tabIndexModel's value
  }
}

The above is reasonably sound, however the implementation of
TabIndexed needs cleanup and has problems with corner conditions.
I'll post the gist of that logic if you like, but the actual
implementation is spread out (unnecessarily) across a couple of
classes.

Scott

On Wed, Mar 10, 2010 at 7:12 AM,   wrote:
> Hi!
>
> Is use a lot of panels on my pages and need to be able to dynamically set
> the tabindex attribute on the FormComponents contained in the panels, so
> that when I reuse them in differenet page compositions the tabindex will
> be correct (top-to-bottom).
> Any good ideas out there on how this could be done?
>
> --
> Espen Ønvik Pedersen
>

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



Re: Large number components and redering time

2010-02-17 Thread Scott Swank
How long does it take to pull up the static html in your browser?
Just the browser render can be non-trivial for a large enough file.

Are you using arrays instead of collections and (where possible)
primatives instead of objects?  An int[100,250] is much smaller than a
comparably scaled List>.

Scott


On Wed, Feb 17, 2010 at 10:30 AM,   wrote:
> Surely a change in the use case would ease our lives, unfortunately we are
> migrating a legacy application to a new technology and the look and feel (if
> you could call it that) must be retained...
>
> J,
>
> Josh Chappelle wrote:
>>
>> Could you use a PageableListView or does that not fall within your
>> business
>> requirements?
>>
>> Josh
>>
>> -Original Message-
>> From: d...@agentlab.de [mailto:d...@agentlab.de] Sent: Wednesday, February
>> 17, 2010 12:08 PM
>> To: users@wicket.apache.org
>> Subject: Large number components and redering time
>>
>> Hi,
>>
>> I have a question on how to address a certain problem that arose in my
>> current
>> project: we have a two-dimensional array with a variable number of rows
>> and
>> columns
>> (not exactly rocket science, I know) that needs to be rendered in an HTML
>> table where
>> each cell is currently represented by a wicket-Label. Now, in the
>> production
>> environment, the number of rows and columns gets quite large such that we
>> have roughly
>> 25.000 cells to render. This yields to the effect, that the rendering
>> process for the
>> component tree takes a lot of time: on my windows machine approx 7 seconds
>> and, for
>> some reason we have not found out about until now, on the integration
>> machine (IBM
>> server) around 45 seconds. Clearly, this is not acceptable.
>>
>> Now, my question is, how should we address this problem? Is the naive
>> approach of
>> using two nested ListViews and rendering each as component plain dumb?
>> What
>> would be
>> the alternatives?
>>
>> Thanks for any help,
>>
>> J.
>>
>>
>>
>>
>>
>> __
>> This email has been scanned by the MessageLabs Email Security System.
>> For more information please visit http://www.messagelabs.com/email
>> __
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
> --
> Dr. Jürgen Lind
> www.agentlab.de
>
>
> __
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> __
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Wicket best practice

2010-02-07 Thread Scott Swank
If you just want to navigate from PageA to PageB then a 
is fine, though I rarely use them.  If you want to have more involved
processing then a Link object is preferable:

thePage.add(new Link("someId") {
  public void onClick() {
doThis();
validateThat();
// either
setResponsePage(PageB.class);
// or
setResponsePage(new PageB(oneParam, anotherParam));
  }
});

On Sat, Feb 6, 2010 at 10:26 PM, Vineet Manohar
 wrote:
> Thanks. Is one approach better than the other?
>
> Vineet
>
> On Sat, Feb 6, 2010 at 5:00 PM, Andrew Lombardi 
> wrote:
>
>> There are 2 main ways to create a link with Wicket:
>>
>> 1. Use autolinking.  wrap your link in  tags in the HTML and
>> take note of package structure, so if in same package HomePage.html would go
>> in href, and if its in a package called admin, you'd have
>> admin/AdminHomePage.html, etc.
>>
>> 2. Use one of the Link objects, which requires a wicket:id attached to
>> "usually an anchor tag" in the HTML.  So you'll have to have Java code and
>> HTML code that match id's
>>
>> -andrew
>>
>> On Feb 6, 2010, at 1:27 PM, Vineet Manohar wrote:
>>
>> > Thanks. I will look at the maven archetype.
>> >
>> > More than just pages, I am looking at links, forms, inputs etc. For
>> example,
>> > to create a link I am either use  in the HTML, or I can use
>> > Wicket link component model, what's the difference and which one should I
>> > use?
>> >
>> > Btw, my goal is to automatically generate a working Wicket app with full
>> > database integration using JPA and security integration as well. The Seam
>> > code generation project that I did was a success, you can write a spec
>> like
>> > this one:
>> >
>> http://code.google.com/p/clickframes-seam-issuetracker-demo/source/browse/trunk/src/main/clickframes/appspec.xml
>> >
>> > and instantly get a working app like this:
>> > live demo link:
>> > http://demo.clickframes.org/tracker
>> >
>> > Of course you can add/remove pages from the app by changing the appspec
>> xml.
>> >
>> > I am trying to replicate the same thing for Wicket, hoping to get some
>> help
>> > from user community!
>> >
>> > On Sat, Feb 6, 2010 at 4:09 PM, Riyad Kalla  wrote:
>> >
>> >> Vineet, very cool stuff you are wooing on. As for best practices with
>> >> regard
>> >> to layout, there is actually a Maven Wicket archetype that would
>> probably
>> >> answer those questions well. From what I remember its pretty straight
>> >> forward maven web layout. And yes, HTML and Java source are in same main
>> >> packages together.
>> >>
>> >> On Feb 6, 2010 1:33 PM, "Vineet Manohar" 
>> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am trying to write a code generator (using Clickframes code generation
>> >> framework) which would generate a fully working Wicket project directly
>> >> from
>> >> the Spec. Is there a document which describes the best practice for
>> >> folder/package structure in a wicket project.
>> >>
>> >> To write the code generator, the only thing I need to know is the Wicket
>> >> project structure that I should be created. For example:
>> >> 1) should html files be colocated in src/main/java/com/mypackage/ along
>> >> with
>> >> Java files (as in the helloworld example) or in src/main/webapp.
>> >> 2) should there be one html file per page (I am assuming yes)
>> >> ... and other such questions related to folder structure
>> >>
>> >> I am the lead developer of open source code generation framework
>> >> Clickframes
>> >> (http://www.clickframes.org) and have written a similar code generator
>> for
>> >> JSF/Seam which instantly gives you a working app directly from the spec
>> >> which the developer can then customize. I think a similar approach for
>> >> Wicket would be very helpful to Wicket users who are trying to start a
>> >> brand
>> >> new project.
>> >>
>> >> Here's what I have so far.
>> >> http://code.google.com/p/clickframes-wicket-plugin/
>> >>
>> >> I am a Wicket novice, so any help or direction is appreciated.
>> >>
>> >> Thanks,
>> >>
>> >> Vineet Manohar
>> >> http://www.vineetmanohar.com
>> >>
>>
>>
>> To our success!
>>
>> Mystic Coders, LLC | Code Magic | www.mysticcoders.com
>>
>> ANDREW LOMBARDI | and...@mysticcoders.com
>> 2321 E 4th St. Ste C-128, Santa Ana CA 92705
>> ofc: 714-816-4488
>> fax: 714-782-6024
>> cell: 714-697-8046
>> linked-in: http://www.linkedin.com/in/andrewlombardi
>> twitter: http://www.twitter.com/kinabalu
>>
>> Eco-Tip: Printing e-mails is usually a waste.
>>
>> 
>> This message is for the named person's use only. You must not, directly or
>> indirectly, use,
>>  disclose, distribute, print, or copy any part of this message if you are
>> not the intended recipient.
>> 
>>
>>
>

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



Re: moving to spring 3

2010-01-20 Thread Scott Swank
Check out jWeekend's maven archetype generator: Leg Up.  Spring 3.0.0
is in there with jdbc & jpa, respectively.

   http://www.jweekend.com/dev/LegUp

Scott

On Wed, Jan 20, 2010 at 2:25 PM, tubin gen  wrote:
> I am using wicket 1.4.1  , can I move to spring 3  ?
>

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



Re: Help with Wicket Adoption Numbers

2010-01-07 Thread Scott Swank
The wiki has a list of some web sites that use Wicket.
http://cwiki.apache.org/WICKET/websites-based-on-wicket.html

A quick search of IBM shows approx 1,080 articles on Wicket:
http://www.google.com/search?q=site:ibm.com+wicket

Scott


On Thu, Jan 7, 2010 at 4:43 PM, Lester Chua  wrote:
> Hi,
>
> I am facing a hurdle that need crossing in my final attempt to push Wicket
> for use in an organization.
> I have:
>
> 1) Prototyped a small size module
> 2) Did 2-3 presentations on the key features and advantages of wicket
>
> No one is disputing my claims about productivity and good OO code that was
> the result.
>
> BUT, the technology evaluation committee is NOT recommending Wicket because
> of. of all things.
> - Wicket's Low Adoption Rate
> Can I find any numbers to blow this away?
>
> My alternative is to accept the finding and work with Struts 2. Which will
> mean the stack will need to expand to DWR
> (for security). I REALLY don't want to go there, and am even considering not
> taking part in this project due to the high risk involved, only 9 months to
> introduce huge changes to a system that has lots of legacy problems (took
> about 3 years to build). I think a lot of those years were spent wrestling
> with the monster that is EJB 1.1. The only way I thought the project can
> even be on time is to scrap the entire presentation layer (aka Struts) and
> redo it in Wicket with 1 dedicated developer while the rest of the team work
> on killing the beast that is EJB 1.1 by refactoring the biz code.
>
> Sigh, my choices are stark. It's either to keep the job and plough ahead and
> probably fail spectacularly 9 months later or go hungry and explain to my
> wife why we need to spend less on the kid..
>
> It's easy to blame the tech committee but they did help me find wicket by
> rejecting my initial proposal to build the new system on a
> (JQuery+JSON+REST) framework, which can be very productive as well, if not
> as "clean" as Wicket.
>
> Sorry for rambling so much. Is there any way I can demolish the silly low
> adoption rate argument (omg I still don't believe it can be so lame)?
>
> Lester
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: OnChangeAjaxBehavior with palette

2010-01-07 Thread Scott Swank
Hmm.  I dug around a bit and Palette is a Panel rather than a form
component.  It however allows access to an internal FormComponent
named recorder.  So you can:

palette.getRecorderComponent().add(
  new OnChangeAjaxBehavior(){
public void onUpdate(AjaxRequestTarget req){}
  }
);

But that's pretty much off the top of my head, I haven't set up a page
and tested it.

Scott


On Thu, Jan 7, 2010 at 9:57 AM, wic...@geofflancaster.com
 wrote:
> But how can you inject previously selected items back into the selected
> menu? The only thing i can see is inserting items into the list as a whole
> which puts them into the available menu.
>
> can you give me a code snippet and better explanation of what you mean?
>
> Original Message:
> -----
> From: Scott Swank scott.sw...@gmail.com
> Date: Thu, 7 Jan 2010 09:49:41 -0800
> To: users@wicket.apache.org
> Subject: Re: OnChangeAjaxBehavior with palette
>
>
> You could add an AjaxFormComponentUpdatingBehavior to your palette so
> that your selections are pushed back to the underlying model.
>
> On Thu, Jan 7, 2010 at 9:40 AM, wic...@geofflancaster.com
>  wrote:
>> any help? i cant be the only person to have tried this.
>>
>> Original Message:
>> -
>> From: wic...@geofflancaster.com wic...@geofflancaster.com
>> Date: Wed, 6 Jan 2010 14:13:50 -0500
>> To: users@wicket.apache.org
>> Subject: OnChangeAjaxBehavior with palette
>>
>>
>> i'm trying using a text field to search through the items available to be
>> selected in a palette. As of right now, it searches correctly but if I add
>> items to the "selected" side of the palette and then search again, I lose
>> my previously selected choices.
>>
>> Is there anyway to only refresh the available menu and not the selected
>> menu?
>>
>> 
>> mail2web.com – Enhanced email for the mobile individual based on
> Microsoft®
>> Exchange - http://link.mail2web.com/Personal/EnhancedEmail
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>> 
>> mail2web LIVE – Free email based on Microsoft® Exchange technology -
>> http://link.mail2web.com/LIVE
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
> 
> mail2web LIVE – Free email based on Microsoft® Exchange technology -
> http://link.mail2web.com/LIVE
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: OnChangeAjaxBehavior with palette

2010-01-07 Thread Scott Swank
You could add an AjaxFormComponentUpdatingBehavior to your palette so
that your selections are pushed back to the underlying model.

On Thu, Jan 7, 2010 at 9:40 AM, wic...@geofflancaster.com
 wrote:
> any help? i cant be the only person to have tried this.
>
> Original Message:
> -
> From: wic...@geofflancaster.com wic...@geofflancaster.com
> Date: Wed, 6 Jan 2010 14:13:50 -0500
> To: users@wicket.apache.org
> Subject: OnChangeAjaxBehavior with palette
>
>
> i'm trying using a text field to search through the items available to be
> selected in a palette. As of right now, it searches correctly but if I add
> items to the "selected" side of the palette and then search again, I lose
> my previously selected choices.
>
> Is there anyway to only refresh the available menu and not the selected
> menu?
>
> 
> mail2web.com – Enhanced email for the mobile individual based on Microsoft®
> Exchange - http://link.mail2web.com/Personal/EnhancedEmail
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
> 
> mail2web LIVE – Free email based on Microsoft® Exchange technology -
> http://link.mail2web.com/LIVE
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: creating item after form is submitted via ajax

2009-12-30 Thread Scott Swank
Alternately, you can put an EmptyPanel in as a placeholder until you
have Panel2.

---Java Psuedo-Code---
 Panel panel1 = new RandomPanel("panel1");
panel1.add(new EmptyPanel("panel2"));

 add(panel1);

 add(new AjaxButton("button", form){

   onSubmit(AjaxRequestTarget target, Form form){
  Panel panel2 = new RandomPanel("panel2");
  panel1.replace(panel2);
   }
 };

Scott


On Wed, Dec 30, 2009 at 9:17 AM, Igor Vaynberg  wrote:
> this should help
>
> http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/
>
> the trick is to add the markup that the component is anchored to using
> javascript.
>
> -igor
>
> On Wed, Dec 30, 2009 at 9:13 AM, wic...@geofflancaster.com
>  wrote:
>> Is there a way to create an item only after a form has been submitted?
>>
>> For example, how can I do the following:
>>
>> ---Java Psuedo-Code---
>>  Panel panel1 = new RandomPanel("panel1");
>>
>>  add(panel1);
>>
>>  add(new AjaxButton("button", form){
>>
>>    onSubmit(AjaxRequestTarget target, Form form){
>>       Panel panel2 = new RandomPanel("panel2");
>>    }
>>  };
>>
>> ---End java Psuedo-Code---
>>
>> ---Psuedo-HTML---
>> ...
>> 
>> ...
>> ---End Psuedo-HTML---
>>
>> When I try it now I get an error saying panel2 is in my markup but not
>> added to the page. Any help is greatly appreciated.
>>
>> Thanks!
>>
>>
>>
>> 
>> mail2web.com – Enhanced email for the mobile individual based on Microsoft®
>> Exchange - http://link.mail2web.com/Personal/EnhancedEmail
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: How to have multiple HTML files per panel?

2009-12-17 Thread Scott Swank
You would either do so at the session level via
session.setStyle("small") or at the component level by implementing
LoginPanel.getVariation() and having it return "small" as appropriate.

http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html

Scott

On Thu, Dec 17, 2009 at 12:26 PM, Don Ferguson  wrote:
> I've heard that it's possible to have multiple .html files for a given panel
> (or page, presumably), but how does one specify which file to apply?  For
> example, if I have:
>
> LoginPanel.java
> LoginPanel.html
> LoginPanel_small.html
>
> How would I get wicket to use LoginPanel_small.html?
>
> Thanks in advance,
>
>  -Don
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



brix & hippo

2009-12-16 Thread Scott Swank
Has anyone used Brix and Hippo enough to give a reasonable comparison
of their respective strengths or perhaps differences in approach?

Thank you,
Scott

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



redirect parameter encoding issue

2009-11-18 Thread Scott Swank
I believe that I see a but in Wicket 1.3.5.  Perhaps it has been fixed
in a subsequent version.  Under certain circumstances an http
parameter that contains a slash "/" ascii 47 results in the following
exception:

*** URL fragment has unmatched key/value pairs, responding with 404. ***

The circumstances under which we've encountered this error are as
follows.  We have a page that is both the home page:

@Override
public Class getHomePage()
{
return VcomCartDetailPage.class;
}

and is also mounted as a bookmarkable page in Application.init()

mountBookmarkablePage("/Cart", VcomCartDetailPage.class);

Then when an http get is made to the app root this is received by the
home page, which works correctly.  However, if you then redirect to a
new instance of the same page:

CartDetailPage redirectTo = new VcomCartDetailPage();
redirectTo.modelChanging();
// put stuff in the Cart -- i.e. in the Session
redirectTo.modelChanged();
// This is to guard against resubmitting legacy page cart additions. We
// redirect to a "page mapped" version of the base CartDetailPage so 
that
// the legacy submitted URL is cleared from the browser history, 
allowing
// back/forward button support.
setRedirect(true);
setResponsePage(redirectTo);

Then BookmarkablePageRequestTargetUrlCodingStrategy.encode() is
invoked (comes from mountBookmarkablePage in App.init()), and
ultimately the parameters are written in a REST-style in
AbstractRequestTargetUrlCodingStrategy.appendValue().

private void appendValue(AppendingStringBuffer url, String key,
String value)
{
String escapedValue = urlEncodePathComponent(value);
if(!Strings.isEmpty(escapedValue))
{
if(!url.endsWith("/"))
url.append("/");
url.append(key).append("/").append(escapedValue).append("/");
}
}

However, because the path component encoder in WicketURLEncoder

public static final WicketURLEncoder PATH_INSTANCE = new
WicketURLEncoder(2);

Does not encode a slash (ascii 47)

// from WicketURLEncoder's constructor
switch(type)
{
case 1: // '\001'
dontNeedEncoding.set(32);
dontNeedEncoding.set(47);
dontNeedEncoding.set(63);
break;

case 2: // '\002'
dontNeedEncoding.set(38);
dontNeedEncoding.set(61);
dontNeedEncoding.set(43);
break;
}

if one of the parameter values contains a slash we end up with a bad
path.  E.g. for the following parameters:

key1 :: value1
key2 :: value2with/slashembedded
key3 :: value3

org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy
URL fragment has unmatched key/value pairs, responding with 404.
Fragment: key1/value1/key2/value2with/slashembedded/key3/value3

Can anyone suggest a work-around?  Has this been fixed in any version
past 1.3.5?

Thank you,
Scott

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



Re: Calling IN TO Wicket from JSP

2009-11-12 Thread Scott Swank
There's always Apache HttpClient.  Hopefully someone else has a better
option for you.

On Thu, Nov 12, 2009 at 8:34 AM, Corbin, James  wrote:
> That is exactly the issue that is causing the problem and what I need
> clarification on how to do
>
> J.D.
>
> -Original Message-
> From: Frank Silbermann [mailto:frank.silberm...@fedex.com]
> Sent: Thursday, November 12, 2009 9:23 AM
> To: users@wicket.apache.org
> Subject: RE: Calling IN TO Wicket from JSP
>
> The question, I think, is how to deliver request-specific parameters
> along with the URL to the Wicket page.  For example, if a form in a JSP
> page is to be processed by a Wicket page, how can the JSP's form data to
> be delivered to the Wicket page?
>
> Is that the question?
>
>> -Original Message-
>> From: Jeremy Thomerson [mailto:jer...@wickettraining.com]
>> Sent: Thursday, November 12, 2009 9:59 AM
>> To: users@wicket.apache.org
>> Subject: Re: Calling IN TO Wicket from JSP
>>
>> I guess a more concrete example from you would be helpful.  You should
> be
>> able to mount a page to a bookmarkable URL and then it will be easy to
>> create a URL to go into Wicket.
>
>
>>> -Original Message-
>>> From: Corbin, James [mailto:jcor...@iqnavigator.com]
>>> Sent: Wednesday, November 11, 2009 4:51 PM
>>> To: users@wicket.apache.org
>>> Subject: Calling IN TO Wicket from JSP
>>>
>>> Is it possible to build a wicket URL in a JSP that gets forwarded to
> and
>>> handle by the Wicket filter mechanism?
>>>
>>> This seems like it should be simple but doesn't appear to work right
> in
>>> 1.4.1.
>>>
>>> We build up a wicketized URL that makes it into the WicketFilter, but
>>> that filter strips all the request parameters.
>>>
>>> Any suggestions on how to approach redirecting from JSP into Wicket
>>> would be greatly appreciated.
>>>
>>> J.D. Corbin | IQNavigator, Inc. | Technology 6465 Greenwood Village
>>> Blvd, Suite 800, Centennial, CO  80111 | Office 303.563.1503 | Mobile
>>> 303.912.0958 | www.iqnavigator.com | jcor...@iqnavigator.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: OT: Relational database + Hibenate vs Content Repository (Jackrabbit)

2009-11-12 Thread Scott Swank
Before you consider a non-rdbms solution you should really think about
who might be interested in your data.  If anyone in the organization
is going to want to report on, or do analysis of the data then it
should be in a relational db.

How many X per hour, and how does that compare with the same value at
this time last week?
What is the ratio between the cost of A and the number of B per day?
etc.

So yes, a blog is perfect for a cms.  Most of the work that is central
to a given organization is not.

Cheers,
Scott


On Thu, Nov 12, 2009 at 6:25 AM, Jeffrey Schneller
 wrote:
> I would be interested in learning what everyone thinks about this.  I am
> planning on using a relational db as described below for things like
> users, roles, and other relational type things.  I am planning on using
> a JCR for content based things like comments, descriptions, etc...  The
> problem is I need to find a JCR administration tool that just will
> manage the data and not force me to run the server through the CMS
> system like Brix, and a bunch of others do.
>
>
>
> -Original Message-
> From: danisevsky [mailto:danisev...@gmail.com]
> Sent: Thursday, November 12, 2009 3:31 AM
> To: users@wicket.apache.org
> Subject: Re: OT: Relational database + Hibenate vs Content Repository
> (Jackrabbit)
>
> I think the best solution is combine JCR and relation database. Some
> data
> store to JCR (on filesystem) a some to database. But question is for
> which
> kind of data si better JCR. My opinion is that data like photos, blogs,
> comments is better store in JCR and data like users, roles, classifiers
> is
> better store in databaze.
> What do you think, is it right?
>
> 2009/11/12 Jeremy Thomerson 
>
>> Anybody have thoughts on this?  I am curious also.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Wed, Nov 4, 2009 at 10:27 AM, danisevsky 
> wrote:
>>
>> > Hallo, I am thinking about learning and using Jackrabbit instead of
>> > relational database (+ Hibernate) in my new wicket application
> (which
>> will
>> > be build on Brix CMS).
>> > Is it very wrong idea?
>> > Thanks
>> >
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: How do you achieve persistency

2009-10-06 Thread Scott Swank
All you really need is a good database browser.

http://mh-nexus.de/en/hxd/


On Tue, Oct 6, 2009 at 2:17 PM, Sam Stainsby
 wrote:
> On Tue, 06 Oct 2009 14:02:56 -0700, Igor Vaynberg wrote:
>
>> i think all the suggestions you have gotten until now are
>> overcomplicated and have a high learning curve. i think the easiest and
>> fastest way to achieve persistency is to use a database that all
>> operating systems already have - the file system.
>>
>> each "table" is a directory, each "entity" is simply a file that has the
>> serialized state of that entity named something like .ser.
>
>
> I suspect this is essentially what the Neodatis object database does
> (http://www.neodatis.org/), plus some trimmings such as OIDs and
> transactions, and making sure multiple copies of the same object are not
> saved. The tricky part is controlling the depth of the reference graphs
> that are saved/restored. DB4O has much more control over such things,
> such as being able to configure 'activation' depth, and also the option
> of instrumentation to activate references as required (transparent
> activation) or even persist automatically based on object changes
> (transparent persistence). However, be aware that DB4O is GPLed.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: how to map 2 html files to 1 class?

2009-10-05 Thread Scott Swank
I don't see a Component#setVariation() method, but then we're still on 1.3.5.

On Mon, Oct 5, 2009 at 4:06 PM, Jeremy Thomerson
 wrote:
> Yes - this sounds like a good idea.  I believe you could also call
> setVariation(parameters.get(0 or "type", etc)) in your constructor and use
> the parameter to determine which HTML file is rendered.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Mon, Oct 5, 2009 at 5:44 PM, Phil Housley wrote:
>
>> 2009/10/5 Alex Rass :
>> > Standardizing footers across the site.
>> > So I will have a dozen pages which are bare content + footer from a
>> common
>> > file/db.
>> > I don't want to have THAT many useless classes.  If I do - wicket is a
>> > failure.
>>
>> It sounds as though you don't actually want to use any Wicket features
>> for the content of any of these pages, so I don't think you actually
>> want to create pages for them at all.
>>
>> Instead, I would have a general "content" page, and then interpret the
>> rest of the URL as an argument.  I can't remember which type of mount
>> you need, but you would basically interpret something like:
>>
>> /content/home
>> /content/index
>> /content/something
>>
>> as all being the same page, with a single parameter.  Then in the page
>> class you just print out some raw HTML content for the entire middle
>> bit of the page.  There are various ways to do that, and you have a
>> free choice if really all you want to do is write straight to the
>> response.
>>
>> > -Original Message-
>> > From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>> > Sent: Monday, October 05, 2009 6:27 PM
>> > To: users@wicket.apache.org
>> > Subject: Re: how to map 2 html files to 1 class?
>> >
>> > What are you handling there ?
>> >
>> > **
>> > Martin
>> >
>> > 2009/10/6 Alex Rass :
>> >> PageA.html <> PageB.html <> PageC.html
>> >>
>> >> Think about it this way:
>> >> PageA.html  = Privacy Page
>> >> PageB.html = SiteMap Page.
>> >>
>> >> I want to "handle" them both in same java class file cause hardly
>> anything
>> >> is going on there.
>> >>
>> >>
>> >> -Original Message-
>> >> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>> >> Sent: Monday, October 05, 2009 6:08 PM
>> >> To: users@wicket.apache.org
>> >> Subject: Re: how to map 2 html files to 1 class?
>> >>
>> >>> PageHandler.java, that handles all 3.
>> >>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>> >>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>> >>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>> >>
>> >> This is a bit confusing, you ar giving different aliases to the same
>> >> page. Is that what you want or you really want different html files
>> >> also..`?
>> >>
>> >> **
>> >> Martin
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >>
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Phil Housley
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: how to map 2 html files to 1 class?

2009-10-05 Thread Scott Swank
Alternately, I'm unsure why variation wouldn't work for you, something like:

public EmptyPage(String pageVariation)
{
  this.pageVariation = pageVariation;
}

@Override
public String getVariation()
{
  return pageVariation;
}

Then you could have html classes such as:

BasePage_home.html
BasePage_index.html
BasePage_something.html

>From there you could look at MixedParamUrlCodingStrategy to set up urls such as

www.domain.com/some/path/home
www.domain.com/some/path/index
www.domain.com/some/path/something

Scott


On Mon, Oct 5, 2009 at 3:50 PM, Martin Makundi
 wrote:
>> But yes, at least you should be able to take the html file name as
>> parameter to a bookmarkable page somehow and work from there?
>>
>> www.domain.com/PageHandler/intro.html/show
>> or
>> www.domain.com/PageHandler/show/intro.html
>
> And then override this:
>
>        public MarkupStream getAssociatedMarkupStream(final boolean 
> throwException)
>        {
>                try
>                {
>                        return 
> getApplication().getMarkupSettings().getMarkupCache().getMarkupStream(this,
>                                false, throwException);
>                }
>
> or something there inside...?
>
>
> **
> Martin
>>
>> **
>> Martin
>>
>> 2009/10/6 Alex Rass :
>>> Standardizing footers across the site.
>>> So I will have a dozen pages which are bare content + footer from a common
>>> file/db.
>>> I don't want to have THAT many useless classes.  If I do - wicket is a
>>> failure.
>>>
>>> -Original Message-
>>> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>>> Sent: Monday, October 05, 2009 6:27 PM
>>> To: users@wicket.apache.org
>>> Subject: Re: how to map 2 html files to 1 class?
>>>
>>> What are you handling there ?
>>>
>>> **
>>> Martin
>>>
>>> 2009/10/6 Alex Rass :
 PageA.html <> PageB.html <> PageC.html

 Think about it this way:
 PageA.html  = Privacy Page
 PageB.html = SiteMap Page.

 I want to "handle" them both in same java class file cause hardly anything
 is going on there.


 -Original Message-
 From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
 Sent: Monday, October 05, 2009 6:08 PM
 To: users@wicket.apache.org
 Subject: Re: how to map 2 html files to 1 class?

> PageHandler.java, that handles all 3.
> mountBookmarkablePage("/PageA.html", PageHandler.class);
> mountBookmarkablePage("/PageB.html", PageHandler.class);
> mountBookmarkablePage("/PageC.html", PageHandler.class);

 This is a bit confusing, you ar giving different aliases to the same
 page. Is that what you want or you really want different html files
 also..`?

 **
 Martin

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



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


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

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



Re: how to map 2 html files to 1 class?

2009-10-05 Thread Scott Swank
But if all three html files are associated with the same Java class,
how does this differ from separate skins?  Is the distinction
semantic, or am I missing something?

Scott

On Mon, Oct 5, 2009 at 2:44 PM, Alex Rass  wrote:
> I don't see how this applies.
> Please note that ResourceStreamLocator does not see the original url's path.
> And Page uses a cacheKey which is solely based on the class name.
>
> Maybe you can elaborate, but all 3 html files are TOTALLY UNRELATED PAGES.
> It's not the same page 3 times for diff skins. All 3 need to be available at
> the same time. (Should have made it clear earlier).
>
>
> -Original Message-
> From: Scott Swank [mailto:scott.sw...@gmail.com]
> Sent: Monday, October 05, 2009 5:38 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
> Have you considered using variant or style?
>
> http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.htm
> l
>
> Scott
>
> On Mon, Oct 5, 2009 at 2:35 PM, Alex Rass  wrote:
>> Yeah, that's what I had before. (Many fake classes that do nothing but
>> extend default one).
>> But I have multiple sites. With lots of pages. I don't want to have 200
>> classes that serve no purpose! (I already have 30 like that for my first
>> couple sites :) was hoping to stop this silly practice) (hold the jokes
>> about "there aren't many classes that can claim to have a purpose" :) )
>>
>> This thing about PageContantHandler intrigues me as this is exactly what I
>> need, but I don't understand how this would work. Unless this is your way
> of
>> asking the question. If so, here's what I want:
>>
>>
>> domain.com/PageA.html
>> domain.com/PageB.html
>> domain.com/PageC.html
>> (all files are locally on my site, just to keep it clear.)
>>
>> PageHandler.java, that handles all 3.
>> mountBookmarkablePage("/PageA.html", PageHandler.class);
>> mountBookmarkablePage("/PageB.html", PageHandler.class);
>> mountBookmarkablePage("/PageC.html", PageHandler.class);
>>
>>
>>
>>
>> -Original Message-
>> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
>> Sent: Monday, October 05, 2009 5:23 PM
>> To: users@wicket.apache.org
>> Subject: Re: how to map 2 html files to 1 class?
>>
>> And ofcourse you could have polymorphism.
>>
>> AbstractPageWithDesiredCommonFunctionality.java with all your common
> logic,
>>
>> Page1Design extends AbstractPageWithDesiredCommonFunctionality
>> Page2Design extends AbstractPageWithDesiredCommonFunctionality
>>  :
>>  :
>>  :
>> Page-n-Design extends AbstractPageWithDesiredCommonFunctionality
>>
>> And also the html would be
>> Page1Design.html
>> Page2Design.html
>>  :
>>  :
>>  :
>> Page-n-Design.html
>>
>>
>> **
>> Martin
>>
>> 2009/10/6 Martin Makundi :
>>> It's too late :) Apparently you wanted just the opposite.
>>>
>>> Well.. you could have:
>>>
>>> PageA.html:
>>> PageB.html:
>>> PageC.html:
>>>
>>> Page?.java:
>>> public class CommonPage extends WebPage {
>>>  public CommonPage() {
>>>      new PageContantHandler(this);
>>>  }
>>> }
>>>
>>> **
>>> Martin
>>>
>>> 2009/10/6 Martin Makundi :
>>>> Hi!
>>>>
>>>> I did not exactly understand what you are after, but you can always do
>>>> like this:
>>>>
>>>> CommonPage.html:
>>>>  blabla ...
>>>>
>>>> CommonPage.java:
>>>> public class CommonPage extends WebPage {
>>>>  public CommonPage() {
>>>>     if (A-mode) {
>>>>       new PageVersionAContantHandler(this);
>>>>     } else {
>>>>       new PageVersionAContantHandler(this);
>>>>     }
>>>>  }
>>>> }
>>>>
>>>> Maybe you wanted something different?
>>>>
>>>> **
>>>> Martin
>>>>
>>>> 2009/10/6 Alex Rass :
>>>>> Hi.
>>>>>
>>>>> Spent hours now trying to figure out how to map 2 html files to 1
> class.
>>>>> If someone knows the answer - please help.
>>>>>
>>>>> I need to map 10 similar html pages to same class (for same behavior).
>>>>>
>>>>> Doing this:
>>>>> webApplic

Re: how to map 2 html files to 1 class?

2009-10-05 Thread Scott Swank
Have you considered using variant or style?

http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications.html

Scott

On Mon, Oct 5, 2009 at 2:35 PM, Alex Rass  wrote:
> Yeah, that's what I had before. (Many fake classes that do nothing but
> extend default one).
> But I have multiple sites. With lots of pages. I don't want to have 200
> classes that serve no purpose! (I already have 30 like that for my first
> couple sites :) was hoping to stop this silly practice) (hold the jokes
> about "there aren't many classes that can claim to have a purpose" :) )
>
> This thing about PageContantHandler intrigues me as this is exactly what I
> need, but I don't understand how this would work. Unless this is your way of
> asking the question. If so, here's what I want:
>
>
> domain.com/PageA.html
> domain.com/PageB.html
> domain.com/PageC.html
> (all files are locally on my site, just to keep it clear.)
>
> PageHandler.java, that handles all 3.
> mountBookmarkablePage("/PageA.html", PageHandler.class);
> mountBookmarkablePage("/PageB.html", PageHandler.class);
> mountBookmarkablePage("/PageC.html", PageHandler.class);
>
>
>
>
> -Original Message-
> From: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com]
> Sent: Monday, October 05, 2009 5:23 PM
> To: users@wicket.apache.org
> Subject: Re: how to map 2 html files to 1 class?
>
> And ofcourse you could have polymorphism.
>
> AbstractPageWithDesiredCommonFunctionality.java with all your common logic,
>
> Page1Design extends AbstractPageWithDesiredCommonFunctionality
> Page2Design extends AbstractPageWithDesiredCommonFunctionality
>  :
>  :
>  :
> Page-n-Design extends AbstractPageWithDesiredCommonFunctionality
>
> And also the html would be
> Page1Design.html
> Page2Design.html
>  :
>  :
>  :
> Page-n-Design.html
>
>
> **
> Martin
>
> 2009/10/6 Martin Makundi :
>> It's too late :) Apparently you wanted just the opposite.
>>
>> Well.. you could have:
>>
>> PageA.html:
>> PageB.html:
>> PageC.html:
>>
>> Page?.java:
>> public class CommonPage extends WebPage {
>>  public CommonPage() {
>>      new PageContantHandler(this);
>>  }
>> }
>>
>> **
>> Martin
>>
>> 2009/10/6 Martin Makundi :
>>> Hi!
>>>
>>> I did not exactly understand what you are after, but you can always do
>>> like this:
>>>
>>> CommonPage.html:
>>>  blabla ...
>>>
>>> CommonPage.java:
>>> public class CommonPage extends WebPage {
>>>  public CommonPage() {
>>>     if (A-mode) {
>>>       new PageVersionAContantHandler(this);
>>>     } else {
>>>       new PageVersionAContantHandler(this);
>>>     }
>>>  }
>>> }
>>>
>>> Maybe you wanted something different?
>>>
>>> **
>>> Martin
>>>
>>> 2009/10/6 Alex Rass :
 Hi.

 Spent hours now trying to figure out how to map 2 html files to 1 class.
 If someone knows the answer - please help.

 I need to map 10 similar html pages to same class (for same behavior).

 Doing this:
 webApplication.mountBookmarkablePage("/page1.html", pageClass);
 Gets wicket to associate set url with the class.
 But then when the ResourceStreamLocator is called, it's given
 A reference to class and a reference to the path. Where class is set
 correctly (pageClass).
 But the PATH is set wrong. It is what Wicket THINKS it should try
 "PageClass_en.html". (class name + locale + default extension)

 While *I* would like to load my own class.

 I was thinking about completely rewriting ResourceStreamLocator to know
> my
 own paths, BUT it's not aware of what real page is being loaded (as the
> path
 is set to "PageClass_en.html").

 I could also break down and load my own stuff in beforeRender, but I was
 hoping there's a better way to handle this.

 Lastly, I could overwrite onRender() in my PageClass...

 Any advice would be much appreciated.

 - Alex.


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


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

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



Re: Default implementation of IChainingModel

2009-09-30 Thread Scott Swank
https://issues.apache.org/jira/browse/WICKET-2498

We're still on Wicket 1.3.5, so I put in a 1 hour estimate for someone
to add generic typing.

Scott


On Wed, Sep 30, 2009 at 3:58 PM, Jeremy Thomerson
 wrote:
> I don't think one was ever created and it fell off my radar.  If you create
> one, can you post yours and post a link to it back on this thread?
>
> Thanks!
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, Sep 30, 2009 at 4:45 PM, Scott Swank  wrote:
>
>> I searched the JIRA for IChainingModel and didn't get any hits.  Did
>> anyone create a JIRA issue?  Here's an implementation of mine.
>>
>> public class BaseChainingModel implements IChainingModel {
>>        private static final long serialVersionUID = 1L;
>>        private Object target;
>>
>>        public BaseChainingModel(Object modelObject) {
>>                if (modelObject == null) {
>>                        throw new IllegalArgumentException("Parameter
>> modelObject cannot be null");
>>                }
>>                else {
>>                        target = modelObject;
>>                }
>>        }
>>
>>       �...@override
>>        public void detach() {
>>                if (target instanceof IDetachable)
>>                        ((IDetachable) target).detach();
>>        }
>>
>>       �...@override
>>        public IModel getChainedModel() {
>>                if (target instanceof IModel)
>>                        return (IModel) target;
>>                else
>>                        return null;
>>        }
>>
>>       �...@override
>>        public void setChainedModel(IModel model) {
>>                target = model;
>>        }
>>
>>       �...@override
>>        public Object getObject() {
>>                Object object = target;
>>                while (object instanceof IModel) {
>>                        Object tmp = ((IModel) object).getObject();
>>                        if (tmp == object) {
>>                                break; // pathological
>>                        }
>>                        object = tmp;
>>                }
>>                return object;
>>        }
>>
>>       �...@override
>>        public void setObject(Object obj)       {
>>                if (target instanceof IModel)
>>                        ((IModel) target).setObject(obj);
>>                else if (obj == null || obj instanceof Serializable)
>>                        target = obj;
>>                else
>>                        throw new WicketRuntimeException("Model object must
>> be Serializable");
>>        }
>>
>> }
>>
>> Scott
>>
>>
>> On Wed, Apr 8, 2009 at 2:53 PM, Jeremy Thomerson
>>  wrote:
>> > I think that's a good idea - I have done a similar thing in my own
>> > projects.  Please open a JIRA so this idea doesn't get lost, but this is
>> one
>> > I may try to do soon.
>> >
>> > --
>> > Jeremy Thomerson
>> > http://www.wickettraining.com
>> >
>> >
>> >
>> > On Wed, Apr 8, 2009 at 4:36 PM, Juan G. Arias 
>> wrote:
>> >
>> >> Hi all,First of all, I'm using wicket 1.3.5
>> >>
>> >> I'm writing a model and ai need it to be "chaineable". I mean, I need
>> this
>> >> model to contain another model, so my model can obtain the data, for
>> >> example, from a property model.
>> >> Ok, I've been reading and this is solved by the IChainingModel.
>> >>
>> >> But I couldn't find any default implementation of this interface.
>> >> There are two classes currently implementing this interface,
>> >> AbstractPropertyModel and CompoundPropertyModel.
>> >> Both classes has some code duplicated, specifically:
>> >> - void detach()
>> >> - IModel getChainedModel()
>> >> - void setChainedModel(IModel model)
>> >> - some lines of void setObject(Object object)
>> >> - the code in CompuntPropertyModel#getObject() and
>> >> AbstarctPropertyModel#getTarget() is different, but the logic is the
>> same.
>> >>
>> >> And I'm afraid my code will be the same as those classes.
>> >>
>> >> So, finally, my point.
>> >> Is there any default implementation of this behavior? Is there a chance
>> to
>> >> add a super-class with this code?
>> >>
>> >> Thanks!
>> >> Juan Arias
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: Default implementation of IChainingModel

2009-09-30 Thread Scott Swank
I searched the JIRA for IChainingModel and didn't get any hits.  Did
anyone create a JIRA issue?  Here's an implementation of mine.

public class BaseChainingModel implements IChainingModel {
private static final long serialVersionUID = 1L;
private Object target;

public BaseChainingModel(Object modelObject) {
if (modelObject == null) {
throw new IllegalArgumentException("Parameter 
modelObject cannot be null");
}
else {
target = modelObject;
}
}

@Override
public void detach() {
if (target instanceof IDetachable)
((IDetachable) target).detach();
}

@Override
public IModel getChainedModel() {
if (target instanceof IModel)
return (IModel) target;
else
return null;
}

@Override
public void setChainedModel(IModel model) {
target = model;
}

@Override
public Object getObject() {
Object object = target;
while (object instanceof IModel) {
Object tmp = ((IModel) object).getObject();
if (tmp == object) {
break; // pathological
}
object = tmp;
}
return object;
}

@Override
public void setObject(Object obj)   {
if (target instanceof IModel)
((IModel) target).setObject(obj);
else if (obj == null || obj instanceof Serializable)
target = obj;
else
throw new WicketRuntimeException("Model object must be 
Serializable");
}

}

Scott


On Wed, Apr 8, 2009 at 2:53 PM, Jeremy Thomerson
 wrote:
> I think that's a good idea - I have done a similar thing in my own
> projects.  Please open a JIRA so this idea doesn't get lost, but this is one
> I may try to do soon.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, Apr 8, 2009 at 4:36 PM, Juan G. Arias  wrote:
>
>> Hi all,First of all, I'm using wicket 1.3.5
>>
>> I'm writing a model and ai need it to be "chaineable". I mean, I need this
>> model to contain another model, so my model can obtain the data, for
>> example, from a property model.
>> Ok, I've been reading and this is solved by the IChainingModel.
>>
>> But I couldn't find any default implementation of this interface.
>> There are two classes currently implementing this interface,
>> AbstractPropertyModel and CompoundPropertyModel.
>> Both classes has some code duplicated, specifically:
>> - void detach()
>> - IModel getChainedModel()
>> - void setChainedModel(IModel model)
>> - some lines of void setObject(Object object)
>> - the code in CompuntPropertyModel#getObject() and
>> AbstarctPropertyModel#getTarget() is different, but the logic is the same.
>>
>> And I'm afraid my code will be the same as those classes.
>>
>> So, finally, my point.
>> Is there any default implementation of this behavior? Is there a chance to
>> add a super-class with this code?
>>
>> Thanks!
>> Juan Arias
>>
>

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



Re: Complicated workflows

2009-09-29 Thread Scott Swank
Phil,

Would an event-centric approach simplify things?  I'm thinking that
you could then have multiple listeners for a given event and the
various listeners would not have to be aware of one another.  This
might reduce the task/sub-task interactions.  Adding errors, or
refreshing components could be handled by various listeners as needed.

I've gone that route with reasonable luck.  Of course I know precious
little about your specific application...

Cheers,
Scott


On Tue, Sep 29, 2009 at 2:11 PM, Phil Housley  wrote:
> Hello list,
>
> I'm currently working on some ideas for building apps with fairly
> complex workflows.  My aim is to find a nice pattern/framework for
> building apps where each unit of work involves many panels, several
> forms, lots of decisions and so on.  In particular I'm aiming at apps
> where you need to be very confident about exactly what is happening,
> so very strict control of actions, being careful of multiple
> renderings of a page each trying to change the server data, and so on.
>  Also, I'm wondering about some options for declarative building of
> workflows out of existing tasks.
>
> My current design involves running from a special page, which
> maintains a stack of tasks.  One type of task is a Workflow, which can
> be configured to automatically spawn subtasks as required, based on
> the result of previous tasks.  Another type of task is based on a
> panel, and is able to cause itself to be rendered.  The stack
> processor makes sure that each task is invoked at the right time, that
> a task can render if it is at the top of the stack, that only the top
> of the stack can be invoked from a form and so on.
>
> This is working ok for some silly demo cases, but there are various
> issues.  For example, any task that is not also a component cannot
> access dependency injection, or set error messages and so on.  I'm not
> sure how to get around this at the moment, as I don't want to force
> every task to be a component, when many will likely have no cause to
> ever be rendered.
>
> So, the reason I'm posting is to ask mainly two things:
>
> 1) Is this of interest to anyone else?  All the code is my own, so
> I'll open source it if there seems to be some future in it.
>
> 2) If so, does anyone have any comments on my current design?  Clearly
> there are problems with it, but should I carry on trying to find ways
> to work around them, or does the whole thing sounds like so much
> crack?
>
> Thanks,
>
> --
> Phil Housley
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Google App Engine and Wicket

2009-08-29 Thread Scott Swank
Here's a minor point that tripped me up.  I have my WicketFilter
mapped to a given path:


WicketFilter
/evansforlv/*


And then when I start up my local app and browse to

localhost:8080/evansforlv

I get redirected by Jetty to

localhost:8080/evansforlv/

with a trailing "/".  GAE is not so kind.  You must add the trailing
"/" to your url or you will simply get a blank page.  Since you are
never sent to the WicketFilter nothing is logged.  It's just a silent
failure.

Cheers,
Scott


On Mon, May 11, 2009 at 11:26 AM, Juha Palomäki wrote:
> File uploads seem to be causing some problems. On Wicket uploaded
> files are first written to some temporary file and on AppEngine this
> is obviously not possible. I haven't yet investigated if it is easy to
> change this behavior in Wicket. Another option might be to write a
> separate servlet for just handling the uploads,
> http://code.google.com/appengine/kb/java.html#fileforms
>
> Br,
> Juha
>
> On Sat, Apr 11, 2009 at 5:15 PM, Matthew Welch  wrote:
>> I've been experimenting a bit with Google App Engine and Wicket and things
>> seemed to work fairly well once I turned off the ModificationWatcher.
>> However, I realized that my simple tests were all stateless and that once
>> stateful, Wicket would use the DiskPageStore to write some files, which is
>> not allowed in the App Engine sandbox. Sure enough, once I added some
>> stateful pages, I started seeing exceptions related to the DiskPageStore.
>>
>> I'm a neophyte when it comes to the deep down Wicket internals so I'm not
>> sure what my other options might be. In a post Matej  Knopp said, ""*
>> DiskPageStore*'s purpose is to store serialized pages on disk in order to
>> allow access to previous page versions and also to conserve session memory
>> usage." This leads me to believe that using the sassion for storing this
>> information isn't a preferred approach. What about the App Engine's
>> datastore (an abstration on BigTable)? That seems like it might be too slow
>> to adequately serve this need, but I'm not sure. A thread on
>> Wicket/Terracotta integration ended up with an alternative
>> "SecondLevelCacheSessionStore" but I'm not sure if that is only usable with
>> Terracotta or if it might might sense in other situations. Any other
>> options?
>>
>> Also, looking forward, with the knoledge that writing giles and spawning new
>> threads are not allowed in the App Engine sandbox, are there any other items
>> I should be onl the lookout for in Wicket that might make it a poor choice
>> for this situation?
>>
>> Matt
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: How to detect model "leakage" into session

2009-08-26 Thread Scott Swank
Bas,

The code you showed is fine, foo will be garbage collected.  You only
have to worry about situations where you reference a final object
inside an anonymous inner class.  E.g. The below WebMarkupContainer
can has to keep a reference to foo, and so foo cannot be garbage
collected.

final Foo foo = getModelObject();

WebMarkupContainer bigBox = new WebMarkupContainer("me"){
if( foo.getX() )
  add( new Label("x", new PropertyModel( getModel(), "x" ) );
else
  add( new Label("x", new PropertyModel( getModel(), "y" ) );
};
add(bigBox);

Scott


Any time you make an object final it is potentially bound into the context of
On Wed, Aug 26, 2009 at 1:27 PM, Bas Gooren wrote:
> Michael,
>
> This is something which is helpful in case you have models which are not
> "owned" by a component. This is not the case in my application.
> Also, the strategy they explain in the blog is something which is quite
> common with wicket, at least for me: a model referencing another model, and
> calling it's detach() method when its own onDetach() is called.
>
> Thanks anyway!
>
> Bas
>
> - Original Message - From: "Michael Mosmann" 
> To: 
> Sent: Wednesday, August 26, 2009 10:13 PM
> Subject: Re: How to detect model "leakage" into session
>
>
>> Am Mittwoch, den 26.08.2009, 21:29 +0200 schrieb Bas Gooren:
>>>
>>> Hi all,
>>>
>>> My problem is as follows: I use LoadableDetachableModels throughout my
>>> application, and have made sure I never use a model without it being
>>> attached to a component to prevent models which never get their detach()
>>> method called.
>>> Nonetheless, after hitting two fairly simple pages which list some
>>> database data in my application, I get a 100kb session which is filled with
>>> literal strings from model objects.
>>>
>>> I've fired up my (Eclipse) debugger and have stepped through all models
>>> on one of the pages after setting a breakpoint on the pages onDetach()
>>> method. I see all LoadableDetachableModels are detached, so I have no idea
>>> what's causing this.
>>>
>>> What would be a good strategy for finding the source of this problem?
>>
>> IMHO this could be a solution to your problem:
>>
>> http://www.wicket-praxis.de/blog/2009/01/03/modell-referenzen/
>>
>> CascadingLoadableDetachableModel will detach it's child so that for any
>> used model detach will be called.
>>
>> mm:)
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: How to detect model "leakage" into session

2009-08-26 Thread Scott Swank
If you are certain that detach is always called then you must have
references to the underlying model objects.  I would look through
every call to IModel#getObject().

One thought is that if you create a final variable and refer to that
variable in an anonymous inner class then you have bound the object to
the component.  E.g.

final Foo foo = fooModel.getObject();
add(new Label("id", whatever){public isVisible(){return foo.isPurple();}});
// now foo is bound to the label, and will end up in the session

Scott

On Wed, Aug 26, 2009 at 12:51 PM, Bas Gooren wrote:
> Sven,
>
> I've been using wicket for over a year, so I'm quite familiar with Model
> usage.
> So thanks for the explanation, but I'm already using CompoundPropertyModels
> and PropertyModels everywhere.
> Because of this it's all the more frustrating to see model contents in my
> session.
>
> Bas
>
> - Original Message - From: "Sven Meier" 
> To: 
> Sent: Wednesday, August 26, 2009 9:48 PM
> Subject: Re: How to detect model "leakage" into session
>
>
>> Hi,
>>
>> you're probably doing something like the following:
>>
>>  add(new Label("foo", ldm.getObject().getFoo()));
>>
>> Never do that, instead use:
>>
>>  add(new Label("foo", new PropertyModel(ldm, "foo")));
>>
>> ... or ...
>>
>>  add(new Label("foo", new AbstractReadonlyModel() {
>>   public Object getObject() {
>>     return ldm.getObject().getFoo());
>>   }
>>  }));
>>
>> ... or even better ...
>>
>>  setModel(new CompoundPropertyModel(ldm));
>>
>>  add(new Label("foo")); // -> getFoo()
>>  add(new Label("bar")); // -> getBar()
>>  add(new Label("baz")); // -> getBaz()
>>
>> HTH
>>
>> Sven
>>
>> On Mi, 2009-08-26 at 21:29 +0200, Bas Gooren wrote:
>>>
>>> Hi all,
>>>
>>> My problem is as follows: I use LoadableDetachableModels throughout my
>>> application, and have made sure I never use a model without it being
>>> attached to a component to prevent models which never get their detach()
>>> method called.
>>> Nonetheless, after hitting two fairly simple pages which list some
>>> database data in my application, I get a 100kb session which is filled with
>>> literal strings from model objects.
>>>
>>> I've fired up my (Eclipse) debugger and have stepped through all models
>>> on one of the pages after setting a breakpoint on the pages onDetach()
>>> method. I see all LoadableDetachableModels are detached, so I have no idea
>>> what's causing this.
>>>
>>> What would be a good strategy for finding the source of this problem?
>>>
>>> Bas
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Wicket and XHR abstraction

2009-08-06 Thread Scott Swank
I like jquery ajax

http://docs.jquery.com/Ajax

Scott

On Thu, Aug 6, 2009 at 5:37 PM, arungupta wrote:
>
> Thanks!
>
> Any specific recommendation by the Wicket community ?
>
> -Arun
>
>
> igor.vaynberg wrote:
>>
>> use any third party library you would like. xhr support that comes
>> with wicket is only for internal ajax use.
>>
>> -igor
>>
>> On Thu, Aug 6, 2009 at 4:44 PM, Arun Gupta wrote:
>>> Does Wicket provide an abstraction of XHR ?
>>>
>>> I need to make a synchronous call to a non-Wicket Servlet hosted in
>>> the same domain but can't see to find a Wicket way. Or is creating own
>>> XHR or using some pre-built utility the way to go.
>>>
>>> -Arun
>>>
>>> --
>>> Need Application Server ? - Download glassfish.org
>>> Blog: http://blogs.sun.com/arungupta
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Wicket-and-XHR-abstraction-tp24856532p24856960.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Looking for Web Application Architecture Book

2009-08-04 Thread Scott Swank
I like Martin Fowler's Patterns of Enterprise Architecture.  I also
like Eric Evans' Domain Driven Design.

As for your specific questions:

dao -- Outside of a reasonably simple crud application I wouldn't have
Wicket even aware of daos.  I like to have wicket (or other clients)
talk to the proverbial "business" layer, with persistance, jms, ws,
and so forth on the other side of said business layer

package hierarchies -- I like to have module based hierarchies:
com.you.customer, com.you.order, com.you.ui.  Within each you would
then have parallel strucures (i.e. if you have a com.you.customer.dao
package for daos, then you would want to have com.you.order.dao).
Just try to make thing predictable.

app v. session -- If an entity is global, such as access to the
business layer, it should go in the app.  Conversely, things like a
cart that vary by session should go in the session.  Or maybe you were
asking something a little meatier?

constants -- I like to have things in the db.  This does not, however
work well for db credentials.  Property or xml files are a fine option
for things that vary by instance (dev v. test v. prod).  I only have
constants in code when multiple classes (or at least methods) need to
agree on a value.  I do not like to have constants that drive business
logic in code.

spring & wicket -- use the google.

Scott

On Tue, Aug 4, 2009 at 11:16 AM, Dane Laverty wrote:
> A few months ago I asked for ideas on project management, and you all gave
> me some great suggestions of tools and books to check out. Now I'd like to
> hear if anyone has recommendations for a resource that explains how to tie
> the web application together -- what I would call "architecture".
>
> I'm running into questions like
> - Where should I put my DAOs? In the session or in the pages? And what's a
> reasonable relationship between DAOs and domain objects?
> - What are some examples of reasonable package hierarchies?
> - What kind of objects should live in the application and what should live
> in the session?
> - Should I put constants in a Constants.java or in an xml file?
> - Spring wants to use interfaces and Hibernate wants to use concrete classes
> -- how do I reconcile these?
>
> Effective Java and Design Patterns have been great resources for learning
> how to solve specific programming problems. Now I'd like to find information
> on how to build the layout of the application in a way that is effective,
> simple, and maintainable. Any suggestions?
>

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



Re: DropDownChoice with ID and Value

2009-07-27 Thread Scott Swank
Look at ChoiceRenderer.  It's pretty easy to write one that takes a
map in it's constructor if your needs are that simple.

Scott

2009/7/27 carlson weber filho - Master CIM Informática
:
> Newbie question:
> I have a list of 3 options, let's supose it's 1=abc, 2=def, 3=ghi
>
> I will present to my user the select field with the choices abc, def and
> ghi. I want that my model updates with 1, 2 and 3. I did not find a way to
> achieve this (must me a simple thing).
>
>
> best regards,
>
> carlson
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Dirty read/edit problem.

2009-06-23 Thread Scott Swank
On-line docs
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lock.htm

DA Morgan's docs
http://www.psoug.org/reference/dbms_lock.html

On Tue, Jun 23, 2009 at 12:58 AM, Maarten
Bosteels wrote:
> Hi,
>
> We have implemented something similar. In our case multiple applications
> should be able to request locks, so we have implemented it on the database.
> It's based on DBMS_LOCK (Oracle specific).
> When an application crashes (or is killed in an unclean manner) Oracle will
> roll back any pending transactions, and automagically release the locks.
> Works very well (btw, our applications never crash :-)
>
> Since you have only one application, I guess you could do it in the
> application layer (keep locks in memory).
>
> Maarten
>
>
> On Tue, Jun 23, 2009 at 3:07 AM, James Carman
> wrote:
>
>> If it's fairly unlikely that two people would be editing the same record at
>> the same time, then it's probably okay to go with optimistic locking.
>>
>> On Mon, Jun 22, 2009 at 8:41 PM, satar  wrote:
>>
>> >
>> > Yep, that is what I thought from the reading I have done. I think I will
>> do
>> > it the way I have in the past but using an application-level edit table
>> > instead of having to use a database. This feels more natural to me and I
>> > have spent an absorbent amount of time learning Hibernate already and
>> just
>> > hoping that I get some return from all of the complexities it has
>> > eventually. I do believe that will be the case because all you smart
>> peeps
>> > wouldn't be using it if there was nothing to gain. The dirty read problem
>> > seems like such a normal condition for any application that has multiple
>> > writers, so I thought I would see what is a typical approach within web
>> > apps
>> > -- something I am very new at.
>> > --
>> > View this message in context:
>> > http://www.nabble.com/Dirty-read-edit-problem.-tp24157057p24158076.html
>> >   Sent from the Wicket - User mailing list archive at Nabble.com.
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>

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



Re: Dirty read/edit problem.

2009-06-22 Thread Scott Swank
Why not just lock the relevant row of the relevant table?  Versioning
is for optimistic locking, but it sounds to me like you want plain old
pessimistic locking.

In Hibernate, check out LockMode.UPGRADE.

Scott


On Mon, Jun 22, 2009 at 3:58 PM, Steve Tarlton wrote:
> I thought I would throw this one out to the user group and see if it makes
> sense or am I over complicating things. I am implementing a check list
> system using Wicket-Hibernate-Spring. There could potentially be more than
> one person trying to edit a given check item within the list and I want to
> be sure that two edits against the same check item cannot happen.
>
> I have implemented something like this before using two database tables one
> for locking and one for writing who has the lock on a given object. Of
> course, that wasn't a web application and it wasn't a client/server
> application (well unless you consider the database the server, which is kind
> of what I was doing). I would hold on to the transaction for a row id lock
> table until the corresponding row that the user was editing was updated this
> included the user think time as they had to press a button to edit, which
> created this lock table entry as well as a entry in a lock info table that
> was committed so that when user b tried to hit edit, it would pull a
> transaction isolation exception and then go lookup who had the item locked.
>
> Okay, so I want to implement this same sort of mechanism for check items;
> however, because there is a common application-level that everyone connected
> shares (I will only have one webserver as opposed to a farm), I was thinking
> that I implement a edit-in-progress table as a data source in the
> application-layer. Then, when someone clicks the edit button on a selected
> check item, I use the edit-in-progress table to make sure someone else isn't
> editing the given item. Is this a typical or at least a good approach to
> solve such a problem or is there something within Hibernate that I am
> unaware of that handles this. I have read about the mult-versioning but how
> would you tell the user BEFORE they start to edit something that someone
> else has it locked?
>
> Sorry, I know this was a long post but I have to believe that others may
> wonder about this kind of user interaction as well and I haven't seen
> anything on the topic with the searches I did.
>
> Thanks,
> -Steve
>

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



Re: JDeveloper - Can I get a show of hands?

2009-06-20 Thread Scott Swank
I'm at best 50% DBA, by training.  You end up with multi-step
operations that work very well as sql*plus scripts.  I also run
analogous queries in TOAD, PL/SQL Dev or SQL Dev -- but no DBA worth
hiring works in the click-and-drag world.  But then I suppose this has
gotten off topic.

On Sat, Jun 20, 2009 at 10:37 AM, James
Carman wrote:
> As a DBA, you use SQL Plus?  I would think most DBAs would either use the
> console thingy that comes with Oracle or Toad.  SQL Plus always seemed a bit
> limiting to me, but that's probably because of my limited knowledge of all
> the commands, so I need the nice GUI stuff to guide me along. :)
>
> On Sat, Jun 20, 2009 at 1:04 PM, Scott Swank  wrote:
>
>> And if you're an Oracle DBA your main tool is called "SQL Plus".
>>
>> On Fri, Jun 19, 2009 at 8:58 PM, James
>> Carman wrote:
>> > +1 to sqldeveloper (java or native).  For developers (not DBAs), it's a
>> very
>> > nice tool and does what you need for the majority of the cases.
>> >
>> > On Fri, Jun 19, 2009 at 11:28 PM, Vasu Srinivasan 
>> wrote:
>> >
>> >> JDeveloper is good to target a narrow Oracle infrastructure. We use it
>> for
>> >> Oracle soa suite, and there are no other IDEs / plugins which can match
>> >> that, it has good integration for ADF too. And thats pretty much it.
>> >>
>> >> Otherwise, it doesn't come half close to IDEA or Eclipse. The project
>> >> structure it generates is pretty un-intuitive. Bad IDE is indirectly
>> >> proportional to Productivity. Lack of good plugins is another major
>> reason.
>> >>
>> >> Our team has only a few licenses for TOAD, so I use sql developer (the
>> >> windows native version, not the java version).. Pretty happy with it,
>> >> though
>> >> it gets a bit slow at times. Last I used the java version was buggy and
>> >> low.
>> >>
>> >>
>> >>
>> >> On Fri, Jun 19, 2009 at 9:09 PM, Daniel Toffetti > >> >wrote:
>> >>
>> >> > Juan Carlos Garcia M.  gmail.com> writes:
>> >> > >
>> >> > > I always thought God used only in LISP :)
>> >> > >
>> >> > > Nicolas Melendez wrote:
>> >> > > >
>> >> > > > god used Eclipse 1.0 to develop universe.
>> >> > > >
>> >> > > > NM
>> >> > > > Software Developer - Buenos aires, Argentina.
>> >> > > >
>> >> >
>> >> >     No. Sadly, He didn't:
>> >> >
>> >> >    http://xkcd.com/224/
>> >> >
>> >> > Daniel
>> >> >
>> >> >
>> >> >
>> >> > -
>> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >
>> >> >
>> >>
>> >>
>> >> --
>> >> Regards,
>> >> Vasu Srinivasan
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: JDeveloper - Can I get a show of hands?

2009-06-20 Thread Scott Swank
And if you're an Oracle DBA your main tool is called "SQL Plus".

On Fri, Jun 19, 2009 at 8:58 PM, James
Carman wrote:
> +1 to sqldeveloper (java or native).  For developers (not DBAs), it's a very
> nice tool and does what you need for the majority of the cases.
>
> On Fri, Jun 19, 2009 at 11:28 PM, Vasu Srinivasan  wrote:
>
>> JDeveloper is good to target a narrow Oracle infrastructure. We use it for
>> Oracle soa suite, and there are no other IDEs / plugins which can match
>> that, it has good integration for ADF too. And thats pretty much it.
>>
>> Otherwise, it doesn't come half close to IDEA or Eclipse. The project
>> structure it generates is pretty un-intuitive. Bad IDE is indirectly
>> proportional to Productivity. Lack of good plugins is another major reason.
>>
>> Our team has only a few licenses for TOAD, so I use sql developer (the
>> windows native version, not the java version).. Pretty happy with it,
>> though
>> it gets a bit slow at times. Last I used the java version was buggy and
>> low.
>>
>>
>>
>> On Fri, Jun 19, 2009 at 9:09 PM, Daniel Toffetti > >wrote:
>>
>> > Juan Carlos Garcia M.  gmail.com> writes:
>> > >
>> > > I always thought God used only in LISP :)
>> > >
>> > > Nicolas Melendez wrote:
>> > > >
>> > > > god used Eclipse 1.0 to develop universe.
>> > > >
>> > > > NM
>> > > > Software Developer - Buenos aires, Argentina.
>> > > >
>> >
>> >     No. Sadly, He didn't:
>> >
>> >    http://xkcd.com/224/
>> >
>> > Daniel
>> >
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>>
>> --
>> Regards,
>> Vasu Srinivasan
>>
>

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



Re: JDeveloper - Can I get a show of hands?

2009-06-19 Thread Scott Swank
Dane,

I have used JDev and it is not my preference for a Java IDE.  That
said, if you're having trouble with it your best resource is posting
at forums.oracle.com.  As for a PL/SQL IDE, why are you moving away
from TOAD, the price ($600 if I remember right...)?  The product
"PL/SQL Developer" from All Around Automations is a terrific product
for more like $180.  I have used it extensively and can vouch for it.

http://www.allroundautomations.com/

Alternately, there is a PL/SQL IDE from Oracle called "SQL Developer"
(formerly Project Raptor).  It is an entirely usable product and it's
free.  I use this on my Mac at home because it's just Java.

http://www.oracle.com/technology/products/database/sql_developer/files/what_is_sqldev.html

I don't see why you would need to use the same IDE for Java & PL/SQL.
I never have.

Scott



On Fri, Jun 19, 2009 at 8:30 AM, James
Carman wrote:
> I've always found that trying to do the UML thing just turns out to be more
> of a pain than it's worth.  For me, it's just easier to code the stuff.  You
> can generate UML from the code pretty easily (check out the yfiles Javadocs
> for an example that's generated using yworks' yDoc product).
>
> On Fri, Jun 19, 2009 at 11:26 AM, Dane Laverty wrote:
>
>> I've really enjoyed getting to use Maven on my recent projects. I'm no
>> Maven expert, but I'm finding that I don't have to be -- it really
>> just does a great job. Getting Maven working with JDeveloper has not
>> been going well so far, so that's been one hangup.
>>
>> There are a few reasons for the department-wide IDE mandate. Our
>> manager has just discovered UML (I don't know anything about it, to be
>> honest), and JDeveloper provides UML functionality out of the box,
>> while any of the free Eclipse UML plugins I could find required a
>> mountain of dependencies and don't appear to work as smoothly as the
>> JDev one. Also, we're trying to replace TOAD as our database tool, and
>> JDev looks like it can do that. The third reason is that most of our
>> applications are Oracle ApEx, and JDev has stuff for that too.
>>
>> I'm trying to port my existing apps to JDeveloper, but without much
>> success. The main problems so far are:
>> - How do I import a Wicket project using the Maven standard directory
>> layout? (I am aware of the Maven JDev plugin for JDev 10, but it has
>> issues with JDev 11)
>> - How do I run a Wicket app in JDeveloper using the internal WebLogic
>> server?
>> - Does JDeveloper have some sort of Maven-like functionality for
>> project lifecycle management?
>>
>> I imagine (hope) that most of these questions have easy answers, but
>> I'm just not finding a lot of relevant online
>> documentation/discussion. Most of the JDeveloper web app documentation
>> is focused on EJBs or basic Servlet/JSP-based apps.
>>
>>
>> On Fri, Jun 19, 2009 at 3:53 AM, James
>> Carman wrote:
>> > +1 on using Maven.  Most folks at our job site use eclipse, but I'm an
>> > IntelliJ junkie (they got me hooked many years ago and I can't break
>> > free).  For the most part, we don't have issues between environments,
>> > provided folks have their plugins set up correctly.
>> >
>> > On Fri, Jun 19, 2009 at 6:39 AM, Martijn Reuvers
>> >  wrote:
>> >>
>> >> When you use ADF, then stick to JDeveloper you'll get a lot of
>> >> integration for your application and can really build applications
>> >> fast.
>> >>
>> >> However if you use open-source frameworks like wicket, you're better
>> >> off using one of the other IDE's (Netbeans, Eclipse, IntelliJ). Just
>> >> use maven or so, then your management has nothing to say, as it does
>> >> not really matter what IDE you use. I always say: Use whatever gets
>> >> the job done. =)
>> >>
>> >> On Fri, Jun 19, 2009 at 1:00 AM, Dane Laverty
>> wrote:
>> >> > Our management has chosen to make JDeveloper 11g the required IDE for
>> >> > the department. Searching the Wicket mailing list archives, I find
>> >> > that there is very little discussion about JDev. I'd be interested to
>> >> > know, are any of you currently using JDeveloper as your main Wicket
>> >> > IDE?
>> >> >
>> >> > -
>> >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >> >
>> >> >
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> >> For additional commands, e-mail: users-h...@wicket.apache.org
>> >>
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>

OT: ESB

2009-06-03 Thread Scott Swank
Warning: Off Topic

Has anyone worked with an open source ESB, and if so do you
particularly like or dislike your choice?  Please respond to me off
the list, though of course if anyone wants a brief synopsis of what I
pull together I'll gladly post it back to the list or send it outside
of the list.

I am specifically considering:

Camel
Mule
ServiceMix

Since we are not willing to move to NetBeans & Glassfish we have
eliminated OpenESB.  And from a brief survey of google results no one
really seems to like JBoss ESB so we're not investigating it further
unless new information otherwise motivates us.

Sorry for the noise.

Best,
Scott

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



Re: Grizzly + Wicket integration

2009-06-01 Thread Scott Swank
Not that I'm aware of.  What specifically do you want to do with nio?

Scott


On Mon, Jun 1, 2009 at 7:01 AM, Eman Nollase  wrote:
> Hello,
>
> Is there a Wicket + Grizzly integration?
>
> Thanks a lot.
> Cheers.
>

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



Re: Framework sales pitch

2009-05-24 Thread Scott Swank
I suspect that articles on broadly read sites, such as theserverside &
dzone are significant vectors.

Scott

On Sun, May 24, 2009 at 11:37 AM, Ricky  wrote:
> Hi,
>
> I am interested in knowing as to how does a framework reach its potential
> developers in open source, for example Wicket, it started out and so how do
> people know about it?
> 1.) Is it that person A tells person B tells person C sort of chain?
> 2.) Or is it well planned out? if so how?
>
> Just curious...
>
> Regards
> Vyas, Anirudh
> ||  ॐ  ||
>

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



Re: Any forum (bb) components / applications written using Wicket?

2009-05-24 Thread Scott Swank
Over here

http://wicketstuff.org/confluence/display/STUFFWIKI/Wiki

there is bbcode & tinymce integration.  I haven't used either, but at
least that's a starting point.  Good luck.

Scott


On Sun, May 24, 2009 at 1:04 AM, Cristi Manole  wrote:
> Hello,
>
> I'm in the need of a forum (bulletin board) component / application written
> in Wicket to integrate in a larger Wicket application.
>
> Does anybody have one / know of one? Please promote it. :)
>
> I don't mind if it's still in alpha or something as I prefer building on top
> of that rather than starting from scratch :) I'm on a _very_ tight schedule.
>
> Thanks,
> --
> Cristi Manole
>
> Nova Creator Software
> www.novacreator.com
>

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



Re: Tools for Managing a Wicket Project

2009-04-29 Thread Scott Swank
I agree with Jeremy, that tech books are probably far more important
than project management books for a first Java project.

Basics
-Effective Java, Joshua Block
-Wicket in Action, Dashorst & Hillenius
-one more on jdbc or hibernate or ibatis -- your persistence api

Design (language agnostic)
-Design Patterns, gang of four
-Domain Driven Design, Eric Evans

Advanced (as needed)
-Java Concurrency in Practice, Goetz
-NIO from O'Reilly
-whatever...

Scott


On Wed, Apr 29, 2009 at 12:19 PM, Jeremy Thomerson
 wrote:
> I would HIGHLY recommend that each of you get a copy of Joshua Bloch's
> Effective Java, now in it's second edition.  It's not really project
> management, but since your team as a whole is not mature with Java, it
> will offer some good advice.  Of course, make sure everyone is
> familiar with Wicket in Action and has gone through the exercises -
> that will give them a good foundation.
>
> As far as books on Java project management, I don't have any
> recommendations.  I've perused some but never been fascinated.  Maybe
> someone else will have a good recommendation.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com

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



Re: Good practice for temporary resource reference

2009-04-19 Thread Scott Swank
Does it make sense to just store them in the Wicket Session?

Scott


On Sun, Apr 19, 2009 at 4:38 PM, Xhelas  wrote:
>
> Well, nobody has the same probelm as me? Is that a stupid question?
>
>
> Xhelas wrote:
>>
>> I am doing an application with a lot of dynamical image creation. These
>> images need to be cached client side, but their life time is bounded by
>> the suer session's lifetime. So I create a lot of image resource
>> references which url is used but the client. What I did not get in the APi
>> is the way do "forget" those references, to unbind them to the
>> application.
>> Is there a canonical way to do so?
>>
>> Thanks for your reading.
>>
>> Alexandre
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Good-practice-for-temporary-resource-reference-tp22773495p23128552.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: [OT] Book/pointers on caching

2009-03-30 Thread Scott Swank
This author compared several caching libraries and recommends ehcache.

http://javalandscape.blogspot.com/2009/03/intro-to-cachingcaching-algorithms-and.html

- Scott


On Mon, Mar 30, 2009 at 4:33 AM, nino martinez wael
 wrote:
> I wrote something about it here:
> http://ninomartinez.wordpress.com/2008/08/25/pump-your-java-with-caching/
>
> It's very easy if your already using spring or guice or any other IOC 
> framework.
>
> One thing though I would'nt cache too much with wicket, the benefit
> are very small and the code cost are high.
>
>
> 2009/3/29 Kaspar Fischer :
>> I again and again run into the following problem: My Wicket app displays a
>> complex page, and in order to compile the information needed for this page,
>> I need to do many database/repository queries and/or computations -- so many
>> that it simply takes to long and the user has two wait.
>>
>> Take for instance a page with many news blocks for different topics, a
>> "recently added content" block, polls, the list of all active users, etc.
>> Fetching all this data requires tons of queries to the backend.
>>
>> I understand that I need some caching mechanism. And as many have pointed
>> out on this list, it is preferable to not do this in the presentation layer
>> (caching Wicket components) but to move the caching to the business logic or
>> persistence layer. So my Wicket models still make the same calls, like
>> service.find(blabla), but behind the scenes, a cache speeds up the access.
>>
>> The question is just: what are good caching strategies? When to update the
>> cache? Should the cache itself know when to invalidate entries? Etc. Is
>> there any sample code, articles, or books on this that you can recommend?
>>
>> I liked to read "Multitiered architectures" in "Wicket in Action" and would
>> enjoy something in this direction: Spring, Hibernate (or db4o), services,
>> ...
>>
>> Thanks a lot,
>> Kaspar
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: HTML can't reference a component (Label) multiple times?

2009-03-26 Thread Scott Swank
Should I open a JIRA for this, or is this an accepted side-effect?

Scott


On Thu, Mar 26, 2009 at 2:39 PM, Scott Swank  wrote:
> Surprisingly getDebugSettings().setComponentUseCheck(false) allows
> this behavior, at least on 1.3.
>
>   add(new Label("authorName"));
>
>   
>   
>
> ... not that I'm advocating this side effect.
>
> Scott
>
>
> On Fri, Feb 13, 2009 at 10:26 AM, Igor Vaynberg  
> wrote:
>> not to mention it doesnt make sense for a lot of usecases, eg
>> setoutputmarkupid() if you call it then the two rendered components
>> will have the same markup id - whoops. which means this will break
>> javascript, ajax, etc, etc.
>>
>> -igor
>>
>> On Fri, Feb 13, 2009 at 2:59 AM, Martijn Dashorst
>>  wrote:
>>> 99.99% of the time this is an error: a component is referenced
>>> multiple times in markup. Therefore we don't allow one component to be
>>> rendering in multiple places. For that 0.01% of useful cases, it is
>>> not too difficult to just add the label component twice.
>>>
>>> Martijn
>>>
>>>
>>> On Thu, Feb 12, 2009 at 8:54 PM, Phil Grimm  wrote:
>>>> Guys,
>>>>
>>>> If I need to reference a Label multiple times on the page.
>>>> Is there a better way than creating multiple redundant but distinct labels?
>>>>
>>>> Is this the only option?
>>>>
>>>> add(new Label("authorName1"));
>>>> add(new Label("authorName2"));
>>>> add(new Label("authorName3"));
>>>>
>>>> 
>>>> 
>>>> 
>>>>
>>>> This (non-one-to-one) usage...
>>>>
>>>> add(new Label("authorName"));
>>>>
>>>> 
>>>> 
>>>>
>>>> ... causes error:
>>>>
>>>> WicketMessage: The component [Component id = author.name] has the same
>>>> wicket:id as another component already added at the same level
>>>>
>>>>
>>>> Phil
>>>>
>>>> --
>>>> Phil Grimm
>>>> Mobile: (858) 335-3426
>>>> Skype: philgrimm336
>>>>
>>>
>>>
>>>
>>> --
>>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>>> Apache Wicket 1.3.5 is released
>>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: HTML can't reference a component (Label) multiple times?

2009-03-26 Thread Scott Swank
Surprisingly getDebugSettings().setComponentUseCheck(false) allows
this behavior, at least on 1.3.

   add(new Label("authorName"));

   
   

... not that I'm advocating this side effect.

Scott


On Fri, Feb 13, 2009 at 10:26 AM, Igor Vaynberg  wrote:
> not to mention it doesnt make sense for a lot of usecases, eg
> setoutputmarkupid() if you call it then the two rendered components
> will have the same markup id - whoops. which means this will break
> javascript, ajax, etc, etc.
>
> -igor
>
> On Fri, Feb 13, 2009 at 2:59 AM, Martijn Dashorst
>  wrote:
>> 99.99% of the time this is an error: a component is referenced
>> multiple times in markup. Therefore we don't allow one component to be
>> rendering in multiple places. For that 0.01% of useful cases, it is
>> not too difficult to just add the label component twice.
>>
>> Martijn
>>
>>
>> On Thu, Feb 12, 2009 at 8:54 PM, Phil Grimm  wrote:
>>> Guys,
>>>
>>> If I need to reference a Label multiple times on the page.
>>> Is there a better way than creating multiple redundant but distinct labels?
>>>
>>> Is this the only option?
>>>
>>> add(new Label("authorName1"));
>>> add(new Label("authorName2"));
>>> add(new Label("authorName3"));
>>>
>>> 
>>> 
>>> 
>>>
>>> This (non-one-to-one) usage...
>>>
>>> add(new Label("authorName"));
>>>
>>> 
>>> 
>>>
>>> ... causes error:
>>>
>>> WicketMessage: The component [Component id = author.name] has the same
>>> wicket:id as another component already added at the same level
>>>
>>>
>>> Phil
>>>
>>> --
>>> Phil Grimm
>>> Mobile: (858) 335-3426
>>> Skype: philgrimm336
>>>
>>
>>
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>> Apache Wicket 1.3.5 is released
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: The ServerSide Java Symposium

2009-03-20 Thread Scott Swank
http://javasymposium.techtarget.com/html/frameworks.html#ALombardiWicket


On Fri, Mar 20, 2009 at 9:44 AM, Scott Swank  wrote:
> Is anyone in Vegas?  Want to nab a beer?
>
> Cheers,
> Scott
>

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



The ServerSide Java Symposium

2009-03-20 Thread Scott Swank
Is anyone in Vegas?  Want to nab a beer?

Cheers,
Scott

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



Re: VOTE: Remove ? extends from constructor of DropDownChoice

2009-03-04 Thread Scott Swank
I agree.  It is very sensible to be able to provide a
Model> as the choices for a dropdown that has
Model.  Restricting the choices to Model> only
eliminates (sensible) options for the client code.

Scott

On Wed, Mar 4, 2009 at 8:08 AM, Johannes Schneider
 wrote:
> On Wed, 2009-03-04 at 10:04 -0500, Brill Pappin wrote:
>> I actually wasn't saying they were the same.
>> What I said (meant) was that:
>>
>> a) don't lock down
>
> Locking down means *removing* the wildcard. Adding the wildcard *widens*
> the collection.
>
> To be clear:
> Wildcard --> it fits for everybody
> No wildcard --> it fits only for some special cases (maybe yours)
>
>> b) I prefer the explicit form rather than the "Any of type" form. i.e.
>> > rather than >.
>
> They mean something completely different. I understand that you prefer
> the shorter version. Many do. But it stays wrong...
>
> If the constructor accepts "List", everybody *has* to give you
> exactly a List.
>
> List n = new List;
>
>
> If the constructor accepts the widened type, you can add all those
> lists...
>
> List n = new List;
> List n = new List;
> List n = new List;
>
>
> If you don't believe me, take a look at GlazedLists. Compare version 1.7
> and version 1.8. They changed exactly that thing (a non backward
> compatible change!). They made exactly the same fault...
>
>
> Regards,
>
> Johannes
> - Show quoted text -
>>
>> - Brill
>>
>> On 4-Mar-09, at 6:26 AM, Johannes Schneider wrote:
>>
>> > On Tue, 2009-03-03 at 16:02 -0500, Brill Pappin wrote:
>> >> I'd hate to be
>> >> prevented from doing so simply because someone wanted to lock down an
>> >> API that didn't really need locking down.
>> >
>> > You are wrong. *Widening* a collection is the exact opposite of
>> > "locking
>> > down".
>> > If you want to have some fancy (read "hacky") write access to the
>> > model
>> > you are free to simply cast...
>> > That is the right choice here. You know that you have a special
>> > model in
>> > there, so cast it.
>> >
>> > But the "common" case is, that you don't know for sure whether the
>> > model
>> > supports adding of choices or not.
>> >
>> >
>> > If you don't believe me, take a look at JComboBox.
>> > javax.swing.JComboBox#getModel returns a *read only* view of the
>> > model.
>> >
>> >
>> >
>> > Regards,
>> >
>> > Johannes
>> >
>> >
>> >> I think the syntax doesn't really mean read only, and if the wicket
>> >> developers really want it to be read only, wrapping the list would be
>> >> the way to go.
>> >>
>> >> I'm for the plain old > because its simple and explicit...
>> >> > would be my next choice because it widens the
>> >> scope.
>> >>
>> >> - Brill
>> >>
>> >> On 2-Mar-09, at 3:44 PM, James Carman wrote:
>> >>
>> >>> Aren't both the "choices" model in DDC and the actual model of
>> >>> ListView supposed to be considered read-only (as far as the
>> >>> component
>> >>> is concerned)?  The DDC and ListView don't need to be able to alter
>> >>> those models anyway, right?  Perhaps my experience is just too
>> >>> limited, but I don't think I've ever tried to do either one of your
>> >>> usecases (I always consider them read-only).
>> >>>
>> >>>
>> >>> On Mon, Mar 2, 2009 at 3:24 PM, Igor Vaynberg
>> >>>  wrote:
>>  see WICKET-2126
>> 
>>  -igor
>> 
>>  On Mon, Mar 2, 2009 at 12:19 PM, James Carman
>>   wrote:
>> > I vote -0.99 on this (non-binding of course).  I'd vote +1 to
>> > making
>> > ListView accept List rather than making DDC less
>> > flexible.
>> >
>> > On Mon, Mar 2, 2009 at 3:11 PM, Brill Pappin 
>> > wrote:
>> >> Ok, as suggested, here is the thread, and the first vote.
>> >>
>> >> +1
>> >> for making the generic definition the same for all list type
>> >> components.
>> >>
>> >> FYI -  you can also "vote" in the issue I just created at (which
>> >> might
>> >> actually be a better place to vote):
>> >> https://issues.apache.org/jira/browse/WICKET-2137
>> >>
>> >> - Brill
>> >>
>> >>
>> >>
>> >>
>> >> On 28-Feb-09, at 5:18 PM, Jeremy Thomerson wrote:
>> >>
>> >>> Perhaps start a vote thread, with the subject something like:
>> >>> "VOTE:
>> >>> Remove
>> >>> ? extends from constructor of DropDownChoice".
>> >>>
>> >>> I'd be +1 non-binding
>> >>>
>> >>>
>> >>> --
>> >>> Jeremy Thomerson
>> >>> http://www.wickettraining.com
>> >>>
>> >>>
>> >>> On Sat, Feb 28, 2009 at 3:33 PM, Brill Pappin 
>> >>> wrote:
>> >>>
>>  I'm of the don't widen it camp anyway :)
>> 
>>  So how do I go about gathering support for having the
>>  DropDownChoice work
>>  with the models the way everything else does?
>> 
>>  - Brill
>> 
>> 
>>  On 28-Feb-09, at 1:42 AM, Igor Vaynberg wrote:
>> 
>>  yes, the choice was intentional. personally i do not care if it
>>  is 
>> >
>>

Re: How (not) to: IModel and Collections (and generics)

2009-03-04 Thread Scott Swank
Does AbstractReadOnlyModel accomplish what you're talking about?

Scott

On Wed, Mar 4, 2009 at 4:50 AM, Johannes Schneider
 wrote:
> Hi,
>
> the concept of IModel seems to be very obvious. It is simply some kind
> of reference and offers a getter and a setter.
>
> When used with ordinary object, everything works fine. An IModel that
> contains a String can easily be mapped to a TextField.
> The text field calls "getObject" to show the initial value and sets the
> changed string to the model using "setObject" on form commit.
>
>
> Everything becomes a little more complicated when collections are
> affected. The problem is, that it is not obvious what those collections
> represent.
>
> 1) A collection might be read-only (e.g. the possible choices for a
> selection).
> 2) But it also might be necessary to add/remove single elements (e.g.
> privileged users shown within a shuffle list).
> 3) And sometimes the complete collection is changed (can't find an
> example here).
>
>
> IModel only supports the *third* method where the complete collection is
> replaced.
> (Don't forget that the reference to the collection changes which will
> lead to several other problems.)
> I strongly recommend the usage of a wrapping class for that case.
> But this case is not very common. Maybe someone finds a good example - I
> can't.
>
>
> For the other two cases it does *not* make any sense to call
> IModel#setObject.
>
>
> Summary: Nearly in every case when the IModel contains a collection, the
> "setObject" method does not make any sense and must not be called.
>
>
> Conclusion: I think we should have created some sort of IModelProvider
> (contains only the getObject method) and IModel (with both methods).
> Components that just *read* values from the model, accept the read only
> interface now.
>
> For special cases where a magic component adds/removes elements to a
> collection, we need some sort of ICollectionModel that offers "add" and
> "remove" methods (but no setter).
> That interface - of course - will be based upon a collection *without*
> wildcards...
>
>
>
> Regards,
>
> Johannes Schneider
>
>
>
>
>
>
>
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Wicket Focus Policy

2009-02-24 Thread Scott Swank
The chief problem in constructing pages with a consistent tabindex is
that you must:

1. Know from which parent component you are basing your numbering.
2. Handle ajax insertions of of components within your current
tabindex strategy.

Our current code has edge conditions where it fails, and is on our
short list of areas where we need  a redesign.  I am happy to work
with anyone on creating a more robust solution.  Does anyone know how
or whether any other web frameworks implement a tabindex strategy?

Scott


On Mon, Feb 23, 2009 at 10:20 AM, Martin Makundi
 wrote:
> Here are some more scientific thoughts about it:
>
> http://www.mail-archive.com/wicket-u...@lists.sourceforge.net/msg26372.html
>
> 2009/2/23 alexander.elsholz :
>>
>> hi,
>>
>> where is the difference?
>>
>> yes, the html attribute tabindex helps to define a focus-policy. so i can
>> define a default policy and update the attribute with an ajax behavior.
>>
>> i think a problem is the amount of updated components, when tabindices
>> changed because of business logic. her i could play with the index range
>> 0-32767.
>>
>> i try to implement a panel-based strategy and present the result in this
>> list.
>>
>> thanks alex
>>
>>
>> Martin Makundi wrote:
>>>
>>> Do yu mean really focus or html tabindex?
>>>
>>> **
>>> Martin
>>>
>>> 2009/2/23 alexander.elsholz :

 Hi,

 had somebody implement a focuspolicy in wicket such as swings
 focustraversalpolicy?

 the policy should be analyzed in browser by default(a sorted list of
 wicket-ids) because of performance. In some cases we need business-code
 to
 evaluate next component. in this case we pass the determination via
 ajax-callback (getNextWicketComponentID) to server-business code

 Had somebody implemented this?
 Are ther some tips, how to implement this policy myself?

 thanks a lot alex
 --
 View this message in context:
 http://www.nabble.com/Wicket-Focus-Policy-tp22165578p22165578.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context: 
>> http://www.nabble.com/Wicket-Focus-Policy-tp22165578p22166754.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Anyone have idea on ofbiz framework

2009-02-13 Thread Scott Swank
http://lmgtfy.com/?q=ofbiz&l=1

On Fri, Feb 13, 2009 at 3:20 PM, Swapna Rachamalla
 wrote:
> Hi
>
> Anyone have any idea on ofbiz framework
>
> Thanks
> Swapna
>
>
>
> On Fri, Feb 13, 2009 at 10:04 AM, Igor Vaynberg 
> wrote:
>
>> in your form.onsubmit() you can check the value of the model - which
>> will give you the selected option.
>>
>> -igor
>>
>> On Fri, Feb 13, 2009 at 9:54 AM, Swapna Rachamalla
>>  wrote:
>> > Hi All
>> >
>> > I have a Radio button group For eg imagine
>> >
>> > Country:
>> >
>> >   - USA
>> >   - UK
>> >   - etc
>> >
>> > If one of the country is selected i want to write logic( if any one of
>> the
>> > option is selected.)
>> > which method i have to override for this.( For eg if we have a link then
>> we
>> > override the method onClick() and if it is a form we override onSubmit()
>> )..
>> >
>> > Thanks
>> > Swapna
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>

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



Re: What's your take on handling markup in properties, html, wicket

2009-02-13 Thread Scott Swank
We use a combination of the following for that sort of l10n/i18n.

1. 
2. A Label with a StringResourceModel, and setEscapeModelStrings(true)
3. Fragments

Scott


On Fri, Feb 13, 2009 at 8:16 AM, Warren Bell  wrote:
> Create a panel with just the markup you need and switch them out with the
> isvisible based on the current language needed? Similar to the post for "Re:
> Adding/Replacing links in Panels" by Michael Sparer below. I use
> WebMarkupContainer, but I only have two states. 14 may get a little messy
>
> Warren
>
> Mathias P.W Nilsson wrote:
>>
>> Hi,
>>
>> Just wondering how this should be handled without DRY.
>>
>> In many scenarios we have multiple languages that should have the same
>> markup but different text. This could be handled by using variation and
>> put
>> every language in an own html file like myWicketPage_style_en.html.
>>
>> However, this is not the optimal way and I don't think variation is made
>> for
>> this either. It would be very annoing having 14 different html files if we
>> have 14 different languages that we should support.
>> Sometimes the languages should look different ( not the same look.
>> Different
>> positioning of elements ) and here we could use variation. As far as I'm
>> concerned this is not the right way of handling look and feel. Different
>> css
>> should be used instead and then place position, coloring of the markup in
>> a
>> css. The html file should be the same and the css should handle the
>> layout. Take a look at  http://www.csszengarden.com/
>> http://www.csszengarden.com/
>> Every time I'm dealing with multiple languages the user wants bold,
>> italic,
>> color in the text. Many times a list will appear just containing text. (
>> Nothing to do with extracting data from database and let wicket handle it
>> )
>> This could be added in a properties file but then we would have bold tags,
>> italic and style tags in the properties file. If something should change
>> we
>> need to go thru 14 properties files to change the markup in the
>> properties.
>>
>> Let's say we have the following text in many different languages. Some
>> markup is changed so you know what I mean.
>>
>> Welcome to our companyHere is some long
>> text.some [BOLD]text[/BOLD]other text
>>
>> Now imaging this text to be very long.
>>
>> Now, my question is this. How do you handle tagged markup for different
>> languages without repeating markup tags.
>>
>> * Variation and the text in the html file.
>> * different properties file with markup in it
>> * Other technique?
>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: style/variation

2009-01-22 Thread Scott Swank
You need the entire line.  Alternately, here's the thread on nabble:

http://www.nabble.com/1.3,-resource-locator-and-properties-to16707905.html#a16707905

And here's the specific post:

http://www.nabble.com/Re:-1.3,-resource-locator-and-properties-p16845592.html


On Thu, Jan 22, 2009 at 11:47 AM, Pierre Goupil  wrote:
> Scott,
>
> I'm sorry, but the link you've sent is invalid. And I was unable to find a
> valid link with.
>
> Regards,
>
> Pierre
>
>
> On Thu, Jan 22, 2009 at 7:03 PM, Scott Swank  wrote:
>
>> Liz,
>>
>> We have completely customized the location of resources in Wicket.
>> Here's what I learned on the subject:
>>
>> http://mail-archives.apache.org/mod_mbox/wicket-users/200804.mbox/<
>> 8ee6dd5c0804221651h70660293pb505d19c2c21e...@mail.gmail.com>
>>
>> - Scott
>>
>>
>> On Thu, Jan 22, 2009 at 12:22 AM, Liz Huber  wrote:
>> > First of all: Sorry that I posted my issue so often. But as you've seen,
>> the mail body wasn't shown.
>> >
>> > Nevertheless, is anyone well versed in styles and variations?
>> >
>> > Please have a look at my last posting or
>> http://markmail.org/search/?q=liz+huber#query:liz%20huber+page:1+mid:ad6axeezpk6ktzbl+state:results
>> >
>> > Liz
>> > --
>> > Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen:
>> http://www.gmx.net/de/go/multimessenger
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> > For additional commands, e-mail: users-h...@wicket.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Sans amis était le grand maître des mondes,
> Eprouvait manque, ce pour quoi il créa les esprits,
> Miroirs bienveillants de sa béatitude.
> Mais au vrai, il ne trouva aucun égal,
> Du calice du royaume total des âmes
> Ecume jusqu'à lui l'infinité.
>
> (Schiller, "l'amitié)
>

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



Re: style/variation

2009-01-22 Thread Scott Swank
Liz,

We have completely customized the location of resources in Wicket.
Here's what I learned on the subject:

http://mail-archives.apache.org/mod_mbox/wicket-users/200804.mbox/<8ee6dd5c0804221651h70660293pb505d19c2c21e...@mail.gmail.com>

- Scott


On Thu, Jan 22, 2009 at 12:22 AM, Liz Huber  wrote:
> First of all: Sorry that I posted my issue so often. But as you've seen, the 
> mail body wasn't shown.
>
> Nevertheless, is anyone well versed in styles and variations?
>
> Please have a look at my last posting or 
> http://markmail.org/search/?q=liz+huber#query:liz%20huber+page:1+mid:ad6axeezpk6ktzbl+state:results
>
> Liz
> --
> Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
> http://www.gmx.net/de/go/multimessenger
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Plain IMG src urls

2009-01-19 Thread Scott Swank
Yes, just like that.

On Mon, Jan 19, 2009 at 9:21 AM, Igor Vaynberg  wrote:
> class simpleimage extends webmarkupcontainer {
>  protected void oncomponenttag(tag) {
>   tag.put("src", getmodelobjectasstring());
>  }
> }
>
> -igor
>
> On Mon, Jan 19, 2009 at 9:15 AM, Prag  wrote:
>>
>> I have a DB table that contains plain URL's in text like
>> http://someExternalServer/blabla/1.jpg.
>>
>> How can I put this plain text URL in a HTML IMG elements' SRC attribute
>> without Wicket making modifications to the URL?
>> --
>> View this message in context: 
>> http://www.nabble.com/Plain-IMG-src-urls-tp21547371p21547371.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Plain IMG src urls

2009-01-19 Thread Scott Swank
This is what we use.  It's mostly code that Igor posted in a response
to me 1 year ago or so...

public class StaticImage extends WebComponent
{

public StaticImage(String id, IModel model)
{
super(id, model);
}

public StaticImage(String id, String url)
{
this(id, new Model(url));
}

public StaticImage(String id)
{
super(id);
}

protected void onComponentTag(ComponentTag tag)
{
checkComponentTag(tag, "img");
super.onComponentTag(tag);
tag.put("src", getModelObjectAsString());
}

}

On Mon, Jan 19, 2009 at 9:15 AM, Prag  wrote:
>
> I have a DB table that contains plain URL's in text like
> http://someExternalServer/blabla/1.jpg.
>
> How can I put this plain text URL in a HTML IMG elements' SRC attribute
> without Wicket making modifications to the URL?
> --
> View this message in context: 
> http://www.nabble.com/Plain-IMG-src-urls-tp21547371p21547371.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Why you should not override isVisible

2009-01-16 Thread Scott Swank
Probably our model should cache the result of cart.getTotal() since
that's the expensive bit.

That said, I see value in introducing visibility caching into Wicket
core.  Others do not.  I make my case, the core developers decide, we
move on.  :)

Scott

On Fri, Jan 16, 2009 at 9:05 AM, Sven Meier  wrote:
> But the model's value is accessed by many other methods, not just
> isVisible().
> If you want to save the reflection overhead why don't you put a caching
> model between your component and the CompoundPropertyModel?
>
> Or access the model of the containing component if this is applicable:
>
> public void CartPanel(IModel cart) {
>  super(new CompoundPropertyModel(cart));
>
>  add(new Label("total") {
>   public boolean isVisible() {
> ((Cart)CartPanel.this.getModelObject()).getTotal().isPositive();
>   }
>  });
> }
>
> I still don't see the need to introduce visibility caching into Wicket core.
>
> Sven
>
>
> Scott Swank schrieb:
>>
>> That comes from a CompoundPropertyModel and is bound to "total".
>>  So getModelObject() corresponds to cart.getTotal().  From there,
>> isPositive() is quite cheap.
>>
>> And we can, of course, keep implementing ad hoc caching of visibility.
>>  It's in no way complex, however it seems preferable to have this as
>> the default behavior since only a very few components are likely to
>> want to change their visibility over the course of rendering.  Is this
>> something that could be examined in 1.4 or 1.5 or is it simply
>> inappropriate -- perhaps due to component details with which I'm
>> unfamiliar?
>>
>>
>> On Fri, Jan 16, 2009 at 12:53 AM,   wrote:
>>
>>>
>>> What's taking so long in your isVisible() method?
>>>
>>>
>>> The model object should be cached, and is isPositive() so expensive?
>>>
>>>
>>> Sven
>>>
>>>
>>>
>>>
>>>
>>>
>>> - Ursprüngliche Nachricht -
>>> Von: Scott Swank
>>> Gesendet: 16.01.09 02:06 Uhr
>>> An: users@wicket.apache.org
>>> Betreff: Re: Why you should not override isVisible
>>>
>>>
>>>
>>> We have implemented this, perhaps a dozen times or more across our
>>>
>>> application.  For example, there are several payment options whose
>>>
>>> relevance is determined by whether the customer owes any money on
>>>
>>> their purchase (e.g. as opposed to using a gift card).  These "total
>>>
>>> the order and determine visibility" methods were particular hot spots.
>>>
>>>
>>>
>>>   @Override
>>>
>>>   public boolean isVisible() {
>>>
>>>   if (visible == null)
>>>
>>>   visible = ((Money) getModelObject()).isPositive();
>>>
>>>   return visible;
>>>
>>>   }
>>>
>>>
>>>
>>> While this is an idiosyncratic example, I can vouch for the fact that
>>>
>>> performance woes in isVisible() show up in profiling.
>>>
>>>
>>>
>>> On Thu, Jan 15, 2009 at 4:56 PM, Jonathan Locke
>>>
>>>  wrote:
>>>
>>>
>>>>
>>>> oh i suppose you also need to reset the value in onBeforeRender(). it's
>>>> a
>>>>  small pain, but how often does this really become a quantifiable
>>>> problem and
>>>>  not just a worry?
>>>>  Jonathan Locke wrote:
>>>>
>>>>>
>>>>> sure, that's the clean way to do it, but it comes at the expense of
>>>>>possibly breaking user code by surprise.
>>>>>i'm not sure how big of a deal this is. i've heard people talk
>>>>> about it,
>>>>>but i'd be interested in some examples of how performance of
>>>>> this method
>>>>>has been a problem for people. i've never run into it myself and
>>>>> if i did
>>>>>see it in a profiler, i'd probably just cache the value in a
>>>>> Boolean. it's
>>>>>literally just this little bit in your anonymous class:
>>>>>Boolean visible = null;
>>>>>public isVisible() {
>>>>>if (visible == null) {
>>>>>visible = // whatever boolean comput

Re: Re: Why you should not override isVisible

2009-01-16 Thread Scott Swank
That comes from a CompoundPropertyModel and is bound to "total".
 So getModelObject() corresponds to cart.getTotal().  From there,
isPositive() is quite cheap.

And we can, of course, keep implementing ad hoc caching of visibility.
 It's in no way complex, however it seems preferable to have this as
the default behavior since only a very few components are likely to
want to change their visibility over the course of rendering.  Is this
something that could be examined in 1.4 or 1.5 or is it simply
inappropriate -- perhaps due to component details with which I'm
unfamiliar?


On Fri, Jan 16, 2009 at 12:53 AM,   wrote:
>
>
>
> What's taking so long in your isVisible() method?
>
>
> The model object should be cached, and is isPositive() so expensive?
>
>
> Sven
>
>
>
>
>
>
> - Ursprüngliche Nachricht -
> Von: Scott Swank
> Gesendet: 16.01.09 02:06 Uhr
> An: users@wicket.apache.org
> Betreff: Re: Why you should not override isVisible
>
>
>
> We have implemented this, perhaps a dozen times or more across our
>
> application.  For example, there are several payment options whose
>
> relevance is determined by whether the customer owes any money on
>
> their purchase (e.g. as opposed to using a gift card).  These "total
>
> the order and determine visibility" methods were particular hot spots.
>
>
>
>@Override
>
>public boolean isVisible() {
>
>if (visible == null)
>
>visible = ((Money) getModelObject()).isPositive();
>
>return visible;
>
>}
>
>
>
> While this is an idiosyncratic example, I can vouch for the fact that
>
> performance woes in isVisible() show up in profiling.
>
>
>
> On Thu, Jan 15, 2009 at 4:56 PM, Jonathan Locke
>
>  wrote:
>
>>
>
>>
>
>> oh i suppose you also need to reset the value in onBeforeRender(). it's a
>
>> small pain, but how often does this really become a quantifiable problem and
>
>> not just a worry?
>
>>
>
>>
>
>> Jonathan Locke wrote:
>
>>>
>
>>>
>
>>> sure, that's the clean way to do it, but it comes at the expense of
>
>>> possibly breaking user code by surprise.
>
>>>
>
>>> i'm not sure how big of a deal this is. i've heard people talk about it,
>
>>> but i'd be interested in some examples of how performance of this method
>
>>> has been a problem for people. i've never run into it myself and if i did
>
>>> see it in a profiler, i'd probably just cache the value in a Boolean. it's
>
>>> literally just this little bit in your anonymous class:
>
>>>
>
>>> Boolean visible = null;
>
>>> public isVisible() {
>
>>> if (visible == null) {
>
>>> visible = // whatever boolean computation
>
>>> }
>
>>> return visible;
>
>>> }
>
>>>
>
>>> and then it disappears from the profiler and who cares about the rest.
>
>>>
>
>>>
>
>>> Scott Swank wrote:
>
>>>>
>
>>>> My idea what an inversion of that one:
>
>>>>
>
>>>> Add a method to Component, such as isVisibleInternal() [no I don't
>
>>>> love the name] that would cache the results of isVisible().  Then all
>
>>>> code that currently calls isVisible() would be changed to call
>
>>>> isVisibleInternal() instead.  Someone who really wanted non-cached
>
>>>> visibility (seemingly the 1% case) could override isVisibleInternal(),
>
>>>> but everyone else would get caching for free with their current code.
>
>>>>
>
>>>> On Thu, Jan 15, 2009 at 2:35 PM, Jonathan Locke
>
>>>>  wrote:
>
>>>>>
>
>>>>>
>
>>>>> well, one simple design that would avoid the reuse problem is:
>
>>>>>
>
>>>>> Boolean Component#isCachedVisible() { return null; }
>
>>>>>
>
>>>>> then override to use visibility caching and return true or false.
>
>>>>> if you don't override you get the current functionality.
>
>>>>> of course you need two more bits in Component to support this...
>
>>>>> one for whether isCachedVisible returned non-null and another
>
>>>>> for the value it returned.
>
>>>>>
>
>>>>
>
>>>> -
>
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>
>>>>
>
>>>>
>
>>>>
>
>>>
>
>>>
>
>>
>
>> --
>
>> View this message in context: 
>> http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21490479.html
>
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>>
>
>>
>
>> -
>
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>
>> For additional commands, e-mail: users-h...@wicket.apache.org
>
>>
>
>>
>
>
>
> -
>
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
>
>
>

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



Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
We have implemented this, perhaps a dozen times or more across our
application.  For example, there are several payment options whose
relevance is determined by whether the customer owes any money on
their purchase (e.g. as opposed to using a gift card).  These "total
the order and determine visibility" methods were particular hot spots.

@Override
public boolean isVisible() {
if (visible == null)
visible = ((Money) getModelObject()).isPositive();
return visible;
}

While this is an idiosyncratic example, I can vouch for the fact that
performance woes in isVisible() show up in profiling.

On Thu, Jan 15, 2009 at 4:56 PM, Jonathan Locke
 wrote:
>
>
> oh i suppose you also need to reset the value in onBeforeRender(). it's a
> small pain, but how often does this really become a quantifiable problem and
> not just a worry?
>
>
> Jonathan Locke wrote:
>>
>>
>> sure, that's the clean way to do it, but it comes at the expense of
>> possibly breaking user code by surprise.
>>
>> i'm not sure how big of a deal this is. i've heard people talk about it,
>> but i'd be interested in some examples of how performance of this method
>> has been a problem for people. i've never run into it myself and if i did
>> see it in a profiler, i'd probably just cache the value in a Boolean. it's
>> literally just this little bit in your anonymous class:
>>
>> Boolean visible = null;
>> public isVisible() {
>> if (visible == null) {
>> visible = // whatever boolean computation
>> }
>> return visible;
>> }
>>
>> and then it disappears from the profiler and who cares about the rest.
>>
>>
>> Scott Swank wrote:
>>>
>>> My idea what an inversion of that one:
>>>
>>> Add a method to Component, such as isVisibleInternal() [no I don't
>>> love the name] that would cache the results of isVisible().  Then all
>>> code that currently calls isVisible() would be changed to call
>>> isVisibleInternal() instead.  Someone who really wanted non-cached
>>> visibility (seemingly the 1% case) could override isVisibleInternal(),
>>> but everyone else would get caching for free with their current code.
>>>
>>> On Thu, Jan 15, 2009 at 2:35 PM, Jonathan Locke
>>>  wrote:
>>>>
>>>>
>>>> well, one simple design that would avoid the reuse problem is:
>>>>
>>>> Boolean Component#isCachedVisible() { return null; }
>>>>
>>>> then override to use visibility caching and return true or false.
>>>> if you don't override you get the current functionality.
>>>> of course you need two more bits in Component to support this...
>>>> one for whether isCachedVisible returned non-null and another
>>>> for the value it returned.
>>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21490479.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
My idea what an inversion of that one:

Add a method to Component, such as isVisibleInternal() [no I don't
love the name] that would cache the results of isVisible().  Then all
code that currently calls isVisible() would be changed to call
isVisibleInternal() instead.  Someone who really wanted non-cached
visibility (seemingly the 1% case) could override isVisibleInternal(),
but everyone else would get caching for free with their current code.

On Thu, Jan 15, 2009 at 2:35 PM, Jonathan Locke
 wrote:
>
>
> well, one simple design that would avoid the reuse problem is:
>
> Boolean Component#isCachedVisible() { return null; }
>
> then override to use visibility caching and return true or false.
> if you don't override you get the current functionality.
> of course you need two more bits in Component to support this...
> one for whether isCachedVisible returned non-null and another
> for the value it returned.
>

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



Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
Is there a reason why the default behavior is not to cache the result
of isVisible()?  Are there cases where the result of isVisible() is
expected to change over the course of rendering?

Would a JIRA w/ code be welcome, or is the current behavior required?

Scott

On Thu, Jan 15, 2009 at 10:23 AM, Jonathan Locke
 wrote:
>
>
> I would be careful not to throw the baby out with the bath water here. The
> design decision you're making is push versus pull and implementing isVisible
> is often going to be a better design decision because it may be more clear
> that visibility state stays consistent for a given problem. If the
> performance actually shows up as a hotspot (don't prematurely optimize!),
> you can always do some appropriate caching of the value and still have it
> "pulled".
>
>
> Erik van Oosten wrote:
>>
>> In the thread "Where to process PageParameters" I was requested to
>> explain why I think you should not override isVisible, but rather should
>> call setVisible in onBeforeRender (slide 100 in my presentation
>> http://www.grons.nl/~erik/pub/20081112%20Effective%20Wicket.pdf).
>>
>> There are 2 reasons, but only the second one is really important.
>>
>> -1- isVisible is called a lot. It is easily called ten times within 1
>> request
>>
>> So if you have anything processor intensive going on, it will be a
>> performance hit. Just doing a simple expression is of course no problem.
>> (For fun, just set a breakpoint in something like
>> FeedbackPanel#isVisible and request a page that contains one.)
>>
>> -2- isVisible can make your model be reloaded multiple times within 1
>> request
>>
>> Consider the following case (pseudo code):
>>
>>   MyPanel(id, personId) {
>>  super(id, new CompoundPropertyModel(new
>> LoadableDetachablePersonModel(personId)));
>>  add( new Label("address") {
>>  @Override
>>  isVisible() {
>>  return getDefaultModel() != null;
>>  }
>>  });
>>   }
>>
>>
>> The label uses the property 'address' of a person to see if the label
>> should be visible. The person is retrieved by a LoadableDetachableModel
>> subclass (LDM) and then wrapped by a CompoundPropertyModel (CPM).
>>
>> During the render phase, isVisible will delegate getting the address
>> property to the CPM and this model delegates it to the LDM. LDM will
>> load the person from the database only once (well until it is detached).
>>
>> At the end of the render phase everything will be detached. But now
>> something weird happens. The problem is that isVisible is called during
>> the detach phase, on the label /after/ the CPM (and therefore also the
>> LDM) are detached. As isVisible retrieves the model from the CPM, and
>> therefore from the LDM, it will trigger a reload of the person inside
>> the LDM.
>>
>> Now, as visibility is often (if not almost always) determined by a
>> business object (e.g. very often a LDM) I think it makes sense to avoid
>> having to think about the situation described above, and just avoid it
>> all together.
>>
>> Note: I observed this behavior in Wicket 1.3 (1.3.3 I think). If it
>> works differently now, I would be very glad to withdraw this
>> recommendation.
>>
>> Regards,
>>  Erik.
>>
>> --
>> Erik van Oosten
>> http://day-to-day-stuff.blogspot.com/
>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Why-you-should-not-override-isVisible-tp21474995p21483816.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Why you should not override isVisible

2009-01-15 Thread Scott Swank
We have done exact that -- a lot.  Driving isVisible() from the state
of the model is very clean, but the performance is potentially awful.
I have wondered whether this should be the default implementation for
Component.isVisible().

Is IVisitor.beforeRender() an appropriate place in the rendering cycle
to make the determination -- i.e.

public abstract class Visibility extends AbstractBehavior {
@Override
public void beforeRender(Component c) {
c.setVisible(isVisible());
}

public abstract boolean isVisible();
}

On Thu, Jan 15, 2009 at 2:45 AM, Martin Makundi
 wrote:
>> -1- isVisible is called a lot. It is easily called ten times within 1
>> request
>
> If you need to optimize, you can use lazy initialization of a boolean
> variable here and reset it in onBeforeRender?
>
>> -2- isVisible can make your model be reloaded multiple times within 1
>> request
>
> If you need to optimize, you can use lazy initialization of a boolean
> variable here and reset it in onBeforeRender?
>
> I consider overriding isVisible a more clean OO approach. Using
> setVisible results in messy non transparent chain of command.
>
> **
> Martin
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Advice on payment options with wicket

2009-01-14 Thread Scott Swank
Have you considered HttpClient?

http://hc.apache.org/httpclient-3.x/

Scott


On Wed, Jan 14, 2009 at 8:44 AM, Mathias P.W Nilsson
 wrote:
>
> The main problem is the external form. I need to send the form to an external
> server. Since I need wicket to check the form first I need a wicket form and
> then a plain html form. The form is submitted when all the data is checked.
> Since there is 10 different forms the webpage get's cluttered. Is there a
> way to make external form from wicket?
> --
> View this message in context: 
> http://www.nabble.com/Advice-on-payment-options-with-wicket-tp21452753p21459848.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Extending to all components

2009-01-06 Thread Scott Swank
Since get() is a static method there is no relationship (i.e.
overriding) between MySession.get() and Session.get().  Hence you do
not even need Java 5.


On Tue, Jan 6, 2009 at 10:25 AM, James Carman
 wrote:
> You don't need a helper if you do what Mr. Swank recommended.  With
> JDK5, you can have covariant return types.  So, just set up a new
> get() method that returns your exact session type.
>
> On Tue, Jan 6, 2009 at 1:11 PM, Per Newgro  wrote:
>> If i'm not completly wrong there is a Session.get(). You could write a
>> Helper which is casting that session instance. So you could use it
>> everywhere you want.
>>
>> SessionConverter.java
>> public static MySession getConverted() {
>>  return (MySession) Session.get();
>> }
>>
>> and in component where you want to access it
>> MySession s = SessionConverter.getConverted();
>>
>> Only an idea.
>> Cheers
>> Per
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Extending to all components

2009-01-06 Thread Scott Swank
We added the following to our Session:

public static final MySession get() {
return (MySession) Session.get();
}

And then we just call MySession.get() instead of calling getSession().

Scott


On Tue, Jan 6, 2009 at 9:59 AM, Dane Laverty  wrote:
> Is there an easy way to add/override a function to all my Wicket classes
> (panels, pages, forms, etc.)? For example, I have a custom session.
> Rather than having to cast (MySession)getSession() , I just want
> getSession() to return a MySession. Two solutions come to mind, but
> neither seems optimal.
>
>
>
> First, I could create a MyPanel for all my panels to extend, a MyPage
> for all my pages to extend, etc. and have MyPanel and MyPage override
> getSession(). However, that means a lot of duplicated code.
>
>
>
> Second, I could update the Wicket source code, which would be quick and
> easy, but then make upgrading Wicket difficult.
>
>
>
> Is there a simple Java solution that allows me to change/add function
> definitions into existing inheritance hierarchies?
>
>

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



Re: Twenty Six Wicket Tricks

2008-12-30 Thread Scott Swank
Thanks Nino.  The problem is that there isn't any place on the wiki
that pulls all of this together.  Consequently I've seen aspects of
this asked several times on the list.

If I don't hear anything to the contrary, I'll assume that this
material is in fact missing from the wiki and I'll add it.  This is
the best info I'm aware of on these components (excepting the good
coverage of DropDownChoice on the wiki):

http://www.wicket-library.com/wicket-examples/forminput/

Oh, and in my first pass I missed

CheckBoxMultipleChoice.
Select (from extensions)

Scott


On Tue, Dec 30, 2008 at 11:08 AM, Nino Martinez
 wrote:
> Check = detailed control of each check (you have to iterate over them to add
> more than one forexample in a listview)
> CheckBox = list of checks (not same as above)
> CheckGroup = Holds the model for checks
>
> Repeat above for radios.
>
> Dropdown = simple component
>
> There are also some ajax versions of above...
>
> It might just be me that have become blind to these things :) Of all the
> frameworks I work with, be it web, orm, log etc Wicket brings me the least
> trouble :)
>
>
> Happy new year :)
>
>
>
>
> Scott Swank wrote:
>>
>> Jonathan,
>>
>> I think that Wicket is missing a solid overview of the below form
>> components, how they differ, how they overlap, and when to use each.
>>
>> Check, Checkbox, CheckGroup, CheckGroupSelector
>> DropDownChoice (there are 3 wiki pages, but I'd like to draw out the
>> overlap with RadioChoice and the role of IChoiceRenderer)
>> Radio, RadioChoice, RadioGroup
>>
>> And of course: IChoiceRenderer.
>>
>> For example, I really don't know whether my above list is missing any
>> components.
>>
>> If such a topic is not in the works for your book, I'll volunteer to
>> put together a first pass at such a wiki page.
>>
>> Cheers,
>> Scott
>>
>>
>>
>>>>
>>>> On Tue, Dec 30, 2008 at 10:32 AM, Jonathan Locke
>>>> wrote:
>>>>
>>>>
>>>>>
>>>>> Well, over the break here I've started something I swore I would never
>>>>> do
>>>>> again (well, two things, if you include the JavaOne talk I'm working
>>>>> on).
>>>>> I'm writing a (hopefully relatively short) book. It's called
>>>>> "Twenty-Six
>>>>> Wicket Tricks". Each trick in the book (lettered from A-Z) demonstrates
>>>>> something that people typically want to do and in the process builds a
>>>>> reusable and educational component. I've got 13 tricks coded up now and
>>>>> ideas for a handful more, but if there are any requests out there,
>>>>> please
>>>>> let me know. I'd also be interested in getting some idea how many
>>>>> people
>>>>> would be interested in this book (would provide some fuel for me to get
>>>>> it
>>>>> done). It does not cover any of the same ground as Wicket in Action
>>>>> (which
>>>>> you should buy if you have not already!), BTW. It's more of a companion
>>>>> to
>>>>> that book.
>>>>>
>>>>> Happy Holidays!
>>>>>
>>>>> Best,
>>>>>
>>>>>  Jonathan
>>>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Twenty Six Wicket Tricks

2008-12-30 Thread Scott Swank
Jonathan,

I think that Wicket is missing a solid overview of the below form
components, how they differ, how they overlap, and when to use each.

Check, Checkbox, CheckGroup, CheckGroupSelector
DropDownChoice (there are 3 wiki pages, but I'd like to draw out the
overlap with RadioChoice and the role of IChoiceRenderer)
Radio, RadioChoice, RadioGroup

And of course: IChoiceRenderer.

For example, I really don't know whether my above list is missing any
components.

If such a topic is not in the works for your book, I'll volunteer to
put together a first pass at such a wiki page.

Cheers,
Scott


>> On Tue, Dec 30, 2008 at 10:32 AM, Jonathan Locke
>> wrote:
>>
>>>
>>> Well, over the break here I've started something I swore I would never do
>>> again (well, two things, if you include the JavaOne talk I'm working on).
>>> I'm writing a (hopefully relatively short) book. It's called "Twenty-Six
>>> Wicket Tricks". Each trick in the book (lettered from A-Z) demonstrates
>>> something that people typically want to do and in the process builds a
>>> reusable and educational component. I've got 13 tricks coded up now and
>>> ideas for a handful more, but if there are any requests out there, please
>>> let me know. I'd also be interested in getting some idea how many people
>>> would be interested in this book (would provide some fuel for me to get
>>> it
>>> done). It does not cover any of the same ground as Wicket in Action
>>> (which
>>> you should buy if you have not already!), BTW. It's more of a companion
>>> to
>>> that book.
>>>
>>> Happy Holidays!
>>>
>>> Best,
>>>
>>>   Jonathan

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



Re: Default Focus Behavior?

2008-12-29 Thread Scott Swank
Jonathan,

Have you considered O'Reilly's "Cookbook" series?  I've done some tech
review for them over the years, though not recently.  E-mail me
directly if you'd like a potentially dated contact.  :)

Scott


On Sun, Dec 28, 2008 at 9:26 AM, Jonathan Locke
 wrote:
>
>
> I have a really elegant solution to this problem that is general enough to
> go in core or extensions eventually (solves all of the above problems).
>
> Actually, I'm putting together a short, but action-packed book called
> "Twenty-Six Wicket Tricks" and the code for this problem is going to be
> trick "F" (i'm halfway through the alphabet already). If anyone really
> desperately wants this and they promise to give me feedback on it, they can
> email me.
>
>
> Antony Stubbs wrote:
>>
>> Why not put this code into Wicket?
>>
>>
>> jwcarman wrote:
>>>
>>> On 3/11/08, Martijn Dashorst  wrote:
 I suggest wiki.

>>>
>>> Done:
>>>
>>> http://cwiki.apache.org/confluence/display/WICKET/Request+Focus+on+a+Specific+Form+Component
>>>
>>> I'm happy now.  My work (no matter how trivial) may help someone
>>> someday! :)  I don't have time to do so now, but I might add in some
>>> examples on how to do focus on errors, etc.
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Default-Focus-Behavior--tp15934889p21194288.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Participating in Wicket

2008-12-17 Thread Scott Swank
I found this helpful.

http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html

Scott


On Wed, Dec 17, 2008 at 2:38 AM, HHB  wrote:
>
> Thanks Martijn
> How do you suggest to start studying Wicket core code (I don't mean getting
> the source code :) )?
> It is complicated to study and grasp?
> Thanks again.
>
>
> Martijn Dashorst wrote:
>>
>> Look at jira issues, fix them, create a patch and attach it to the
>> jira issue. When we like your code and are tired of applying the fixes
>> for you, you might be proposed to become a committer yourself.
>>
>> Valuable info:
>>
>> http://apache.org/dev/contributors.html#patches
>>
>> Martijn
>>
>> On Wed, Dec 17, 2008 at 11:13 AM, HHB  wrote:
>>>
>>> Hey,
>>> I really have a great passion toward Wicket framework and I really want
>>> to
>>> participate with their core developer teams.
>>> My problem is that this framework has really great and passion developers
>>> and I can't imagine myself trying to join them (nor they will accept, I
>>> think) not to mention this great community.
>>> What do you suggest me to do?
>>> Thanks for your time.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Participating-in-Wicket-tp21050410p21050410.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.com
>> Apache Wicket 1.3.4 is released
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Participating-in-Wicket-tp21050410p21050753.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Another Ajax back button question

2008-12-04 Thread Scott Swank
If the ajax changes are reflected in the relevant model(s) then you
will see them when you go back to the page.

Scott


On Thu, Dec 4, 2008 at 2:29 PM, Matt Welch <[EMAIL PROTECTED]> wrote:
>
> I'm sure this has been asked and answered but after searching the list, I'm
> still not sure if there is something I can do to fix my situation.
>
> The general gist is this:
>
> 1) I make some changes to a page with ajax calls (i.e. replace panel
> contents)
> 2) Click a link to take me away from that page
> 3) Use browser back button to return to previous page
> 4) Original page is in the state that it was BEFORE the changes made with
> the ajax calls.
>
> Maybe this is a, "Well, duh.. of course it is. That's just the way it works"
> moment, but I could have sworn I've seen this work differently in other
> wicket examples and apps I've worked on.
>
> Any tips?
>
> -Matt
>
> --
> View this message in context: 
> http://www.nabble.com/Another-Ajax-back-button-question-tp20843893p20843893.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: Render a Wicket page to a string for HTML email

2008-11-06 Thread Scott Swank
Ours is running in a separate, non-Wicket process that just generates
and sends e-mail, so there's nothing to step on.  But otherwise yes,
you would want to protect your ThreadLocal.

On Thu, Nov 6, 2008 at 4:52 PM, cjlyth <[EMAIL PROTECTED]> wrote:
>
> Yeah this is about the same, I think you would still have to do it in its own
> thread.
>
>try {
>return Executors.newSingleThreadExecutor().submit(
>new Callable() {
>public String call() throws 
> Exception {
>return new 
> PageRenderer().render(pageClass, pageParameters);
>}
>}).get();
>} catch (InterruptedException e) {
>throw new WicketRuntimeException(e.getMessage(), e);
>} catch (ExecutionException e) {
>throw new WicketRuntimeException(e.getMessage(), e);
>}
>
> I think its also worth mentioning that Anatoly Kupriyanov has a template
> implementation that might solve this problem. However, I like the simpler
> approach in this thread.
> http://cwiki.apache.org/confluence/display/WICKET/Use+wicket+as+template+engine
>
>
>
> Scott Swank wrote:
>>
>> Here is a largely equivalent class that I created.  It simply extends
>> BaseWicketTester.
>> ...
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Render-a-Wicket-page-to-a-string-for-HTML-email-tp20325702p20372800.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: Render a Wicket page to a string for HTML email

2008-11-06 Thread Scott Swank
Here is a largely equivalent class that I created.  It simply extends
BaseWicketTester.

public class PageRenderer extends BaseWicketTester {
private final Locale locale;

public PageRenderer(Locale locale) {
this.locale = locale;
}

public PageRenderer() {
this.locale = null;
}

private String renderStartPage() {
if (this.locale != null) {
getWicketSession().setLocale(locale);
}

return getServletResponse().getDocument();
}

public synchronized String render(Class pageClass) {
startPage(pageClass);
return renderStartPage();
}

public synchronized String render(Class pageClass,
PageParameters parameters) {
startPage(pageClass, parameters);
return renderStartPage();
}

public synchronized String render(WebPage page) {
startPage(page);
return renderStartPage();
}

}

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



Re: Moving from Tapestry to Wicket?

2008-10-31 Thread Scott Swank
Regarding session state, you really have basic options.  State is kept
in implementations of IModel.

1. Model is just a holder for an object.  If you use it then your
object is in your session.
2. LoadableDetachableModel stores an id (or whatever) and retrieves
the relevant object from your repository.

So you're back to the basic tradeoff: memory vs. i/o.

Scott


On Fri, Oct 31, 2008 at 5:02 AM, Nino Saturnino Martinez Vazquez Wael
<[EMAIL PROTECTED]> wrote:
> Regarding scalability. If you stick to using loadable detachable models and
> use terracotta, I've heard thats a good option?
>
>
> And no defiantly the automatic handling of state are have never been a
> problem for me, you just need to remember that things can be serialized at
> times, but the serializable checker will remind you if somethings not
> serializable, and then you have a heads up.
>
> GK1971 wrote:
>>
>> Hi.
>>
>> Thank you all for your input. Very valuable. I started reading Wicket In
>> Action last night and I like how the book is written - very much. It has
>> the
>> right explanations in the right places. So, I'm becoming convinced to try
>> it. But I have concerns around the handling of state. I understand this is
>> probably where people do have concerns and I know I am not the first to
>> ask.
>>
>> I want to imagine myself in a position where I have a fairly rich web
>> application that is publically available on the web, where people can join
>> by invitation and have a great user experience. All this may take some
>> state. Everyone talks about the RESTful model these days but I'm not
>> convinced thats either new or wise all of the time. What it does allow you
>> is easy scalability.
>>
>> What are the best ways to scale a Wicket built application across multiple
>> servers? I'm assuming Layer 7 load balancers. With bigger state stored (is
>> that true?) than an average web app that may mean less users concurrently
>> per server, but of course you can add more servers.
>>
>> Does anyone have any experience with this? Has this automatic handling of
>> state ever been an issue for anyone?
>> Thanks, Graeme.
>>
>>
>> Martin Voigt wrote:
>>
>>>
>>> while I haven't migrated any big app from tapestry to wicket (but i
>>> know tapestry nonetheless), the number one reason to do so would be
>>> (at least for me) this: wicket is driven by usability (from the
>>> developers pov) and tapestry is driven by technology. while one does
>>> not exclude the other, wicket's approach is the better one. i've seen
>>> java web frameworks come and go, and i watched wicket's progress for
>>> ages now, and wicket still get's easier to use with each version while
>>> advancing in terms of technology where it makes sense.
>>>
>>> and for the concern about scalability, wicket goes the easy road: more
>>> load? add some servers and go with the standard apache plus mod-jk
>>> session sticky thingy or whatever is you load balancer of choice.
>>>
>>> but the main reason still would be the developer-friendliness of
>>> wicket, cos most things are too easy to believe, i18n for example, or
>>> the serving of error pages. I'm not writing this because I get
>>> something from promoting wicket, but I did several projects migrating
>>> to wicket or using it from scratch, and it really delivers what it
>>> promises.  it made me like java again ;)
>>>
>>> Regardsm
>>> Martin
>>>
>>>
>>> 2008/10/30 GK1971 <[EMAIL PROTECTED]>:
>>>

 Hi.

 You are possibly correct. My main concern is that I have to upgrade from
 Tapestry 4 to... something. Given that Tapestry 5 is not compatible in
 the
 least I have allowed myself to look at the options.

 I guess I am really asking for reasons to move from Tapestry to Wicket -
 particularlu if anyone has any experience of doing this which they could
 share. What were those reasons, and pros/cons after sampling both
 solutions.

 Thanks for pointing out that I was not clear.


 Daniel Frisk wrote:

>
> I actually read your mail but I didn't quite get it, what is your main
> concern?
> It seems to me like Wicket would be a perfect fit to your four
> criteria.
>
> // Daniel
> jalbum.net
>
>
> On 2008-10-30, at 21:05, GK1971 wrote:
>
>
>>
>> Hi. I hope this email is appropriate for the forum - its my first time
>> posting.
>>
>> My partner and I are in the process of working on a site that
>> currently uses
>> Tapestry 4 and must be reasonably scalable vertically (we have
>> horizontally
>> covered in a road map). I am looking around at technologies that we
>> can
>> pursue in the future that will provide us with a way of creating a
>> wonderful
>> experience for a user based on dynamic content with Java as a base
>> language.
>>
>> I have used Tapestry 3 and 4 in prior lives in prior companies and as
>> Tapestry 5 was still early a year ago when

Re: Using wicket to create html (in replace of velocity templates)

2008-10-29 Thread Scott Swank
Have you seen:

http://cwiki.apache.org/confluence/display/WICKET/FAQs#FAQs-HowcanIrendermytemplatestoaString%3F

Scott


On Wed, Oct 29, 2008 at 3:58 PM, fatefree <[EMAIL PROTECTED]> wrote:
>
> I was working on a velocity template and came into some internationalization
> problems, when I realized it would be great if I could just use wicket to do
> this. After all, its practically doing the same thing, merging some model
> object into an html output.
>
> Ideally i'd love to use stateless page classes, and using the traditional
> html with all of wickets localization support, and call up some method that
> returns the html output of the rendered page. I was told to look into the
> WicketTester as it seems to do what I am looking for, however I was unable
> to instantiate it within my own running application (and I imagine it wasn't
> meant to be used that way to begin with).
>
> Is there any way I can hook into the render process and get the rendered
> html for a page? Is anyone else interested in this idea or maybe tried
> something similar?
>
> Edit - I forgot to mention the intent of all this was to get html that I
> could use as an e-mail body text.
> --
> View this message in context: 
> http://www.nabble.com/Using-wicket-to-create-html-%28in-replace-of-velocity-templates%29-tp20237644p20237644.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 and URLs

2008-10-28 Thread Scott Swank
Those will be available to you in the YourPage(PageParameters
parameters) constructor.

On Tue, Oct 28, 2008 at 5:08 PM, S D <[EMAIL PROTECTED]> wrote:
>
> But what if the URL is "dynamic" like, for example, is this google URL that 
> points to the second page of results:
>
> http://www.google.com/search?hl=en&q=wicket&start=10&sa=N
>
> Thanks
>
> --- On Tue, 10/28/08, Scott Swank <[EMAIL PROTECTED]> wrote:
>
>> One option is to define urls in your application:
>>
>>mountBookmarkablePage("/Tour",
>> TourBrowsePage.class);
>>
>>
>> On Tue, Oct 28, 2008 at 4:03 PM, S D
>> <[EMAIL PROTECTED]> wrote:
>> >
>> > Hi,
>> >
>> > I was browsing through examples, it looks very
>> impressive but there's a thing that bothers me somewhat.
>> The Basic Label example uses the following URL:
>> >
>> >
>> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>> >
>> > The problem with that is that we'd like to have an
>> appearance of a technology neutral site (or at least not to
>> be blatant about it) but Jsessionid and especially
>> wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>> > destroy that impression completely.
>> >
>> > I understand it's possible to remove Jsessionid
>> from URL but what about Wicket's contribution to the
>> URL? We'd like to keep our URLs as clean and readable as
>> possible.
>> >
>> > Thanks
>
>
>
>
>
>
> -
> 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 and URLs

2008-10-28 Thread Scott Swank
One option is to define urls in your application:

   mountBookmarkablePage("/Tour", TourBrowsePage.class);

On Tue, Oct 28, 2008 at 4:03 PM, S D <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I was browsing through examples, it looks very impressive but there's a thing 
> that bothers me somewhat. The Basic Label example uses the following URL:
>
> http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
>
> The problem with that is that we'd like to have an appearance of a technology 
> neutral site (or at least not to be blatant about it) but Jsessionid and 
> especially 
> wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage
> destroy that impression completely.
>
> I understand it's possible to remove Jsessionid from URL but what about 
> Wicket's contribution to the URL? We'd like to keep our URLs as clean and 
> readable as possible.
>
> Thanks
>
>
>
>
>
>
>
> -
> 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: setObject( ), getObject( )

2008-10-21 Thread Scott Swank
However setObject() doesn't work as well on AbstractReadOnlyModel as
it does on Model, which is particularly important for immutable
backing objects such as Strings.

On Tue, Oct 21, 2008 at 2:35 AM, Johan Compagner <[EMAIL PROTECTED]> wrote:
> we have also AbstractReadOnlyModel for that
> so igor are you sure you dont want to have Model final? :)
>
>
> On Mon, Oct 20, 2008 at 5:02 PM, Igor Vaynberg <[EMAIL PROTECTED]>wrote:
>
>> whenever there is something nonfinal people will always find a way to
>> misuse it.
>>
>> model methods are not final because it gives you a simple base class
>> to subclass instead of starting from scratch with an imodel.
>>
>> -igor
>>
>> On Mon, Oct 20, 2008 at 6:37 AM, Ricky <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> >
>> > Is there any reason getObject and setObject were not made final in Model
>> > class? the reason why i am asking is that there might be the case when
>> > people misuse this; for example (and i have seen this at my current
>> > workplace);
>> >
>> >Model xModel = new Model(new Long(1)) {
>> >
>> >@Override
>> >public Object getObject() {
>> >// return super.getObject(); <-- not calling this, instead
>> i
>> > return null
>> >return null;
>> >}
>> >};
>> >
>> >// some lines afterwards ... i need this model ... i use it
>> > (expecting to get back object i set)
>> >// instead i get null. Original intent was to set object passed in
>> > and get the same thing ...
>> >System.out.println(xModel.getObject());
>> >
>> > Here i get null as the result.
>> >
>> > Any suggestions?
>> >
>> > Regards
>> > Vyas, Anirudh
>> >
>>
>> -
>> 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]



  1   2   3   >