I have a Vaadin ComboBox, populated with some values. I want to add a new value and pass that new value to the action listener upon clicking a Button, just next to the ComboBox.
I am not getting any clue how to proceed further.
Please help me. Thanks in advance.
Related
Preamble
I have uneditable combobox (user can select from list, but can't type). I suppose, when user have focus on it and press DELETE, it's selection must be cleared? It seems that it is (screenshot was made when I selected some value and then pressed DELETE):
selectionModel is null - screenshot
Problem
But UI control still shows old value, it wasn't cleared. Also ValueChanged listener wasn't triggered.
How to cause
Create ComboBox and fill it with some values. Select any value. You already have selection on it, but it's not enough - now DELETE pressing won't even clear selectionModel. The same with selecting by TAB. Select it with double click (expand and collapse) and then press DELETE. Now selectionModel must be cleared, but UI still show your value.
Another thing: if you closed ComboBox, pressing DELETE will trigger ValueChanged listener. Pressing DELETE on expanded ComboBox won't trigger it, but nevertheless value will become null.
Did anybody face with this? Any ideas to make it work naturally i.e. clear selectionModel and update UI?
Well, the problem was not exactly where I thought. "Delete" button did nothing in any case, ComboBox was cleared because it's items list was refreshed every time when it was expanded -> old items were deleted including selected. Problem was the same - UI wasn't updated. So I resolved this by adding ComboBox.getEditor().clear() before refreshing it's items list in onShowing event.
I'm new to Zoho CRM. I need to show a warning on button press but only once for the first button press. This sounds really simple but yet I can't figure out how to do it in Zoho Creator as all variables seems to have local scope so I can't determine if the button was pressed before. I've been searching if there are global variables in Zoho but found only workarounds with creating another applications for that case.
I've also tried creating a field on my form and hiding it to pass some value there if the button was pressed so next time I can check this field but is not working for some reason.
In validation part I'm assigning new value to a field
warning_shown=true;
But on a form this checkbox remains unchecked and next time I press the button warning_shown equals false.
Any suggestions will be appreciated!
In case someone interested, here is a reply I got on another forum that might help. Here is a link for that topic
It's not going to be possible to use the validation code section to display the message.
I was thinking you could have your hidden decision box field, and in the "On User Input" of the last field in the form you could use something like:
//remember to change field names accordingly
if !input.warning_shown
{
alert "Message here!";
input.warning_shown = true;
}
This would show the message after the last field is filled but before the button is clicked.
I am facing a problem like I have one Vaadin ComboBox with preselected value.I am changing the value from the ComboBox to another value,then ValueChangeEvent is fired.Inside the valueChange method I have written something to show a Popup Window which has Cancel and Ok button.Upon clicking on OK button of Popup Window I am going with the changed value of the ComboBox but upon clicking on Cancel button I just want to have the old value which was there before value change event fired.
Could anyone please help me out from the above issue?
Thanks in advance.
Maybe you can save whatever SelectedItem the combobox has when the event is fired, and if the user pressed cancel, you reset it to this stored item.
Before the click, how do you know what is selected in the click? Of course, you need to store the current selection somewhere. Lets call it currentSelectedValue (it could be NULL in the begining)
On click, you have a new selection, lets call it newSelectedValue
Now, if you do not want to go with this newSelectedValue, simply do this:
combo.setValue(currentSelectedValue);
I have a DevExpress DataGrid in wpf apllication and it will contain two columns my problem is that I want to get particular clicked cell value in DevExpress DataGrid.
Please anybody help me!
You can identify clicked column and row handle using the hit-information returned by the GridView.CalcHitInfo() method:
GridHitInfo hitInfo = gridView1.CalcHitInfo(new Point(e.X, e.Y));
if(hitInfo.InRowCell){
object value = View.GetRowCellValue(hitInfo.RowHandle, hitInfo.Column);
//...
}
Related help-article: Hit Information Overview
Related How-To: Identify the Grid's Element Located Under the Mouse Cursor
I have added a custom button to the navigator in my jqgrid and i am wondering how can i ,when i click on the button, show a dialog with the same style as the edit dialog and ask for some especific fields that are not included in the colModel. Those field would be to be sent to the server when clicking on ok button.
Any ideas?
Thanks in advance.
Carlos.
You can display the "Edit" dialog using editGridRow method. In the second (properties) parameter of the method you can include your custom beforeShowForm event handler which can make any modifications in the dialog.
See last demo from the answer for an example. The demo has the line
$('<tr class="FormData" id="tr_AddInfo"><td class="CaptionTD ui-widget-content">'+
'<b>Additional Information:</b></td></tr>').insertAfter (nameColumnField);
inside of beforeShowForm.
If the information which you need to show in the dialog are from the hidden column of the grid you can use simplified way which you find here. The main idea in the solution is that jqGrid include in the form dialog all hidden fields, but the corresponding row is hidden. So it is enough just to show the hidden row.