Forum Replies Created

Page 1 of 7
  • Uwe Smidt

    Member
    January 31, 2026 at 12:27 pm in reply to: Dynamic sorting of lists

    [], eval() and evalf() did not work 😳, but my unelegant spaghetti code did work.

    I would still favour a more elegant solution than switch casing, because this dynamic problem not only applies to $sort, but everywhere where $ref is use in the parameter of a method, eg $search() etc

  • Uwe Smidt

    Member
    January 31, 2026 at 12:06 pm in reply to: Dynamic sorting of lists

    Hi Andreas,

    Thanks for your prompt response.

    I will try the [] and eval – approach, but your second answer does allow for the dynamic aspect of my intended method: I do not know how many sort column there will be, so a static approach will not work.

    Right now, I am trying to work around the problem (very unelegantly) with:

    Switch prSortByFields.$colcount ## depending on no of sort cols..

    Case 1

    Do llList.$sort($ref.[prSortByFields.1],kFalse) ## ...set up the $sort - params

    Case 2

    Do llList.$sort($ref.[prSortByFields.1],kFalse,$ref.[prSortByFields.2],kFalse)

    Case 3

    Do llList.$sort($ref.[prSortByFields.1],kFalse,$ref.[prSortByFields.2],kFalse,$ref.[prSortByFields.3],kFalse)

    Case 4

    Do llList.$sort($ref.[prSortByFields.1],kFalse,$ref.[prSortByFields.2],kFalse,$ref.[prSortByFields.3],kFalse,$ref.[prSortByFields.4],kFalse)

    Case 5

    Do llList.$sort($ref.[prSortByFields.1],kFalse,$ref.[prSortByFields.2],kFalse,$ref.[prSortByFields.3],kFalse,$ref.[prSortByFields.4],kFalse,$ref.[prSortByFields.5],kFalse)

    Default

    #0 or more than 5 sort coloumns: do nothing, as yet

    End Switch

    But I’ll try with [] and eval()!
    Best regards
    Uwe

  • Uwe Smidt

    Member
    January 28, 2026 at 12:57 pm in reply to: How to get a Datagrid’s Displayorder?

    A display order is a display order is a display order…

    …no matter if changed or not!

    Hi Andreas, problem solved! Thank you for pointing me in the right direction!

    But I do think that the implementation of $displayOrder in Omnis is half-hearted: it should not matter if the order has been changed by the user or not – even the initial displayorder – which will always be ‘1,2,3,…,n’, is a displayorder and should be given by grid.$displayorder().

    In my app, I want to rearrange a 30 column grid by code (not user intervention)- so in order to do this, I first have to generate a string like ‘1,2,3,…,30’ to transform it to something like ‘1,17,6,3,…,30’. No big deal to generate this initial string of ‘1,2,3,…,30’, but I’d expect Omnis to always consider a DisplayOrder a DisplayOrder – not only after changing it.

    Best regards

    Uwe

  • Uwe Smidt

    Member
    January 28, 2026 at 12:45 pm in reply to: datagrid filters have no effect on grid’s datalist

    Hi Götz,

    Thank you for going the long way with JavaScript – I’ll try to integrate it into my code!

    And I hope for the enhancement request to be implemented soon- because the grid’s filter function is only half as useful – or rather unfinished, if it does not sync with the datalist attached to it.

    I really like the grid’s filter function, but as long as it doen’t sync it may be better to code your own filter functionality, so what you see (grid) is what you get (datalist). So I’ll look into filtering the datalist itself with $filter() and the like…

    Best regards
    Uwe

  • Uwe Smidt

    Member
    January 28, 2026 at 12:31 pm in reply to: Images/Icons within JS Data Grid

    Ok, so here we go:

    1) the datagrid column that is to contain an icon needs to have the property $columnstyledtext=ktrue

    2) the $columndatacol needs to be styled text. In my app, I do it this way, depending on if there is an attachment (‘Anhaenge’):

    Do ilDataList.$sendall($ref.Anhaenge.$assign(style(kEscBmp,’attach_file+16×16′)),$ref.tB_Set_FS>0)

    Do ilDataList.$sendall($ref.Anhaenge.$assign(style(kEscBmp,’cloud_upload+16×16′)),isclear($ref.tB_Set_FS))

    Find more info on the function style() in the docs:
    https://www.omnis.net/developers/resources/onlinedocs/FunctionRef/Functions_A-Z/style.html#style

    Hope this helped!

    Btw: I would never have figured this out myself – Andreas helped me a lot then (and now)…

  • Uwe Smidt

    Member
    January 28, 2026 at 8:52 am in reply to: Images/Icons within JS Data Grid

    Hi Blake,

    Short answer: yes, definitely! Via styled text/html.

    Long answer: pending, need to look in my code, asap

  • Uwe Smidt

    Member
    January 24, 2026 at 8:18 am in reply to: Smartlist is outsmarting me

    Hi Diego,

    Thank you for your ideas.

    I’m afraid I could not really put the puzzle pieces together for me 😳.

    Best regards

    Uwe

  • Uwe Smidt

    Member
    January 21, 2026 at 6:47 am in reply to: datagrid filters have no effect on grid’s datalist

    Sometimes it just takes some RTFM, and a problem is solved. But reading the doc chapter on datagrid filters gave me no clues on how to sync a filtered datagrid with the assigned datalist.

    So again: can you help me here?

    Thank you!

  • Uwe Smidt

    Member
    January 11, 2026 at 12:53 am in reply to: Impact of changing $root.$prefs.$language on my code

    Sorry, needs to be :

    Do $root.$prefs.$separators(‘,.,,;’) Returns #F

    I have now put it in my Startup_Task, and all seems to be fine…

  • Uwe Smidt

    Member
    January 3, 2026 at 10:04 am in reply to: Smartlist is outsmarting me

    PS: I missed out on the mystery part:

    I have not tested if all would have worked fine when using a schema class for definition, with the default $dowork still in place.

  • Uwe Smidt

    Member
    January 3, 2026 at 10:00 am in reply to: Smartlist is outsmarting me

    Problem solved – still a bit of a mystery left…

    Problem was that I defined the list from a schema class:

    Do llAggregierteZaehlerstaende.$definefromsqlclass($schemas.tnZaehlerstaende) ## create a list based on the the same schema

    While the Documentation says

    You create a table instance in Omnis when you define a list or row variable from a schema, query, or table class, using the Define list from SQL class command, or the $definefromsqlclass() method.

    it appears that defining a list from a schema is good practice. However, reading on, there are subtle differences:

    Table instances created from a table class have all the default methods of the table class in addition to any custom methods you have added, perhaps to override the default methods.

    And yes, in my table super class taSuper, I have overridden all the default $dowork etc methods.

    So changing one line of code to

    Do llAggregierteZaehlerstaende.$definefromsqlclass($tables.tanZaehlerstaende) ## create a list based on the the same table class, NOT schema!!!

    did the job!

    Long live the small subtle differences in Omnis that make big differences!

  • Uwe Smidt

    Member
    January 2, 2026 at 5:54 pm in reply to: Smartlist is outsmarting me

    It seems like Omnis considers llAggregierteZaehlerstaende not to be ‘worth’ considering the $dowork-method, like it is not $smartlist, or not even defined from an SQL class.

    Is the a way the check the ‘status’ of a list, i.e. is it a SQL class-based list?

  • Uwe Smidt

    Member
    January 2, 2026 at 5:28 pm in reply to: Smartlist is outsmarting me

    Thanks for the hint:
    Calculate liStatus as llAggregierteZaehlerstaende.$history.1.$status ## Status is 8: kRowInserted
    So the first line has Status kRowInserted, and

    Do llAggregierteZaehlerstaende.$includelines(kRowInserted) ## are there lines to be inserted? YES, all 747 lines

    says that there are 747 lines to be inserted!

  • Hi Sten-Erik,

    I was thinking that it would be a great idea to put all specific Omnis Knowledge (Documentation, Forum, Omnis List, own coding, etc) into one model, but as I am not very much into creating my own AI, I have not followed up this idea.

    Now I accidentally found your comment on this 😃! What is your state of affairs in this matter?

    Best regards

    Uwe

  • Uwe Smidt

    Member
    January 24, 2026 at 8:10 am in reply to: Omnis Studio IDE Programming

    Dear $all,
    Thank you for your replies!

    The Apple Script I posted before does a fairly good job in keeping my IDE organized, and maybe with Matthew’s hint to sys(194), the script could be optimized further…

Page 1 of 7