Announcement

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

    iconSpacing for form items

    There is a 3px margin between the two icons ...is there any way to modify this? It looks like iconSpacing is not a valid property

    Code:
    isc.DynamicForm.create({
        width: 200,
        fields : [
            {name: "severityLevel",
             title: "Severity Level",
             type: "staticText",
             defaultValue: "Severity 2",iconSpacing: 2,
             helpText: "<br><b>Severity 1</b> - Critical problem<br>System is unavailable in production or " +
                       "is corrupting data, and the error severely impacts the user's operations." +
                       "<br><br><b>Severity 2</b> - Major problem<br>An important function of the system " +
                       "is not available in production, and the user's operations are restricted." +
                       "<br><br><b>Severity 3</b> - Minor problem<br>Inability to use a function of the " +
                       "system occurs, but it does not seriously affect the user's operations.",
             icons: [{
                src: "other/help.png",
                click: "isc.say(item.helpText)"
             },{
                src: "other/help.png",
                click: "isc.say(item.helpText)"
             }]
            }
        ]
    });

    #2
    I'd also like to know how to move the icon - iconOrientation is currently not available in Form items as of SmartClient 8.2p 2013-02-04

    Comment


      #3
      A response would be greatly appreciated.

      Comment


        #4
        There's an undocumented property for this: formItem.iconHSpace, or for per-icon configuration, icon.hspace

        These govern how many px appear to the left of each icon.

        We'll go ahead an make these public moving forward

        Regards
        Isomorphic Software

        Comment


          #5
          ok Thanks iconHSpace fixes my spacing issue but I still have the issue regarding iconOrientation?

          "acarur01 I'd also like to know how to move the icon - iconOrientation is currently not available in Form items as of SmartClient 8.2p 2013-02-04"

          Comment


            #6
            Sorry - we somehow missed that part of the question.

            We don't have a property called iconOrientation for FormItems.
            Can you clarify what appearance you're trying to achieve?

            Thanks

            Comment


              #7
              We just want to move the icon from the left of the title to the right of the title

              Comment


                #8
                Presumably you mean you want to move the icon such that it shows up to the left of the item value rather than at the end (trailing the item value).
                This is not currently supported.
                ValueIcons show up on the left of the item value, so this might work for you, or you could make use of a custom CanvasItem containing an Img and a Label as subcomponents or similar.

                Regards
                Isomorphic Software

                Comment


                  #9
                  Ok - this works fine if the item is a static text but when I modify to use with a textfield, the valueIcon is shown on the top of the field, not the left of it. Is this expected?

                  Code:
                  isc.DynamicForm.create({
                      width: 200,
                      fields : [
                          {name: "severityLevel",
                           title: "Severity Level",
                           type: "text",
                           defaultValue: "Severity 2",
                           helpText: "<br><b>Severity 1</b> - Critical problem<br>System is unavailable in production or " +
                                     "is corrupting data, and the error severely impacts the user's operations." +
                                     "<br><br><b>Severity 2</b> - Major problem<br>An important function of the system " +
                                     "is not available in production, and the user's operations are restricted." +
                                     "<br><br><b>Severity 3</b> - Minor problem<br>Inability to use a function of the " +
                                     "system occurs, but it does not seriously affect the user's operations.",
                           cwicons: [{
                              src: "other/help.png",
                              click: "isc.say(item.helpText)"
                           }],
                  getValueIcon: function(v){
                     return this.cwicons[0].src;
                  }
                  
                  
                          }
                      ]
                  });

                  Comment


                    #10
                    This is not correct behavior - we should not be wrapping the text box below the valueIcon for TextItems. Yours is not a common usage, but this is not the expected appearance. We will look at how to resolve this at the framework level.

                    However - you can avoid this by ensuring there's enough space to render the form item without expanding the form as a whole.
                    For example adding colWidths:[50,150] to this example will ensure the TextItem renders in a column with enough space to accomodate it automatically.
                    ---
                    Update: we've now made a change which should address this issue. Please try the next nightly build and let us know if the wrapping issue persists. The change has been applied to the 8.3 and 9.0 branches.
                    Last edited by Isomorphic; 20 Feb 2013, 12:40.

                    Comment


                      #11
                      Thanks - I noted that our current version is SmartClient 8.2p 2013-02-04 - Can the fix be ported?

                      Comment


                        #12
                        Actually we're not going to port this one back to 8.2, but you should be able to workaround as suggested, by ensuring the DynamicForm width / colWidths are set such that there is enough space within the column for the item.

                        Comment


                          #13
                          I'm having some problems with using ValueIcon - it doesn't appear to have any other properties except for the src url - the field icons have a click method as well as the tooltip - anyway we can do this with valueIcons? I realize valueIcons are probably just meant for showing the values

                          Comment


                            #14
                            That's correct, valueIcons are intended for annotating displaying values and not considered an interactive element. They have no events.

                            Two comments on this:
                            1. maybe you are trying to manually implement RTL (right to left). You just need to set this dir="rtl" on the <html> element as explained in the docs to get this; there's no need to manually reverse every layout on the page

                            2. another way to get an interactive icon in the form "in front of" an item is to create a StaticTextItem in the adjacent column with no value, and some FormItemIcons defined

                            Comment


                              #15
                              No, this is not an attempt to make the page rtl. Our client asked for this feature - they are US based.

                              It seems like a lot of work on our part to create a new control just so we can move the icon before the field..but I guess we have no choice.

                              Comment

                              Working...
                              X