Results 1 to 3 of 3

Thread: [Answers] Refresh

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Refresh

    Q:
    How do I refresh a page/section when I navigate to that page? Been trying with init/ready delegate
    A:
    Use the activate delegate.



    The refresh delegate is called when data is refreshed into the UI. This can occur as you navigate data or when you rollback changes before they are committed by clicking undo/cancel. If you have no related sections e.g a map or chart or report that depends on data in another UI section you can update it from the refresh method.



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-01-11 at 06:09.

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    As I try to placing field from another table into a grid section I get an error message "You cannot drop this column onto this section". Is it possible to construct a grid from more tables? For example: from related code tables.
    A:
    If you want to display fields from more than one table use a "local" virtual table.



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-01-11 at 06:05.

  3. #3
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    I have a PurchaseOrders table that looks like this:

    poid (pk, autoinc)
    posuppid (references suppliers.suppid)
    potoal (currency)
    Dragging that table to a form section gives me the fields, now I don't want the user to capture posuppid as this is already known so I want to fill this with a valid supplier id, say '2'.
    The first approach I tried was to leave the posuppid field on the form and set it like this:

    Code:
    loSec = Lianja.get("Purchase_Orders.section1")          
            loSec.add()
    
            lfFld = Lianja.get("Purchase_Orders.section1.field5")
            lfFld.value = 2

    All looks ok onscreen until I save, then posuppid is set to 0 and the record is saved without the value being set.
    So my question is - what is the best way to update a field like this, should I maybe be setting it directly on the table and not on-screen,
    A:
    UI controls are bound to a data source. Changing the data source and refreshing the control it is bound to should be done.
    Programmatically updating the UI control does not update the data source.


    Code:
    replace purchase_orders.posuppid with 2
    Lianja.getElementByID("purchase_orders.section1.fi eld5").refresh()
    You have to select the correct cursor first.
    If you select a cursor save the active one first and restore it afterwards. See SELECT and SELECT()



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/showthread.php?2717-Answers

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