Skip to main content
1-Visitor
September 26, 2016
Solved

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

  • September 26, 2016
  • 5 replies
  • 3051 views

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?

Best answer by CarlesColl

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

5 replies

1-Visitor
September 26, 2016

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

fmanniti1-VisitorAuthor
1-Visitor
September 26, 2016

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?

1-Visitor
September 26, 2016

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.