Re: Migration to wicket 1.5 and properties.xml files

2012-04-30 Thread Sven Meier
You can use a custom IPropertiesFactory or adjust the default one, see 
PropertiesFactory#getPropertiesLoaders().


Sven

On 04/30/2012 07:44 AM, jensiator wrote:

Hi everyone.
I'm late out with migration. And I have a problem. We got a big system using
wicket.
The .xml change to .properties.xml could be painful. I could just rename all
xml files so I can reach the pages to check if some migration features has
been successful. But the check on the migration might take some time and
this is a big project. I would like to be at update with the rest of the
code on the project and I have bad experience with SVN and renamed files. Is
it anyway to make wicket 1.5 load the old *.xml property files? Only
temporarily.
Jens

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migration-to-wicket-1-5-and-properties-xml-files-tp4597473.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



Setting value to object when validation failed

2012-04-30 Thread meduolis
Hello this is quick start project which reproduces my case
http://apache-wicket.1842946.n4.nabble.com/file/n4597599/project.zip
project.zip 

The problem is, that I cannot set value for object after form validation
fails.

How to reproduce:
1. Startup my quicstart app;
2. Do not fill required field and press Save;
4. Validation error occurs, that field is required;
3. Press Set name; (this should set first name to John Doe and refresh);

Expected result: input field sets to John Doe;

Actual result: nothing happens;

Does anyone knows what I am doing wrong? :)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-value-to-object-when-validation-failed-tp4597599.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



Elephas Blog Engine: how to setup a test repo

2012-04-30 Thread datazuul
This weekend I had a look into the wicket based Elephas Blog Engine
(http://code.google.com/p/elephas/).
I updated it to the latest stable 1.4.20 version and tried to fire it up
with the included StartElephas class.

After fixing some missing properties-file and defining JCR credentials I got
stuck because of not having a jackrabbit repository (repository.xml) at the
(by me) defined location.

I just wanted to fire up and see how the blog looks like.
So how to get an empty Blog up and running?
How to create a new blog with users?
Can it be run without a jackrabbit repository with some flatfiles or just
database?

The last commits were 2008, so I am aware of it being not so wide spreaded.
But I hope that some guys who worked on it are still around here... ;-)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Elephas-Blog-Engine-how-to-setup-a-test-repo-tp4597689.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



Re: Elephas Blog Engine: how to setup a test repo

2012-04-30 Thread meduolis
I believe that this is not the right place to ask for Elephas engine howto :)

This discussion board is for Elephas  http://groups.google.com/group/elephas
http://groups.google.com/group/elephas  :D

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Elephas-Blog-Engine-how-to-setup-a-test-repo-tp4597689p4597714.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



call onsubmit automatically

2012-04-30 Thread raju.ch
Hi, 
I want to POST some data to a URL which internally redirects to a Page based
on the POSTed params, for this I'm trying to do auto form submission but how
to do it in wicket 1.4 or if you know other way which suits my requirement
please let me know.

In javascript, we can do like this , but how to do it wicket 1.4. Please
suggest.

/head
body onload=submitTheForm();

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/call-onsubmit-automatically-tp4597765.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



Re: call onsubmit automatically

2012-04-30 Thread Sebastien
If you are have a Form (a wicket one) inside a Page, then you can do your
'submitTheForm()', because a simple 'submit()' suffice to post the form.
If your 'page' parameter you want to retrieve is bound to an Wicket
FormComponent (even an HiddenField), then you can retrieve it server side
and do a setResponsePage; you just have to get the right Page class from
the param and maybe construct your PageParameters also...

Hope this helps,
Sebastien.


Re: call onsubmit automatically

2012-04-30 Thread raju.ch
Thnx for the reply sebastian, but I didn't get the solution what you
suggested..Can you please explain it with an example?

thanks in advance

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/call-onsubmit-automatically-tp4597765p4597836.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



Re: Elephas Blog Engine: how to setup a test repo

2012-04-30 Thread datazuul
I had s look to the group there, there is only spam entries
So I guess I will have no luck there

Anybody else willing to help?
-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.



meduolis [via Apache Wicket] ml-node+s1842946n4597714...@n4.nabble.com 
schrieb:

I believe that this is not the right place to ask for Elephas engine 
howto :) 

This discussion board is for Elephas http://groups.google.com/group/elephas :D  


_




If you reply to this email, your message will be added to the discussion below:


http://apache-wicket.1842946.n4.nabble.com/Elephas-Blog-Engine-how-to-setup-a-test-repo-tp4597689p4597714.html
  



To unsubscribe from Elephas Blog Engine: how to 
setup a test repo, click here.
NAML



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Elephas-Blog-Engine-how-to-setup-a-test-repo-tp4597689p4597860.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



Re: call onsubmit automatically

2012-04-30 Thread Sebastien
Hi again,

I maybe replied a little bit quickly (it was launch time :p). So, I meant
about something like this:

HTML:
body onload=window.document.getElementById('form').submit();
form id=form wicket:id=form
  input type=hidden wicket:id=page /
/form
/body

Java counterpart:
private FormComponentString input;

public HomePage(final PageParameters parameters) {

final FormVoid form = new FormVoid(form) {

private static final long serialVersionUID = 1L;

@Override
@SuppressWarnings(unchecked)
protected void onSubmit()
{
String typeName = input.getModelObject(); //ie:
com.mycompany.MyPage
Class? extends Page page = (Class? extends Page)
Class.forName(typeName); //!\ need to catch exception
this.setResponsePage(page);
}
};
this.add(form.setMarkupId(form)); //be careful, you have to set
the htmlId yourself because it is hard-coded in the javascript

this.input = new HiddenFieldString(page, new
ModelString(MyPage.class.getName()));
form.add(this.input);
}


Where MyPage is the page you want to redirect to.

Hope it answers your need.
Sebastien.


On Mon, Apr 30, 2012 at 12:34 PM, raju.ch raju.challagun...@gmail.comwrote:

 Thnx for the reply sebastian, but I didn't get the solution what you
 suggested..Can you please explain it with an example?

 thanks in advance

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/call-onsubmit-automatically-tp4597765p4597836.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




Re: Passing parameter to a portion of a page

2012-04-30 Thread Dan Retzlaff
I'm not sure what you mean by passing a parameter-- you control the
forms' construction, so you can pass anything you'd like.

If your goal is to make bookmarkable construction parameters available to
all forms, getPage().getPageParameters() would help. (That doesn't change
with AJAX, though, so probably not what you meant.) If your goal is to
share the same IModel among all instances, you might consider stashing it
in metadata on the page (getPage().setMetaData(...)), and having your forms
grab it from there.

Hope that helps,
Dan

On Mon, Apr 30, 2012 at 4:10 AM, kshitiz k.agarw...@gmail.com wrote:

 Hi,

 Lets say there are many forms in a page and in every form, there is drop
 down choice with onselectionchange feature. Is it possible to pass a
 parameter to any one of the form only rather than entire page? Will it be
 done through Ajax?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Passing-parameter-to-a-portion-of-a-page-tp4597887.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




Re: dynamic vertical menu

2012-04-30 Thread Dan Retzlaff
Hi, Lenin. Have you looked into these two examples? They might help you get
started.

http://www.wicket-library.com/wicket-examples/nested/
http://www.wicket-library.com/wicket-examples/navomatic/

Dan

On Mon, Apr 30, 2012 at 12:30 AM, lenin lening...@gmail.com wrote:

 Dear,

 i am new in the wicket1.5.5 framework , how to create dynamic vertical
 menu(with sub menu) 
 i want to display the page within the menu page.
 i am trying this past one month but till not able to find out the solution
 can any one help to resolve the problem...

 thanks in advance

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/dynamic-vertical-menu-tp4597577.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




Re: Setting value to object when validation failed

2012-04-30 Thread Dan Retzlaff
Generally when a field validation fails, the user's raw input is
re-rendered instead of the original model value. This lets the user correct
his input instead of retyping the whole thing. Since this is not the
behavior you want, you can call firstName.clearInput() in your onError().

On Mon, Apr 30, 2012 at 12:45 AM, meduolis meduol...@gmail.com wrote:

 Hello this is quick start project which reproduces my case
 http://apache-wicket.1842946.n4.nabble.com/file/n4597599/project.zip
 project.zip

 The problem is, that I cannot set value for object after form validation
 fails.

 How to reproduce:
 1. Startup my quicstart app;
 2. Do not fill required field and press Save;
 4. Validation error occurs, that field is required;
 3. Press Set name; (this should set first name to John Doe and
 refresh);

 Expected result: input field sets to John Doe;

 Actual result: nothing happens;

 Does anyone knows what I am doing wrong? :)

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Setting-value-to-object-when-validation-failed-tp4597599.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




Re: Passing parameter to a portion of a page

2012-04-30 Thread kshitiz
Thanks for the reply Dan...now consider a situation: 

You have 5 drop downs, each with onselectionchange enabled. When you change
the choice of any one drop down, the chosen value should be passed as
parameter to that drop down only, so that it will display new value. Rest
drop downs should not get changed. How will you do that? 

On way would be to allocate each drop down a unique id and then, associate
each parameter being passed to the same page with that id. This will help to
judge the coming parameter belongs to which drop down. But is there any more
efficient way?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Passing-parameter-to-a-portion-of-a-page-tp4597887p4598758.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



Re: Passing parameter to a portion of a page

2012-04-30 Thread Dan Retzlaff
What you describe sounds like Wicket's default behavior. It knows which
widgets correspond to which Java components, and routes data accordingly
when submitted.

On Mon, Apr 30, 2012 at 10:05 AM, kshitiz k.agarw...@gmail.com wrote:

 Thanks for the reply Dan...now consider a situation:

 You have 5 drop downs, each with onselectionchange enabled. When you change
 the choice of any one drop down, the chosen value should be passed as
 parameter to that drop down only, so that it will display new value. Rest
 drop downs should not get changed. How will you do that?

 On way would be to allocate each drop down a unique id and then, associate
 each parameter being passed to the same page with that id. This will help
 to
 judge the coming parameter belongs to which drop down. But is there any
 more
 efficient way?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Passing-parameter-to-a-portion-of-a-page-tp4597887p4598758.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




Re: Passing parameter to a portion of a page

2012-04-30 Thread Carl-Eric Menzel
On Mon, 30 Apr 2012 10:05:46 -0700 (PDT)
kshitiz k.agarw...@gmail.com wrote:

 Thanks for the reply Dan...now consider a situation: 
 
 You have 5 drop downs, each with onselectionchange enabled. When you
 change the choice of any one drop down, the chosen value should be
 passed as parameter to that drop down only, so that it will display
 new value. Rest drop downs should not get changed. How will you do
 that? 

I very much recommend looking at wicket-examples, they show very well
how Wicket components and pages work together. For most usecases, your
components will not have to look directly at page parameters *at all*,
and certainly not at other components' parameters.

 On way would be to allocate each drop down a unique id and then,
 associate each parameter being passed to the same page with that id.
 This will help to judge the coming parameter belongs to which drop
 down. But is there any more efficient way?

Your components need a unique id in Wicket anyway. You don't have to
handle those parameters yourself though. Simply override
DropDownChoice#wantOnSelectionChangedNotifications() to return true,
and then #onSelectionChanged will be called *for this component only*
when a new value is selected.

Carl-Eric

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



ListView (or other Repeater) with backing map

2012-04-30 Thread cmagnollay
So essentially I want to use Wicket 1.5 to display an item and its associated
quantity. The data structure I am using to back this is a Map (new
HashMap()) where Item is a POJ whose details are of no consequence.
Essentially I would like to use one of wicket's repeaters, but I only have
experience using ListView. Is there a repeater that would work well with a
Map, or am I going to need to code my own? If I need to code my own, what is
the best class to override?

The List has has key-value pairs of type: Item-Integer where integer is
the quantity.

I would the output of the repeater to essentially be something like:

QuantityX : ItemName (ItemNum)

so for example:

2x : someItem (255609)
1x : someOtherItem (125123)

The map can change through user input, but I am familiar with refreshing
component's markup with AJAX via Wicket. Your help is much appreciated.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListView-or-other-Repeater-with-backing-map-tp4598817.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



Re: ListView (or other Repeater) with backing map

2012-04-30 Thread Carl-Eric Menzel
On Mon, 30 Apr 2012 10:25:21 -0700 (PDT)
cmagnollay cmagnol...@gmail.com wrote:

 So essentially I want to use Wicket 1.5 to display an item and its
 associated quantity. The data structure I am using to back this is a
 Map (new HashMap()) where Item is a POJ whose details are of no
 consequence. Essentially I would like to use one of wicket's
 repeaters, but I only have experience using ListView. Is there a
 repeater that would work well with a Map, or am I going to need to
 code my own? If I need to code my own, what is the best class to
 override?
 
 The List has has key-value pairs of type: Item-Integer where
 integer is the quantity.

I'd just use Map#entrySet, which gives you a
SetMap.EntryItem,Integer. You can turn that into a list and feed it
to a ListViewMap.EntryItem,Integer. That way you have an Entry in
each ListItem and can simply use its two parts.

Hope this helps.

Carl-Eric

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



Re: ListView (or other Repeater) with backing map

2012-04-30 Thread cmagnollay
if the map is called something like 

MapItem, Integer itemMap = new HashMapItem, Integer();

Hmm, so I would instantiate the ListView like so?

ListViewListlt;Map.Entrylt;Item, Integer lv = new
ListViewListlt;Map.Entrylt;Item, Integer(id, new
PropertyModelListlt;Map.Entrylt;Item, Integer(this,
itemMap.entrySet()){


populateItem(Map.EntryItem, Integer entry)
{

}

}

Is this what you are implying somewhat? Thanks for the answer by the way, I
had not considered just, for lack of a better term, fooling the listview
into using my map elements.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListView-or-other-Repeater-with-backing-map-tp4598817p4598865.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



Re: ListView (or other Repeater) with backing map

2012-04-30 Thread Carl-Eric Menzel
On Mon, 30 Apr 2012 10:43:30 -0700 (PDT)
cmagnollay cmagnol...@gmail.com wrote:

 if the map is called something like 
 
 MapItem, Integer itemMap = new HashMapItem, Integer();
 
 Hmm, so I would instantiate the ListView like so?
 [...]
 Is this what you are implying somewhat? Thanks for the answer by the
 way, I had not considered just, for lack of a better term, fooling
 the listview into using my map elements.

Basically yes, though the propertymodel won't work like that. I'd do
something like this (pseudocode):

MapItem,Integer itemMap = ...;

IModelListMap.EntryItem,Integer mapListModel = new
  LoadableDetachableModel() {
load() {
   return new ArrayList...(itemMap.entrySet());
}
  };

...new ListViewMap.Entry...(id, mapListModel) {
  populateItem(ListItemItem,Integer li) {
  ...
  }
}

Carl-Eric

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



Re: Setting value to object when validation failed

2012-04-30 Thread meduolis
This solves my problem. Is there any way to collect all components that
fails?
or I just have to check each separate component if it has any feedback
messages (level  ERROR) and then clear it's value by myself?


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-value-to-object-when-validation-failed-tp4597599p4598947.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



Re: Setting value to object when validation failed

2012-04-30 Thread Dan Retzlaff
Check out Form#clearInput() which calls FormComponent#clearInput() on all
of its components. You can do similiar, but incorporate
FormComponent#hasErrorMessage() so you don't also reset fields with valid
input.

On Mon, Apr 30, 2012 at 11:11 AM, meduolis meduol...@gmail.com wrote:

 This solves my problem. Is there any way to collect all components that
 fails?
 or I just have to check each separate component if it has any feedback
 messages (level  ERROR) and then clear it's value by myself?


 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Setting-value-to-object-when-validation-failed-tp4597599p4598947.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




Re: ListView (or other Repeater) with backing map

2012-04-30 Thread cmagnollay
And I can force the model to update, via AJAX, or in other words, how I force
the list view to update after a user action?

onUpdate(AjaxRequestTarget target)
{
  target.add(theListView) ??
}

or is it something I do with the model itself? Sorry, I have no experience
with LoadableDetachable, and a quick glance at the API did not enlighten me.
My guess would be to give the listview a new model on each trigger of the
AJAX code.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListView-or-other-Repeater-with-backing-map-tp4598817p4599009.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



Re: ListView (or other Repeater) with backing map

2012-04-30 Thread Dan Retzlaff
You can call LDM#detach() after the modification, but since this particular
implementation is so light, I'd just use AbstractReadyOnlyModel instead. It
doesn't cache, so detach is not required.

On Mon, Apr 30, 2012 at 11:36 AM, cmagnollay cmagnol...@gmail.com wrote:

 And I can force the model to update, via AJAX, or in other words, how I
 force
 the list view to update after a user action?

 onUpdate(AjaxRequestTarget target)
 {
  target.add(theListView) ??
 }

 or is it something I do with the model itself? Sorry, I have no experience
 with LoadableDetachable, and a quick glance at the API did not enlighten
 me.
 My guess would be to give the listview a new model on each trigger of the
 AJAX code.

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/ListView-or-other-Repeater-with-backing-map-tp4598817p4599009.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




Re: ListView (or other Repeater) with backing map

2012-04-30 Thread Carl-Eric Menzel
On Mon, 30 Apr 2012 11:38:36 -0700
Dan Retzlaff dretzl...@gmail.com wrote:

 You can call LDM#detach() after the modification, but since this
 particular implementation is so light, I'd just use
 AbstractReadyOnlyModel instead. It doesn't cache, so detach is not
 required.

Actually, getObject() can be called pretty often, so that would incur
the cost of creating the new List object *each time*. I would really
use the LDM. Since in my example the LDM is passed directly into the
ListView as its default model, the ListView will take care of
detaching [1].

cmagnollay, that means that on each render you should simply see
whatever is currently in your map, so it should be up to date on its
own without further action.

An LDM calls the load() method the first time its getObject() is
called. The value you return from load() will be cached until detach()
is called on the LDM. The normal usecase is to do an expensive
operation (load from DB, create a lot of objects, etc) only once in a
request but to still have fresh data in each request. Also it reduces
session size because the cached data is not kept between requests.

Hope this helps!
Carl-Eric

[1] Carl-Eric's rule of detaching models: *always* do one of the
following:
  - detach the model yourself
  - pass the model to one of your child components or your
superclass, thus making it that code's responsibility.

You never know what model implementation you might be getting as a
parameter. Be nice to whoever calls you.

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



Re: ListView (or other Repeater) with backing map

2012-04-30 Thread Dan Retzlaff
I assumed the action phase would dereference the ListItemModel (e.g. to
remove it from the map), hence dereference the LDM, and then require the
explicit detach() before rendering. Agreed that LDM is the way to go if
you're concerned about the ArrayList constructions.

On Mon, Apr 30, 2012 at 11:57 AM, Carl-Eric Menzel cmen...@wicketbuch.dewrote:

 On Mon, 30 Apr 2012 11:38:36 -0700
 Dan Retzlaff dretzl...@gmail.com wrote:

  You can call LDM#detach() after the modification, but since this
  particular implementation is so light, I'd just use
  AbstractReadyOnlyModel instead. It doesn't cache, so detach is not
  required.

 Actually, getObject() can be called pretty often, so that would incur
 the cost of creating the new List object *each time*. I would really
 use the LDM. Since in my example the LDM is passed directly into the
 ListView as its default model, the ListView will take care of
 detaching [1].

 cmagnollay, that means that on each render you should simply see
 whatever is currently in your map, so it should be up to date on its
 own without further action.

 An LDM calls the load() method the first time its getObject() is
 called. The value you return from load() will be cached until detach()
 is called on the LDM. The normal usecase is to do an expensive
 operation (load from DB, create a lot of objects, etc) only once in a
 request but to still have fresh data in each request. Also it reduces
 session size because the cached data is not kept between requests.

 Hope this helps!
 Carl-Eric

 [1] Carl-Eric's rule of detaching models: *always* do one of the
following:
  - detach the model yourself
  - pass the model to one of your child components or your
superclass, thus making it that code's responsibility.

You never know what model implementation you might be getting as a
parameter. Be nice to whoever calls you.

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




Re: Setting value to object when validation failed

2012-04-30 Thread meduolis
OK, I got the idea :), thanks a lot for helping.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Setting-value-to-object-when-validation-failed-tp4597599p4599127.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



Re: ListView (or other Repeater) with backing map

2012-04-30 Thread cmagnollay
Thank for you all for the response. I am trying to test that code but am
having a different separate issue at the moment. Your solutions however
worked exactly as intended. Thank you for all the help!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListView-or-other-Repeater-with-backing-map-tp4598817p4599149.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



Re: ListView (or other Repeater) with backing map

2012-04-30 Thread Carl-Eric Menzel
On Mon, 30 Apr 2012 12:15:20 -0700
Dan Retzlaff dretzl...@gmail.com wrote:

 I assumed the action phase would dereference the ListItemModel (e.g.
 to remove it from the map), hence dereference the LDM, and then
 require the explicit detach() before rendering. Agreed that LDM is
 the way to go if you're concerned about the ArrayList constructions.

That assumption depends very much on the code you give the model to.
Many places will simply call getObject() instead of keeping a reference
to whatever is inside. PropertyModel is one of them that is very
commonly used.

Carl-Eric

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



Re: Migration to wicket 1.5 and properties.xml files

2012-04-30 Thread jensiator
thank you. Ill look into it

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migration-to-wicket-1-5-and-properties-xml-files-tp4597473p466.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