Hi *,

i have a panel with a form. This contains a textfield, which is initialized
with a default value, if the field in the model has no value. After changing
the textfield and submitting the form, the model isn't changed.
After submitting a new website should be open and display the value of the
model.
Can somebody please tell me where i made a mistake? I've searched the intire
day to solve the problem.
Or is there an alternative way?
I put example code below.


regards per



RequiredTextField tlastName=new RequiredTextField("lastName",new
StringI18NModel2(new PropertyModel(pModel,"customerData.lastName"), new
PropertyModel(this, "session.locale"),new
ResourceModel("label.lastName").wrapOnAssignment(UserPanel.this)));
tlastName.add(StringValidator.minimumLength(2));
add(tlastName);



public class StringI18NModel2 extends Model {

private IWrapModel _resourceModel;
private IModel _valueModel;
private IModel _localeModel;

public StringI18NModel2(IModel pValueModel, IModel pLocaleModel, IWrapModel
pResourceModel) {
super();
_valueModel = pValueModel;
_localeModel = pLocaleModel;
_resourceModel = pResourceModel;
}

protected Format getFormatInstance() {
return null;
}

protected Object getNullRepresentation() {
return _resourceModel.getObject();
}
        
public Object getObject() {
Object o = _valueModel.getObject();
if (o != null) {
return getFormatInstance() == null ? o : getFormatInstance().format(o);
}
return getNullRepresentation();
}

protected Locale getLocale() {
return (Locale) _localeModel.getObject();
}
}






-- 
View this message in context: 
http://www.nabble.com/Value-not-changing-after-submitting-a-form-tf4844099.html#a13858917
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to