Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Can I use FormItem.setAutoChildConstructor to use my DateChooser? How?

    Can I use FormItem.setAutoChildConstructor to use my DateChooser? How? (missing documentation? example?)

    I did try but got an error about my class not being loaded. I think I don't understand how to define the class to be loadable or how to specify the class to load or something.

    1. the *complete* SmartGWT or SmartClient version from the lower left-hand corner of the Developer Console (see FAQ for how to open Developer Console), for example, \"v8.2p_2012-04-18/PowerEdition Deployment\"

    SmartGWT4.0p
    SmartClient Version: v9.0p_2013-11-17/LGPL Development Only (built 2013-11-17)

    2. browser(s) and version(s) involved

    FireFox/Mac

    5. if there is a JavaScript error, the stack trace logged in the Developer Console (see FAQ)

    19:37:28.513:TMR1:WARN:DateItem:isc_DateItem_1[requestedDueDate]:Date Item pickerConstructor class 'com.lstreetc.pi.client.ui.ProjectResultsLG.InnerDateChooser' is not loaded. This property may have been modified incorrectly or a required module may not be loaded. Suppressing the pickerIcon.

    6. sample code if applicable

    dateItem.setAutoChildConstructor( "picker", "com.lstreetc.pi.client.ui.ProjectResultsLG.InnerDateChooser" );

    ...

    I saw a suggested way to implement my own picker (via a FieldItemIcon), but I wanted to have it show up near the field like the existing DateItem field in the normal flow, just use MY picker, and skip figuring out how to make all that happen properly myself.
    Last edited by RobertHana; 28 Feb 2014, 13:29.

    #2
    Looks like your class has not been made reflectable. See the Reflection overview in the "docs" JavaDoc package.

    Comment


      #3
      thanks it worked

      thanks it worked,

      but my DateChooser did not fire my overridden todayClick function as I thought it would according to what I read in the documentation.

      Comment


        #4
        todayClick()

        I wanted to override the today button so I could have it save a slightly modified value for today. I ended up getting the button from the initialized layout structure (assuming it would structurally always be in the same place), adding a clickHandler, and in the handler setting the date on the chooser.

        The new click handler caused the chooser to not hide/dismiss.

        And thus I added a call to todayClick, and it both pushed a date to the origin field, and dismissed/hid the date chooser.

        Thus my guess is that todayClick is used to programmatically simulate the today having been clicked. But now what I am uncertain of is calling it caused the original date (as the today button would have chosen). If it does, then I need to know how to properly perform the chosen date push to the origin field and then to properly dismiss/hide the chooser. (it doesn't cause a dataChanged event, that's for sure)

        So, do I need to implement the push+dismiss? and how would I properly do it? (I don't know what to call to push to the origin field and I do not at this point have access to the origin field as in anonymous subclass with access to the origin field)
        Last edited by RobertHana; 1 Mar 2014, 00:25.

        Comment


          #5
          The todayButton is an AutoChild, so you need not make any assumptions about structure to access the todayButton or override its click handler.

          However we suspect you may completely "off in the weeds" with this deep dive into DateChooser customization - why don't you try explaining the big picture of what you are trying to achieve, from an end user's perspective (not just implementation details - user experience).

          Comment

          Working...
          X