on 01-11-2007 10:17 AM
Hello,
i have a table in a view that shows data that comes from a aRFC
model from the R/3 backend.
So far so good, the values shown are the same as in the backend.
Now i have the problem that two colums in this table contain only
keys (one character, represented as String).
I want to show the right values for this keys in the table, so i created
two simple types that contain the enumerations for these two columns.
The problem is, that i can not change the type of these two elements
in the Context of the view controller, because they are mapped from
the model and can not be altered.
Is there a "best practice" approach to the topic of getting values for
given keys from the backend?
Hello Armin,
yes you can change the type of your with something like this:
// get Mofiable type of your model attribute
ISimpleTypeModifiable statiType = wdThis.wdGetAPI().getContext().getModifiableTypeOf(
"YourModelNode.YourModelNode.YourModelAttribute");
// Set valid values for this data type
IModifiableSimpleValueSet statiValues =statiType.getSVServices().getModifiableSimpleValueSet();
statiValues.clear();
for (int i = 0; i < yourValues.size(); i++) {
//set key value pairs
String statusText = yourValues.get(i);
statiValues.put(i, statusText);
}
}
Hope it helps, regards
Sakib
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for you answers!
After thinking a while over this topic, i think that it may be cleaner/ nicer/ more performant if i change the table in the R/3 backend to use a check table.
With using such a check table (referred to via foreign key relationship) the model automatically maps this table and also manages to have the right simple type in the context for my two colums.
Is this the wrong direction i am thinking?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
you can add into a model Node a new value node in wich you can insert others value attribute.
After this step you bind them your simple types.
You will have the complete control on a value Node.
Regards.
Gianluca
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
26 | |
9 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.