locked
One table feeding two fields on a screen. RRS feed

  • Question

  • I have a screen that has two different fields that are both Modal Window Pickers attached to the same table.

    One Modal Window Picker is for selecting a client contact for "billing" purposes and one Modal Window Picker is for selecting a client contact for "work related" purposes.  All the client contacts are in the same table.

    How do I get the result from the modal window picker into it's respective fields on the screen when the second modal window pick will over-write the first?  I assume I must save the result of the first modal window pick in a different field than the result of the second modal window pick but I can't find how to do that.

    Is there a way to do that?

    Thanks   

     
    Wednesday, December 19, 2012 2:17 PM

Answers

  • I don't see the need for any screen properties. Just drag the entity's property from the left-hand side of the screen designer onto the control tree, then change the control type from ACB to WMP (assuming you have a relationship defined between the two tables involved).

    This is all you need to do, unless I'm missing something.

    I've unmarked your answer Laurentz, but Ed is welcome to mark it as the answer if I'm wrong & he needs to do what you've suggested.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Marked as answer by Jyuma1 Monday, December 31, 2012 2:08 PM
    Monday, December 31, 2012 7:14 AM
    Moderator

All replies

  • Try to add 2 DataItems of the type "Client Contact" on the screen and bind those to the modal window pickers. And on the Select/OK event of the modal window picker copy the selected item from the dataItem to the fields of your table.
    • Proposed as answer by LaurentzT Wednesday, December 19, 2012 9:04 PM
    • Marked as answer by Angie Xu Monday, December 31, 2012 6:53 AM
    • Unmarked as answer by Yann DuranModerator Monday, December 31, 2012 7:14 AM
    Wednesday, December 19, 2012 7:58 PM
  • Hi Jyuma

    I will mark LaurentzT's reply as answer, if the marked answer is not helpful to solve your problem, please unmark and give quick response.

    Kind regards


    Angie xu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 31, 2012 6:54 AM
  • I don't see the need for any screen properties. Just drag the entity's property from the left-hand side of the screen designer onto the control tree, then change the control type from ACB to WMP (assuming you have a relationship defined between the two tables involved).

    This is all you need to do, unless I'm missing something.

    I've unmarked your answer Laurentz, but Ed is welcome to mark it as the answer if I'm wrong & he needs to do what you've suggested.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Marked as answer by Jyuma1 Monday, December 31, 2012 2:08 PM
    Monday, December 31, 2012 7:14 AM
    Moderator
  • Sorry for my late response... it's been a hectic few weeks.

    I already applied the changes that LaurentzT suggested and it worked.  However, it would appear that Yann's suggestion is a little cleaner and I will likely adopt his solution.

    Thanks to you both  

    Monday, December 31, 2012 2:07 PM