Veil behavior of wicketstuff-minis

2010-05-23 Thread Kai Mütz
Hi,

is there an example of the veil behavior of wicketstuff-minis. I want to try
it but am not sure how to use it.

Thanks, Kai


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



RE: Security in a Spring Wicket layered application

2009-03-10 Thread Kai Mütz
Kent Larsson mailto:kent.lars...@gmail.com wrote:
 Integrating with jSecurity instead is really a last resort. If it is
 at all possible I wouldn't like to introduce more framework
 dependencies. That integration project seems a bit early to use as
 well, but it might be interesting in the future. Thanks for the link!

 Regarding Spring Security (SS). Is anyone integrating Wicket with SS
 on their own? I've read lots about SS now but I still find it hard to
 see what I need for a Wicket application.

We are using Acegi and Wicket-auth-roles (1.3.5) similar to the WIKI
description:

http://cwiki.apache.org/WICKET/acegi-and-wicket-auth-roles.html

Have you read it?

But we do only:
- Authentication
- Authorization on pages, components

No Authorization on service layer. Are you interested in a small sample?

Cheers, Kai



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



RE: @SpringBean vs getApplication().getDao()

2009-02-18 Thread Kai Mütz
Sergey Podatelev mailto:brightnesslev...@gmail.com wrote:
 Thanks for your insight, Patrick.

 But I'm stuck in my dumbness: setting the component's fields --
 does this mean a new instance of that particular annotated bean is
 created, or that singleton is accessed somehow (proxy)?
 Also, it's not the injected beans that are null, it's their
 dependencies,
 and I assume that is because new instances of those beans are created.


Do you have tested the repositoryDao with
AbstractDependencyInjectionSpringContextTests? Does this problem only occurs
if you access the repositoryDao from a Wicket component?

See
http://static.springframework.org/spring/docs/2.5.x/reference/testing.html#j
unit38-legacy-support

Cheers, Kai


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



RE: improved resource bundles in 1.4

2008-10-30 Thread Kai Mütz
Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 i just committed a patch for WICKET-1103 which greatly improves i18n
 in wicket.

 first: you can have validators provide their own bundles. eg
 MyValidator.properties that is next to MyValidator.java. These keys
 are searched last - after the application.properties - which will
 allow you to override validator bundle values if needed.

 second: there is now support for package-level properties, which live
 in a bundle called package.properties. this means that you can have
 each logical application module have its own global bundle rather then
 having to stick everything into application.properties.

package-level properties sounds good. This is what I am looking for
currently. Is there a plan to port PackageStringResourceLoader to 1.3.x
branch?

If not, what is the best way to provide properties for multiple
Pages/WebResources in 1.3.x if I do not want to put them into
application.properties?

Cheers, Kai


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



RE: improved resource bundles in 1.4

2008-10-30 Thread Kai Mütz
Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 On Thu, Oct 30, 2008 at 5:13 AM, Kai Mütz [EMAIL PROTECTED]
 wrote:
 package-level properties sounds good. This is what I am looking for
 currently. Is there a plan to port PackageStringResourceLoader to
 1.3.x branch?

 no plan so far. this is a new feature and we dont generally roll new
 features into a maintenance release.

 If not, what is the best way to provide properties for multiple
 Pages/WebResources in 1.3.x if I do not want to put them into
 application.properties?

 there is no way to do that in core. you can take my mods from above
 commit and build a new istringresourceloader and add it to your
 application.

Ok, I have added a PackageStringResourceLoader to my application and it
works for WebPages. Thanks.

Now I want to use those resources within a DynamicWebResource via Localizer
which seems to be impossible because Localizer.getString() requires a
component. Is there another way to implement internationalized webresource?

Regards, Kai


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



Compatibility of objectautocomplete

2008-10-29 Thread Kai Mütz
Hi,

does the objectautocomplete libs require wicket 1.4 or is it possible to use
it with 1.3.x? Is it compatible with the AutoCompleteTextField of wicket
extensions? Can I use a AutoCompleteTextField of wicket extensions and an
ObjectAutoCompleteField in one form?

Thanks in advance,
Kai


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



RE: Compatibility of objectautocomplete

2008-10-29 Thread Kai Mütz
Nino Saturnino Martinez Vazquez Wael  wrote:
 Hi Kai

 Im not sure if the authors are around.. But the one Objectautocomplet
 in trunk of stuff are not backwards compatible, that goes for every
 contrib which depends on wicket 1.4. But there should be a branch
 with the old version I think, Igor did that a while back the 1.3
 branch I mean..

I can not find a 1.3 of objectautocomplete branch at
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/branches/wicke
t-1.3.x/

Anywhere else?


 As for having AutoCompletetextfield along with
 objectautocompletefield, theres nothing intentionally done for them
 not to live together but the JS could be clashing(I dont even know if
 they use the same libs) you'll just have to try and see..

I will try it if I find a 1.3 branch.

Thanks,
Kai


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



RE: Session timeout page

2008-10-29 Thread Kai Mütz
Swanthe Lindgren mailto:[EMAIL PROTECTED] wrote:
 How do I change the session timeout page? I want my application to
 display the actual home page on session timout instead of the default
 Return to homepage-link page.

Try

getApplicationSettings().setPageExpiredErrorPage(HomePage.class);

in the init() method of your application.

Kai


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



Compatibility of objectautocomplete

2008-10-29 Thread Kai Mütz
Hi,

does the objectautocomplete libs require wicket 1.4 or is it possible to use
it with 1.3.x? Is it compatible with the AutoCompleteTextField of wicket
extensions? Can I use a AutoCompleteTextField of wicket extensions and an
ObjectAutoCompleteField in one form?

Thanks in advance,
Kai


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



RE: Compatibility of objectautocomplete

2008-10-29 Thread Kai Mütz
Hoover, William mailto:[EMAIL PROTECTED] wrote:
 or you can go with this solution:
 http://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html

Hi William,
I have tried it but not successfully. I can select a choice from the
choicelist. But if I want to save it I get a

java.lang.IllegalArgumentException: argument type mismatch
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at
org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Proper
tyResolver.java:1093)
 at
org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(Pro
pertyResolver.java:583)
 at
org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:
137)
 at
org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyMode
l.java:164)
 at org.apache.wicket.Component.setModelObject(Component.java:2889)

This is because the model object seems to be a String. Do I have to use a
special IModel for CHOICE?
Where is the findChoice methode invoked? Or do I have to invoke it within a
behavior?

Regards, Kai


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



RE: Compatibility of objectautocomplete

2008-10-29 Thread Kai Mütz
Maybe I have found another solution using the standard AutoCompleteTextField
and a custom converter by overwriting getConverter():

public IConverter getConverter(final Class type) {
return new MyAutoCompleteConverter();
}

private class MyAutoCompleteConverter implements IConverter {

public MyDomainModelObject convertToObject(final String value, final 
Locale
locale) {
if (Strings.isEmpty(value)) {
return null;
}
MyDomainModelObject myModelObject = findChoice(value);
if (myModelObject == null) {
try {
myModelObject = (MyDomainModelObject)

MyAutoCompleteTextField.this.getType().newInstance();
myModelObject.setValue(value);
} catch (Exception e) {
return null;
}
}
return myModelObject;
}

private MyDomainModelObject findChoice(final String value) {
MyDomainModelObject myChoice = null;
if (value != null) {
for (MyDomainModelObject choice : choices) {
if (choice.getValue() != null
 
choice.getValue().equals(value)) {
myChoice = choice;
break;
}
}
}
return myChoice;
}
}

I do not need any special AjaxFormComponentUpdatingBehavior because the
findChoice() method is invoked from convertToObject(). I haven't tested it
enough but it seems to work.

Cheers,
Kai


Hoover, William mailto:[EMAIL PROTECTED] wrote:
 // optional, but probably needed
 final AjaxFormComponentUpdatingBehavior afcub = new
   AjaxFormComponentUpdatingBehavior(onchange) { protected final void
   onUpdate(final AjaxRequestTarget target) { // TODO : do 
 something
   }
 };
 // optional
 final AbstractAutoCompleteRenderer autoCompleteRenderer = new
   AbstractAutoCompleteRenderer() { protected final String
   getTextValue(final Object object) { // TODO : get the text value
   representation of our domain model object }
   protected final void renderChoice(final Object object, final
   Response response, final String criteria) {
   response.write(getTextValue(object)); }
 };
 // required
 final AbstractAutoCompleteTextFieldMyDomainModelObject
   autoCompleteField = new
   AbstractAutoCompleteTextFieldMyDomainModelObject(id,
   autoCompleteRenderer) { protected final ListMyDomainModelObject
 getChoiceList(final String searchTextInput) { // TODO : return your
 choice list }

   protected final String getChoiceValue(final MyDomainModelObject
   choice) throws Throwable { // TODO : get the value that will be
   displayed for the choice in the autocomplete list }
 };
 autoCompleteField.add(afcub);

 -Original Message-
 From: Hoover, William [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, October 29, 2008 9:03 AM
 To: users@wicket.apache.org; [EMAIL PROTECTED]
 Subject: RE: Compatibility of objectautocomplete

 The CHOICE is your domain model object (there was an error in the
 WIKI). You should be able to use any object in your domain. Can you
 post your code example?

 -Original Message-
 From: Kai Mütz [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, October 29, 2008 8:57 AM
 To: users@wicket.apache.org
 Subject: RE: Compatibility of objectautocomplete

 Hoover, William mailto:[EMAIL PROTECTED] wrote:
 or you can go with this solution:
 http://cwiki.apache.org/WICKET/autocomplete-using-a-wicket-model.html

 Hi William,
 I have tried it but not successfully. I can select a choice from the
 choicelist. But if I want to save it I get a

 java.lang.IllegalArgumentException: argument type mismatch
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at

org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(Proper
 tyResolver.java:1093)
  at

org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(Pro
 pertyResolver.java:583)
  at

org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:
 137)
  at

org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyMode
 l.java:164)
  at
 org.apache.wicket.Component.setModelObject(Component.java:2889)

 This is because the model object seems to be a String. Do I have to
 use a special IModel for CHOICE?
 Where is the findChoice methode invoked? Or do I have to invoke it
 within a behavior?

 Regards, Kai

RE: Validation Messages

2008-10-22 Thread Kai Mütz
Thank you, but it seems that only found resources are logged. Meanwhile I
have found out that I have to use a key like this:

myform.tabs.panel.myfield=My Field

where tabs is the id of my tabbed panel. But I haven't found a log message
that points to a missing key myform.tabs.panel.myfield.

Kai

Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 log4j.logger.org.apache.wicket.resource=DEBUG

 should do it afair.

 -igor


 On Tue, Oct 21, 2008 at 8:16 AM, Kai Mütz [EMAIL PROTECTED]
 wrote:

 Hi,

 I have some problems with validation messages. Normally I set my
 validation messages within the property files like this:

 Required='${label}' is required
 StringValidator.maximum='${label}' [...] ${maximum} [...]

 myform.myfield=My Field

 and got (as expected) 'My Field' is required if I do not fill
 myfield.

 A problem occurs with a form which contains a tapped panel. The
 validator does not find the resource and I got the message 'myfield'
 is required. Is there a possibility to find out which resource key
 the validator uses to find the resource? And in which property files
 the validator is searching?

 Thanks in advance,
 Kai



 -
 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]



Validation Messages

2008-10-21 Thread Kai Mütz
Hi,

I have some problems with validation messages. Normally I set my validation
messages within the property files like this:

Required='${label}' is required
StringValidator.maximum='${label}' [...] ${maximum} [...]

myform.myfield=My Field

and got (as expected) 'My Field' is required if I do not fill myfield.

A problem occurs with a form which contains a tapped panel. The validator
does not find the resource and I got the message 'myfield' is required. Is
there a possibility to find out which resource key the validator uses to
find the resource? And in which property files the validator is searching?

Thanks in advance,
Kai



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



Multiple AjaxFormComponentUpdatingBehaviors

2008-10-14 Thread Kai Mütz
Hi,

I have some form components with AjaxFormComponentUpdatingBehavior added. If
I add another AjaxFormComponentUpdatingBehavior within the onbeforerender()
method using an IVisitor the original behavior doesn't work reliably
anymore. Is it possible to add 2 AjaxFormComponentUpdatingBehaviors to the
same form component, one in constructor, other before rendering?

Thanks in advance, Kai


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



RE: Navigating from a Modal Window

2008-09-18 Thread Kai Mütz
Try setWindowClosedCallback(ModalWindow.WindowClosedCallback)

Kai

Eyal Golan mailto:[EMAIL PROTECTED] wrote:
 Hi,
 I have a Modal Window that uses a page.
 I want that when the user presses OK in the page, there will be a
 navigation to a new page and the modal window will be closed.
 The navigation should be not in the modal window but in the original
 page itself. Here's what I did:
 In the page that is the content of the window:
 EurekifyAjaxButton okButton = new EurekifyAjaxButton(ok) {
 private static final long serialVersionUID = 1L;
 
 @Override
 protected void onError(AjaxRequestTarget target, Form
 form) { super.onError(target, form);
 target.addComponent(feedbackPanel); }
 
 @Override
 protected void onSubmit(AjaxRequestTarget target, Form
 form) {

 *window.setReportSrcUrl(getParametersPairsForReport(),
 getReportName());* window.close(target, true); } 
 
 };
 
 In the window:
 public final void setReportSrcUrl(MapString, String
 parametersPairsForReport, String reportName) {
 if (reportPage == null) {
 reportPage = new ReportPage(this, link);
 reportPage.setReportSrcUrl(parametersPairsForReport,
 reportName); setResponsePage(reportPage);
 } else {
 reportPage.setReportSrcUrl(parametersPairsForReport,
 reportName); }
 }
 
 Where reportPage is a class member.
 
 I thought about keeping a reference to the page where the link that
 opened the popup was. And then do the setResponsePage on it.
 
 Is there a nicer way?

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



RE: Display a PDF in a new Window

2008-09-17 Thread Kai Mütz
Extend DynamicWebResource with something like

public class MyDynamicResource extends DynamicWebResource {

protected final ResourceState getResourceState() {
return new MyResourceState();
}
   
private class MyResourceState extends ResourceState {

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

public byte[] getData() {
return pdfAsBayeArry;
}

}

}

and add a ResourceLink to your page, e.g.:

add(new ResourceLink(pdf-link, new MyDynamicResource()));



HTH, Kai


ulrik mailto:[EMAIL PROTECTED] wrote:
 Hi again
 
 I have no idea of how to solve it..
 Could you please explain more in detail?
 
 What I want to do is, when I click on a link/button or something
 similar I want to open a pdf which will be downloaded from a database
 as a byte[].. 
 
 How would I do this?
 
 //Ulrik
 
 
 Kai Mütz wrote:
 
 ulrik mailto:[EMAIL PROTECTED] wrote:
 Hello!
 
 I have a PDF file in a byte[]. How do I display that PDF in a new
 window when I click on a link? Can someone please point me in the
 right direction?
 
 DynamicWebResource should do it.
 
 
 http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apac
 he/wicket/
 markup/html/DynamicWebResource.html
 
 Cheers,
 Kai
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
http://www.nabble.com/Display-a-PDF-in-a-new-Window-tp19493773p19531929.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: Form with tabbed panel: Tracking changes

2008-08-25 Thread Kai Mütz
Nino Saturnino Martinez Vazquez Wael  wrote:
 Look at Ivisitor and add one to the form, that could add it for
 you... I think theres a example pdf on jweekends homepage...

I have tried the IVisitor approach, but there are 2 problems:

1) I invoke the visitChildren() methon within the onBeforeRender() method of
the form. Thus visitChildren() only visits the components of the selected
tab because only the selected tab is rendered while loading the page.

2) I have some form components with AjaxFormComponentUpdatingBehavior added.
If I add another AjaxFormComponentUpdatingBehavior within the IVisitor the
original behavior doesn't work reliably anymore. Is it possible to add 2
AjaxFormComponentUpdatingBehavior to the same form component, one while
constructing, other while rendering?

Thanks, Kai


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



RE: Form with tabbed panel: Tracking changes

2008-08-23 Thread Kai Mütz
Nino Saturnino Martinez Vazquez Wael  wrote:
 Look at Ivisitor and add one to the form, that could add it for
 you... I think theres a example pdf on jweekends homepage...
 
 http://www.jweekend.com/dev/ArticlesPage/

I will try this. Thank you.

Kai


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



RE: Wicket-phonebook problem with cleaning fields in FilterToolbar

2008-08-22 Thread Kai Mütz
Lukasz Lipka mailto:[EMAIL PROTECTED] wrote:
 Can you show what did you change in your code that it start to work?

Just

clear.setDefaultFormProcessing(true);

But this seems to be fixed in newer versions. So I have no clue what's the
problem.

Sorry, Kai


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



Form with tabbed panel: Tracking changes

2008-08-22 Thread Kai Mütz
Hi,

I have a tabbed panel within a form. I have overwritten the newlink method
and return a submitlink instead of regular link in order to keep the form
content. Everything works fine for far.
While using these submitlinks I want to differentiate if the user has made
some changes within the tab he is leaving or not. If so I want to diplay a
message. Is there a possibilty to check if the model has changed while
selecting another tab?

Obviously I don't want to add an AjaxFormComponentUpdatingBehavior to ervery
single form component.

Thanks in advance,
Kai


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



RE: Filter Toolbar and changing size of TextFilter input box

2008-08-14 Thread Kai Mütz
Karen Schaper mailto:[EMAIL PROTECTED] wrote:
 Hello,

 I have a question about the FilterToolbar.  I just came across it
 and I love
 it.

 Except now my page is taking up to much space and the user has to
 scroll right to see all my columns.

 This is because the text filter boxes are too big for the column they
 represent.

 How do I change this?  Do I have to create my own TextFilter
 object and set
 the size on the input box?  I can't remember but if you don't set the
 size for an input text box I think html defaults to something?

I have extended TextFilter with my own markup where I have set the size of
the input field.

HTH, Kai


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



RE: Strange AjaxFormComponentUpdatingBehavior with Internet Explorer

2008-08-13 Thread Kai Mütz
Timo Rantalaiho mailto:[EMAIL PROTECTED] wrote:
 On Fri, 08 Aug 2008, Kai Mütz wrote:
 final CheckBox required = new CheckBox(required, new
 PropertyModel(project, required));
 add(required);
 final DropDownChoice officer = new DropDownChoice(officer, new
 PropertyModel(project, officer), users, true);
 add(officer);
 officer.setOutputMarkupId(true);
 officer.setEnabled(project.isRequired());
 required.add(new AjaxFormComponentUpdatingBehavior(onchange) { ...

 Could it be that IE does not fire onchange event for checkboxes?

Exactly this was the problem.


 Have you tried with onclick? And checked that you have Javascript
 enabled in IE :)

Yes, I have tried it yesterday and it works.

Thanks,
Kai


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



RE: Strange AjaxFormComponentUpdatingBehavior with Internet Explorer

2008-08-11 Thread Kai Mütz
Can anyone helb with the above issue?

Kai Mütz mailto:[EMAIL PROTECTED] wrote:
 BTW, whilw checking the checkbox the AJAX Debug window says:

 Info: Set focus on required


 That's all.


 2008/8/8 Kai Mütz [EMAIL PROTECTED]

 Hi,

 I have 2 form components in a form. A checkbox and a dropdownchoice.
 The dropdownchoice should depend on the checkbox, as it is enabled if
 the checkbox is checked and disabled if the checkbox is not checked.

 Thus I have added a AjaxFormComponentUpdatingBehavior:

 final CheckBox required = new CheckBox(required, new
 PropertyModel(project, required));
 add(required);
 final DropDownChoice officer = new DropDownChoice(officer, new
 PropertyModel(project, officer), users, true);
 add(officer);
 officer.setOutputMarkupId(true);
 officer.setEnabled(project.isRequired());
 required.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(final AjaxRequestTarget target) {
officer.setEnabled((Boolean)
required.getModelObject()); if (!officer.isEnabled()) {
officer.setModelObject(null);
}
target.addComponent(officer);
}
 });


 This works fine withe Firefox. With IE7 (and IE6) the dropdownchoice
 is not updated until clicking on the it. Example:

 - Checkbox is unchecked and dropdownchoice is disabled by default
 - Check the checkbox - nothing happens, dropdownchoice is still
 disabled (in IE)
 - Clicking on dropdownchoice - dropdownchoice is enabled
 - Uncheck the checkbox - nothing happens, dropdownchoice is still
 enabled (in IE)
 - Clicking on dropdownchoice - dropdownchoice is disabled


 Can anybody help?

 Cheers, Kai


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



Strange AjaxFormComponentUpdatingBehavior with Internet Explorer

2008-08-08 Thread Kai Mütz
Hi,

I have 2 form components in a form. A checkbox and a dropdownchoice. The
dropdownchoice should depend on the checkbox, as it is enabled if the
checkbox is checked and disabled if the checkbox is not checked.

Thus I have added a AjaxFormComponentUpdatingBehavior:

final CheckBox required = new CheckBox(required, new
PropertyModel(project, required));
add(required);
final DropDownChoice officer = new DropDownChoice(officer, new
PropertyModel(project, officer), users, true);
add(officer);
officer.setOutputMarkupId(true);
officer.setEnabled(project.isRequired());
required.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(final AjaxRequestTarget target) {
officer.setEnabled((Boolean) required.getModelObject());
if (!officer.isEnabled()) {
officer.setModelObject(null);
}
target.addComponent(officer);
}
});


This works fine withe Firefox. With IE7 (and IE6) the dropdownchoice is not
updated until clicking on the it. Example:

- Checkbox is unchecked and dropdownchoice is disabled by default
- Check the checkbox - nothing happens, dropdownchoice is still disabled
(in IE)
- Clicking on dropdownchoice - dropdownchoice is enabled
- Uncheck the checkbox - nothing happens, dropdownchoice is still enabled
(in IE)
- Clicking on dropdownchoice - dropdownchoice is disabled


Can anybody help?

Cheers, Kai


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



Re: Strange AjaxFormComponentUpdatingBehavior with Internet Explorer

2008-08-08 Thread Kai Mütz
BTW, whilw checking the checkbox the AJAX Debug window says:

Info: Set focus on required


That's all.

2008/8/8 Kai Mütz [EMAIL PROTECTED]

 Hi,

 I have 2 form components in a form. A checkbox and a dropdownchoice. The
 dropdownchoice should depend on the checkbox, as it is enabled if the
 checkbox is checked and disabled if the checkbox is not checked.

 Thus I have added a AjaxFormComponentUpdatingBehavior:

 final CheckBox required = new CheckBox(required, new
 PropertyModel(project, required));
 add(required);
 final DropDownChoice officer = new DropDownChoice(officer, new
 PropertyModel(project, officer), users, true);
 add(officer);
 officer.setOutputMarkupId(true);
 officer.setEnabled(project.isRequired());
 required.add(new AjaxFormComponentUpdatingBehavior(onchange) {
protected void onUpdate(final AjaxRequestTarget target) {
officer.setEnabled((Boolean) required.getModelObject());
if (!officer.isEnabled()) {
officer.setModelObject(null);
}
target.addComponent(officer);
}
 });


 This works fine withe Firefox. With IE7 (and IE6) the dropdownchoice is not
 updated until clicking on the it. Example:

 - Checkbox is unchecked and dropdownchoice is disabled by default
 - Check the checkbox - nothing happens, dropdownchoice is still disabled
 (in IE)
 - Clicking on dropdownchoice - dropdownchoice is enabled
 - Uncheck the checkbox - nothing happens, dropdownchoice is still enabled
 (in IE)
 - Clicking on dropdownchoice - dropdownchoice is disabled


 Can anybody help?

 Cheers, Kai




RE: Where has DateLabel gone to

2008-07-31 Thread Kai Mütz
Daniel Freitas mailto:[EMAIL PROTECTED] wrote:
 I'm reading Wicket in Action and I'm using Wicket 1.3.4. On the
 chapter about models, the author uses a DateLabel which he says can be
 found in the
 extensions project. Well, I have tried 1.3.0, 1.3.3 and 1.3.4 for both
 wicket and wicket extensions and I just can't find this component.

You can found it in wicket datetime package.

http://svn.apache.org/repos/asf/wicket/branches/wicket-1.3.x/jdk-1.4/wicket-
datetime/

Cheers, Kai


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



Re: Problem: Check within a ListView

2008-06-21 Thread Kai Mütz
I have no idea how to implement such a model. Do you have any hint? I am not
sure where/when exactly the IModel.getObject() method is called and where
the missing values can be inserted.

Regards, Kai

2008/6/5 Igor Vaynberg [EMAIL PROTECTED]:

 right, so like that its not going to work. you need a model in between
 that can buffer values and insert missing checked by disabled values.

 -igor

 On Thu, Jun 5, 2008 at 4:36 AM, Kai Mütz [EMAIL PROTECTED] wrote:
  Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
  it is possible, just depends on how you set up your models. it is not
  possible by directly reading the collection of checkgroup, but you
  can come up with a different way.
 
 
  The checkgroup is part of a form based on a CompoundPropertyModel
 wrapping a
  User object which has a roles property (List). Nothing special.
 
  Kai
 
 
  -
  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: Problem: Check within a ListView

2008-06-05 Thread Kai Mütz
Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 it is possible, just depends on how you set up your models. it is not
 possible by directly reading the collection of checkgroup, but you
 can come up with a different way.


The checkgroup is part of a form based on a CompoundPropertyModel wrapping a
User object which has a roles property (List). Nothing special.

Kai


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



Problem: Check within a ListView

2008-06-04 Thread Kai Mütz
Hi,

I have a ListView nested in a CheckGroup which works actually fine. In some
cases I have to disable (or make invisible) a certain Check within the
Checkgroup. e.g.

CheckGroup roleGroup = new CheckGroup(roles);
add(roleGroup);
roleGroup.add(new CheckGroupSelector(selector));
ListView roleList = new ListView(role-list, new DetachableRolesModel()) {
@Override
protected void populateItem(final ListItem item) {
Check check = new Check(check, item.getModel());
item.add(check);
item.add(new Label(role,
new PropertyModel(item.getModel(), value)));
if (condition) {
check.setEnabled(false);
}
}
};
roleList.setReuseItems(true);
roleGroup.add(roleList);

The problem is that the disabled item is removed from my model while
submitting the form although the disabled checkbox is checked. A disabled
and checked checkbox should not yield to the same result as a enabled and
unchecked checkbox. If I modify it to check.setEnabled(true); everything
works fine. Same with setVisibiliy().

What am I doing wrong?

Kai



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



RE: Problem: Check within a ListView

2008-06-04 Thread Kai Mütz
Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 you are not doing anything wrong, that is how things are meant to
 work.


So, isn't it possible to add a disabled checkbox to a listview without
removing the item from the corresponding collection?

Kai


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



RE: Correct use of DateLabel in DataTable/AjaxFallbackDefaultDataTable

2008-03-26 Thread Kai Mütz
rzechner mailto:[EMAIL PROTECTED] wrote:
 Hello!

 I am not sure about how to correctly use the DateLabel in a
 AjaxFallbackDefaultDataTable. The code below is oriented on the
 samples found in
 http://www.wicket-library.com/wicket-examples/repeater/
 I want to display a table of  events (id, name, dateBegin, dateEnd)
 which can also be selected. But my use of the DateLabel seems ...
 *ehem* unelegently to me, but it works. What would be a simple and
 elegant solution to display a Date object in a table?


I use something like:

public void populateItem(final Item item, final String componentId, final
IModel model) {
item.add(DateLabel.forDateStyle(componentId, new
PropertyModel(model.getObject(), dateBegin), SS));
}

HTH, Kai


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



Size of TextFilter TextField

2008-03-25 Thread Kai Mütz
Hi,

I want to set the size of a textfield within the FilterForm. How can I do
that? Subclass TextFilter or is there a better way?

Regards, Kai


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



Re: Problems with clearing of filter form

2008-03-22 Thread Kai Mütz

dcastannon schrieb:

Clear button of FilterForm is set  as defaultFormProcessing false by default.
Change it to true.





This seems to solve my problem. Thanks a lot.

Kai

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



Re: changing dropdown labels in an AjaxEditableChoiceLabel

2008-03-19 Thread Kai Mütz

francisco treacy schrieb:

hi,

and i'm instantiating the component like this:

setModel(new CompoundPropertyModel(doctor));
(...)
add(new CustomAjaxEditableChoiceLabel(free).setOutputMarkupId(true));

this is working very well, except for the labels when i enter the
dropdown mode i still see true, false, (blank). i want my
labels also to be displayed when entering in edit mode.

i read about IChoiceRenderer and i even implemented one, but i can't
use it with the CompoundPropertyModel (?) cause in my component
constructor i can't do
super(id, Arrays.asList(Boolean.TRUE, Boolean.FALSE, null), new
CustomDropDownRenderer());
 (i need to pass in a Model, which is not updated as it is with the
compound one. or how would you do?)


Have you tried
super(id, new PropertyModel(doctor, property), 			 
Arrays.asList(Boolean.TRUE, Boolean.FALSE, null), new 
CustomDropDownRenderer());

?

Kai

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



Re: Problems with clearing of filter form

2008-03-19 Thread Kai Mütz
2008/3/19, Martin Makundi [EMAIL PROTECTED]:

 Can you show any binding code related to your case?

 DocumentDataProvider dataProvider = new
DocumentDataProvider(documentService);
DefaultDataTable documentTable = new DefaultDataTable(document-table,
createColumns(), dataProvider, 10);
final FilterForm form = new FilterForm(filter-form, dataProvider) {
private static final long serialVersionUID = 1L;

@Override
protected void onSubmit() {
documentTable.setCurrentPage(0);
}
};
documentTable.addTopToolbar(new FilterToolbar(documentTable, form,
dataProvider));
form.add(documentTable);

private ListIColumn createColumns() {
ListIColumn columns = new ArrayListIColumn();
columns.add(new TextFilteredPropertyColumn(
new ResourceModel(field.document.name), name, name) {
public void populateItem(final Item cellItem,
final String componentId, final IModel docModel) {
cellItem.add(new EditDocumentNamePanel(componentId, docModel));
}
});
columns.add(new TextFilteredPropertyColumn(
new ResourceModel(field.document.path), path, path));
columns.add(new ChoiceFilteredPropertyColumn(
new ResourceModel(field.document.mimetype), mimetype,
mimetype,
new LoadableDetachableModel() {
@Override
protected Object load() {
ListString mimeTypes = documentService.getMimeTypes();
mimeTypes.add(0, null);
return mimeTypes;
}
}
));
columns.add(new FilteredAbstractColumn(
new ResourceModel(form.common.filter)) {
public Component getFilter(final String id, final FilterForm form) {
return new GoAndClearFilter(id, form);
}
public void populateItem(final Item cellItem,
final String componentId, final IModel docModel) {
cellItem.add(new DocumentActionPanel(componentId, docModel));
}
});
return columns;
}


Markup:
div style=margin-top:25px;
form wicket:id=filter-form
input type=hidden name=tracker wicket:id=focus-tracker/
table class=dataview wicket:id=document-table/table
span wicket:id=focus-restore[call to focus restore
script]/span
/form
/div

Very similar to the phonebook example.

Kai


Re: Problems dependency slf4j wicket 1.3.1

2008-03-19 Thread Kai Mütz

luigiDC schrieb:

Hi  EveryBody!!!

I'm really new with wicket, i just have using it for a week.

I maked all my examples with wicket 1.2.6, and i didn't have any problem,
but now i wanna try wicket 1.3.1, and my problem start when in my screen
appear this problem:

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

org.apache.wicket.protocol.http.WicketServlet.clinit(WicketServlet.java:102

I have read that wicket 1.3.1 depends on slf4j, and i know that wicket 1.3.1
doesn't work with out this library. I have downloaded this jars,
slf4j-jcl-1.5.0-sources.jar and slf4j-jcl-1.5.0.jar, when I add to my
project the first one, the class not found is LoggerFactory, and when I add
the secon one, the class missed is org/slf4j/impl/StaticLoggerBinder.java.


You need at least:
slf4j-api-1.5.0.jar and one implementation, e.g.
- slf4j-jcl-1.5.0.jar or
- slf4j-log4j12-1.5.0.jar

If you choose the latter you need the log4j-1.2.x.jar as well.

HTH, Kai

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



Re: ModalWindow (component based) + form submit = can't close

2008-03-18 Thread Kai Mütz

Matej Knopp schrieb:

You have to use AjaxSubmitButton if you put panel into modal window.



No difference. I have tried AjaxSubmitButton, AjaxButton and 
AjaxSubmitLink. Once I have submitted the form, the modal window stays 
open. Reload of the entire page necessary to close modal.


Is there a working example of getting form input within a modal window?

Thanks, Kai

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



Re: DropDownChoice and setNullValid()

2008-03-18 Thread Kai Mütz

Kaspar Fischer schrieb:

I am trying to get a DropDownChoice to select either a country or
the option any country.

   searchOptions.add(new DropDownChoice(search-country, countries, 
countriesRenderer)

 .setNullValid(true).setRequired(false)  // (*)
   );

With the second line (*) commented out, the drop-down menu initially
shows

   any country
   Belgium
   ...

Once I select Belgium and submit the form, the any country vanishes
forever. That's the what I expect.

... but: with the line (*), I have the behaviour I need, but instead of
any country I get an empty string:

   empty string
   Belgium
   ...

Meaning, the DropDownChoice does not pick up anymore my entry

  search-country.null=any country


Try
search-country.nullValid=any country

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



Re: Problems with clearing of filter form

2008-03-18 Thread Kai Mütz
Nobody out there with a similar problem? I have mounted the page as
bookmarable page. Can this cause the problem? I have already set the
response header to no-cache.

Anybody an idea?

2008/3/17, Kai Mütz [EMAIL PROTECTED]:

 Hi,

 I am using the filter toolbar with filter form within a DefaultDataTable
 very similar to the phonebook example. I also use the GoAndClearFilter.
 The problem is the clear function: If I press the clear button the
 filter form modal seems to be updated/cleared because all (non filtered)
 results are shown. But the input fields (TextFiltered and
 ChoiceFiltered) of the filter form are not cleared. Does anybody know
 this problem?

 Regards, Kai



Problems with clearing of filter form

2008-03-17 Thread Kai Mütz

Hi,

I am using the filter toolbar with filter form within a DefaultDataTable 
very similar to the phonebook example. I also use the GoAndClearFilter. 
The problem is the clear function: If I press the clear button the 
filter form modal seems to be updated/cleared because all (non filtered) 
results are shown. But the input fields (TextFiltered and 
ChoiceFiltered) of the filter form are not cleared. Does anybody know 
this problem?


Regards, Kai

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



Problems with clearing of filter form

2008-03-17 Thread Kai Mütz

Hi,

I am using the filter toolbar with filter form within a DefaultDataTable 
very similar to the phonebook example. I also use the GoAndClearFilter. 
The problem is the clear function: If I press the clear button the 
filter form modal seems to be updated/cleared because all (non filtered) 
results are shown. But the input fields (TextFiltered and 
ChoiceFiltered) of the filter form are not cleared. Does anybody know 
this problem?


Regards, Kai

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



Re: wicket-suckerfish

2008-03-17 Thread Kai Mütz

Hoover, William schrieb:

Anyone know what repository that the wicket-suckerfish menus are available in 
(non-svn)?


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




https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-suckerfish

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



Re: wicket-suckerfish

2008-03-17 Thread Kai Mütz

Hoover, William schrieb:

Thanks, but I was looking for a way I could include it in a maven project with 
a dependency tag. I need to know what maven repository that this project is 
housed?



I have installed it in a local maven repository.

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



Re: [vote] Release 1.4 with only generics and stop support for 1.3

2008-03-17 Thread Kai Mütz

Martijn Dashorst schrieb:


Everybody is invited to vote! Please use

[ ] +1, Wicket 1.4 is 1.3 + generics, drop support for 1.3
[ ] -1, I need a supported version running on Java 1.4

Let your voices be heard!


+1

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



RE: Re: Re: spring problem! Panel Component could not get spring context beans,

2008-03-07 Thread Kai Mütz
[EMAIL PROTECTED]  wrote:
 Hello lars vonk,
 
 yes, I did. Other component is ok, just Panel component cause some
 NullException. did you access SpringContext in Panel, and its that
 OK? Thanks for your help. 

I do and it works. But I use the Annotation-based approach:

http://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach

Kai


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



RE: DropDownChoice getting value into the model

2008-03-07 Thread Kai Mütz
[EMAIL PROTECTED]  wrote:
 Thanks for trying but I get:
 
 WicketMessage: No get method defined for class: class
 java.lang.String expression: state 

Have you defined a getter/setter for field state in your vendor class?


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



Page reload after file upload

2008-03-06 Thread Kai Mütz
Hi,

I have one form with multiple fields where I can edit a object. I want to
attach a document or image (of class Document) to the form/object using a
second upload form. This works fine if I first execute the upload, then edit
other fields and finally submit the form.

The problem occurs if I upload/attach a file subsequent to editing the
fields. The upload form reloads the page and the changes in the form are
gone. How can I avoid this? How can I catch the changes made before upload?
Can nested forms solve this?

Thanks in advance,
Kai


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



RE: Page reload after file upload

2008-03-06 Thread Kai Mütz
[EMAIL PROTECTED]  wrote:
 a fancy solution would be to upload the file by means of an ajax
 request - then the values would stay the same as the page doesn't
 perform a full reload, that ain't as easy as it sounds, take a look a
 this:
 http://www.nabble.com/Submitting-an-ajaxform-with-multipart-form-d
 ata-to15734375.html#a15734375 

Thanks for your quick reply.

Have you tried the multi file upload component? Does that work?

Kai 


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



RE: Cross fields validation

2008-02-29 Thread Kai Mütz
[EMAIL PROTECTED]  wrote:
 Guys,
 
 Which the best pattern using wicket to write validation rule that
 span over
 more than one field?!

http://cwiki.apache.org/WICKET/validating-related-fields.html

HTH, Kai


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



FW: Problem while updating model within DojoDropDownChoice

2008-02-25 Thread Kai Mütz
Anybody with experiences in DojoDropDownChoice?

Furthermore I have read about the wickettools-extjs libs. Are there any
example out there how to use it?

Regrads, Kai

[EMAIL PROTECTED]  wrote:
 Hello list,

 I am new to wicket and playing around with the DojoDropDownChoice from
 wicketstuff-dojo-1.3.0-beta. I want to use it similar to a normal
 DropDownChoice component with ChoiceRenderer. But after selecting an
 entry of the list and submiting the form the model is not updated
 correctly. The corresponding ModelObject is set to null.

 Has anybody experience in this issue? Can anybody help me? Is it
 possible to
 use DojoDropDownChoice similar to a DropDownChoice within a form.
 Do I have
 to use the DojoSubmitButton in this case? Which methods of
 DojoDropDownChoice do I have to override exactly?


 Example:

 public final class MyModelChoiceRenderer implements IChoiceRenderer {

 public Object getDisplayValue(final Object object) {
 MyModel model = (MyModel) object;
 return model.getValue();
 }

 public String getIdValue(final Object object, final int index) {
 MyModel model = (MyModel) object;
 return String.valueOf(model.getId());
 }

 }

 public final class MyDropDownChoice extends DojoDropDownChoice {

 public MyDropDownChoice(final String id, final IModel model,
 final List ? extends MyModel data) {
 super(id, model, data, new MyModelChoiceRenderer());
 super.setHandleSelectionChange(true);
 }

 }

 ListMyModel models = getModels();

 form.add(new MyDropDownChoice(id, new PropertyModel(myObject,
 myModel), models));
 form.add(new MySubmitButton);



 Where myObject is a field of type MyModel with corresponding
 getter/setter. Any ideas?

 Regards, Kai


 -
 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]



Problem while updating model within DojoDropDownChoice

2008-02-20 Thread Kai Mütz
Hello list,

I am new to wicket and playing around with the DojoDropDownChoice from
wicketstuff-dojo-1.3.0-beta. I want to use it similar to a normal
DropDownChoice component with ChoiceRenderer. But after selecting an entry
of the list and submiting the form the model is not updated correctly. The
corresponding ModelObject is set to null.

Has anybody experience in this issue? Can anybody help me? Is it possible to
use DojoDropDownChoice similar to a DropDownChoice within a form. Do I have
to use the DojoSubmitButton in this case? Which methods of
DojoDropDownChoice do I have to override exactly?


Example:

public final class MyModelChoiceRenderer implements IChoiceRenderer {

public Object getDisplayValue(final Object object) {
MyModel model = (MyModel) object;
return model.getValue();
}

public String getIdValue(final Object object, final int index) {
MyModel model = (MyModel) object;
return String.valueOf(model.getId());
}

}

public final class MyDropDownChoice extends DojoDropDownChoice {

public MyDropDownChoice(final String id, final IModel model,
final List ? extends MyModel data) {
super(id, model, data, new MyModelChoiceRenderer());
super.setHandleSelectionChange(true);
}

}

ListMyModel models = getModels();

form.add(new MyDropDownChoice(id, new PropertyModel(myObject, myModel),
models));
form.add(new MySubmitButton);



Where myObject is a field of type MyModel with corresponding getter/setter.
Any ideas?

Regards, Kai


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



Problem while updating model within DojoDropDownChoice

2008-02-20 Thread Kai Mütz
Hello list,

I am new to wicket and playing around with the DojoDropDownChoice from
wicketstuff-dojo-1.3.0-beta. I want to use it similar to a normal
DropDownChoice component with ChoiceRenderer. But after selecting an entry
of the list and submiting the form the model is not updated correctly. The
corresponding ModelObject is set to null.

Has anybody experience in this issue? Can anybody help me? Is it possible to
use DojoDropDownChoice similar to a DropDownChoice within a form. Do I have
to use the DojoSubmitButton in this case? Which methods of
DojoDropDownChoice do I have to override exactly?


Example:

public final class MyModelChoiceRenderer implements IChoiceRenderer {

public Object getDisplayValue(final Object object) {
MyModel model = (MyModel) object;
return model.getValue();
}

public String getIdValue(final Object object, final int index) {
MyModel model = (MyModel) object;
return String.valueOf(model.getId());
}

}

public final class MyDropDownChoice extends DojoDropDownChoice {

public MyDropDownChoice(final String id, final IModel model,
final List ? extends MyModel data) {
super(id, model, data, new MyModelChoiceRenderer());
super.setHandleSelectionChange(true);
}

}

ListMyModel models = getModels();

form.add(new MyDropDownChoice(id, new PropertyModel(myObject, myModel),
models));
form.add(new MySubmitButton);



Where myObject is a field of type MyModel with corresponding getter/setter.
Any ideas?

Regards, Kai


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