Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Understanding combo boxes in web/mobile

  1. #11
    Senior Member
    Join Date
    Jan 2014
    Posts
    263
    Thanks Barry for prompt reply

    That all makes sense.

    Should be able to finish this app now

    Cheers

    Simon

  2. #12
    Senior Member
    Join Date
    Jan 2014
    Posts
    263
    Hi guys

    Data mapping is powerful - really impressed !!

    That works perfectly on js desktop but doesn't work at all on web with 5.0RC79.

    The second combobox is always empty. We are using the following :

    var choicelisttext = "select distinct smname from tablename where tablename.company_no = " + lccompany_no + " order by smname";
    Lianja.getElementByID("pcust.welcome.cbosmname").c hoicelist = choicelisttext;

    It's as if the Lianja.index file is fixed when created and we cannot change/influence it.

    We have tried building the web index file with both a blank choicelist and a populated one.

    What have we missed?

    Thanks in advance

    Simon

  3. #13
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,235
    It works perfectly well in web if it’s setup properly.

    Read the doc right at the bottom of the page.
    https://www.lianja.com/doc/index.php/Data_Mapping

    To use Data Mapping in the Web/Mobile client, the Choices, Get data mapping and Set data mapping data dictionary field attributes must be set.

    Setting the Inherit dictionary rules Section Attribute for the Grid Section to True causes the data dictionary settings to be applied to the Grid Column Attributes automatically.

    Remember the database needs to be deployed after making any data dictionary changes, before these will be available in the desktop App Center or Web/Mobile client.
    Last edited by barrymavin; 2019-10-26 at 18:24.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  4. #14
    Senior Member
    Join Date
    Jan 2014
    Posts
    263
    Hi Barry

    Thanks for the pointers.

    Having done hours of experimentation, we now understand that in Web we cannot change the choicelist in code, it has to come from the data itself.

    You say that "To use Data Mapping in the Web/Mobile client, the Choices, Get data mapping and Set data mapping data dictionary field attributes must be set" and the data mapping to fixed table values all makes sense as per the example app. However none of the examples use a WHERE clause in the choicelist SQL.

    It is the dynamic choicelist definition that is confusing us.

    Approach 1 :

    We are effectively trying to change the WHERE clause in an SQL search based on some memvar from a previous combobox choice rather than a static table lookup value as we have not saved yet - we are in edit / add record status.

    Memvar is lcompanyno = Lianja.getCursor("tablename").getData("company_no" );

    Instinctively to set up a choicelist SQL in a table that refers to a memvar that is out of scope has got to be asking for trouble.

    We thought maybe we could save the edit and then re-edit so we now have a table value to work from but that is a mess and when we try to enter that in the choices box of the combo we always get an immediate crash.


    Approach 2 :

    We tried to apply a filter to the static source table but that doesn't seem to make any difference because the data is already in the combobox


    Approach 3 :

    The most promising way forwards appears to be to have another slave table / cursor that we SQL to each time that the combobox uses as its source. Having tried that, the data is extracted perfectly but we can't get the combobox to refresh() without a call to the choicelist which we cannot do in Web.

    We have now spent 2 whole days trying to get a single combobox working in Web - there must be something fundamental we are missing.

    Any ideas? How have other people done this?

    Thanks in advance




    Simon

  5. #15
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,235
    I think my previous post provides an explanation already.

    Data mapping occurs on the server in web/mobile for Read and Update operations.

    The choicelist is initially specified in the DD and populates it on the client.

    You can dynamically change the choicelist on the client as previously explained in the previous past. What makes you think you cannot.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  6. #16
    Senior Member
    Join Date
    Jan 2014
    Posts
    263
    OK - done lots of testing and rewritten this in several different ways.

    In Dev, this works perfectly. The data mapping is great and it is really fast.

    Several things have come up :

    Firstly the behaviour of combobox is subtely different on Web vs Dev/app centre.

    InteractiveChange() does not seem to fire in Web - so we used Change() instead.

    You can update the choicelist of a combobox in Web (either SQL or a choice list) as often as you like but the data in the combobox does not update from its original state.

    Is there a requery() or similar method we have to call to make that happen? refresh() doesn't make any difference.

    Hope this helps. Really need to get this sorted.

    Cheers

    Simon

  7. #17
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,235
    This is working as expected in the next build. I did not realize you were doing this in a canvas section.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #18
    Senior Member
    Join Date
    Jan 2014
    Posts
    263
    Thanks Barry

    We were only using a canvas section because we wanted a command button there too.

    Didn't realise before that textboxes can effectively become comboboxes with data mapping - very clever stuff !!

    Thanks for getting on to it so quickly. Looking forward to next build

    Cheers

    Simon

  9. #19
    Senior Member
    Join Date
    Jan 2014
    Posts
    263
    Thanks Barry

    Just to confirm that both the choicelist dynamic data refresh and the InteractiveChange() canvas section web issues now work great in RC80

    Thanks again for your help

    Simon
    Last edited by barrymavin; 2019-10-30 at 07:42.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us