SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DevExpress DBTreeList ExtLookupCombo Column

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
plumothy



Joined: 25 Oct 2010
Posts: 13

PostPosted: Wed Oct 14, 2015 1:09 pm    Post subject: DevExpress DBTreeList ExtLookupCombo Column Reply with quote

TsiLang has caused me a massive amount of wasted time this week.

I have a form called frmAssetTree with a DevExpress TcxDBTreeList, called tlAssets. This TreeList has a column (called tlAssetsAnalysisID) which had its Properties property set to LookupComboBox. There were 3 columns names in tlAssetsAnalysisID.Properties.ListFieldNames.

So, TsiLang had these 3 entries in the Collections section of the Editor:
TfrmAssetTree.tlAssetsAnalysisID.Properties.ListColumns[0].Caption
TfrmAssetTree.tlAssetsAnalysisID.Properties.ListColumns[1].Caption
TfrmAssetTree.tlAssetsAnalysisID.Properties.ListColumns[2].Caption


That was all fine - exactly what I would expect.

Then I decided to change the tlAssetsAnalysisID column Properties from LookupComboBox to ExtLookupComboBox.

Now the Translation Editor shows nothing in the Collections tab. That is good because the ExtLookupComboBox does not have any collections of objects that have captions.

As usual, I saved my project to a SIL file and then exported it to a SIB file.

Before building my application I always clear all translations and then load the SIB file at runtime.

At runtime I get an error when I open the AssetTree form: "List index out of bounds (-1)".

I debugged siComp and discovered that it is still looking for tlAssetsAnalysisID.Properties.ListColumns[0].Caption.

So, opened the SIL file and in the Collections section I can see 2 of the original 3 lookup column captions:
TfrmAssetTree.tlAssetsAnalysisID.Properties.ListColumns[0].Caption
TfrmAssetTree.tlAssetsAnalysisID.Properties.ListColumns[1].Caption


They are also in the SIB file.

I presume this is why I get the error at runtime.

Have I done anything wrong or is it a problem with siLang?

How do put this right?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Wed Oct 14, 2015 3:10 pm    Post subject: Reply with quote

Hello,

May be you created SIL file before opening Translation Editor or updating translations in TsiLang? Because it looks like still contained old Collections information. It is not possible to automatically catch the event of collection property change in other components so just be sure to either call Update Translations from TsiLang popup-menu or open Translation Editor to update translations list.
Also you can save to SIB file directly without using SIL as intermediate.
Back to top
View user's profile Send private message
plumothy



Joined: 25 Oct 2010
Posts: 13

PostPosted: Wed Oct 14, 2015 8:25 pm    Post subject: Reply with quote

Thanks for the reply. I have spent 2 days battling with this so I have been through the following procedure many many times:
- Update Translations
- Open Translations Editor for this form and checked that the Collections section is empty
- Close & Save Translation Editor
- Save Project to SIL, then Export to SIB.

The SIL and SIB both still have the two of the original three ListColumns entries.

As a workaround for this problem I have manually deleted the two ListColumn entries from the SIB. But, I would like to be able to trust the the SIB to contain the correct entries (because there are thousands of them in the entire project). At the moment I can't trust it.

Am I doing it wrong?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Sun Oct 18, 2015 6:28 am    Post subject: Reply with quote

Will the same occur if you save your translations into the NEW SIL file?
Back to top
View user's profile Send private message
plumothy



Joined: 25 Oct 2010
Posts: 13

PostPosted: Sun Oct 18, 2015 8:48 am    Post subject: Reply with quote

Yes. As I said before, I have done it many times.
Back to top
View user's profile Send private message
plumothy



Joined: 25 Oct 2010
Posts: 13

PostPosted: Mon Oct 19, 2015 8:47 am    Post subject: Reply with quote

I think I have figured out what is going on.

My project is quite big - 55 forms, resulting in several thousand items for translation.

Before I build my project for release, I save the project to a SIL file, then select all the forms and clear all the translations. I then export the SIL to SIB and load the SIB at runtime (because I understand this to be best for performance - is that correct?).

Then I work on my project again to enhance it. When ready, I load the SIL file again. But, because the project has changed, there are now items in the SIL file which are no longer in the project (just as there will be new items in the project which are not in the SIL file).

So, if I removed an item from the project it no longer appears in the translation editor, but siLang still has an entry for it somewhere (which came from the SIL). Then, when I save the project to SIL that entry is still being written to the SIL, even though it wasn't in the translation editor.

Try these steps:
01. Create a new delphi VCL Forms application
02. Onto Form1, add a TsiLangRT.
03. Add a TcxLookupComboBox
04. Open the editor for cxLookupComboBox1.Properties.ListColumns
05. Add 3 columns and give them different captions ('Col 0', 'Col 1' and 'Col 2')
06. Open the Translations Editor and you see the 3 column captions in the Collections section.
07. Close the translations editor
08. In TsiLang Expert, save the project to a '3 Cols.SIL'.
09. Double-click on '3 Cols.SIL' and you see the 3 column captions in the Collections section.
10. Close the SIL.
11. In TsiLang Expert, clear the translations
12. Save the Delphi project
13. Open the editor for cxLookupComboBox1.Properties.ListColumns
14. Remove Col 1
15. Right-click on siLangRT1 and select Clear Translations
16. Open the Translations Editor and see the column captions in the Collections section - now only 2 of them.
17. Close the translations editor
18. In TsiLang Expert, load '3 Cols.SIL'
19. In TsiLang Expert, Save the project to '2 Cols.SIL'
20. Double-click on '2 Cols.SIL' and you will see 2 column captions in the Collections section.
They have the captions 'Col 0' and 'Col 1' ('Col 2' is not there). But why? We deleted the column with caption 'Col 1' and we did not delete the column with caption 'Col 2'.

I think this is related to the issue I described in the original post.
Please let me know if I did something wrong in the steps above.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Mon Oct 19, 2015 9:16 am    Post subject: Reply with quote

Quote:
18. In TsiLang Expert, load '3 Cols.SIL'
19. In TsiLang Expert, Save the project to '2 Cols.SIL'

As you loaded SIL with 3 items in collections but there were only 2 items in actual project the third item was deleted. TsiLang UNABLE to uniquely identify collection items so they are just numbered sequentially.
Before deletion there were:
Item[0] = Col 0
Item[1] = Col 1
Item[2] = Col 2


After deletion:
Item[0] = Col 0
Item[1] = Col 2


But in SIL file you have:
Item[0] = Col 0
Item[1] = Col 1

Item[2] = Col 2

So when you loaded info from SIL the items became:
Item[0] = Col 0
Item[1] = Col 1
Back to top
View user's profile Send private message
plumothy



Joined: 25 Oct 2010
Posts: 13

PostPosted: Mon Oct 19, 2015 11:44 am    Post subject: Reply with quote

OK, I now understand what was happening in my test project - thank you.

Was this also responsible for the runtime error (List index out of bounds) that I reported in my original post?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Tue Oct 20, 2015 3:05 am    Post subject: Reply with quote

List index error in initial post might be caused by the fact that list columns captions exist in loaded SIL/SIB file but were deleted in actual component.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group