Search Results

Search found 10 results on 1 pages for 'listgrid'.

Page 1/1 | 1 

  • smartgwt listgrid not updating

    - by user1488594
    I'm using Smartgwt Lgpl 3.0p. I had a problem with ListGrid column width. I'm using listGrid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH); When first time listGrid.setData() is called, Column width is set according to the Titles and data is cropped but if listGrid.setData() is called again it works fine as expected. I think I have a problem with combination of listGrid properties. I tried to reproduce problem in standalone example but no success, Here is my code: final ListGrid listGridShipmentsItems; final ListGridField lstGridOrderItem = new ListGridField("orderItem"); final ListGridField lstGridPartNumber = new ListGridField("partNumber"); final ListGridField lstGridProductDesc1 = new ListGridField("productDescriptionLine1"); final ListGridField lstGridBillingPieces = new ListGridField("billingPieces"); final ListGridField lstGridBillingWeight = new ListGridField("billingWeight"); final ListGridField lstGridCertificates = new ListGridField("certificatesText"); final ListGridField lstGridInvoiceNumber = new ListGridField("invoiceNumberTextAndImage"); // create ListGrid listGridShipmentsItems = new ListGrid() { @Override protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum){ String fieldName = listGridShipmentsItems.getFieldName(colNum); if(fieldName.equals("certificatesText")) { Label certificates = new Label(record.getAttribute("certificates")); certificates.setAutoHeight(); certificates.setAutoWidth(); certificates.setWrap(false); certificates.setBaseStyle("dataGridLabel"); certificates.setPrompt(delegate.i18nResolver.tooltip("CMW-CERT-2","Certificates")); certificates.setHoverWrap(false); certificates.setHoverWidth(certificates.getPrompt().length()*5); certificates.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { delegate.showCertificatesByShipmentsItems(record); } }); return certificates; } else if(fieldName.equals("invoiceNumberTextAndImage")) { HLayout hLayout = new HLayout(10); hLayout.setAutoHeight(); hLayout.setAutoWidth(); hLayout.setAlign(VerticalAlignment.CENTER); Label invoiceNumber = new Label(); if(record.getAttribute("invoiceFlag").trim().equalsIgnoreCase("1")) { if(!record.getAttribute("updateReference").trim().equalsIgnoreCase("")) { invoiceNumber.setContents(record.getAttribute("updateReference")); } else { invoiceNumber.setContents(""); } } else { invoiceNumber.setContents(""); } invoiceNumber.setAutoHeight(); invoiceNumber.setAutoWidth(); invoiceNumber.setWrap(false); invoiceNumber.setBaseStyle("fieldLabel"); invoiceNumber.setValign(VerticalAlignment.CENTER); ImgButton invoicesPdfImg = new ImgButton(); invoicesPdfImg.setShowDown(false); invoicesPdfImg.setShowRollOver(false); invoicesPdfImg.setSrc(Icons.PDF_16X16); invoicesPdfImg.setHeight(16); invoicesPdfImg.setWidth(16); invoicesPdfImg.setPrompt(delegate.i18nResolver.tooltip("CMW-INV","Invoice")); invoicesPdfImg.setCursor(Cursor.POINTER); invoicesPdfImg.setHoverWrap(false); invoicesPdfImg.setHoverWidth(invoicesPdfImg.getPrompt().length()*5); invoicesPdfImg.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { delegate.openInvoicesPDF(record); } }); hLayout.addMember(invoiceNumber); hLayout.addMember(invoicesPdfImg); return hLayout; } else { return null; } } }; // set initial properties GridController.setListGridInitialProperties(listGridShipmentsItems); /**Common method to set ListGrid initial properties*/ public static void setListGridInitialProperties(ListGrid listGrid) { listGrid.setWidth("100%"); listGrid.setHeight("100%"); listGrid.setShowAllRecords(true); listGrid.setLeaveScrollbarGap(false); listGrid.setSelectionType(SelectionStyle.SINGLE); listGrid.setAlternateRecordStyles(true); listGrid.setFixedRecordHeights(false); listGrid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH); //removing it will not show any column or only first column when grid is blank listGrid.setAutoFitFieldWidths(true); listGrid.setAutoFitFieldsFillViewport(false); listGrid.setCellPadding(5); listGrid.setCanSort(false); listGrid.setCanResizeFields(true); listGrid.setCanMultiSort(false); listGrid.setCanReorderRecords(false); listGrid.setCanReorderFields(false); listGrid.setAlternateRecordStyles(true); listGrid.setFastCellUpdates(false); listGrid.setShowHeaderContextMenu(false); listGrid.setEmptyMessage(""); listGrid.setBaseStyle("dataGrid"); listGrid.setBodyStyleName("dataGridBody"); listGrid.setHeaderBaseStyle("headerTitleStyle"); listGrid.setShowRecordComponentsByCell(true); listGrid.setShowRecordComponents(true); } Thanks,

    Read the article

  • smartGWT: ListGrid setDataSource on a servlet

    - by itit
    I want to setDataSource of my ListGrid on response received from my java servlet. For example: request = builder.sendRequest(null, new RequestCallback() { public void onResponseReceived(Request request, Response response) { if(200 == response.getStatusCode()) { final ListGrid countryGrid = new ListGrid(); countryGrid.setWidth(300); countryGrid.setHeight(450); countryGrid.setAlternateRecordStyles(true); countryGrid.setShowFilterEditor(true); countryGrid.setFilterOnKeypress(true); countryGrid.setDataSource(Frequenze.getInstance()); countryGrid.setAutoFetchData(true); ListGridField wordField = new ListGridField("word", "Word"); ListGridField frequenceField = new ListGridField("frequence", "Frequece"); countryGrid.setFields(wordField, frequenceField); countryGrid.setDataSource(dataSource); // ?? ... How can I fill the servlet response in the ListGrid?

    Read the article

  • smartGWT: retrieve data from server to populate a listGrid

    - by Gabriele
    I'm searching a way to populate a ListGrid with an XML response from a server. This is an example of my server response: <?xml version="1.0" encoding="UTF-8"?> <tbody id="tbody"> <tr> <word>The</word> <frequence>12</frequence> </tr> <tr> <word>best</word> <frequence>3</frequence> </tr> ... And this is how I can populate the ListGrid using a file (item.xml) where I have saved the xml result: public class Frequenze extends DataSource { private static Frequenze instance = null; public static Frequenze getInstance() { if (instance == null) { instance = new Frequenze("frequence"); } return instance; } public Frequenze(String id) { setID(id); setRecordXPath("//tr"); DataSourceTextField wordField = new DataSourceTextField("word", "Word"); wordField.setRequired(true); DataSourceIntegerField frequenceField = new DataSourceIntegerField("frequence", "Frequence"); frequenceField.setRequired(true); setFields(wordField, frequenceField); setDataURL("ds/item.xml"); setClientOnly(true); } } Now I want not to use the file, but I'm searching a way to retrieve the data directly from the server. Anyone know how I get this?

    Read the article

  • How to add button in HeaderSpan of SmartGWT

    - by Anuroop
    I want to add a button to the HeaderSpan of ListGrid in SmartGWT. I tried using the 'HeaderSpan.setAttribute((String property, Object value)) method but it did not work. Below is the example I tried with:- ListGrid countryGrid = new ListGrid(); HeaderSpan ident = new HeaderSpan("Identification", new String[]{"countryCode", "countryName"}); ident.setAttribute("control", new Button("Test")); countryGrid.setHeaderSpans(ident); countryGrid.draw(); Please help!

    Read the article

  • how get value from smartgwt Custom FilterEditorType ?

    - by Ehsan Khodarahmi
    Hi I've developed a custom widget (a persian calendar consist of a base textbox & image widget on a gwt grid which look likes smartgwt calendar) & putted it in a CanvasItem because i want to add it as a filter editor for a listGrid : ListGridField regDateTimeField = new ListGridField("regDateTime", ????? ? ????", 120"); regDateTimeField.setFilterEditorType(new PersianCalendarItem()); now list grid displays it successfully, but when i click on filter button, nothing happend even when it value changes. I think i have to override some canvas item methods to return internal textbox value, but i don't know how should i do this ???

    Read the article

  • SmartGWT Widgets not displaying properly

    - by Holograham
    I have a basic GWT Maven project going. I added SmartGWT and started playing around with some widgets and nothing displays correctly. The ListGrid seems to somewhat render but things are off and even data isnt showing up (though the rows respond to indicate there is data within the row). Sorting arrows dont appear but are clickable, and filters are wildy off. Whats causing this. I deleted everything in the .css file. GWT newbie here.

    Read the article

  • how to change the filed while showing on the grid?

    - by rockers
    helo friends, I am new to Asp.net mvc.. I have a column called Indicator in the data base..that has Y or N this is the code I am using to get the field from data base.. Indicator= !dr.IsDBNull(8) ? dr.GetString(8) : null, In my entity class i have the filed public string Indicator { get; set; } while to assing the grid I am doing soemthing like this var result = (from e in A.List.AsQueryable() select new { Indicator= e.Indicator, }); return gridModel.ListGrid.DataBind(result); But on the grid I am seeing Y and N.. but Yesterda of that if it return Y I need to show them YES if it is N i need to show them NO where do I need to change this? thanks

    Read the article

  • SmartGWT - Update ListGridRecord dynamically

    - by Haylwood
    I am using SmartGWT and I have a ListGrid populated with an array of ListGridRecords using the setData() call. I am trying to update a progress property of a single record (on a timer for testing) and have it update in the browser. I have tried various combinations of draw(), redraw(), markForRedraw() etc. to no avail. I also tried overriding the updateRecordComponent() method in my table class, but it only gets called when the records are first created (after createRecordComponent()). I should note that I do NOT want to accomplish this by binding to a DataSource. I just want to be able to update the attribute on the client-side. ArrayList<SegmentSortRecord> mRecords; mRecords.add(new SegmentSortRecord("03312010_M001_S004")); mRecords.add(new SegmentSortRecord("03312010_M001_S005")); mRecords.add(new SegmentSortRecord("03312010_M001_S006")); mRecords.add(new SegmentSortRecord("03312010_M001_S007")); SegmentSortRecord[] records = new SegmentSortRecord[mRecords.size()]; mRecords.toArray(records); mSortProgressTable.setData(records); . . . mTestTimer = new Timer() { public void run() { mTestPercent += 5; if (mTestPercent <= 100) { mSortProgressTable.getRecord(2).setAttribute(Constants.PROGRESS_COL_NAME, mTestPercent); //mSortProgressTable.markForRedraw(); //mSortProgressTable.redraw(); } else { mTestPercent = 0; } } }; ... @Override protected Canvas createRecordComponent(final ListGridRecord aRecord, Integer aColumn) { String fieldName = getFieldName(aColumn); // Want to override the behavior for rendering the "progress" field if (fieldName.equals(Constants.PROGRESS_COL_NAME)) { Progressbar bar = new Progressbar(); bar.setBreadth(10); bar.setLength(100); // The JavaScript record object contains attributes that we can // access via 'getAttribute' functions. bar.setPercentDone(aRecord.getAttributeAsInt(Constants.PROGRESS_COL_NAME)); return bar; } Thanks in advance for any help.

    Read the article

  • Insane SmartGWT + GWT situation... Error on instantiating ListGridRecord?

    - by Xandel
    Hi all, I am asking this here in the hope that someone has maybe come across this situation too... I have posted this on the SmartGWT forum: I am having an issue when trying to instantiate a ListGridRecord object on my server side. I am using the ListGrid on the client side, I want to use GWT's RPC to pass back an array of ListGridRecord objects to populate the grid with. I know that SmartGWT is designed to link to a datasource but I want full control over when I populate the grid and this shouldn't be as much of a nightmare as it is to do. I have searched high and low and cannot find anyone complaining about the same thing. The exception however (listed below) has come up (in my search findings) as a possible memory error - where increasing the memory (-Xmx512m argument) has apparently solved the problem. It did not, however, sort out mine. If anyone can shed any light on this I would greatly appreciate it! Here are my details: Developing using Eclipse Galileo on Ubuntu 9.04 (Jaunty) and GWT 2.0.3, I built the initial GWT project using the webAppCreator bundled with the GWT 2.0.3 release and imported the project into Eclipse as described on the GWT Getting Started Page (as using the GWT Eclipse plugin caused even more nightmares when trying to connect to a database - this is apparently due to using the Google App Engine and turning it off as all the posts suggested only causes ClassNotFound exceptions). The line that causes the error is literally: ListGridRecord a = new ListGridRecord(); The error I get is the following: 00:00:25.916 [WARN] Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException : Service method 'public abstract java.lang.String za.co.company.product.client.service.EmployeeServi ce.getAllEmployeeAsListGridRecord()' threw an unexpected exception: java.lang.UnsatisfiedLinkError: com.smartgwt.client.util.LogUtil.setJSNIErrorHandl er()V at com.google.gwt.user.server.rpc.RPC.encodeResponseF orFailure(RPC.java:378) at com.google.gwt.user.server.rpc.RPC.invokeAndEncode Response(RPC.java:581) at com.google.gwt.user.server.rpc.RemoteServiceServle t.processCall(RemoteServiceServlet.java:188) at com.google.gwt.user.server.rpc.RemoteServiceServle t.processPost(RemoteServiceServlet.java:224) at com.google.gwt.user.server.rpc.AbstractRemoteServi ceServlet.doPost(AbstractRemoteServiceServlet.java :62) at javax.servlet.http.HttpServlet.service(HttpServlet .java:637) at javax.servlet.http.HttpServlet.service(HttpServlet .java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle (RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(Selec tChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:488) Caused by: java.lang.UnsatisfiedLinkError: com.smartgwt.client.util.LogUtil.setJSNIErrorHandl er()V at com.smartgwt.client.util.LogUtil.setJSNIErrorHandl er(Native Method) at com.smartgwt.client.core.JsObject.(JsObjec t.java:30) at za.co.company.product.server.service.EmployeeServi ceImpl.getAllEmployeeAsListGridRecord(EmployeeServ iceImpl.java:83) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncode Response(RPC.java:562) at com.google.gwt.user.server.rpc.RemoteServiceServle t.processCall(RemoteServiceServlet.java:188) at com.google.gwt.user.server.rpc.RemoteServiceServle t.processPost(RemoteServiceServlet.java:224) at com.google.gwt.user.server.rpc.AbstractRemoteServi ceServlet.doPost(AbstractRemoteServiceServlet.java :62) at javax.servlet.http.HttpServlet.service(HttpServlet .java:637) at javax.servlet.http.HttpServlet.service(HttpServlet .java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle (RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(Selec tChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:488) Thanks in advance! Xandel

    Read the article

1