cancel
Showing results for 
Search instead for 
Did you mean: 

How I can show the img in to table and where to save the img in the dynPro

0 Kudos

Hi friends,

I want to display a img in the table,( in the CUIBB)

I have the img on the desktop, how i can bring that into the CUIBB and show that image.

Could you support me in this regard?

Thanks & Best Regards, Prabhu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Go to navigator view in web dynpro perspective

save the image into

just copy ur image and paste it into following path

Project-Folder>Src>Mimes>Components>YourComponentname, inside that you can save.

Just make sure that ur CUIBB is a image type editor.

Just delete existing CUIBB editor and add tablecelleditor of Image type.

go to properties of image type editor and and in source property type ur full image name.

At runtime u will see image in ur output.

Regards

Surender Dahiya

0 Kudos

Hi Surender ,

I have saved image into following path

Project-Folder>Src>Mimes>Components>YourComponentname,

But I am not able to show that img in the table,

How I can read that image into table.

I am not undestanding 'image type editor' as said

(Just make sure that ur CUIBB is a image type editor.

Just delete existing CUIBB editor and add tablecelleditor of Image type.

go to properties of image type editor and and in source property type ur full image name.)

Regards

Prabhu

Former Member
0 Kudos

Hi,

Dont specify CUIBB in the forums its not known out side the SAP. And it will be confusing.

To get the image in your table do the following

1)Place your image in Src->Mimes->Components-><Your Component Name>

2)Create a table column

3)Insert table cell editor->Image

4)set the sourcee property of your image from the component.

Ex:Sunset.jsp

deploy your dc and embed the CUIBB in Vc and test

Regards

Ayyappaaraj

Former Member
0 Kudos

Hi,

U need to bind ur table to a data source so create a value node say ctx_node.

bind it to table manually dont use apply template.

Create an attribute of string type say ctx_image in ctx_node.

bind this attribute to source property of Image editor manually.

and In ur code create an element of this node set ctx_image

with ur image name(with proper case) and add that element to ctx_node.

This will surely work.

Regards

Surender Dahiya

0 Kudos

Hi Surender,

Yes i have followed the same procedure ,

I have created a context node with context attribute which will hold the img URL for me.

Then depending on the two conditions i am adding elements and the img URL as:

if(mandatory.equalsIgnoreCase("false")){

selcontextElement.setAttributeValue("ImgUrl", one.gif);

}

else{

selcontextElement.setAttributeValue("ImgUrl",stwo.gif);

}

This will add the img url to the context what i have created.

But in the table i have taken table column followed by the img UI element.

When i depoy it and run, I am getting the one.gif only for all the rows in the column.

but in the context the two.gif is there as attribute.

Could you support me here ??

Thanks & Best Regards, Prabhu

0 Kudos

Hi Ayyappaaraj,

It was an urgent requirement, thats why i posted.

Could you suggest me what i have posted above ??

Thanks & Best Regards, Prabhu

Former Member
0 Kudos

Hi,

Make this attrinute calculated and do the same.

Regards

Ayyapparaj

0 Kudos

Hi Ayyapparaj,

I made the attribute as calulated, tried to execute it

But struck up with dump showing "attribute ImgUrl is read only. "

Here I am attaching the exception :

The initial exception that caused the request to fail, was:

com.sap.tc.webdynpro.progmodel.context.ContextException: NodeElement(Root.Floorplan.FAU.IIU/EvaluationDimensionComp.Inports.Img.0): attribute ImgUrl is read only.

at com.sap.tc.webdynpro.progmodel.context.NodeElement.wdSetCalculated(NodeElement.java:610)

at com.sap.tc.webdynpro.progmodel.context.DataAttributeInfo$CalculatedAccessor.set(DataAttributeInfo.java:737)

at com.sap.tc.webdynpro.progmodel.context.DataAttributeInfo.setAttributeValue(DataAttributeInfo.java:524)

at com.sap.tc.webdynpro.progmodel.context.NodeElement.wdSetObject(NodeElement.java:600)

at com.sap.tc.webdynpro.progmodel.context.NodeElement.wdSetObject(NodeElement.java:649)

could you suggest me in this case ??

Thanks & Best Regards, Prabhu

Former Member
0 Kudos

Hi,

set the property readOnly for the attribute to false.

Regards

Ayyapparaj

0 Kudos

Hi Ayyappaji,

I have made chnages as

0 Kudos

Hi Ayyappaji,

I have made the attribute readoOnly--> as false and then tried to execute and got a dump telling

java.lang.NullPointerException

at com.sap.tc.uip.dt.kpi.plugin.tstx.wd.comp.evaluationdimensioncomp.MainView.wdDoModifyView(MainView.java:211)

Then I tried to chane the attribute Buffered Mode --> as Buffered , Then it worked BUT Not as expected to show the different images on the rows..

Could you gine some info to proceed??

Thanks & best Regards, Prabhu

Former Member
0 Kudos

Hi,

What is the code at line wdDoModifyView(MainView.java:211)

Regards

Ayyapparaj

0 Kudos

Hi Ayyappaji,

I have done the assignment of context attribute by using the below code:

if(mandatory.equalsIgnoreCase("false")){

wdThis.wdGetEvaluationDimensionCompController().wdGetAPI().getComponent().getMessageManager().reportSuccess("Not mandatory");

selcontextElement.setAttributeValue("ImgUrl", NosinglevalDesc);

}

else{

wdThis.wdGetEvaluationDimensionCompController().wdGetAPI().getComponent().getMessageManager().reportSuccess("mandatory");

selcontextElement.setAttributeValue("ImgUrl",singlevalDesc);

}

when i tried to check if value is assigned then i get the exception.

i.e

Object fortest = "";

String s = null;

for(int i=wdContext.nodeImg().size()-1;i>=0;i--)

{

IImgElement NodeElement = wdContext.nodeImg().getImgElementAt(i);

fortest = NodeElement.getAttributeValue("ImgUrl");

s = fortest.toString();

wdThis.wdGetEvaluationDimensionCompController().wdGetAPI().getComponent().getMessageManager().reportSuccess(""+s);

}

Could you look into it??

Thanks & Best Regards, Prabhu

Answers (2)

Answers (2)

nikhil_bose
Active Contributor
0 Kudos

delete default table cell editor under table column and use image as table cell editor.

you have to place images under src/mimes/components/com.app.package folder.

nikhil

Former Member
0 Kudos

Hi Prabhu,

You can save your image inside your project only and you can set this to the UI context.

plz save the project under following mention ladder:-

Project-Folder>Src-folder>Mimes>Components>YourComponentname, inside that you can save.

Think that may help you.

Regards,

Deepak