Skip to Content
author's profile photo Former Member
Former Member

Adding a table with an own AbstractTableModel

My existing Java application comprises a class with the following signature:

public class RankingModel extends AbstractTableModel

Now I want to include a table with this "RankingModel" logic into a WebDynpro view.

In the WebDynpro documentation I could not find a method to include such a "self-defined"

table logic.

Does anybody know, whether this is possible, and how?

Best regards

Klaus

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2004 at 04:37 PM

    Hello Klaus,

    You have three options to do that:

    - The simplest way to do this is to use ValueNode This is filled with those columns from the "table model" that are relevant to the display. However, this is a copy operation. That is, any changes made using the Web Dynpro TableUIElement have to be written back into the table model. You would have to write the code for this operation manually. If the table model were to be changed then these changes would have to be copied back into the ValueNode. These can involve a lot of work and, with increasing amounts of data, be very expensive. The advantage of this procedure is that you can bind the TableUIElement declaratively (that is, using Wysiwyg) in the IDE.

    - An alternative procedure which would be less declarative would be to implement a wrapper round your table model. This would then implement the interface ICMIGenericModelClass. You can bind this interface as a model (according to the definition of Web Dynpro) to ModelNodes. You can then bind this in turn to TableUiElements. However, this procedure is generic: that is, the TableUIElement only finds out at runtime (via the metadata in the interface mentioned) which attributes there are. So the TableUIElement can only be bound and the columns defined at runtime.

    - A third option would be to implement a typed wrapper for the line structure of your table model. This would have get/set methods for every field for a line element (every column) of your table model (perhaps it has already been implemented like that). In this case you can import the structure of your table model into Web Dynpro as a model using the UML Model Import via XMI. You can then bind a collection of these line element instances to ModelNodes and TableUIElements. No buffer is generated and the data is transported directly from the UI into your table model.

    Best regards,

    Karin

    Add comment
    10|10000 characters needed characters exceeded