Results 1 to 9 of 9

Thread: Where I have set the index for a web app?

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    213

    Where I have set the index for a web app?

    I'm not sure where I have to set the index for a web app rsp. for a section?

    Could I change the index (order) in a canvas section interactively (f.e. by a click event...) ?
    Is there an example?

    Thanks!
    Georg

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,719
    Blog Entries
    17
    Hi Geog,

    You can change the orderby attribute dynamically on a section if required.
    https://www.lianja.com/doc/index.php...ion_Attributes

    After changing it you will need navigate to the first record then refresh the 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

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    213
    2 additional questions:

    - Where should I write the start order? In page_ready()?
    - My canvas (web) app has several tabs of the same data record.
    Have I to write the ORDERBY for every tab?

    Thanks!
    Georg

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,719
    Blog Entries
    17
    Hi Georg,

    Theres an "orderby" section attribute.

    See screenshot below.

    Click image for larger version. 

Name:	Screen Shot 2022-01-18 at 12.11.03 PM.jpg 
Views:	47 
Size:	99.7 KB 
ID:	2730

    This only needs specified on the first tab.
    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

  5. #5
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    213
    Quote Originally Posted by barrymavin View Post
    Hi Georg,

    Theres an "orderby" section attribute.

    See screenshot below.

    This only needs specified on the first tab.
    Thank you, Barry,

    sorry I can't find not any line with "orderby" in all the *.js fles of all examples.
    For searching text into files is very good the VFP - tool/example "FILER".
    We should have it in Lianja!


    Georg

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,719
    Blog Entries
    17
    Hi Georg,

    itís a section attribute. That doc link I sent you shows you how to set it dynamically.

    What is it you are wanting to search for in code? Thereís a lot of attributes that are set declaratively that are not needed changed dynamically.
    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

  7. #7
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    213
    itís a section attribute. That doc link I sent you shows you how to set it dynamically.

    What is it you are wanting to search for in code? Thereís a lot of attributes that are set declaratively that are not needed changed dynamically.

    ---
    That is certainly correct!

    However, some of the documentation doesn't work for me (or I misunderstand it).
    So sometimes I'd like to know how my problems are solved in any of your examples.

    An example:

    I want to change the caption of a button(page1.section1.field1). So I think I would have to use the Caption attribute to do this.

    An example from the documentation for programmatically changing an attribute seems to be "Caption":

    1. In the attributes of the "Caption" form item, I first enter "Yesterday" manually, for example, which is also displayed on the button.

    2. I'm trying to change this label with with
    Lianja.get("page1.section1.field1").setAttribute(" caption","Today");

    Unfortunately, this does not change the inscription on the button.
    Also, "Yesterday" is still displayed in the list of attributes.

    3. I ask for the caption attribute with
    var cButton = Lianja.get("page1.section1.field1").getAttribute(" caption");
    messageBox(cButton);

    And to my amazement, messageBox returns "Today", although "Yesterday"
    is still displayed in the attributes list.

    So that would be one of the reasons reasons to search in the examples!

    In the meantime, I found out by "trial and error" that the following does work:

    page1.section1.field1.text = "Today";
    und
    var cButton = page1.section1.field1.text;
    messageBox(cButton);

    Georg

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,719
    Blog Entries
    17
    Hi Georg,

    I'm sorry to hear that you are having a problem understanding the basics of a "formitem" in a canvas section so although this is all covered extensively in the online documentation let me summarize this for you so you don't waste time in the future.

    ----

    An App consists of pages. Pages are made up of Sections. Form and Canvas sections are made up of FormItems. We call these collectively "UI Elements" or "Visual Elements".

    Attributes are available at formitem (Field, Gadget, Canvas Section Advanced Control) or Section level to configure the appearance of formitems.

    These attributes may apply to the formitem's Caption or its Data.

    When you add a formitem to a canvas section or a form section you are adding a caption and its related data.

    Click image for larger version. 

Name:	Screen Shot 2022-01-19 at 10.29.48 AM.jpg 
Views:	28 
Size:	90.9 KB 
ID:	2731

    This article explains how to reference and interact with formitems.
    https://www.lianja.com/doc/index.php...a_Object_Model

    So, to change the caption in code rather than declaratively you would do this:

    Code:
    Lianja.get("page1.section1.field1").caption = "hello world"
    Click image for larger version. 

Name:	Screen Shot 2022-01-19 at 10.40.28 AM.jpg 
Views:	26 
Size:	104.6 KB 
ID:	2732

    To change the data you would do this:

    Code:
    Lianja.get("page1.section1.field1").text = "new text"


    Click image for larger version. 

Name:	Screen Shot 2022-01-19 at 10.41.08 AM.jpg 
Views:	26 
Size:	103.9 KB 
ID:	2733

    However, some UI elements have no caption, they only have data. CommandButton is one of those UI elements. So to change the text for a CommandButton you need to reference the data of the formitem.

    Click image for larger version. 

Name:	Screen Shot 2022-01-19 at 10.44.40 AM.jpg 
Views:	28 
Size:	106.1 KB 
ID:	2734

    I hope that clarifies things to you.




    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

  9. #9
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    213
    Hi Barry,
    thank you! All you wrote was clear to me exept
    >> Some UI elements have no caption, they only have data. *CommandButton* is one of those UI elements <<
    Georg

    P.S. My intention of my post #7 was to show that the following seems not logical to me:
    If I fill in "caption" in the listing of attributes this text appears onto the button instead "caption" were missing or not usable. Not so by ....caption = "new text";
    Last edited by gcjm; 2022-01-18 at 22:51.

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