I am using org.eclipse.ui.dialogs.CheckedTreeSelectionDialog, to display a list of values. I want to select(check) all the values by default. Can you please let me know how this can be done.
You can set which nodes are checked initially (on dialog creation), by using the setInitialElementSelections method.
CheckedTreeSelectionDialog dlg = new CheckedTreeSelectionDialog(shell,
new cLabelProvider(),
new cContentProvider());
dlg.setInput(model);
dlg.setInitialElementSelections(model.getAllElements());
Also, make sure that you do your
dlg.setInitialElementSelections(model.getAllElements());
before you open your dialog:
dlg.open(); because otherwise it won't work.
Related
I have some text field page items on my APEX 5.0 page and I want to make the textboxes as read only/non-editable. During the page load I want to use these text boxes for only the data display on the page and should be non-editable.
Can somebody advice on how to do that? What attributes need to set for this?
This answer is a bit late to the party, but I found myself confronted to this problem and I wanted to share the solution I came up with.
In fact you just need to create your item as a text area, let say P1_Text_Area and you give it a readonly attribute using JavaScript. Write thoses 2 lines in the "Function and Global Variable Declaration" of your page:
var disItem = document.getElementById('P1_Text_Area');
disItem.readOnly = true;
Hope this helps someone in need.
in item properties find the
Read Only group
and set Read Only Condition Type as Always
or the option that suits to you
You can use disabled + save session state ==> read only
I'm using the following statement to clear text filed value:
input.value("abc")
input.value("")
input.value("def")
But, instead of clearing and set new value, it is appending the new value to old value. ('abcdef').
Is there any way to clear the TextField, before setting new val?
You can clear using the selenium element:
input.firstElement().clear()
And you can send keys using << like so:
input << "abc"
You can use the selenium Keys to backspace the texts that you already had entered. You can try many different ways to accomplish that. Here is a simple way to do that:
import org.openqa.selenium.Keys
input.value("abc")
input.value(Keys.chord(Keys.CONTROL, "A")+Keys.BACK_SPACE)
input.value("def")
It should do the job. Let us know whether it worked for you or not!
Cheers#!
Actually, I'm trying to use a combo-box in Ext.Net to select a value from its selecting list. This combo-box is editable and user can type any value he want.
On selecting list, I want to prevent user from selecting the highlighted item by pressing Enter key and let him just select it by mouse click. for this, i tried to use an listener on bound list "ItemKeyDown" but it did nothing. Other events related to mouse par example, working fine but all events related to key are not working.
I don't know if i have missed something in configurations or what.
Anyone can give me any advise to make theses listeners work?
Thanks in advance,
var combo = Html.X().ComboBox().DisplayField(mark).ValueField(type).Editable(true)
.ID(combo_id).EnableKeyEvents(true).AutoSelect(false).SelectOnFocus(true)
.QueryMode(DataLoadMode.Local).ValidateOnBlur(false).ValidateOnChange(false)
.ListcConfig(Html.X().BoundList()
.Listeners(l => l.ItemKeyDown.Handler = "console.log('ItemKeyDown');")); /// ItemKeyDown not displayed in console.
I post the solution i got from Ext.Net support team so if someone need it in future:
#(Html.X().ComboBox()
.Listeners(events => {
events.Expand.Handler = #"this.listKeyNav.map.removeBinding({
key: Ext.EventObject.ENTER
});";
events.Expand.Delay = 1;
events.Expand.Single = true;
})
)
I am having a UltraListView and some items with checkbox in it. Now I have to disable the specified checkbox with help of index give.
For eg: If i provide '0' then i should get the first checkbox disabled and if I provide '1' the second checkbox should get disabled.
//Code
Me.lvUnlink.Items(O).Control.ViewSettingsList.CheckBoxStyle = UltraWinListView.CheckBoxStyle.CheckBox
I tried like the above code and it disables all the checkboxes. How can I achieve this?
There are different approaches to solve this task. Maybe one of the easiest solutions could be if you are using instance of UltraListViewItemCheckBoxUIElement. For example:
UltraListViewItemCheckBoxUIElement elem = e.Element.GetDescendant(typeof(UltraListViewItemCheckBoxUIElement),ultraListView1.Items[3]) as UltraListViewItemCheckBoxUIElement;
if (elem != null) elem.Enabled = false;
If you want to disable/enable specific item/items using an index, you should specify the context in your GetDescendant() method
If you have any questions, feel free to write me
When using Selenium how can I wait for a popup window if its id is dynamically generated?
For example:
selenium.click("link=mylink");
selenium.waitForPopUp("popup072815372337691199");
Obviously I cannot hardcode the window id in my source code. Any hints?
It would obviously be best to have a consistent or fully predictable window name, however if this is not possible you could try using the getAllWindowNames command to wait until the number of windows increments. If the name of the window is somewhat predictable (like a consistent prefix) you could then find out the full name of the new window before using waitForPopup or selectWindow.
do it this way....
'String href = selenium.getAttribute("link=myLink#herf");
selenium.openWindow(href, "myWindow");
selenium.selectWindow("myWindow");
selenium.click(...);
// do whatever
selenium.selectWindow(null); // go back to the previous window'