In my Vaadin flow project, I have a grid and I set some items but it shows like grid data items
I want a decent format that a user can see specific details not like. Any idea or is there any component in vaadin to make this pretty?
There are two options to do that:
provide a better ValueProvider than the .toString(), that is used in your property right now. E.g.
grid.addColumn(person -> Integer.toString(person.getYearOfBirth()))
.setHeader("Year of birth");
TemplateRenderer: You can provide a "complex" HTML structure where to place content. The docs contain an example: https://github.com/vaadin/flow-and-components-documentation/blob/master/documentation/components/tutorial-flow-grid.asciidoc#using-template-renderers E.g.:
grid.addColumn(TemplateRenderer.<Person> of("<b>[[item.name]]</b>")
.withProperty("name", Person::getName)).setHeader("Name");
Related
I am having one document type which contains a dropdown list, I need to add a couple of things in it:
I need to display the Database table names in drop-down dynamically.
On the change of dropdown option, i need to display the selected table columns names in another drop-down.
Are above things possible by using only existing data types or it will require creating a custom template using razor syntaxes (if it is so then how the template will display directly in the back office content node?)
Can you please provide your views and any links for code/tutorials?
screen shot of content form
If this is for the back office, you will need to do it in HTML and Angular, with an API controller to handle the DB lookup stuff.
As far as I'm aware, there's nothing built in to do dropdowns that depend on each other, so you'd have to create a new DataType to do it.
The process is to long to detail here, but here are some useful links on creating custom DocTypes in Umbraco 7.
https://our.umbraco.org/documentation/tutorials/Creating-a-Property-Editor/
http://velstand.info/tips/umbraco/to-create-a-datatype-by-using-external-data-sources/
https://24days.in/umbraco-cms/2016/custom-property-editor-tutorial/
We are using Primefaces library for development of JSF components in our application.
I need different subviews(subcomponents) to be embedded in primary views(components).
For example : I need to embed securityXXX.xhtml in both clientXXX.xhtml and marketXXX.xhtml.securityXXX.xhtml itself contains sub-menus(Example : checkbox,drop-down etc).
securityXXX.xhtml is already embedded in clientXXX.xhtml.Now I need to embed securityXXX.xhtml in marketXXX.xhtml but I need to introduce a new sub-menu in securityXXX.xhtml which is required in case of marketXXX.xhtml but not in clientXXX.xhtml.
Is there any way I can hide/show sub-menus in securityXXX.xhtml and display same in clientXXX.xhtml and marketXXX.xhtml according to my need.Can securityXXX.xhtml be re-usable?
I know one of the rendered and visible attributes can be useful for this.Please correct me if I am wrong.I am new to JSF.Please provide me a demonstration/example if possible
I'm trying to get the DevExpress grid view extension working using custom data binding with an existing ASP.NET MVC 3 site. I've read through and followed the steps in this guide in the DevExpress documentation, but when I try to page, sort or filter, the column information in the GridViewPagerState or GridViewColumnState objects that are bound to the callbacks used to handle these operations come back with default (blank) column information.
I can run the "simple custom data binding" and "advanced custom data binding" demos from the demo center application - these both work as expected. When I transplant the code into my application though, it doesn't work.
How can I get past this?
It turns out I was missing the setup of the DevExpressEditorsBinder in my Global.asax.cs file. Unfortunately I skimmed over this highlighted note taken from the Custom Data Binding - Overview:
Note
When implementing the grid's custom data binding, the DevExpressEditorsBinder must be used instead of the default model binder to correctly transfer values from DevExpress editors back to the corresponding data model fields. See the Binding to Model section in the Binding Data Editors to Data topic for more details on how to specify DevExpressEditorsBinder as a model binder.
I think the answer is no, but the question has been put to me so I'd like to confirm. My understanding is that any custom XBL control that I create for use in Form Builder can have one and only one value. Is this correct?
I have always assumed this because the control name is then used in the data instance as the name of the node which contains the the value.
This question comes from the desire to have reusable components with multiple values, for example, an Address control so that addresses can be recorded consistently and the same set of fields does not need to be added many times. Orbeon does have some support for this in the form of Section Templates but because the control names stay the same in each instance of a Section Template this does not work well with our design.
The best idea I've had is that a custom control which records multiple values could encode all the values into a single text string for example in JSON. Of course, this is not ideal.
Are there any other options?
It is possible for controls to have multiple values. When that happens the values are typically stored in nested elements. I.e. a control could bound to an element <address>, and could create nested elements <street>, <city>,<country>, etc to store the different parts of the address.
In practice, you can look at how this is done in the Image Annotation annotation control (see wpaint.xbl), which creates nested elements <image> and <annotation>, leveraging the xxbl:mirror="true" functionality.
Ok, so this is an alternative to this question.
I'm trying to produce an MVC application using LinqToSql that allows for bulk editing of data on a single page.
Imagine a simple table Item with ItemId, ItemName, ItemPrice as fields.
There are many examples out there of extrmely simple MVC applications that show you a list of these items with an edit button next to each and an add button at the bottom.
From a UI perspective I find this very time consuming when a lot of data needs entering / updating.
I'm after a single page containing the items names and prices in textboxes that can all be edited in one go and then a single "Save" button pressed to update the data.
I've seen a number of examples that perform various stages of this but have yet to find one that implements the full solution. In particular the interaction with Linq.
I have a number of methods I've tried which all work, however, my gut feeling tells me my methods "smell" and therefore I'd like to see some examples of how other people have attempted this.
So, put simply, my question is can anyone provide some links to some examples please?
I have written about how to do this with MvcContrib's FluentHtml. Steve Sanderson has written about how to do it without FluentHtml. Both of our articles have a sample solution you can download and look at.
As far as LinqToSql, I would consider any interaction between bulk editing mechanism (controller and view) and LinqToSql to be a smell. That is to say, as far as possible your UI should be ignorant of your persistence mechanism.
What I would probably do to get around this is use jQuery to call a jsonResult when you switch rows. This jsonResult would call the code in the model to save the ItemId, ItemName, ItemPrice for only the row you are switching off of. More on general jsonResult w/ jQuery usage here : http://www.dev102.com/2008/08/19/jquery-and-the-aspnet-mvc-framework/
The other thing you could do is do model binding to a list of Items, iterating thru the list saving each item -- Phil Haack has an example of list binding here: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx With either method you'll want to do something to signify the row has changed so you're not updating every field if you're just changing a handful of rows.
What is your goal exactly, are you trying to commit a series of information all at once? Or do you simply not want your page to postback every time you change something. In either case jQuery is your best bet. If you want to do everything in one pass it is going to get complex unless you use a jQuery control that will do this for you. There are some great ones out there such as the Flexigrid.