jquery multi select with wicket ajax refresh

2009-08-21 Thread Martin Makundi
Hi!

Did anybody manage to integrate something like this into wicket ajax
processing:
* http://dropdown-check-list.googlecode.com/svn/trunk/demo.html

I have got it working pretty well WITHOUT AJAX:
  @Override
  public void renderHead(IHeaderResponse response) {
response.renderCSSReference("/css/multiselectstyle.css");
response.renderJavascriptReference("/js/jquery.js");
  response.renderJavascriptReference("/js/ui.core.js");
  response.renderJavascriptReference("/js/ui.dropdownchecklist.js");
String removeFunc;
String func;
  func = "$(\"#" + getMarkupId() + "\").dropdownchecklist({
firstItemChecksAll: true, maxDropHeight: 100 });";
  removeFunc = "$('#" + getMarkupId() +
"-dropdownchecklist-wrapper').remove(); $('#" + getMarkupId() +
"-dropcontainer-wrapper').remove();";
response.renderJavascript("$(document).ready(function() {"
+ removeFunc
+ func
+ "});", null);


The idea of the removeFunc is that when ajax update occurs, it would
re-initialize the skin. However, the select ends up naked :)

Without ajax update it works really fine. Could anybody with more
experience on the subject have a look at it? It is just a regular
public class ListMultipleJQueryChoice extends ListMultipleChoice
implements IHeaderContributor with the above renderHead method. So all
the code is here already.

**
Martin

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



Re: multiple feedback panels in same page

2009-08-21 Thread satar

Thank you for the quick example. I think I actually seen this way of setting
up a feedback panel at one point in time but had forgotten and then bumped
into the problem of having two feedback panels on one page. This got me
moving on quickly -- thank again!
-- 
View this message in context: 
http://www.nabble.com/multiple-feedback-panels-in-same-page-tp22298693p25089341.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



Re: Improving maven/wicket deployment process

2009-08-21 Thread Tauren Mills
I just wanted to follow up on this.  As an interim solution until I
have time to really do this right (using Hudson, etc.), I've done what
is suggested here:
http://www.developer.com/java/ent/article.php/3811931

In my spring config PropertyPlaceholderConfigurer, I use this:
classpath*:/application.${env}.properties

This means that steps 1 and 2 have been resolved without the effort
required to switch to using JNDI, maven profiles, or other build
tools.  All I do is specify -Denv=prod on my production server and
-Denv=dev -Dwicket.configuration=development on my development system.
 I can add additional staging, QA, and other servers with this
scenario, and it doesn't require a separate WAR for each one.

Tauren


On Mon, Aug 17, 2009 at 11:07 AM, Tauren Mills wrote:
> Janos and Jeremy,
>
> Thank you both for your feedback!
>
> After considering your answers, I think that using Maven profiles is
> most in line with my needs.  And the suggestion to use the command
> line -Dwicket.configuration=deployment parameter will certainly help.
> I've never used Hudson before, but I'm looking into it now. It sounds
> like it could help simplify things significantly.
>
> Thanks again,
> Tauren
>

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



RE: LoadableDetachableModel#load() called twice

2009-08-21 Thread Warren Bell
I need to read you response a little better. The choice id is being
submitted with the form the button is on. Now if I have the button on a
different form, can I update the ListChoice by simply adding the
ListChoice to the target?

Warren

-Original Message-
From: Warren Bell [mailto:warr...@clarksnutrition.com] 
Sent: Friday, August 21, 2009 12:43 PM
To: users@wicket.apache.org
Subject: RE: LoadableDetachableModel#load() called twice

Ok, I see what is happening. I am using one of the selected choice
objects in the onSubmit and then adding a new choice object to the list.
In order for me to use that selected object, LDM#load() has to be called
first to get it. But how does it know I am going to use that chosen
object if I am not calling getObject()? Now if the selected object is a
member of the page and I don't use the selected object anywhere or add
the ListChoice to the tagret, does the ListChoice choices LDM#load get
called everytime any AjaxButton is pressed regardless of what form it is
on? Or to put it another way, in the situation below what are the
conditions that cause the LDM#load() to be called? 

class MyPage extends WebPage
{
  private MyObject myListChoiceSelectedObject;

  public MyPage()
  {
setDefaultModel(new CompoundPropertyModel(this));
...
someForm.add(new ListChoice("myListChoiceSelectedObject",
new LoadableDetachableModel>(){...}, new
IChoiceRenderer(){...}));
...
  }
}

Thanks for your help

Warren

-Original Message-
From: jWeekend [mailto:jweekend_for...@cabouge.com]
Sent: Friday, August 21, 2009 11:37 AM
To: users@wicket.apache.org
Subject: Re: LoadableDetachableModel#load() called twice


Warren,

Unless you are indirectly calling load() yourself, eg by calling
getObject(), on your LDM) during form processing it's Wicket converting
the selected item (by choice id) to the actual "choice" object, by
matching the id against the list of choices, calling load() on your LDM
in the process.

This implies that you may be submitting the selected value from the list
which is probably unnecessary if that particular submit is designed to
just add a value to the choices' backing model (eg the List or table
etc... you are deriving your list of choices from). 

One way to get around your issue would be to have your "Add an item to
my list" button and, the associated component where you add that new
list object, both on a separate form. Then, after that new form's
submit, your LDM's load() should only be called during any rendering,
which is probably what you want.

Does that do it?

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development
http://jWeekend.com



Warren Bell-3 wrote:
> 
> I have a ListChoice that I add a choice to. I do this in an 
> AjaxButton#onSubmit(...). The problem is that load() has been called 
> before onSubmit() and I have to call LoadableDetachableMode#detach() 
> and have load() called again. This seems like a waste to have load() 
> called twice in order to get the new choice added to the ListChoice. 
> Is there a better way of doing this?
>  
> Warren
> 
> 

--
View this message in context:
http://www.nabble.com/LoadableDetachableModel-load%28%29-called-twice-tp
25082195p25085222.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: LoadableDetachableModel#load() called twice

2009-08-21 Thread Warren Bell
Ok, I see what is happening. I am using one of the selected choice
objects in the onSubmit and then adding a new choice object to the list.
In order for me to use that selected object, LDM#load() has to be called
first to get it. But how does it know I am going to use that chosen
object if I am not calling getObject()? Now if the selected object is a
member of the page and I don't use the selected object anywhere or add
the ListChoice to the tagret, does the ListChoice choices LDM#load get
called everytime any AjaxButton is pressed regardless of what form it is
on? Or to put it another way, in the situation below what are the
conditions that cause the LDM#load() to be called? 

class MyPage extends WebPage
{
  private MyObject myListChoiceSelectedObject;

  public MyPage()
  {
setDefaultModel(new CompoundPropertyModel(this));
...
someForm.add(new ListChoice("myListChoiceSelectedObject",
new LoadableDetachableModel>(){...}, new
IChoiceRenderer(){...}));
...
  }
}

Thanks for your help

Warren

-Original Message-
From: jWeekend [mailto:jweekend_for...@cabouge.com] 
Sent: Friday, August 21, 2009 11:37 AM
To: users@wicket.apache.org
Subject: Re: LoadableDetachableModel#load() called twice


Warren,

Unless you are indirectly calling load() yourself, eg by calling
getObject(), on your LDM) during form processing it's Wicket converting
the selected item (by choice id) to the actual "choice" object, by
matching the id against the list of choices, calling load() on your LDM
in the process.

This implies that you may be submitting the selected value from the list
which is probably unnecessary if that particular submit is designed to
just add a value to the choices' backing model (eg the List or table
etc... you are deriving your list of choices from). 

One way to get around your issue would be to have your "Add an item to
my list" button and, the associated component where you add that new
list object, both on a separate form. Then, after that new form's
submit, your LDM's load() should only be called during any rendering,
which is probably what you want.

Does that do it?

Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development
http://jWeekend.com



Warren Bell-3 wrote:
> 
> I have a ListChoice that I add a choice to. I do this in an 
> AjaxButton#onSubmit(...). The problem is that load() has been called 
> before onSubmit() and I have to call LoadableDetachableMode#detach() 
> and have load() called again. This seems like a waste to have load() 
> called twice in order to get the new choice added to the ListChoice. 
> Is there a better way of doing this?
>  
> Warren
> 
> 

--
View this message in context:
http://www.nabble.com/LoadableDetachableModel-load%28%29-called-twice-tp
25082195p25085222.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: LoadableDetachableModel#load() called twice

2009-08-21 Thread jWeekend

Warren,

Unless you are indirectly calling load() yourself, eg by calling
getObject(), on your LDM) during form processing it's Wicket converting the
selected item (by choice id) to the actual "choice" object, by matching the
id against the list of choices, calling load() on your LDM in the process.

This implies that you may be submitting the selected value from the list
which is probably unnecessary if that particular submit is designed to just
add a value to the choices' backing model (eg the List or table etc... you
are deriving your list of choices from). 

One way to get around your issue would be to have your "Add an item to my
list" button and, the associated component where you add that new list
object, both on a separate form. Then, after that new form's submit, your
LDM's load() should only be called during any rendering, which is probably
what you want.

Does that do it?

Regards - Cemal 
jWeekend 
OO & Java Technologies, Wicket Training and Development 
http://jWeekend.com



Warren Bell-3 wrote:
> 
> I have a ListChoice that I add a choice to. I do this in an
> AjaxButton#onSubmit(...). The problem is that load() has been called
> before onSubmit() and I have to call LoadableDetachableMode#detach()
> and have load() called again. This seems like a waste to have load()
> called twice in order to get the new choice added to the ListChoice. Is
> there a better way of doing this?
>  
> Warren
> 
> 

-- 
View this message in context: 
http://www.nabble.com/LoadableDetachableModel-load%28%29-called-twice-tp25082195p25085222.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



LoadableDetachableModel#load() called twice

2009-08-21 Thread Warren Bell
I have a ListChoice that I add a choice to. I do this in an
AjaxButton#onSubmit(...). The problem is that load() has been called
before onSubmit() and I have to call LoadableDetachableMode#detach()
and have load() called again. This seems like a waste to have load()
called twice in order to get the new choice added to the ListChoice. Is
there a better way of doing this?
 
Warren


Re: Absolute urls in forms

2009-08-21 Thread Igor Vaynberg
thats funny, we worked really had to make all urls relative because it
would make it a lot easier to work with proxies... :)

-igor

On Fri, Aug 21, 2009 at 12:43 AM, Steen Larsen wrote:
> Hi,
>
> Just a quick question. Is it somehow possible to make Wicket generate
> absolute urls in the forms action attribute. The reason I ask is
> because my Wicket application is going to be embedded in a CMS through
> a proxy, and apparently the dude writing the proxy would prefer the
> urls to be absolute.
>
> /Steen
>
> -
> 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: Question on brix

2009-08-21 Thread Igor Vaynberg
thats what we are using it for...

things like entering products, prices, etc, have nothing to do with
brix. brix is a cms only.

-igor

On Fri, Aug 21, 2009 at 2:49 AM, Cristi Manole wrote:
> Hello,
>
> I am after building a (basic) ecommerce application and I'd love to do it in
> wicket with Brix. My question is if it's feasible for this task.
> Specifically, I'd like to be able to offer to a non technical user the
> possibility to enter products with description, prices, photos, etc, to have
> access to (simple) layout rules.
>
> I think Brix was designed exactly for tasks like this and, while I know up
> front that I could check everything out myself, this takes a great deal of
> time so I'd like to find out if I'm wasting my time looking more into Brix
> for this.
>
> Thanks a mil,
>
> --
> 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: ConversionException and onSubmit is not called

2009-08-21 Thread Harrie Hazewinkel


On 21 aug 2009, at 15:36, Jonas wrote:


Have you tried removing setType(Region.class); from your code?
I don't think that's necessary for a DropDownChoice - and probably  
the cause

why an IConverter is used (which is probably the source of the
ConversionException you mentioned).


Actually, by accident I deleted the line and found out that
without the line it all works.


thanks,
Harrie


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



Re: [announce] Wicket 1.4.1

2009-08-21 Thread Igor Vaynberg
there is a url in the original email

-igor

On Thu, Aug 20, 2009 at 11:02 PM, uud ashr wrote:
> any release/changes notes?
>
> On Thu, Aug 20, 2009 at 11:39 PM, Anton Veretennikov <
> anton.veretenni...@gmail.com> wrote:
>
>> Thank you! Great news!
>>
>> On Thu, Aug 20, 2009 at 10:14 PM, Jeremy
>> Thomerson wrote:
>> > 1.4.1 is now available as source in the releases dir.
>> >
>> > --
>> > Jeremy Thomerson
>> > http://www.wickettraining.com
>> >
>> >
>> >
>> >
>> > On Thu, Aug 20, 2009 at 2:40 AM, Martin Funk
>> wrote:
>> >> and leave clean underwear
>> >>
>> >> don't think Martijn is up for another one of this:
>> >> http://www.nabble.com/SVN-URL-for-Wicket-1.4.0-sources--td24803875.html
>> >>
>> >> mf
>> >>
>> >> 2009/8/20 Igor Vaynberg 
>> >>
>> >>> Apache Wicket 1.4.1 Released
>> >>>
>> >>> The Apache Wicket project is proud to announce the first maintenance
>> >>> release of Apache Wicket 1.4.
>> >>>
>> >>> Download Apache Wicket 1.4.1
>> >>> -
>> >>> You can download the release here:
>> >>> http://www.apache.org/dyn/closer.cgi/wicket/1.4.1
>> >>>
>> >>> Or use this in your Maven pom's to upgrade to the new version:
>> >>>
>> >>> 
>> >>>  org.apache.wicket
>> >>>  wicket
>> >>>  1.4.1
>> >>> 
>> >>>
>> >>> Changes
>> >>> -
>> >>> The most notable change in this release is the transparent support for
>> >>> multipart form submissions via Ajax. Wicket is now smart enough to
>> >>> submit a form using a hidden iframe rather then the standard
>> >>> XMLHttpRequest if the form contains file upload fields.
>> >>>
>> >>> A complete list of changes can be found in our Jira instance[0].
>> >>>
>> >>> --
>> >>>
>> >>> We thank you for your patience and support.
>> >>>
>> >>> The Wicket Team
>> >>>
>> >>> [0]
>> >>>
>> https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&mode=hide&sorter/order=DESC&sorter/field=priority&pid=12310561&fixfor=12314113
>> >>>
>> >>> -
>> >>> 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: using hibernate pojo as model instead of dto

2009-08-21 Thread Fernando Wermus
The case I use DTO is when I have wizards that involves many entities or/and
some data that will become an entity but it is not the entity itself.
Besides, some types that I cannot use in wicket, or maybe yes, like JodaTime
DateTime.


On Fri, Aug 21, 2009 at 5:42 AM, Mathias Nilsson <
wicket.program...@gmail.com> wrote:

>
> I don't know about the good design but why should you make a detached copy
> of
> an perfectly good entity? It's just more work.
>
> However, if you need to use dto for webservices or there are some cases
> when
> you need to get fields from different entities then maybe you should
> consider dto.
> --
> View this message in context:
> http://www.nabble.com/using-hibernate-pojo-as-model-instead-of-dto-tp25071549p25079082.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
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: Regarding datepicker popup when inputfield pressed

2009-08-21 Thread sander v F
There is a JQuery plugin capable of doing this, see:
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerClickInput.html

You should have a look at WiQuery ( http://code.google.com/p/wiquery/ ), a
Wicket JQuery component. I don't know if they already implemented this
datepicker, but it should be easy to make a plugin.



2009/8/21 Michael Mosmann 

> Am Freitag, den 21.08.2009, 14:33 +0200 schrieb copenhag copenhagen:
> > Has no one really needed the calendar popup when the input field is
> > selected/pressed ?
>
> sorry.. (btw. IMHO it is annoying ..)
>
> i searched for some solution.. but i think you have to
> a) take a look into this yui magic
> b) ask on dev list for some infos about an extension of the current
> datepicker
> c) choose some different..
> d) ..?
>
> mm:)
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Regarding datepicker popup when inputfield pressed

2009-08-21 Thread Michael Mosmann
Am Freitag, den 21.08.2009, 14:33 +0200 schrieb copenhag copenhagen:
> Has no one really needed the calendar popup when the input field is
> selected/pressed ?

sorry.. (btw. IMHO it is annoying ..)

i searched for some solution.. but i think you have to
a) take a look into this yui magic
b) ask on dev list for some infos about an extension of the current
datepicker
c) choose some different.. 
d) ..?

mm:)


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



Re: ConversionException and onSubmit is not called

2009-08-21 Thread Jonas
Have you tried removing setType(Region.class); from your code?
I don't think that's necessary for a DropDownChoice - and probably the cause
why an IConverter is used (which is probably the source of the
ConversionException
you mentioned).

On Fri, Aug 21, 2009 at 3:17 PM, Harrie Hazewinkel wrote:
> HI Cemil,
>
> I had to modify the setObject rather different, but it gave me
> the clue on where the conversion went wrong.
>
> Thanks for your sample code!
>
> regards,
> Harrie
>
>
>
> -
> 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: ConversionException and onSubmit is not called

2009-08-21 Thread Harrie Hazewinkel

HI Cemil,

I had to modify the setObject rather different, but it gave me
the clue on where the conversion went wrong.

Thanks for your sample code!

regards,
Harrie



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



Re: ModalWindow with Page problem in IE8

2009-08-21 Thread Kristoffer Jelbring
I believe this issue was addressed in Wicket 1.3.6. I'm guessing that  
the live example hasn't been rebuilt using that version.


Kristoffer

On Aug 21, 2009, at 1:19 PM, Stefan Lindner wrote:


The Live example on http://wicketstuff.org/wicket13/ajax/modal-window
does not work in IE8 (the "Show modal dialog with a page"). We have
several Computers where this does not work. Error is "invalid URL".
We put wicketstuff.org into the trusted sites, we reduce security, we
turn off virus scanners. But it does not work. Any idea?

Stefan

-
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: using hibernate pojo as model instead of dto

2009-08-21 Thread Mathias Nilsson

I don't know about the good design but why should you make a detached copy of
an perfectly good entity? It's just more work.

However, if you need to use dto for webservices or there are some cases when
you need to get fields from different entities then maybe you should
consider dto. 
-- 
View this message in context: 
http://www.nabble.com/using-hibernate-pojo-as-model-instead-of-dto-tp25071549p25079082.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



Re: Regarding datepicker popup when inputfield pressed

2009-08-21 Thread copenhag copenhagen
Has no one really needed the calendar popup when the input field is
selected/pressed ?

It is a common feature on many calendars...How can i make it work...

Help would be appreciated a lot.

Best Regards

On Fri, Aug 21, 2009 at 11:13 AM, copenhag copenhagen
wrote:

> Hi,
>
> Thanks for the suggest, but it did not work.
>
> Any other ideas on how to do it ...?
>
> Best Regards
> Cemil
>
>
> On Thu, Aug 20, 2009 at 4:20 PM, Michael Mosmann wrote:
>
>> Am Donnerstag, den 20.08.2009, 16:00 +0200 schrieb copenhag copenhagen:
>> > Maybe it's because i am a new Wicket user, but i tried that, without any
>> > luck.
>> >
>> > I can't figure out how the calendar is called when clicked on the icon,
>> it's
>> > pretty tricky for me how
>> > it's done.
>>
>> IMHO yui is doing some magic stuff...
>>
>> maybe this will work
>>
>> DatePicker render something like
>> ---
>> initStart3 = function() {
>>  Wicket.DateTime.init( {
>> 
>> ---
>>
>> to header..
>> where "Start3" is the WicketID of the input
>>
>> you should extend the input tag with
>> --
>> onfocus="initStart3.showCalendar()"
>> --
>>
>> not testet..
>> mm:)
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>


Re: ConversionException and onSubmit is not called

2009-08-21 Thread copenhag copenhagen
Hi,

This example is working for me:

DropDownChoice ddc = new DropDownChoice("departments", new
Model(userDepartment) {

@Override
public UserDepartment getObject() {
return userDepartment;
}

@Override
public void setObject(Serializable object) {
if (object != null) {
userDepartment = (UserDepartment) object;
}
}
}, userDepartmentService.getAll(), new
ChoiceRenderer("department", "id"));
add(ddc.setRequired(true));

userDepartment is an object and consists of id and a department, also it is
an
instance variable in the Page/Form that i use the DropDownChoice in.

So userDepartment is pretty much like youre Region object...

userDepartmentService.getAll() => returns the list of UserDepartments to be
displayed.

Hope you can use it.

Best Regards
Cemil



On Fri, Aug 21, 2009 at 1:25 PM, Harrie Hazewinkel wrote:

> HI,
>
> I am trying to make a 'simple' DropDownChoice in a form for a class called
> region,
> but when I push the submit Wicket does not understand how to convert it
> back to
> the Region class. (see below for code sample)
>
> Does anyone have a hint? Or maybe sample code?
>
> Harrie
>
>
> The Region class is basically a class that combines an id with a name.
>
> public class Region {
>   private long id;
>   private String name;
>
>   public long getId() {
>   return id;
>   }
>   public String getName() {
>   return name;
>   }
> }
>
> The drop down goes correctly with the code below. The options in the
> select box have the correct name and ids.
>
>
> public class RegionDropDownChoice extends DropDownChoice {
>
>@SpringBean
>private RegionService regionService;
>
>public RegionDropDownChoice(String id, List regionList) {
>this(id, false, regionList);
>}
>
>public RegionDropDownChoice(String id, boolean nullValid, List
> regionList) {
>super(id);
>setType(Region.class);
>setNullValid(nullValid);
>setChoiceRenderer(new ChoiceRenderer() {
>public Object getDisplayValue(Region Region) {
>return Region.getName();
>}
>
>@Override
>public String getIdValue(Region Region, int index) {
>return Region.getName();
>}
>});
>setChoices(regionList);
>}
> }
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


ConversionException and onSubmit is not called

2009-08-21 Thread Harrie Hazewinkel

HI,

I am trying to make a 'simple' DropDownChoice in a form for a class  
called region,
but when I push the submit Wicket does not understand how to convert  
it back to

the Region class. (see below for code sample)

Does anyone have a hint? Or maybe sample code?

Harrie


The Region class is basically a class that combines an id with a name.

public class Region {
   private long id;
   private String name;

   public long getId() {
   return id;
   }
   public String getName() {
   return name;
   }
}

The drop down goes correctly with the code below. The options in the
select box have the correct name and ids.


public class RegionDropDownChoice extends DropDownChoice {

@SpringBean
private RegionService regionService;

public RegionDropDownChoice(String id, List regionList) {
this(id, false, regionList);
}

public RegionDropDownChoice(String id, boolean nullValid,  
List regionList) {

super(id);
setType(Region.class);
setNullValid(nullValid);
setChoiceRenderer(new ChoiceRenderer() {
public Object getDisplayValue(Region Region) {
return Region.getName();
}

@Override
public String getIdValue(Region Region, int index) {
return Region.getName();
}
});
setChoices(regionList);
}
}


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



ModalWindow with Page problem in IE8

2009-08-21 Thread Stefan Lindner
The Live example on http://wicketstuff.org/wicket13/ajax/modal-window
does not work in IE8 (the "Show modal dialog with a page"). We have
several Computers where this does not work. Error is "invalid URL".
We put wicketstuff.org into the trusted sites, we reduce security, we
turn off virus scanners. But it does not work. Any idea?

Stefan

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



Re: DropDown where (type of model property) != (type of choices)

2009-08-21 Thread elygre


elygre wrote:
> 
> It seems to me that it is a fairly hard requirement that the model and the
> choice list have identical types. I'll investigate a bit further, to see
> if I can build a generic mechanism for both a Map and a "bean"-style
> object.
> 

After looking deeper into this, I created two different specialized
DropDownChoices, with different properties. The class signatures
(interfaces) are as follows with complete code further below

Now, of all the things I did in Wicket, this is the one thing that turned
out to be furthest from expectations. It wasn't the hardest, but it was the
easiest thing that turned out to be hard :-). If there is interest (or at
least no objections...), I'll create a jira issue and submit this code for
inclusion into 1.5.

Class signatures:

public class MapDropDownChoice extends DropDownChoice {
public MapDropDownChoice(String id, Map choices);
public MapDropDownChoice(String id, IModel model, Map choices);
}

public class BeanDropDownChoice extends MapDropDownChoice {
public BeanDropDownChoice(String id, List choices, IChoiceRenderer
renderer);
public BeanDropDownChoice(String id, IModel model, List choices,
IChoiceRenderer renderer);
}


Full code:
public class MapDropDownChoice extends DropDownChoice {

public MapDropDownChoice(String id, Map choices) {
super(id, new ArrayList(choices.keySet()), new
MapChoiceRenderer(choices));
}

public MapDropDownChoice(String id, IModel model, Map choices)
{
super(id, model, new ArrayList(choices.keySet()), new
MapChoiceRenderer(choices));
}

private static class MapChoiceRenderer extends ChoiceRenderer {

private final Map map;

public MapChoiceRenderer(Map map) {
super("value", "key");
this.map = map;
}

public Object getDisplayValue(Object object) {
Object value = map.get(object);
return value == null ? "" : value.toString();
}

public String getIdValue(Object object, int index) {
return object == null ? "" : object.toString();
}
}

}

public class BeanDropDownChoice extends MapDropDownChoice {

public BeanDropDownChoice(String id, List choices, IChoiceRenderer
renderer) {
super(id, createMap(choices, renderer));
}

public BeanDropDownChoice(String id, IModel model, List choices,
IChoiceRenderer renderer) {
super(id, model, createMap(choices, renderer));
}

static Map createMap(Collection choices, IChoiceRenderer renderer) {
Map map = new HashMap();
for (Object choice : choices) {
map.put(renderer.getIdValue(choice, -1),
renderer.getDisplayValue(choice));
}
return map;
}
}


-- 
View this message in context: 
http://www.nabble.com/DropDown-where-%28type-of-model-property%29-%21%3D-%28type-of-choices%29-tp25052893p25076154.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



Re: Absolute urls in forms

2009-08-21 Thread Steen Larsen
Hm, didn't know about that one. I suppose you could rewrite the url
through this, but maybe there was some setting you could change in the
init phase, that already did this. But the AttributeModifier looks
like a workaround so thanks for the hint.

/Steen

2009/8/21 copenhag copenhagen :
> Hi,
>
> Why can't you just add a AttributeModifier to the Form and then modify it as
> you wish ?
>
> Best Regards
> Cemil
>
> On Fri, Aug 21, 2009 at 9:43 AM, Steen Larsen  wrote:
>
>> Hi,
>>
>> Just a quick question. Is it somehow possible to make Wicket generate
>> absolute urls in the forms action attribute. The reason I ask is
>> because my Wicket application is going to be embedded in a CMS through
>> a proxy, and apparently the dude writing the proxy would prefer the
>> urls to be absolute.
>>
>> /Steen
>>
>> -
>> 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



Question on brix

2009-08-21 Thread Cristi Manole
Hello,

I am after building a (basic) ecommerce application and I'd love to do it in
wicket with Brix. My question is if it's feasible for this task.
Specifically, I'd like to be able to offer to a non technical user the
possibility to enter products with description, prices, photos, etc, to have
access to (simple) layout rules.

I think Brix was designed exactly for tasks like this and, while I know up
front that I could check everything out myself, this takes a great deal of
time so I'd like to find out if I'm wasting my time looking more into Brix
for this.

Thanks a mil,

-- 
Cristi Manole

Nova Creator Software
www.novacreator.com


Re: Absolute urls in forms

2009-08-21 Thread copenhag copenhagen
Hi,

Why can't you just add a AttributeModifier to the Form and then modify it as
you wish ?

Best Regards
Cemil

On Fri, Aug 21, 2009 at 9:43 AM, Steen Larsen  wrote:

> Hi,
>
> Just a quick question. Is it somehow possible to make Wicket generate
> absolute urls in the forms action attribute. The reason I ask is
> because my Wicket application is going to be embedded in a CMS through
> a proxy, and apparently the dude writing the proxy would prefer the
> urls to be absolute.
>
> /Steen
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Regarding datepicker popup when inputfield pressed

2009-08-21 Thread copenhag copenhagen
Hi,

Thanks for the suggest, but it did not work.

Any other ideas on how to do it ...?

Best Regards
Cemil

On Thu, Aug 20, 2009 at 4:20 PM, Michael Mosmann  wrote:

> Am Donnerstag, den 20.08.2009, 16:00 +0200 schrieb copenhag copenhagen:
> > Maybe it's because i am a new Wicket user, but i tried that, without any
> > luck.
> >
> > I can't figure out how the calendar is called when clicked on the icon,
> it's
> > pretty tricky for me how
> > it's done.
>
> IMHO yui is doing some magic stuff...
>
> maybe this will work
>
> DatePicker render something like
> ---
> initStart3 = function() {
>  Wicket.DateTime.init( {
> 
> ---
>
> to header..
> where "Start3" is the WicketID of the input
>
> you should extend the input tag with
> --
> onfocus="initStart3.showCalendar()"
> --
>
> not testet..
> mm:)
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Absolute urls in forms

2009-08-21 Thread Steen Larsen
Hi,

Just a quick question. Is it somehow possible to make Wicket generate
absolute urls in the forms action attribute. The reason I ask is
because my Wicket application is going to be embedded in a CMS through
a proxy, and apparently the dude writing the proxy would prefer the
urls to be absolute.

/Steen

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



Re: what is modal window

2009-08-21 Thread nino martinez wael
http://www.wicket-library.com/wicket-examples/ajax/modal-window.1


2009/8/21 Gerald Fernando :
> hi friends,
> what is modal window what is the difference between this and Panel
> what are the uses
>
> Thanks&Regards,
> Gerald A
>
> --
> Thanks®ards,
> Gerald A
>

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