how to retrieve data from gridList in smartGWT - smartgwt

I have created a ListGrid from Smart GWT
Attached is the screenshot
I am not able to get the values of the gridList.
Attached is my gridList img
ListGrid countryGrid = new ListGrid();
now how will i get this "my test" ?
thanks

Related

Styling a vaadin Component (Dialog) with CSS file

I have a Dialog that retrieve informations from an endpoint (String of information) but I have a Problem with style this dialog, because all these informations appear untidily!
For example to be clear, I have this endpoint, that it helps me to retrieve a Data about Mobile, and want to show this Data in a Dialog (BUT the Style should like Screenshot Nr. 1), but my Problem is that the data appears as Preview (Screenshot 2).
You can use the Html component with a pre tag where you put the formatted JSON:
Html pre = new Html("<pre>" + formattedJson + "</pre>");
To format the JSON String you can use this:
String prettyJson = mapper.writerWithDefaultPrettyPrinter()
.writeValueAsString(mapper.readTree(inputJson));
Find more examples here: https://roytuts.com/how-to-pretty-print-json-in-java/

How to attach a new BrowserWindowOpener to a button, without destroying the button first?

on Vaadin 7 I have the working code :
private void gridAttachmentsClickItemEventAction(ItemClickEvent event) {
// blablabla some code to get the data from the repository
byte[] data = bibocoAttachmentResponseEntity.getBody().getContent();
StreamResource.StreamSource source = convertByteArrayToStreamResource(data);
String filename = "c:\\droppdf\\"
+"temp"+bibocoAttachmentResponseEntity.getBody().getFileName()+LocalDate.now().toString();
StreamResource resource = new StreamResource(source, filename);
resource.setMIMEType("application/pdf");
resource.getStream().setParameter("Content-Disposition", "attachment; filename=" + filename);
BrowserWindowOpener opener = new BrowserWindowOpener(resource);
opener.extend(btnAttachmentPreview);
}
When I click on a grid row, the data is collected from that grid
and code following on it gets the data byte[] from a repository by calling a service.
Afterwards, when the user clicks on btnAttachmentPreview a new browser tab opens
and shows the pdf (that's what's in the data byte[])
This works fine the first time, but when I select a new row in the grid,
the problem is that the second call does not set the listener to the button right.
It show the first data byte[] again in a new tab, not the current data ...
The method is accessed, the correct data[] has been loaded in the array the second time, I checked.
I believe the listener on the btnAttachmentPreview attached due the code
opener.extend(btnAttachmentPreview);
should be binned (empty'ed or nulled) first. But I have no reference to it as for as I can tell.
Problem is that I don't want to destroy the btnAttachmentPreview object.
(The btnAttachmentPreview is a global variable and is set to a layout that I may not change. I know, not nice, but it's a ancient product)
When I close the browser and restart and clicking another row, the right data byte[] is showed.
Anyone a clue ?
Any help appreciated
You can remove an extension using its remove() method, i.e. opener.remove();.
If you cannot easily structure your code to store a reference to the old opener so that you have it available when you want to add a new one, then you can use btnAttachmentPreview.getExtensions() to get a collection of all current extensions and then from that you can find the appropriate extension (if any) and call remove() on it.

iText RadioCheckField tooltip issue

I am trying to set tooltip (mouse over info) on Acroforms fields using itext. I have no issues with Textfields, Checkboxes and Listfields. But for some reason the tooltip is not getting shown in case of RadioCheckField. Following is the code snippet
RadioCheckField radio = new RadioCheckField(writer, new Rectangle(x, y - 4, x + 14, y - 14), name, exportValue);
PdfFormField field = radio.getRadioField();
field.setUserName(toolTip);
field.setName(name);
writer.addAnnotation(field);
radiogroup.addKid(field);
Invoking setUserName on PdfFormField sets the /TU flag in PDF. When I examined the generated PDF through Rups, I can see that /TU is set for RadioCheckField kids in the radioGroup. But still no tooltip is shown. For 508 (accessibility) compliance tooltip functionality is a must.
Here is a link to PDF file generated from above code http://www.docdroid.net/14son/output.pdf.html
Can anybody provide some information?

get selected one value of dataview by default in ext.net

I am working with Ext.Net 1.5. and I am working with Ext:dataview.
I want to get selected one value of dataview by default.
suggest me how is it possible??
please look at Image
Try to add following JS code:
if ({your_dataview_id}.store.data.length > 0) {
{your_dataview_id}.select(0); // Selects first element in a dataview
}
on a client side when you want to select the first element in the dataview. Just replace {your_dataview_id} with your dataview's id

ASPNET MVC: how do i add an image to a RSS item?

I need to add an image to my RSS feed but cannot see it.
My code is:
var item = new SyndicationItem
(
title: Title,
content: Content,
itemAlternateLink: new Uri(bla)
);
item.ElementExtensions.Add(
new XElement("enclosure",
new XAttribute("type", "image/jpeg"),
new XAttribute("url", new Uri(Uri))
).CreateReader()
);
If I use ElementExtensions I see a link to the image in the RSS but I would like to see directly the image without clicking the link. Is it possible?
Are you asking how to show an image in your RSS feed? If so, i believe that to show images in a feed you need the RSS media extensions - http://video.search.yahoo.com/mrss
For example, Zenfolio uses this to render photos in the gallery feeds.

Resources