Re: Customize AjaxEditableLabel

2011-07-05 Thread PDiefent
Here are some code sniplets, perhaps you can see what's wrong - I definitely
don't call super newEditor().

The next problem I will get is that the ContentEditorLabel closes when I
click on an other field in the form. I would prefer a modal behaviour what
means that I have to use the buttons to close the ne edit fields ...


private class ContentEditorLabel extends AjaxEditableLabelString {
private static final long serialVersionUID = 1L;
public ContentEditorLabel(String id) {
super(id);

}   
@Override
protected final FormComponentString newEditor(
MarkupContainer parent, String componentId,
IModelString model) {

final SwiftFieldInput editor = new 
SwiftFieldInput(componentId, model){
private static final long serialVersionUID = 1L;

@Override
public IConverter getConverter(Class? type)
{
IConverter c = 
ContentEditorLabel.this.getConverter(type);
return c != null ? c : 
super.getConverter(type);
}

@Override
protected void onModelChanged()
{
super.onModelChanged();

ContentEditorLabel.this.onModelChanged();
}

@Override
protected void onModelChanging()
{
super.onModelChanging();

ContentEditorLabel.this.onModelChanging();
}
}; 
editor.setOutputMarkupId(true);
editor.setVisible(false);
editor.add(new EditorAjaxBehavior());
return editor;
}
};

package com.csc.pts.web.panels.swift;

import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.form.FormComponentPanel;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

public class SwiftFieldInput extends FormComponentPanelString {
private static final long serialVersionUID = 1L;

private final FormComponentString contentArea;
String test;
public SwiftFieldInput(String id, IModelString model) {
super(id,model);

contentArea = new TextAreaString(contentarea,new 
ModelString());
add(contentArea);
}

@Override
protected void onModelChanged() {
super.onModelChanged();
String content = getModelObject();
if (content != null)
contentArea.setModelObject(content);
else
contentArea.setModelObject(null);
}
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3645206.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: Customize AjaxEditableLabel

2011-07-05 Thread Martin Grigorov
Check 
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableMultiLineLabelT

If this doesn't fit your needs then advise from
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableChoiceLabelT
as well

On Tue, Jul 5, 2011 at 8:38 AM, PDiefent pdief...@csc.com wrote:
 Here are some code sniplets, perhaps you can see what's wrong - I definitely
 don't call super newEditor().

 The next problem I will get is that the ContentEditorLabel closes when I
 click on an other field in the form. I would prefer a modal behaviour what
 means that I have to use the buttons to close the ne edit fields ...


 private class ContentEditorLabel extends AjaxEditableLabelString {
                private static final long serialVersionUID = 1L;
                public ContentEditorLabel(String id) {
                        super(id);

                }
                @Override
                protected final FormComponentString newEditor(
                                MarkupContainer parent, String componentId,
                                IModelString model) {

                        final SwiftFieldInput editor = new 
 SwiftFieldInput(componentId, model){
                                private static final long serialVersionUID = 
 1L;

                                @Override
                                public IConverter getConverter(Class? type)
                                {
                                        IConverter c = 
 ContentEditorLabel.this.getConverter(type);
                                        return c != null ? c : 
 super.getConverter(type);
                                }

                                @Override
                                protected void onModelChanged()
                                {
                                        super.onModelChanged();
                                        
 ContentEditorLabel.this.onModelChanged();
                                }

                                @Override
                                protected void onModelChanging()
                                {
                                        super.onModelChanging();
                                        
 ContentEditorLabel.this.onModelChanging();
                                }
                        };
                        editor.setOutputMarkupId(true);
                        editor.setVisible(false);
                        editor.add(new EditorAjaxBehavior());
                        return editor;
                }
        };

 package com.csc.pts.web.panels.swift;

 import org.apache.wicket.markup.html.form.FormComponent;
 import org.apache.wicket.markup.html.form.FormComponentPanel;
 import org.apache.wicket.markup.html.form.TextArea;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;

 public class SwiftFieldInput extends FormComponentPanelString {
        private static final long serialVersionUID = 1L;

        private final FormComponentString contentArea;
        String test;
        public SwiftFieldInput(String id, IModelString model) {
                super(id,model);

                contentArea = new TextAreaString(contentarea,new 
 ModelString());
                add(contentArea);
        }

        @Override
        protected void onModelChanged() {
                super.onModelChanged();
                String content = getModelObject();
                if (content != null)
                        contentArea.setModelObject(content);
                else
                        contentArea.setModelObject(null);
        }
 }



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3645206.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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com


Customize AjaxEditableLabel

2011-07-04 Thread Peter Diefenthaeler
Hallo,
is it possible to customize AjaxEditableLabel in a way that I can replace 
the TextEditField with a panel? I have to display a little Form with a 
text area component and some buttons. A modal window doesn't work for me 
because I want to show the panel exactly at the position of the label.
Thanks, Peter 


Re: Customize AjaxEditableLabel

2011-07-04 Thread Martin Grigorov
See 
org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel.newEditor(MarkupContainer,
String, IModelT)
Return FormComponentPanel.

On Mon, Jul 4, 2011 at 1:30 PM, Peter Diefenthaeler pdief...@csc.com wrote:
 Hallo,
 is it possible to customize AjaxEditableLabel in a way that I can replace
 the TextEditField with a panel? I have to display a little Form with a
 text area component and some buttons. A modal window doesn't work for me
 because I want to show the panel exactly at the position of the label.
 Thanks, Peter




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Customize AjaxEditableLabel

2011-07-04 Thread PDiefent
Thanks for your fast response. 
Is there a QuickStart available how to implement it?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643435.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: Customize AjaxEditableLabel

2011-07-04 Thread Martin Grigorov
AjaxEditableLabel itself, I guess.
See how it creates TextField.

On Mon, Jul 4, 2011 at 1:49 PM, PDiefent pdief...@csc.com wrote:
 Thanks for your fast response.
 Is there a QuickStart available how to implement it?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643435.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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Customize AjaxEditableLabel

2011-07-04 Thread PDiefent
I tried it like AjaxEditableLabel does itself, but now I get the default
input field plus the new fields in the panel! How do I erase the default
text field?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643712.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: Customize AjaxEditableLabel

2011-07-04 Thread Martin Grigorov
Unless you call super.newEditor() in your implementation it should not
know the TextField.
Paste your code in some pastebin service (e.g. www.pastie.com)

On Mon, Jul 4, 2011 at 4:10 PM, PDiefent pdief...@csc.com wrote:
 I tried it like AjaxEditableLabel does itself, but now I get the default
 input field plus the new fields in the panel! How do I erase the default
 text field?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Customize-AjaxEditableLabel-tp3643409p3643712.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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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