5 Replies Latest reply on Sep 27, 2016 4:40 AM by carlesc RSS
    fmanniti Creator

    Is it possible to add a command inside a list widget?

    In my mashup I have a dropdown list widget which shows me all the rows of the infotable; the user has the chance to add new items so I put a button which invokes the serivice.

    Is it possible to put the "Add new item" command at the bottom of the dropdown list instead of an outside button?

      • Re: Is it possible to add a command inside a list widget?
        carlesc Ninja

        Hi Fabio,

         

        Yes you can do some tricks to do it...

         

        Your service should return as the last item "Add new Item" and id for instance "addNew".

         

        Then with a Validator widget which has as input value the Selecte Row Id value (let's say the parameter it's called "value"), you just need to set the expression as:

        (value=="addNew")

         

        Then on True event from Validator widget, you just need to trigger you AddNewItem service.

         

        Hope it helps,

        Carles

          • Re: Is it possible to add a command inside a list widget?
            fmanniti Creator

            It acutally works but, my problem is, after I click on "Add new" it opens a popup where I can add my new data.

            The problem is, once I close the popup I get back on my page where "Add new" is still selected on the dropdown list so it will open again the popup in a infinite loop.
            How can "clean" the selection in the dropdown list?

              • Re: Is it possible to add a command inside a list widget?
                carlesc Ninja

                But selected row event it's triggered again? You can use an expression widget instead of a validator widget, and change only on value change, then it will not trigger Change event if it doesn't change.

                 

                Another option, more hard, will be to get the value Id of the new created item on the pop-up ( through a parameter ) and set "Selected text" property on the list widget with it.

                 

                Carles.

                  • Re: Is it possible to add a command inside a list widget?
                    fmanniti Creator

                    Actually the expression widget doesn't work at 100%. I mean, when I close my popup it will open it one more time and only the second time I close it stays closed (don't know why).

                    Anyway yesterday I tried a solution similar to the one you wrote but a little easier:

                    I put a textbox widget (non visible in runtime) and I bind its "Text" property to "SelectedText" of my dropdown list widget and its default text is blank; then I bind my "popup closed" event from navigation widget to "ResetToDefaulValue" of textbox so, anytime I close the popup, my list get back to a blank value.

                    It works fine this to me.

                    Thank you very much for your help