You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ivlev Dmitry (JIRA)" <ji...@apache.org> on 2007/05/04 05:51:15 UTC

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

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
         Environment: jdk1.4 wicket-1.3.-incubating-beta1
            Reporter: Ivlev Dmitry
             Fix For: 1.3


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.


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

Posted by "Alastair Maw (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alastair Maw updated WICKET-530:
--------------------------------

        Fix Version/s:     (was: trunk)
                       1.3.0-rc1
    Affects Version/s:     (was: trunk)
                       1.3.0-beta1

> 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
>             Fix For: 1.3.0-rc1
>
>
> 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.