Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Button in TableColumn
Button in TableColumn [message #1801337] Thu, 17 January 2019 03:29 Go to next message
Eclipse UserFriend
Hey guys,

i was wondering if it is possible to have a button inside a table column.

The only information about this topic i found was this thread:

https://www.eclipse.org/forums/index.php/t/796089/

So is this the way to go or did things change?
I am working on Scout 8, just in case you need that information.

Thank you in advance.
Re: Button in TableColumn [message #1801356 is a reply to message #1801337] Thu, 17 January 2019 06:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

using app links as suggested in the other post probably still is the easiest way. If you want the links to look like buttons, you could use the button css class. And you need to remove the text-decoration: underline, otherwise the text in your buttons would be underlined...

Unfortunately, adding a css class to the app link does not seem to be supported, so you need to create the app link by yourself. Something like that:

HTML.span("text").addAttribute("data-ref", "ref").cssClass("app-link button");  // (Instead of using HTML.appLink("ref", "text")


In order to remove the text-decoration, you need to use a custom css class. Either add that new class to the list of css classes set by cssClass(), or include the button class in your new class as LESS mixin.

HTML.span("text").addAttribute("data-ref", "ref").cssClass("app-link app-link-button");

.app-link-button {
  .button();
  text-decoration: none;
}


Important: The class app-link needs to be a separate class on the link, otherwise the handler won't be attached.
Re: Button in TableColumn [message #1801404 is a reply to message #1801356] Fri, 18 January 2019 07:02 Go to previous messageGo to next message
Eclipse UserFriend
Thank you so far i managed to get the basic working.
I will have to mess around with the CSS later on, because i need that link to be behind an Icon, but i think you mentioned all the parts needed to achieve that.
Re: Button in TableColumn [message #1871253 is a reply to message #1801404] Wed, 18 September 2024 12:18 Go to previous messageGo to next message
Eclipse UserFriend
Hello,
I am interested in this topic, I tried to implement it but I do not see how can I execute the action because the AbstractStringColumn does not contain an executeAppLinkAction Handler on it.

and also the icon associated to the button I tried the HTML.iconbyId("") but their is no way to attach the icon to the cell

Can you please give more details on this topic

[Updated on: Wed, 18 September 2024 12:19] by Moderator

Re: Button in TableColumn [message #1871259 is a reply to message #1871253] Wed, 18 September 2024 14:23 Go to previous messageGo to next message
Eclipse UserFriend
I have done something similar to previous post but i have one think to solve
I set a icon to string column and set app-link as css class
The issue is that i do not get ref fot the app-link so in case i would define tow column the same way i can not make differnce between action 1 and action 2
I hope their is a way to set data-ref attribute
Re: Button in TableColumn [message #1871274 is a reply to message #1871259] Thu, 19 September 2024 03:38 Go to previous message
Eclipse UserFriend
Hi,

you can find the callback function for the app link on the table, not on the column: AbstractTable#execAppLinkAction(String ref). There you get the reference to the clicked app-link as parameter. Just create unique references and use them for the data-ref attribute. You can use the HTML-Builder to do so: HTML.appLink(ref, text).
Previous Topic:Issue After Migrating Scout Project from Java 11 to Java 17 - Frontend Deployment Error
Next Topic:On Scout 24.1 Formbased Login fails on Safari
Goto Forum:
  


Current Time: Sun Jun 22 18:11:06 EDT 2025

Powered by FUDForum. Page generated in 0.05831 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top