How to pass an URL as value inside an attribute.

0
Hi everyone, I want to pass an URL as a value inside an attribute but not having any idea to how to do so, like we can only pass boolean, string, long, integer etc,, but how to pass a URL. 
asked
5 answers
3

Question is, where does the URL originate from? 

A URL is just a string with a specific format. 

In the open link button you do have 2 options

  1. Hardcoded URL → literal value
  2. Dynamic URL → use attribute

 

I hope the first doesn’t require explanation.

The second is based on a string type attribute. An attribute is part of an Object and a Object is derived from an entity.

Thus if you want to use the dynamica value; this button must be placed inside an Dataview, with the datasource connected to the entity, which contains the attribute capturing the URL.

 

What the source of the value of the URL is; I don’t know, that depends on the app process.

  1. Is it a value to be specified by a user; allow the user somewhere in the app to enter a URL, using the same object/attribute and a input widget textbox
  2. The URL of the app itself? Use the GetApplicationURL action from the Community commons module in a microflow and set the value using change object (no clue why you need a button in that case but you never know)
  3. The URL from a other source; depends on what your source is. But in all cases a microflow is involved capturing the URL value of the source and using change object to set the attribute value. 
answered
1

Hi Shreyash,

 

Please read this document ref: https://docs.mendix.com/refguide/page-properties#2-3-6-url

 

Edit:

You can add a URL in Attribute on the Default value, see on the image, and pass this attribute on your button make sure to use your button on data-view.

Try this if it works for you.

 

answered
0

You will need to wrap your button/link in a data view, and use the entity and attribute which contains the URL you are referring to.  Otherwise the “Use attribute” option wont have any context.

answered
0

Hi,

You can select url attribute form here

answered
0

Hi Shreyash,

I have used this concept. But in that scenario in the edit page, I had put any value in the address attribute and sent that attribute in button in list view. Like below

answered