Hello all,
we want to create a styled button for our application.
Each button can be of different size and we want to use localization for the
text so we thought about creating 3 images for our buttons.
left gif, middle gif and right gif.

I want to create a new component that rendered itself to something like:
<img .....> <input type="submit" ...> <img....>

If there is already something like that, I would love using it.
If not, I would be even more glad creating it.

Here's something I started:

package com.....components;

import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupStream;
import org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.model.IModel;

public abstract class MyButton extends
WebMarkupContainerWithAssociatedMarkup {
    private static final long serialVersionUID = -5168724130685807087L;
    private final Button button;

    public MyButton(String id) {
        super(id);
        button = new Button("eurekifyButton");
    }

    public MyButton(String id, IModel model) {
        super(id, model);
        button = new Button("eurekifyButton", model);
    }

    @Override
    protected void onComponentTag(ComponentTag tag) {
        // TODO Auto-generated method stub
        super.onComponentTag(tag);
    }

    @Override
    protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
        // TODO Auto-generated method stub
        super.onComponentTagBody(markupStream, openTag);
    }

    public abstract void onSubmit();
}

The onSubmit is to imitate the onSubmit of a button.

Is the component should be WebMarkupContainerWithAssociatedMarkup or just
WebMarkupContainer?
Is a Panel good candidate? (I believe not).

Any help would be appreciated.
It seems that this is my first "more that a trivial" reusable component.

Thanks guys,
This users list is most helpful.


-- 
Eyal Golan
[EMAIL PROTECTED]

Visit: http://jvdrums.sourceforge.net/

Reply via email to