Image Field show pictures from file


If you wish to leave comments or ask questions, please log on or sign up.

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company:

Hello!
I want to show images from file when any item selected from tabularsection. But it is not showing. Here is my code;

Code
&AtClient
Procedure ÜrünlerSelection(Item, SelectedRow, Field, StandardProcessing)
   
   // Insert handler content.
   ThisObject.ChoosenProduct = Object.Ürünler.get(SelectedRow).Code;
   resim =Right(ThisObject.ChoosenProduct,StrLen(ThisObject.ChoosenProduct)- 1);
   //message("C:\Users\User\Desktop\yashar_сайт\Новая_папка" + resim +".jpg"); 
   address = "C:\Users\User\Desktop\yashar_сайт\Новая_папка\"+resim +".jpg" ;
   BeginPutFile(New NotifyDescription("ChangePictureAfterPutFile", ThisForm),,address,False, UUID);
 EndProcedure

&AtClient
Procedure ChangePictureAfterPutFile(Result, Address, SelectedFileName, AdditionalParameters) Export
   If Result Then
     ThisObject.PictureAddress = Address;
   EndIf;
EndProcedure


 
#2
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Mar 6, 2018
Company:

I think I have to explain what i want to do;

* My items names in list are same with pictures in folder.
* When i sel ect any item in list, i want to show picture of it.

I can choose picture fr om folder, but it can not show in image Field....

 
#3
People who like this:0Yes/0No
Administrator
Rating: 18
Joined: Dec 4, 2017
Company:

Dear eyup yilmaz,

A proper way to work with images in your scenario is to:

- extend your products with an image attribute

- for each product, save the image to this attribute

- in your code, display the contents of the attribute (the image) upon selecting an item of the tabular section

Best regards,
Vladimir Gurov

1C Company support team
 
Subscribe