I am working on smartGwt project i have developed simple slectedItem dropdown. This dropdown does not showing any vaules for slection this is multiple selction dropdown. below is my code
final Window winModal = new Window();
winModal.setWidth(700);
winModal.setHeight(400);
winModal.setAutoSize(true);
winModal.setTitle("Schedule");
winModal.setShowMinimizeButton(false);
winModal.setIsModal(true);
winModal.setShowModalMask(true);
winModal.centerInPage();
DynamicForm form = new DynamicForm();
form.setHeight100();
form.setWidth100();
form.setPadding(5);
form.setLayoutAlign(VerticalAlignment.BOTTOM);
SelectItem selectItemMultiplePickList = new SelectItem();
selectItemMultiplePickList.setTitle("Select Multiple");
selectItemMultiplePickList.setMultiple(true);
selectItemMultiplePickList.setMultipleAppearance(MultipleAppearance.PICKLIST);
selectItemMultiplePickList.setValueMap("Cat", "Dog", "Giraffe", "Goat", "Marmoset", "Mouse");
form.setFields(selectItemMultiplePickList);
winModal.addItem(form);
winModal.show();
my dropdown widget is showing but not showing any values inside dropdown
anyhelp
Thanks in advance
It's kinda hacky but a quick way to use a select without a datasource is to set the special values:
https://www.smartclient.com/smartgwtee-release/javadoc/com/smartgwt/client/widgets/form/fields/SelectItem.html#setSpecialValues-java.util.LinkedHashMap-
Related
I have the following page:
http://live.guru99.com/index.php/mobile.html.
I need to click Sort By "name" on the dropdown list in Selenium, trying to do this with this code:
public void f() {
verifyTitle(baseUrl, "Home page");
driver.findElement(By.cssSelector(".level0 ")).click();
verifyTitle(driver.getCurrentUrl(), "Mobile");
Select dd = new Select(driver.findElement(By.cssSelector("select[title=Sort By][css=1]")));
dd.selectByVisibleText("Name");
}
What's wrong with this code? Are quotation marks in right place?
Try to use the following code:
Select dd = new Select(driver.findElement(By.cssSelector("select[title='Sort By']")));
dd.selectByVisibleText("Name");
Hope it helps you!
Following is my code but it shows only one column in autocomplete but i want shows data in tabular foramte with multiple column[In short i want to show suggestion box in tabular formate]. how i can do that?
Thanks in advance Please suggest anything..
FlowPanel panel = new FlowPanel();
initWidget(panel);
final BulletList list = new BulletList();
list.setStyleName("token-input-list-facebook");
final ListItem item = new ListItem();
item.setStyleName("token-input-input-token-facebook");
final TextBox itemBox = new TextBox();
itemBox.getElement().setAttribute( "style", "outline-color: -moz-use-text-color; outline-style: none; outline-width: medium;");
final SuggestBox box = new SuggestBox(getSuggestions(), itemBox);
box.getElement().setId("suggestion_box");
item.add(box);
list.add(item);
I want to verify tooltip text on NEW Button of my webpage. The html backend code of NEW Button before mousehover is as below:
<button id="newBtn" class="checkForSave" title="Create a new Configuration Package" type="button">New</button>
After mousehover on NEW Button the html backend code of NEW Button is as below:
<button id="newBtn" class="checkForSave" title="" type="button"> area-describdby="ui-tooltip-27"New</button>
Now I want to verify that tooltip text "Create a new Configuration Package" should come after mousehover on NEW Button.
I'm able to store the text in a string before mouseover by following code:
WebElement NewButton = driver.findElement(By.id("newBtn"));
String Tooltip = NewButton.getAttribute("title");
System.out.println(Tooltip);
Its printing text "Create a new Configuration Package"
But when I'm moving mouse over NEW button and writing code
Actions ActionChains = new Actions(driver);
WebElement NewButton = driver.findElement(By.id("newBtn"));
actions.moveToElement(NewButton).build().perform();
ActionChains.clickAndHold(NewButton).perform();
String Tooltip = NewButton.getAttribute("title");
System.out.println(Tooltip);
I'm not geting anything i m getting blank message Because after mousehover the title is "" in backend html code of NEW Button.
How can I do that?
Comment out the line ActionChains.clickAndHold(NewButton).perform();
import org.openqa.selenium.interactions.HasInputDevices;
import org.openqa.selenium.interactions.Mouse;
import org.openqa.selenium.internal.Locatable;
Locatable hoverItem = (Locatable) webEleObj;
Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
mouse.mouseMove(hoverItem.getCoordinates());
Try to find element using xpath! It may help you as the same thing i tried with "id" & it didn't work, while it worked using xpath instead!!
I am trying to learn Wicket. One of the problems I encounter, is changing the values of components like a label.
This is how I declare the label:
Label message = new Label("message", new Model<String>(""));
message .setOutputMarkupId(true);
add(message );
The only solution I can find:
Label newMessage= new Label(message.getId(), "MESSAGE");
newMessage.setOutputMarkupId(true);
message.replaceWith(newMessage);
target.add(newMessage);
Is there a better/easier way to edit the value of a Wicket label and display this new value to the user?
Thanks!
I think you did not understand what Models are. Your example could be rewritten as follows
Model<String> strMdl = Model.of("My old message");
Label msg = new Label("label", strMdl);
msg.setOutputMarkupId(true);
add(msg);
In your ajax event
strMdl.setObject("My new message");
target.add(msg);
This is my code :
HighChart chart = new HighChart(title, PIE, data);
VLayout vlayout = new VLayout(title);
vlayout.setHeight100();
vlayout.setWidth100();
vlayout.addMember(chart);
Tab tab = new Tab();
tab.setTitle(title);
tab.setPane(vlayout);
tab.setCanClose(true);
tabset.addTab(tab);
The HighChart class contain the showcase example code.
The result is an empty tab, any solutions?
I solved the problem, the ​​RootLayoutPanel who did not accept the chart display, a simple replacement by a layout.draw(); did the trick