I have two ListFragments next to each other.
The left one shows categories to be selected while the right on shows the elements in the selected category.
Now at the very start of the screen the left ListFragment shows all categories while the right one is empty and waits for a category to be selected. Only then it can display the memebers of the selected categry.
While it's empty however, the "Loading.." message gets display - which I think looks quite good.
All I like to do now is replace the "Loading..." text by my own.
Is this possible without having to implement the complete ListFragment class?
Many thanks.
ListFragment.setEmptyText(..) should do the trick!
The method setEmptyText shows a TextView when the list is empty therefore "Loading..." will not be shown. From Documentation
The default content for a ListFragment has a TextView that can be
shown when the list is empty. If you would like to have it shown, call
this method to supply the text it should use.
whereas spinning loading animation is an indeterminant progress indicator and is normally shown as per the docs
public void setListShown (boolean shown)
Since: API Level 11 Control whether the list is being displayed. You
can make it not displayed if you are waiting for the initial data to
show in it. During this time an indeterminant progress indicator will
be shown instead.
Applications do not normally need to use this themselves. The default
behavior of ListFragment is to start with the list not being shown,
only showing it once an adapter is given with
setListAdapter(ListAdapter). If the list at that point had not been
shown, when it does get shown it will be do without the user ever
seeing the hidden state.
Parameters shown If true, the list view is shown; if false, the
progress indicator. The initial value is true.
Related
I have a grid that presents database entities one per row with some crud options (the crud options are icons in their own cells). When the delete button is clicked, the design calls for the entire row to be turned into a confirmation message with buttons to continue or cancel.
Apparently you can give a function for colSpan on each colDef. I tried giving the first colDef a span equal to the number of displayed columns in the case that the row data has a property isDeleting === true, while clicking the delete icon would set the row data's isDeleting property to true.
I was unable to get this to work, and even if I were to get it to work, I'd need to be able to dynamically change the cell so that it contains the confirmation message.
Any help is greatly appreciated.
After a very long day of searching, I found this article on "full-width" rows. You can provide your gridOptions with an isFullWidthCell function, plus fullWidthCellRenderer and fullWidthCellRendererParams properties, and the full width of the row will be populated using the renderer according to the params (as is the case with a cellRenderer in a ColDef)
So, my delete button component can set a piece of data that the isFullWidthCell function can check for, and if it finds it, it will use the cellRenderer provided.
AgGrid seems to have thought of everything.
I'm trying to select an item from a list that's sorted the same way as a ToggleGroup I have besides it. However, I found that toggleGroup.getToggles().indexOf(toggleGroup.getSelectedToggle()) always returns -1 (visible in the IndexOutOfBoundsException thrown as I pass it). Is there another way of figuring out the index, or am I at a loss with my approach and need to figure out something completely different?
UPDATE: Apparently, for the first time an item is selected (I have this code attached to changes of selectedToggleProperty()), it works fine (I just get no notice of it because the elements I make visible have no proper layout). However, when an item is selected while another item already is selected, getselectedToggle() becomes null, causing aforementioned behavior.
All of the JavaFX toggle controls have a property called UserData. You should use that to create the links between the toggles and data list. Relying on the index of the toggles in the toggle group is probably a bad idea.
Is there a way to open a second Fragment Page? (ie. open multiple fragment pages at the same time)
I have a database setup and when users click a button a Fragment Page pops up so they can edit the fields. I would like to try and have a sub-menu appear for comments (so they don't have to scroll all the way to the bottom of the screen).
Something like the Menu in the Material Gallery Sample would be great.
Note:
I am currently using app.showDialog(app.pageFragments.Menu); to open the Page Fragments.
Having both Fragments open side by side would be a usable options as well.
Thanks!
Here is an example diagram.
Sorry for the late reply. I'll put this as an answer because I think it will get you what you need. You could implement this if you put the page fragments directly into your page, and toggled their visible property to show/hide them.
The biggest trick here is how does the first page fragment tell the second to open? That ends up being simple, just add a custom boolean property to the first fragment. Then in the base page (which contains the two fragments) bind the visible property of the second fragment to the custom property of the first fragment. Then in the first fragment, you can set that property to "true" when you want the second fragment to show, and "false" when you want it to hide.
ControlsFX has an awesome control called NotificationPane, which can easily be use like so
NotificationPane np = new NotificationPane();
np.setText("What to be displayed here");
What I am wondering, is it possible to extends it in such a way that, instead of it displaying text to display a Node.
You don't need to extends it. Just use the constructor that accepts a node.
http://controlsfx.bitbucket.org/org/controlsfx/control/NotificationPane.html#NotificationPane-javafx.scene.Node-
The Node that NotificationPane accepts in the constructor is actually the content pane OVER which the notification appears, not the content of the notification itself.
There is however a way to achieve what you asked. From the JavaDocs:
The graphic property represents the Node to show within the popup
notification bar that appears on top of the content that is within the
NotificationPane. Despite the term 'graphic', this can be an
arbitrarily complex scenegraph in its own right.
This means that you can indeed put complex Nodes (even whole trees) inside the notification. As long as the Text/Action properties are null, it will occupy all available space (or up to the preferred/max sizes of the node itself), leaving space for the closing button.
Today I faced a strange issue (could be a silly one) for data binding while navigating to 2nd view which is showing List of data coming from OData model and Panel at the bottom
I have replicate the code into this link - http://plnkr.co/edit/ClZqvo?p=info (You can run this as well through RUN on the Top) - Kindly run it in chrome with disabled security (Due to CORS issue)
Now the problem is when I am navigating to 2nd view (OData Table) and then Select any List Item, you will see in the bottom, the Panel will reflect the selected item (as I have used BindElement method to bind the path). After this I clicked back and then my 1st view will appear (JSON table) again I clicked on Next Button and then 2nd view will appear again. When I select the same item which I have selected previously then this time Panel will not show the selected items. This issue is coming only when I navigate back and forth and select the same item. Not able to understand what caused this?
But if I choose any other item then it will show me the selected item.
Anyone having any idea about this?
~Rahul
This is common issue when using bindElement, I have faced it too. It might be failing to resolve context of referenced entity. So, fields are not binded with respective values.
As a alternative you can use setBindingContext to bind fields within panel.
Since you are using named model, it should be specified as argument to setBindingContext.
So your code will be like
onSelect: function(oEvent) {
var oContext = oEvent.getSource().getBindingContext("odataModel");
var oProductDetailPanel = this.getView().byId("prodDetailsPanel");
oProductDetailPanel.setBindingContext(oContext, "odataModel");
}