I am writing a custom cell for GWT, but the data to be displayed will be fetched asynchronously (REST call). How do I make the rendering asynch for the cell?
I see ImageLoadingCell shows a spinner, then shows the image when it is loaded, this is done by a browser event, however, since mine is a REST call, I can't use the onBrowserEvent() method, and hence, I don't have a handle to the Element, to refresh its information.
I'm thinking maybe I have to do this through table.refresh()? I'd really like the render method to trigger the fetching however.
If you look at the goals of cell widgets, then I don't think this is possible and definitely not desirable :
Cell widgets (data presentation widgets) are high-performance,
lightweight widgets composed of Cells for displaying data.
I have faced a similar problem : suppose you have a Contact with a List of tags but only the tagIds are stored with the contact. To visualize the tags in the table, you would have to make callbacks to the server to get the names.
The solution is in using the adapter pattern. Create a ContactAdapter that holds the contact and the actual tags instead of the tagIds. Pre-fill the contact adapters with the tags based on the tagIds and set the List as the datasource for your celltable.
Related
I have this function in which I access from other classes to retrieve the indexpath of the relevant cells so I can edit the data within the cell dynamically across the App.
The problem is, when I update cells modified previously, I would like to modify them again once a user closes and re opens the app, but I am unable to access the cells past the 10th row. And I am assuming it is due to the fact the TableView only loads whats viewable at the moment.
Is there a way to force load all cells? Is my theory behind the problem right? Or is there a different approach I should be going about to this.
Instead of writing directly into the cell, you should write towards a centralized data source (or Model by the MVC pattern).
I am working on Bonita Open source version of 6.4.2 for my project of end of study and I'm facing a big problem to which I'm not finding any coming.
In fact I have a form with an editable Grid widget in which the user enter some data which will be transported to a DB MySQL, at this stage everything works perfectly.
Besides a new constraint occurred to me: I must populate the boxes of the first column with a list of values from my database so that when a user clicks on this boxes the list scrolls and the value will be picked from this list (the same behavior as the Select widget) but inside a table.
Unfortunately, this cannot be achieved with the Editable Grid widget that is provided out of the box (it only allows basic text input).
To implement the kind of UI you described, you have two possible solutions:
Use Bonita BPM Subscription edition's dynamic form feature. This will allow you to create repeatable groups of widgets representing rows of your table. This solution allows to use any types of widgets with data and validators.
Create a HTML widget that contains a JavaScript UI component inside it such as DataTables. This solution is quite flexible but it requires some good/advanced JS coding skills in order to integrate the custom table, link it with the form data and implement validators.
Cheers,
POZ
I would like to create Custom Gwt Celltable with editable columns, where each column may accept any type of widget, is there way to do it, please let me know?
Thanks for your help.
The Cell system, by design, does not allow widgets to be added inside of a Cell. This is the point of the Cell idea - drawing many elements with a single instance, and letting that one instance handle the events for all of them.
This is how the various Cell-based widgets can perform better than the FlexTable or Grid, which allow widgets.
The closest you can get is to draw a Widget on some event sent to the Cell instance, but even there you must be careful to detach the widget when you are finished with it, or risk a memory leak.
I'm really struggling with a choice between the GWT Tree widget, which has been a part of GWT for ages; or the new CellTree, which is introduced by GWT 2.1.
The tree I want to present to the user is not particularly large, but I am very concerned about responsiveness.
The data at the nodes of the tree will be editable. By clicking on a node, the user will put the node into edit mode. Editing the more simple nodes will require only a single TextBox or TextArea; but others will involve several widgets, over which I want styling control via CSS.
I'm attracted to the CellTree approach because it seems to offer great flexibility and speed; however, the sample code for CellTree editing deals with only very simple data types: string, date, integer, etc. I don't know if CellTree is appropriate when you've got more complex node-editing needs.
What do you think? Is CellTree the best approach? Does CellTree replace Tree in general? What heuristics can I apply in choosing between them?
I'm using a CellTable with several custom input Cells, including one comprised of many widgets. It works great!
It took me a couple of hours to understand how to implement a custom Cell that could do complex operations - since a single instance of the Cell will flit around the CellTree, pretending to be many instances, you need to understand how it's getting its data and when it is refreshed and rendered. I learned a lot from the source of the DatePickerCell.
I can't speak for CellTree, but the CellTable is very flexible, was easy to program, and saves me hundreds of Widget instances.
Using CellTree is problematic. Because it hasn't good access to view implementation stored in CellTree. It cause problem (ex. for me :D) in making custom handlers for opening nodes with children by clicking on whole parent cell. Of course you can make custom cells by AbstractCell, where you must write own renderer.
I think this widget must be enchanced and more objects must be more visible for users.
Customizing CSS is simple. All what you have to do is extende CellTree.resource and insert own css based on celltree.css class names.
I have some items in panel A along with some descriptions like time of delivery. All items in different div. In the second panel I have list of drivers with different timings like 9AM, 10AM and so on.
Now I need, that, when I drag and drop itemA from Panel1 to DriverA in panel2, I want that the item should be added to the dropped driver(DriverA) and the the cell of that particular driver with timing (say if item has to be delivered at 10AM , then then cell of driver with 10 AM changes the color to red).
There is support in jQuery for drag and drop.
See http://www.codeproject.com/KB/webforms/JQueryPersistantDragDrop.aspx and the documentation of jQuery.
Do this with a JavaScript framework like jQuery together with an AJAX framework like Prototype.
Make the Elements droppable with jQuery: http://jqueryui.com/demos/droppable/
Then store the information with an AJAX call using Prototype and the callback functions of the jQuery methods.