Announcement

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

    redraw() or setWidth() makes ComboBoxItem non typable

    Hi,

    In my sample application, I have a form which contains several formitems including ComboBoxItem. I have added FormItemIcon with each formitem but initially there is setShowIcons(false) for all. I only want to show the icon when user focus on the item. Thats why i have handled onFocus (in which I have added code event.getItem().setShowIcons(true) and event.getItem().redraw())
    and same thing but setShowIcons(false) in onBlur event.

    Now my problem is, Initially my combo box is typable. User can type and matched result will be populated in picker list. But when I focus on combo box, onFocus event gets fired and I am able to see FormItemIcon but my combo box is not typable now. Please note that instead of redraw I tried setWidth() also and if I remove redraw or setWidth my combo box works fine but no icon gets displayed.

    Thanks in advance.

    #2
    Can you post your code here?

    Comment


      #3
      Hi,
      I am sorry but i was using one flag which was creating the problem. I resolved it and it is working fine.

      But can you provide me some information about how to hide pick list of combo box and same for DateItem ? I want to make ComboBoxItem and DateItem uneditable untill user clicks on edit button, but I want to receive focus and blur event thats why I can not make them disable. I handled ChangeEvent and cancelling it if user has not clicked edit button but I want that Pick List should also not get opened when user clicks on picker icon (in case of ComboBoxItem and DateItem)

      Comment


        #4
        You can try this:
        For ComboboxItem:
        Code:
        comboBoxItem.setAttribute("readOnly", true);
        comboBoxItem.setShowPickerIcon(false);
        For DateItem:
        Code:
        TextItem textItem = new TextItem();
        textItem.setAttribute("readOnly", "true");
        
        dateItem.setTextFieldProperties(textItem);
        dateItem.setUseTextField(true);
        dateItem.setShowPickerIcon(false);

        Comment


          #5
          But using this both ComboBoxItem and DateItem will look like normal TextItem. I think user should know that it is ComboBoxItem or DateItem but nothing should happen when user clicks on pick list icon.

          Comment


            #6
            Ok then, Try this:
            Code:
            dateItem.setInputTransformer(new FormItemInputTransformer() {
            @Override
            public Object transformInput(DynamicForm form, FormItem item,
            	Object value, Object oldValue) {
            		return null;
            	}
            });
            comboBoxItem.setInputTransformer(new FormItemInputTransformer() {
            @Override
            public Object transformInput(DynamicForm form, FormItem item,
            	Object value, Object oldValue) {
            		return null;
            	}
            });

            Comment


              #7
              This will only cancel out any user input which has already been taken care in ChangeEventHandler. Here just we need is don't show anything when user clicks on pick list icon.

              Comment


                #8
                Can anybody provide some solution for this ?

                Comment


                  #9
                  Don't you think this will be like cheating the user?
                  You want a ComboboxItem. You want its PickerItem to be shown. You want that ComboboxItem to be filled up with values. You don't want to disable/hide that ComboboxItem. But when the user clicks the PickerIcon, values should not be shown to him. Is this your requirement?

                  Comment


                    #10
                    Yes, It's our requirement. We can not hide / disable combo box because we want events on it.

                    Comment


                      #11
                      Can anybody please provide solution.

                      Comment

                      Working...
                      X