Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » AbstractBeanColumn<VALUE>
AbstractBeanColumn<VALUE> [message #1751291] Sat, 07 January 2017 07:04 Go to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 187
Registered: November 2014
Senior Member

Hi there,

I'm just fooling around with an AbstractBeanColumn<VALUE> in a table and I'm wondering how I can get a display text based on VALUE.getName() shown in the corresponding column?

Is the getPlainText(ITableRow row) the right mehtod to override or is there something else I have to use?

Because overriding getPlainText() leaves the column/cells still empty.

Thanks in advance.

Peter
Re: AbstractBeanColumn<VALUE> [message #1751339 is a reply to message #1751291] Mon, 09 January 2017 06:43 Go to previous messageGo to next message
Matthias Otterbach is currently offline Matthias OtterbachFriend
Messages: 11
Registered: August 2015
Junior Member
The getPlainText() method is just provided for an alternative text representation of the value (e.g. for exports).

Basically for the AbstractBeanColumn it is expected to implement a custom java script rendering within the java script code. This creates a powerful solution to render practically every bean value.

For example to display the name attribute of your bean the java script column code could be similar to:

scout.ExampleBeanColumn = function() {
  scout.ExampleBeanColumn.parent.call(this);
};
scout.inherits(scout.ExampleBeanColumn, scout.BeanColumn);

scout.ExampleBeanColumn.prototype._renderValue = function($cell, value) {
  $cell.appendElement('<h1>')
    .text(value.name)
    .addClass('example-bean-name-attribute-css');
};
Re: AbstractBeanColumn<VALUE> [message #1751341 is a reply to message #1751339] Mon, 09 January 2017 07:50 Go to previous messageGo to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 187
Registered: November 2014
Senior Member

Ok. Thanks for the input. Since I don't have JavaScript knowledge I have to find a workaround Smile

What about setting the dsiplayable to false of the BeanColumn and add another String Column where I set the value of the corresponding bean?
Re: AbstractBeanColumn<VALUE> [message #1751349 is a reply to message #1751341] Mon, 09 January 2017 09:52 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 561
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Why not use an AbstractColumn<TYPE> and then use execDecorateCell() to call cell.setText()?
Re: AbstractBeanColumn<VALUE> [message #1751351 is a reply to message #1751349] Mon, 09 January 2017 10:16 Go to previous message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 187
Registered: November 2014
Senior Member

Good question. Will give that a try Smile
Previous Topic:[Blog Post] Business Applications on Blockchains: Eclipse Scout, Ethereum and web3j
Next Topic:[neon] AbstractOutlineViewButton behaving differently from Mars
Goto Forum:
  


Current Time: Sun Jun 25 22:46:05 GMT 2017

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

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