Results 1 to 3 of 3

Thread: Property Editor

  1. #1
    Join Date
    Apr 2005
    Location
    Porto Alegre, RS, Brazil
    Posts
    14

    Default Property Editor

    Hello,

    I'm trying to create a "StatePropertyEditor", which is supposed to transform a string (the id of the state) that comes from a dropdown of state selection. This property editor needs to consult the database and get the state object from its primary key.

    The problem that my "stateService" attribute isn't being setted by spring. I make a right declaration of the "StatePropertyEditor" bean in applicationContext.xml, I create its "stateService" property, refering it to "stateService" bean, but in my StatePropertyEditor class, "stateService" is null.

    Am I making some stupid mistake? Is there any "trick" on spring's Ioc when working with property editors?

    Thanks very much.

    Mauricio

  2. #2
    Join Date
    Oct 2004
    Location
    Rotterdam, Netherlands
    Posts
    90

    Default

    Can you post your configuration and StatePropertyEditor code? Did you configure the PropertyEditor as described in the reference doc? Sample:

    Code:
    <bean id="customEditorConfigurer" 
        class="org.springframework.beans.factory.config.CustomEditorConfigurer">
        <property name="customEditors">
            <map>
                <entry key="example.ExoticType">
                    <bean class="example.ExoticTypeEditor"/>
                </entry>
            </map>
        </property>
    </bean>
    No "tricks", sorry ...

  3. #3
    Join Date
    Apr 2005
    Location
    Porto Alegre, RS, Brazil
    Posts
    14

    Default

    Thanks for trying to help me, delnoij

    The solution I found was get spring 1.2.1 (until now, I was working on 1.1.3), which MultiActionController's can have an initBinder method, so I could register my editor by java code. :lol:

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  5. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •