Announcement

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

    Datasource type "link" issue

    Hi Isomorphic,
    at first, please let me congratulate for the fantastic work you have done on the last release of Smartclient, i'm very impressed.

    I have a little issue with the datasource type "link" as follows:
    If i use this kind of field type, i can have a "clickable" text on a listgrid, but unfortunately i cant see the same on the related DetailViewer.
    The text simply shows the URL, but i cannot click on it as i can do on the same field on the listgrid.

    Is that something wich can be solved with a configuration or it's simply working as designed?
    And, in this last case, is there a way i can make "clickable" the Viewer field when a URL is shown on that field?

    Thanks a lot in advance for your answer,
    Best regards

    #2
    Exact same issue

    I am also trying to create a link for text in a DetailViewerField. Is this supported at all? It seems to my review of the documentation and this forum that it is not...

    Comment


      #3
      Originally posted by ecruz
      I am also trying to create a link for text in a DetailViewerField. Is this supported at all? It seems to my review of the documentation and this forum that it is not...
      Hi,

      Did you find any solution/answer for this? I am trying to do the same thing also. I need a link for the text in the DetailViewerField..

      Comment


        #4
        Not exactly a workaround...

        What we wound up doing was creating a "mock" link in a custom formatter for the dataviewer field that we were working with. In other words, we interleaved some styles on the text for the field that made it look and behave like a link (including a onMouseOver to change the pointer into a hand), and then added an click handler on the entire DataViewer (rather than the individual field) for the desired "link" behavior.

        Believe it or not, from a user perspective this actually behaves pretty much exactly like a real link on the field would. If you have have more than one link in the dataviewer, however, you would still be SOL with this approach.

        Comment


          #5
          HI guys,
          i've actually found a working solution (i'm using it without any issue) using formatcellvalue function as follows:


          {
          type:"link",
          title:"Allegato",
          name:"documento",
          required:false, detail:false,
          formatCellValue: function(value) {
          if(value) {
          return "<a href='"+value+"' target='_blank'>"+value+"</a>";
          }else {return null}
          }


          In this way eventviewer link fields can be clicked and mouse "hand" appears exactly as for normal html links.

          Comment


            #6
            Seems that the DetailViewer should be updated to work like a ListGrid. Or the ListGrid should have a setter/getter for the DetailViewer

            This one the link works but puts the field in the list grid.(where I don't want it.)
            Code:
             
                    DataSourceLinkField helpLink = new DataSourceLinkField("helpLink", "More Help");
                    DataSourceTextField linkText = new DataSourceTextField("linkText");
                    helpLink.setAttribute("linkText", linkText);
                    linkText.setHidden(true);
            This puts the data where I want it, but the link fails.
            Code:
             DataSourceLinkField helpLink = new DataSourceLinkField("helpLink", "More Help");
                    DataSourceTextField linkText = new DataSourceTextField("linkText");
                    helpLink.setAttribute("linkText", linkText);
                    helpLink.setDetail(true);
                    linkText.setHidden(true);
            Anyway to get this working in the next release?

            Comment


              #7
              How do you mean the link "fails"? Did you mean it fails in the DetailViewer only?

              Comment


                #8
                The link is not a link, just static text of the url.

                Comment


                  #9
                  And in what widget?

                  Comment


                    #10
                    Yes, in the DetailsViewer, the "link" is static text of a URL. Unlike the ListGrid which renders the link as a clickable and presentable link. Is it unreasonable to believe that 2 strongly coupled widgets that are bound to the same datasource would have the same or similar behavior?

                    I would have extended and overloaded the DetailsViewer to preform as I wished it to, but there is no way to tell the ListGrid to use said overloaded DetailsViewer.

                    Comment


                      #11
                      It makes sense that the DetailViewer would act like ListGrid here, we'll add that feature to 3.1d (including support for field.linkText and field.target). In the meantime, or for any existing release, just use the formatter support if you want to create an actual link.

                      Comment

                      Working...
                      X