Conditional Apperence

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 10, 2022
Company: abc

In the documents section, you select the form section and the conditionals apperance section does not appear. For example, when a warning is selected somewhere, I want that part to be yellow when it is approved, and I want that part to be green, I cannot do this because there is no conditional apperence.

https://ibb.co/qYgjZvj

 
#2
People who like this:0Yes/0No
Administrator
Rating: 18
Joined: Oct 3, 2019
Company:

Hello Kadoryz,

judging by your screenshots, you are using the so-called "thick client".

However, conditional appearance can only be applied in the "thin client" when the application is running in managed application mode.

Please specify which 1C configuration you're using and what task you want to solve. Anf I'll try to help you.

 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 10, 2022
Company: abc

https://ibb.co/nDj34QX

Thank you for your help.

I am using an old version 1TÇ and what I want to do is that when I select the first of the selections that appear in the table row, I want the color of the selected part (Teklif Kalemlerine Ait Durmlar) to be yellow. When I select the others, I want the color to be different.

 
#4
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 10, 2022
Company: abc

Sorry, I posted the wrong picture above, this is the correct picture.

https://ibb.co/rFW3PNv

 
#5
People who like this:0Yes/0No
Administrator
Rating: 18
Joined: Oct 3, 2019
Company:

in general it's possible to do it...

i'll try to give you an example tomorrow

 
#6
People who like this:1Yes/0No
Administrator
Rating: 18
Joined: Oct 3, 2019
Company:

Hi Kadoryz,

the following code will help you:

The 1C thick client uses a different event model. In order for you to implement your task, you need to use the OnRowOutput event - take a look at the first screenshot.

The code will be something like this:

Code
Procedure TabularSection1OnRowOutput(Control, RowAppearance, RowData)
   
   colorRed    = New Color(255,0,0); // red
   colorBlue    = New Color(0,0,255); // blue
   
   If RowData.Product.Code = "000000001" Then 
      RowAppearance.BackColor = colorRed;
   EndIf;
   
   If RowData.Product.Code = "000000002" Then 
      RowAppearance.TextColor = colorBlue;
   EndIf;
   
EndProcedure


I think how the code works doesn't need to be explained. As you can see, you can change not only the background color, but also the font color and other parameters (screenshot 2).

And you can see the result in screenshot 3.

However, keep in mind that this method is not very efficient, as it is called every time the document's form changes. With a large number of rows, this can greatly slow down the program.

Download Scr_1.png (63.28 KB)
Download Scr_2.png (29.61 KB)
Download Scr_3.png (57.84 KB)
 
#7
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Oct 10, 2022
Company: abc

Thanks for your help Aleksandr. Yes, what you say is true, I will take it into consideration.Have a good day.

 
Subscribe
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.