Disable button in Body part with Table view

Hello,

I have a form with Table view set, and for each row I have a button.

How can I make the button for a specific row to be disable?

For instance, in the image below I want the first button to be disabled because there is no file to be saved.

[attachment=0]table_button.png[/attachment]

Thanks,
Bogdan.

don’t think it can be done with a native button.
Why not use an icon and create a calculation which will show the icon based your criteria?

How can I return an icon in a calculated field, so it will show in a TableView form, to indicate a status or something for each row?
I’m trying to figure this, but don’t have any clue.

Hi udrescu_bogdan

return "media:///picture.png";

where picture.png is in the media branch of the servoy solution.

Best regards. Roberto Blasco.

Hello, thanks for reply, but still doesn’t work for me.

I have this calculation, which I set it first to type TEXT, the I tried with MEDIA. But in both cases the image is not displayed in the TableView field.

function status_icon() {

	if (status == 1) {
		return "media:///circle_yellow.png";

	} else if (status == 2) {
		return "media:///circle_red.png";
	}

	return "media:///circle_green.png";
}

The TableView looks like this:
[attachment=0]status.PNG[/attachment]

Is there any other setting to do at the label in which I want the image to be displayed? Or anything else?

Thanks,
Bogdan.

status.PNG

Set your field to HTML_AREA, then return a html with the img embedded:

function status_icon() {
   var html = '<html><body><img src="';
   if (status == 1) {
      html += "media:///circle_yellow.png";

   } else if (status == 2) {
      html += "media:///circle_red.png";
   } else {
      html += "media:///circle_green.png";
   }
   return html + '"></img></body></html>';
}

You might want to add some style as well to place your image correctly inside the field, and make sure that the scrollbars property is set to"V:n H:n".

Hope this helps,

udrescu_bogdan:
Is there any other setting to do at the label in which I want the image to be displayed? Or anything else?

Try setting the calculation as TEXT and a field as IMAGE_MEDIA instead of the label. This works for me.
Hope this helps!

Thanks, I didn’t try it till then, but now I got it running.