Can I put expression in a text or path of a link?

#1

Hello,
I supposed this was simple.
I have a text box which contains "\c\path\file.xls"
I need to make a link like file:///c/path/file.xls"
Very nice: I put in link path the following expression: ${"file://"+this.myform.mytextbox.replace(/\/g,"/")

But unfortunately it seems that for link it does not work.
Can you help me?
Thanks,
Mario

0 Likes

#2

I think for Windows should be file:///C:\path\file.xls:

0 Likes

#3

Thanks but my biggest problem is that I cannot put a javascript expression inside link widget in text or in path

0 Likes

#4

I see in your documentation that I can put an expression like ${new Date()} but this does not work inside link widget

0 Likes

#5

In link widget I see another strange behaviour: I can add "parameters" but they are not added in GET nor in POST

0 Likes

#6

I see in your documentation that I can put an expression like ${new Date()} but this does not work inside link widget

Component properties are translated to Angular template syntax which supports a small subset of the the JavaScript language. As a result you cannot set a component property to ${ new Date() }. You can however use the latter in an event handler just fine as it gets translated to TypeScript (that transpiles to JavaScript).

I need to make a link like file:///c/path/file.xls"

Setting the Path property of the Link to file:///${myform.mytextbox} should set the href attribute of the link. However at least in Google Chrome the link will still not work as the local file protocol is disabled for security reasons.

Thanks but my biggest problem is that I cannot put a javascript expression inside link widget in text or in path

Indeed setting a custom expression in the Path property isn't easy from UI point of view as it doesn't properly expose the Property Picker dialog. We will address that limitation.

In link widget I see another strange behaviour: I can add "parameters" but they are not added in GET nor in POST

Currently the Parameters property works only when the Path of the Link is set to an existing application page (available from the dropdown). We may add support for external URLs too.

0 Likes