Results 1 to 3 of 3

Thread: Problem with the syntax for a filter expression

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

    Problem with the syntax for a filter expression

    I have a syntax problem.

    Section1:
    1. txtbx is a text box. Here you can enter a text for a filter.
    2. cmbbx a Combobox. Here you can choose the field (column) what the filter should refer to.
    3. okbtn a commando button. The click event is supposed to set the filter for the Grid section (section2).

    Function Page1_section1_okbtn_click ()
    {
    var txt1 = lianja.get ("page1.section1.txtbx"). text;
    var txt2 = lianja.get ("page1.section1.cmbbx"). text;

    var txt3 = txt1 + "$" + txt2; // f.e. like "Georg" $ firstname

    Lianja.get ("page1.section2"). Filter = 'txt3'; // ???????
    Lianja.get ("page1.section2"). Refresh();
    };

    I don't know to write the right syntax for the filter.

    Georg
    Last edited by gcjm; 2022-09-15 at 10:30.

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,735
    Hi Georg,

    Code:
    function page1_section1_okbtn_click()
    {
    	var txt1 = Lianja.get("page1.section1.txtbx").text;
    	var txt2 = Lianja.get("page1.section1.cmbbx").text;
    	var txt3 = "'" + txt1 + "' $ " + txt2;
    	
    	Lianja.get("page1.section2").filter = txt3;
    	Lianja.get("page1.section2").refresh();
    };
    Note: Remember JavaScript is case-sensitive.

    Regards,

    Yvonne

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Germany, near Jena and Weimar
    Posts
    225
    Thank you Yvonne!
    It worked immediately!

    However, I had tried exactly the same before, only it didn't work. I do not know why.
    What I have seen:
    Sometimes the App Builder seems not accept my changes and the old condition is displayed the next time it is called.

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