locked
Add drop down list to search screen in lightswitch html client RRS feed

  • Question

  • Hi 

    I was creating a custom search screen for one of my projects; and i found that on LS HTML client i can't change parameter's fields to a drop-down list (picked from another table). So the question how to do that? 

    How to make html client search screen with different parameters? but with "fields" as drop-down list picked from another table (with a relationship to the required search table). 

    Thanks for your help. 

    Mo

    Sunday, October 5, 2014 10:24 AM

Answers

  • In this case you need a browse screen based on a query with a parameter.  The parameter is used to filter the query by the related entity.  Like Contacts related to Categories.  Parameter CategoryID type integer and filter Category.ID = CategoryId parameter.  Now your screen will allow you to put that parameter as a  text box and when you type a valid ID in the box your data will filter.

    I'm guessing this is where you're at and now you need to turn that into a drop down...here goes:

    In screen design > Add Data Item > Query > Categories (all)

    Drag selected item to the screen and set to summary

    select query parameter in data pane

    set binding in property pane to Categories.selectedItem.Id

    That should do it.

    HTH,

    Josh

    • Marked as answer by DontNet_me Wednesday, October 22, 2014 5:34 PM
    Thursday, October 9, 2014 3:16 PM
    • Marked as answer by Angie Xu Monday, October 13, 2014 2:50 AM
    Thursday, October 9, 2014 10:56 PM

All replies

  • Any help please? directions? suggested readings? 

    Thanks a million

    Mo

    Thursday, October 9, 2014 12:32 PM
  • In this case you need a browse screen based on a query with a parameter.  The parameter is used to filter the query by the related entity.  Like Contacts related to Categories.  Parameter CategoryID type integer and filter Category.ID = CategoryId parameter.  Now your screen will allow you to put that parameter as a  text box and when you type a valid ID in the box your data will filter.

    I'm guessing this is where you're at and now you need to turn that into a drop down...here goes:

    In screen design > Add Data Item > Query > Categories (all)

    Drag selected item to the screen and set to summary

    select query parameter in data pane

    set binding in property pane to Categories.selectedItem.Id

    That should do it.

    HTH,

    Josh

    • Marked as answer by DontNet_me Wednesday, October 22, 2014 5:34 PM
    Thursday, October 9, 2014 3:16 PM
  • good way to go forward; yet i am little lost. Can you help with example? or screen shots? 

    Josh: You rock!
    Mo


    • Edited by DontNet_me Thursday, October 9, 2014 9:30 PM wronge
    Thursday, October 9, 2014 9:20 PM
    • Marked as answer by Angie Xu Monday, October 13, 2014 2:50 AM
    Thursday, October 9, 2014 10:56 PM
  • I found this question on this forum; which has many intersting and related answers: 

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/d56002e1-16c1-4f13-ab5a-1cf82c24930f/can-you-bind-a-drop-down-to-a-query-or-dynamic-data-in-the-html-client?forum=lightswitch

    i thought to put it on this question post as a reference. 

    Mo

    Wednesday, October 22, 2014 5:36 PM