on 09-03-2009 9:47 AM
Hi,
I used DropDownByKey element (DDLPROJE) and mapped it a contex element(PROJE).
I tryed to fill PROJE with code below.No problem on compile, but when i run, it gets error below on line bold in code.
How can i solve this problem?
Thanks.
error
com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(FAALIYETappYeniView.PROJE): must not modify the datatype of a mapped attribute
code
IWDAttributeInfo attInf =
wdContext.getNodeInfo().getAttribute(
wdContext.currentContextElement().PROJE);
ISimpleTypeModifiable stm = attInf.getModifiableSimpleType();
IModifiableSimpleValueSet svs = stm.getSVServices().getModifiableSimpleValueSet();
try {
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/SAPEPTDB");
Connection con = ds.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select PROJE from ZHF_PROJE");
svs.put("", "");
while (rs.next()) {
svs.put(rs.getString("PROJE"), rs.getString("PROJE"));
}
con.close();
} catch (Exception e) {
wdContext.currentContextElement().setMESAJ(e.toString());
}
I asked as different problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to modify the datatype of the mapping origin i.e. the attribute in the component or custom controller to which you have mapped.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
My aim is to clear and fill with new values the content of PROJE context element.
I have another DrppDownByKey element has values inside.Whenever it changes DDLPROJE must filled with new values.
I used string type both context element and database table.I did not understand why type problem?
Thanks.
Hi,
I guess you did as below.
You have created the context attribute PROJE in View Context as well as in Controller Context.
And then you have changed the type of PROJE attribute in View Context by binding it to some Simple type.
After that you have mapped this attribute to the PROJE attribute in Controller context.
That is why it is giving that error.
If my guess is correct:
Then delete the context mapping - by right click on the PROJE attribute in the View Controller.
Now in Comp Controller change the type of PROJE attribtue by binding the simple type.
And now do the mapping between the attribtues.
Regards,
Charan
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.