cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

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

fmanniti
9-Granite

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5

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

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?

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.

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

Your welcome, yes TW Mashups are a bit tricky when you want to get that kind of interaction, I have more tricky ones

Top Tags