Web Form Data Grid Hyperlink Column
Created: 08 Jan 2013 | 16 comments
I'm trying to set up a data grid with a column that has clickable links in it, but I'm trying to figure out, how does the hyperlink column actually work? When I use a Text Property Name (which for each row contains a [data value]) and click on the link, it generates a URL http://server/project/[data value]. This would be useful if I could put some text in the URL like dialog.aspx?Variable=[data value]. It seems like this would be placed in the Format field. However when I try to enter a URL or part of a URL in the Format field, workflow throws an error inside of the cell on the grid, not posting it in the log. So what is the Format field used for?
Using workflow solution 7.1.2. Any help would be useful.
Thanks,
Justin
Discussion Filed Under:
Comments 16 Comments • Jump to latest comment
I, too, would love to hear more about the format field if anyone has insight!
That said, the way I've solved this when using the grid component was to alter the data in the field I wanted to be a hyperlink. I would run the collection through a for each and use a merge text component to add the correct html '<a href=' type data to the front and '</a>' to the end. In some cases I've even gone a step farther towards lunacy by using the sql query from custom components to add that in instead. Obviously that's only wise if I feel that the data will only be used in such a grid, but it did save more a for loop.
If there's a better way to do it, I'd love to hear it.
If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.
Michael.george is correct. That's how the hyperlink column is used. A merge field on the column that's lets you create the link using all fields in the row would be a nice addition.
Format is a property of all columns but I can't think of a case where its useful here. If you're familiar with C# it basically does a .ToString(<format>). Its mostly useful for currency, dates, numbers, guids, etc. For example, on a decimal or integer field "c" would format the field as currency. "0.00" would round a decimal field to two decimal places. If you google "c# format examples" you can find more.
This, in particular covers some of that. I'm putting it here to save someone a few clicks.
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
Thanks for the information, rhamner!
If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.
I don't understand why it generates the URL like this "http://server/project/[data value]" with all the stuff before the data value. Is there a way to get it to generate the URL like this "[data value]"? My grid has actual links in them. I just want to be able to reference them.
Not sure what you mean by 'data value'. Can you say more and/or give some examples?
If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.
Data value = an item in the grid.
I have a grid that displays a bunch of URLs. I just want the user to be able to click one of them from the grid and go to that particular site.
EX: One of the links in the grid is "www.google.com". When I click on that link, the workflow takes me to "http://server/project/www.google.com" Why? How is this useful? Is there a simple way that the workflow can just take me to www.google.com?
That sounds to me like your text merge didn't go right. In your text merge, you should have the text "<a href=" then the variable you want to go to (from the data variable you are using in your grid or otherwise) then ">text to display</a>". It sounds like you ended up with the project property variable for basepathtoproject in addition to the variable you wanted. Can you give a screenshot of the merge text components data?
If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.
I might know what's wrong with it, let me make some changes and I'll let you know what happens. Thank you.
Tried it again, still not working. I even tried just using a link button component, and hardcoding www.google.com in the URL, and it takes me to http://server/projectname/www.google.com. Why is it putting the server and the project name before the URL? I tried this with and without the text merge component.
This is blowing my mind.
Whoa. I've never seen such a thing. Especially to a link button. SYMC employees, any insight?
If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.
bump
I still say this would be easier to trouble shoot if we had some screen shots. Can you provide them?
If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.
I've attached 4 screenshots of a workflow.
Link = The form builder
Component = The link component
URL = The url that workflow takes me to when the link is clicked
FormBuilder = The form builder
OK, now I see it. I guess some people (like myself) just need a visual to go off. The problem in this case is the URL you are using in that link component. Instead of www.google.com, put in a full URL like http://www.google.com. Leaving out the protocol portion of the URL leaves the browser or IIS (not sure which is the culprit) to assume it's relative from the current URL path.
If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.
Sounds dumb, but you need to preface the URL with http:// or https://
This tells the workflow system to launch a new URL instead of a new application on your web server.
What I have done to make the URL work in a Grid is to construct the URL in my web query and then use that fully constructed URL (with the http:// etc...) already present.
Rob
Feel free to contact me, I can show you some examples of this in action.
rob.moore@travelport.com
Just wow...
Thanks guys =)
Would you like to reply?
Login or Register to post your comment.