v9.1p_2014-04-17/PowerEdition Deployment 2014-04-17
Chrome
Hi,
There is problem of collision of ID when creating an XML component. Following the example below, you can reproduce the problem and the solution. I hope your answer.
09:45:58.989 [ERROR] [tdsbandweb] 09:45:58.971: XRP2: WARN: Log: Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MENUBUTTON ID: isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
09:45:58.971: XRP2: WARN: Log: Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MENUBUTTON ID: isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
09:45:58.989 [ERROR] [tdsbandweb] 09:45:58.971:XRP2:WARN:Log:Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MenuButton ID:isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
09:45:58.971:XRP2:WARN:Log:Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MenuButton ID:isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
- ComponentClass
public class MenuButtonExt extends MenuButton {
public MenuButtonExt() {
super();
}
}
- ComponentSchema
<DataSource ID="MenuButtonExt"
inheritsFrom="MenuButton"
Constructor="br.com.tds.framework.client.widgets.M enuButtonExt">
</DataSource>
- ComponentXML
<HLayout xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" >
<members>
<MenuButtonExt title="Test 1"/>
<MenuButtonExt title="Test 2"/>
</members>
</HLayout>
- Component Reflection
public interface TDSMetaFactory extends BeanFactory.MetaFactory {
BeanFactory<MenuButtonExt> getMenuButtonExtFactory();
}
- Run
public void onModuleLoad() {
TDSMetaFactory metaFactory = GWT.create(TDSMetaFactory.class);
RPCManager.loadScreen("screenReuse", new LoadScreenCallback() {
@Override
public void execute() {
this.getScreen().draw();
}
});
}
SOLUTION OF THE PROBLEM
Do Override "public JavaScriptObject getOrCreateJsObj ()" method and replace the line "internalSetID (SC.generateID (getClass () getName ()), true.);" the line "internalSetID (SC.generateID (" br.com.tds.framework.client.widgets.MenuButton "), true);"
Example of modified class
public class MenuButtonExt extends MenuButton {
@Override
public JavaScriptObject getOrCreateJsObj() {
if (!isCreated()) {
if (id == null) {
// HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE
internalSetID(SC.generateID("br.com.tds.framework. client.widgets.MenuButton"), true);
}
// The SC.REF property will already be set if new was called on a SmartClient
// JS properties object; warn here if we actually attempt to create() it.
if (getRef(config) == this) {
SC.logWarn("Instantiating in SGWT a properties object from the SmartClient " +
"side may lead to undefined behavior if the SmartClient Framework " +
"is expecting to perform the instantiation itself.");
} else {
JSOHelper.setObjectAttribute(config, SC.REF, this);
JSOHelper.setObjectAttribute(config, SC.MODULE, BeanFactory.getSGWTModule());
}
JavaScriptObject jsObj = create();
return jsObj;
} else {
return getJsObj();
}
}
public MenuButtonExt() {
super();
}
Chrome
Hi,
There is problem of collision of ID when creating an XML component. Following the example below, you can reproduce the problem and the solution. I hope your answer.
09:45:58.989 [ERROR] [tdsbandweb] 09:45:58.971: XRP2: WARN: Log: Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MENUBUTTON ID: isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
09:45:58.971: XRP2: WARN: Log: Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MENUBUTTON ID: isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
09:45:58.989 [ERROR] [tdsbandweb] 09:45:58.971:XRP2:WARN:Log:Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MenuButton ID:isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
09:45:58.971:XRP2:WARN:Log:Specified ID: isc_MenuButtonExt_0 collides with the ID for an existing object '[MenuButton ID:isc_MenuButton_0]'. The existing object will be destroyed and the ID bound to the new object.
- ComponentClass
public class MenuButtonExt extends MenuButton {
public MenuButtonExt() {
super();
}
}
- ComponentSchema
<DataSource ID="MenuButtonExt"
inheritsFrom="MenuButton"
Constructor="br.com.tds.framework.client.widgets.M enuButtonExt">
</DataSource>
- ComponentXML
<HLayout xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" >
<members>
<MenuButtonExt title="Test 1"/>
<MenuButtonExt title="Test 2"/>
</members>
</HLayout>
- Component Reflection
public interface TDSMetaFactory extends BeanFactory.MetaFactory {
BeanFactory<MenuButtonExt> getMenuButtonExtFactory();
}
- Run
public void onModuleLoad() {
TDSMetaFactory metaFactory = GWT.create(TDSMetaFactory.class);
RPCManager.loadScreen("screenReuse", new LoadScreenCallback() {
@Override
public void execute() {
this.getScreen().draw();
}
});
}
SOLUTION OF THE PROBLEM
Do Override "public JavaScriptObject getOrCreateJsObj ()" method and replace the line "internalSetID (SC.generateID (getClass () getName ()), true.);" the line "internalSetID (SC.generateID (" br.com.tds.framework.client.widgets.MenuButton "), true);"
Example of modified class
public class MenuButtonExt extends MenuButton {
@Override
public JavaScriptObject getOrCreateJsObj() {
if (!isCreated()) {
if (id == null) {
// HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE
internalSetID(SC.generateID("br.com.tds.framework. client.widgets.MenuButton"), true);
}
// The SC.REF property will already be set if new was called on a SmartClient
// JS properties object; warn here if we actually attempt to create() it.
if (getRef(config) == this) {
SC.logWarn("Instantiating in SGWT a properties object from the SmartClient " +
"side may lead to undefined behavior if the SmartClient Framework " +
"is expecting to perform the instantiation itself.");
} else {
JSOHelper.setObjectAttribute(config, SC.REF, this);
JSOHelper.setObjectAttribute(config, SC.MODULE, BeanFactory.getSGWTModule());
}
JavaScriptObject jsObj = create();
return jsObj;
} else {
return getJsObj();
}
}
public MenuButtonExt() {
super();
}