Hi Andrea,
I'm trying to make a component that edits the
corners of a rectangle. The model of this
component should be a JTS Envelope class:
http://www.jump-project.org/docs/jts/1.7/api/com/vividsolutions/jts/geom/Envelope.html?is-external=true
This class has getters for minX,minY,maxX,maxY,
but has no setters for them, you're supposed
to call init(x1,x2,y1,y2) instead.
Has anyone an idea of how to bind four text fields
so that the model of my Panel is the JTS Envelope,
the fields use the Envelope corners, but the
update takes place as a single shot instead
of a field by field basis (that I cannot do
given the lack of setters?)
I think you should use a FormComponentPanel<Envelope> as the base of
your panel.
That way you can have a Model<Envelope> and manually pull out the parts
(in panel.onBeforeRender) for the text fields into their Model<Integer>
models.
Overriding panel.convertInput() will allow out to build a new instance
(i..e calling init(x1,x2,y1,y2) when the containing form submits.
something like:
@Override
protected void convertInput() {
Integer x1 = x1TextField.getObject();
.
.
.
Envelope e = Envelope.init (x1, ...);
setConvertedInput (e);
}
Regards,
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org