cancel
Showing results for 
Search instead for 
Did you mean: 

WD Java File Up/Download - 'Resource' type issue with auto generated code

Former Member
0 Kudos

Hi All

I'm having trouble setting up a Context Value Attribute as type com.sap.ide.webdynpro.uielementdefinitions.Resource for a File Upload development I'm doing.

I've read through the documentation and tutorials for File uploading in 2004s but can't get passed this step as it auto-generates invalid code in the IPrivateView.java showing an 'Unmatched brackets' error in the task list along with 3 other 'Syntax errors on token'.

Has anyone else used this recently and had similar issues with the 'com.sap.ide.webdynpro.uielementdefinitions.Resource' type and if so do you know of a work-around?

NWDS Version 2.0.19

NWDI Libs for 7.0

Thanks,

Steve.

Accepted Solutions (0)

Answers (1)

Answers (1)

p330068
Active Contributor
0 Kudos

Hi Steve,

Please have a look at below documents might helps :

http://wiki.sdn.sap.com/wiki/display/WDJava/UploadingexcelfileusingWebDynproforJava

https://wiki.sdn.sap.com/wiki/label/excel

As per your issue with 'Unmatched brackets' error in the task list along with 3 other 'Syntax errors on token'

Check in the code if there is any 'Unmatched brackets' and resolve it.

Hope it will helps

Regards

Arun

Former Member
0 Kudos

Hi Arun,

Thanks for the links but they are examples I've already looked through and ity is when I do the task in the first one that says 'Resource of Type Resource that I am hitting the problem. This is because the underlying code which is automatically generated is invalid.

As it is underlying code I should not really be touching it as rebuilding will only bring back the errors as automatically generated in the first place.

Here is the code generated.

public static class IContextElement extends com.sap.tc.webdynpro.progmodel.context.NodeElement

{

private InternalUploadDocumentsView gen_delegate;

public IContextElement(InternalUploadDocumentsView delegate, com.sap.tc.webdynpro.progmodel.gci.IGCINodeInfo info) {

super(info);

gen_delegate = delegate;

}

// attribute "FileResource01"

public final static String FILE_RESOURCE01 = "FileResource01";

private com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;factory=com.sap.tc.webdynpro.progmodel.mime.ResourceFactory _fileResource01;

/**

  • Returns the attribute FileResource01.

*/

public com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;factory=com.sap.tc.webdynpro.progmodel.mime.ResourceFactory getFileResource01() {

return _fileResource01;

}

/**

  • Sets the attribute FileResource01.

  • @param value the new value

*/

public void setFileResource01(com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;factory=com.sap.tc.webdynpro.progmodel.mime.ResourceFactory value) {

this._fileResource01 = value;

changed(0);

}

// generic access to fields (framework usage)

protected Object wdGetObject(IGCIAttributeInfo info) {

switch (info.getIndex()) {

case 0: // FileResource01

return _fileResource01;

default:

return super.wdGetObject(info);

}

}

protected void wdSetObject(IGCIAttributeInfo info, Object value) {

switch (info.getIndex()) {

case 0: // FileResource01

this._fileResource01 = (com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;factory=com.sap.tc.webdynpro.progmodel.mime.ResourceFactory)value;

changed(info);

break;

default:

super.wdSetObject(info, value);

break;

}

}

}

Regards,

Steve.

Former Member
0 Kudos

For further information it seems the generated parts causing the problem are:

;factory=com.sap.tc.webdynpro.progmodel.mime.ResourceFactory

Removing these allows it to successfully pass the syntax check but when rebuilt they are automatically put back so I'm still no nearer a valid solution.

Steve.

Former Member
0 Kudos

Changing NWDS Versions has resolved this issue so beware when using 2.0.19

Cheers,

Steve.