Gravity Documentation

  1. 7 years ago

    Joel_Eisenstat

    19 Nov 2016 User since 2016

    Is it possible to have either some documentation and/or examples with Gravity ? I cannot decipher the error messages, need direction as to obtain, pass values between objects , etc.
    Possibly a small example per day, week via the blog.
    Regards,
    Joel

  2. marco

    20 Nov 2016 Administrator User since 2016

    @Joel_Eisenstat you are right and we are working on a new Tutorial section for the website.
    In the meantime please feel free to ask any question you have directly here, I'll be more than happy to answer you.

  3. Joel_Eisenstat

    20 Nov 2016 User since 2016

    Thanks for the offer :
    Please explain the method
    - PageSplit1.openDetailWindowAtIndex(rowIndex);
    I could not find this method in the documentation class Navigation ( wrong class?) , also there is no receiving method in the load event of the client window - built in?
    Additionally row index seems to be the array row as opposed to the table index

    I tried to get around passing the array row by using in the Detail load event ;
    if (Master.SegmentedControl1.selectedSegmentIndex == 0) {
    View1.dataSet = SQLite1.sortbycode;
    } else {
    View1.dataSet = SQLite1.sortbyid;
    }
    View1.reloadData();

    However there is an error :
    Runtime Error
    Unable to find selectedSegmentIndex into class Null
    Looking forward to the Tutorials
    Regards
    Joel

  4. marco

    23 Nov 2016 Administrator User since 2016

    Hi @Joel_Eisenstat, the method openDetailWindowAtIndex is documented into the PageSplit class (and not into the Navigation class): http://docs.creolabs.com/classes/PageSplit.html

    > Additionally row index seems to be the array row as opposed to the table index

    Seems like you are trying to display a detailed view based on user selection (so bases on a query identifier I guess). In this case the best way to proceed is the following:

    1. PageSplit is driven by a DataSet (SQLite1.Query1) with a query like: "SELECT * FROM myTable;" and you set the cell identifier to the query main identifier.

    2. Create another DataSet (SQLite1.Query2) with a query like "SELECT * FROM myTable where id =1; "

    3. Set the DataSet of the custom view displayed in the detail window to the DataSet you created on point2.

    4. In MasterTable.DidSelectItem wrote a code like:

    SQLite1.Query2.sql = "SELECT * FROM myTable where id = " + identifier;
    SQLite1.Query2.run();
    PageSplit1.openController(Detail);

    In this way you can use the database identifier of the selected row to fill-in the detailed view.

    > I tried to get around passing the array row by using in the Detail load event ... However there is an error : Unable to find selectedSegmentIndex into class Null

    You are receiving the class Null error here because you wrote the code in the Load event. In Load objects hierarchies are not yet instantiated and so they are still null. Try to move your code to Detail.DidShow event and everything should work as expected.

  5. Joel_Eisenstat

    23 Nov 2016 User since 2016

    Good morning,
    Thanks for the direction.
    Joel

  6. Joel_Eisenstat

    25 Nov 2016 User since 2016

    Good morning,
    The code generates no errors but the client doesn't change - is a refresh required ?
    Also can you define the " identifier" property - ? first column ?
    Master;
    MasterTable ;
    DidSelectItem ;
    <Drugs.searchbycode.sql = "SELECT * FROM myTable where id = " + identifier;
    Drugs.searchbycode.run();
    PageSplit1.openController(Detail);>

    Client;
    View1;
    <dataSet.Drugs.searchbycode>
    where the query is <SELECT * FROM main."Content" WHERE "code" = 9;>
    Thanks
    Joel

  7. marco

    12 Dec 2016 Administrator User since 2016

    Hi @Joel_Eisenstat please try with a MasterTable.reloadData(); command.

or Sign Up to reply!