Announcement

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

    Multiple text boxes as one field

    Hi,

    I was wondering if it is possible to add multiple text boxes as one (logical) field within dynamic form (similar to the case when DateItem is displayed as three drop down boxes, but having text boxes instead)?

    I am using SmartGWT 1.1.

    Thanks.

    #2
    Short answer yes, but you need to create your own class to do, just create something as such:
    Code:
    public class myCustomFormItem extends CanvasItem {
        TextItem textone = new TextItem();
        TextItem texttwo = new TextItem();
         ...
    
        public myCustomFormItem() {
            VLayout l = new VLayout();
            l.addMember(textone);
            l.addMember(texttwo);
            setCanvas(l); 
        }
    };
    Obviously just a short example, but something similiar is all you need. Any instance of myCustomFormItem can be used like any other form field.

    Comment


      #3
      Thanks, I'll try this out.

      Comment


        #4
        hmm, is seems that addMember method of layouts only accepts widgets and canvases and TextItem is not descended from either.

        Any other suggestions?

        Thanks in advance.

        Comment


          #5
          Woops just use a dynamic form and setItems(). Then setCanvas(form).

          Comment

          Working...
          X