You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Frank Bille Jensen (JIRA)" <ji...@apache.org> on 2007/12/06 19:50:44 UTC

[jira] Updated: (WICKET-530) FormComponent.type ignored for print

     [ https://issues.apache.org/jira/browse/WICKET-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frank Bille Jensen updated WICKET-530:
--------------------------------------

    Fix Version/s:     (was: 1.3.0-rc2)

> FormComponent.type ignored for print
> ------------------------------------
>
>                 Key: WICKET-530
>                 URL: https://issues.apache.org/jira/browse/WICKET-530
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-beta1
>         Environment: jdk1.4 wicket-1.3.-incubating-beta1
>            Reporter: Ivlev Dmitry
>            Assignee: Igor Vaynberg
>
> I have created text field:
> add(new TextField("quantity", Converters.QUANTITY.getClass()));
> and register my custom converter in session's ConverterLocator.
> But my converter is not called for markup output because:
> TextField.onComponentTag => tag.put("value", getValue());
> FormComponent.getValue => return getModelValue();
> FormComponent.getModelValue => return getModelObjectAsString();
> Component.getModelObjectAsString() =>
> 		final Object modelObject = getModelObject();
> 		if (modelObject != null)
> 		{
> 			// Get converter
> 			final IConverter converter = getConverter(modelObject.getClass());
> As a result FormComponent.type is ignored and I need to overwrite  method getConverter for right converter selection.
> PS: Why FormComponent.type is Class? I think Object or String will be better. This gives more freedom for ConverterLocator. In my project I have about 4 converters for Double which uses four different DecimalFormats for convert/parse values. Why do I need create four classes for it? With String type selector I can be use four instances of one DecimalFormatConverter each of them is initialized with customized DecimalFormat instance.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.