Announcement

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

    ListGridFieldType.LINK improvement idea

    Hi,
    I've an idea of an improvement to the ListGridFieldType.LINK componement. It could be very nice to have the same features URLPrefix and URLSuffix than the ListGridFieldType.IMAGE component.

    I explain : I've a datasource XML file, and in the XML I've some business data. When linking this to a ListGridFieldType.LINK componement the data is just set at the end of the current location, to create a link like this : http://my.current.location/mydata . It could be very nice to have the same functionnality than the ListGridFieldType.IMAGE component to generate a link like this : http://my.current.location/<myPrefix>mydata<mySuffix>

    It could, for example, generates url like this :
    http://my.current.location/myPage.htm?param=myData with prefix = "myPage.htm?param="
    http://my.current.location/myData.htm with suffix = ".htm"
    or any other combinaison
    Last edited by romain.vdk; 30 Sep 2010, 23:18.

    #2
    Is there any solution to this problem ?

    Comment


      #3
      Actually this is already supported but unexposed.
      Call ListGridField.setAttribute("linkURLPrefix", "http://somePrefix/"); and ListGridField.setAttribute("linkURLSuffix", ".html"); to make use of it.
      We'll expose this via proper, documented getter and setter methods too.

      Comment


        #4
        Thanks, that works well.
        It's a little pitty that the attribute is not directly available ...

        Comment


          #5
          In the same way, is it possible to acces the link value itself without modifing the displayed value ?
          A simple example :
          I wish create a link like this <a href="+LinkURLPrefix++LinkURL??++LinkURLSuffix+">+LinkURL??+</a>

          are the two +LinkURL+ linked each other or may I also use a special attribute to modify the link and not the displayed value ?

          Comment


            #6
            You can call setLinkText() on the field to provide the display value for each record, or call setLinkText() on specific records to change the display value per record.
            Or if you already have another property on the record you want to use as the link text you can call setLinkTextProperty() on the ListGrid to pick it up.

            Comment

            Working...
            X