What is the most flexible/suitable form/layout in SmartGWT, if i would like to customize my user interface?
Dynamic form should be used to create form.There are many controls you can use with it.
You can see the examples here
Related
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");
Do you have a recommendation for creating a dynamic URL on a form (to open another form in a new window):
I should use buttons and how I can to configure that?
I should use explanatory text and how I can configure that?
This will be become easier when RFE 2427 is implemented. For now, you can use the technique described in this answer.
In the context of that question, the URL comes from a property. For your case, you're not saying what logic determines the dynamic URL, but I imagine that you can implement it in XPath. If it is indeed the case, you can just replace the call to xxf:property('com.example.siteurl') by your own XPath.
I was wondering if there was a way, to show certain parts of my footer, only when in certain categories.
E.g. a email link (mailto) only when in the Category:FAQ
I am using a custom Skin.
With help of this snippet a CSS class is added to your body tag for every category the current page belongs to. You could then display or hide certain elements with help of the corresponding class.
If you are using your own, custom skin, you can just check what categories your current wikipage belongs to, by calling
OutputPage::getCategories(). This will probably affect caching, though.
if (in_array( 'FAQ', $out->getCategories() ) {
// do something
}
edit: #Florian points out below, that you should use OutputPage methods to output stuff, rather than echoing them, so I removed that unfortunate example. And as #Florian also points out, if you want this effect to persist also for users who might have selected another skin than your custom one, you'll have to use a hook, e.g.SkinTemplateOutputPageBeforeExec.
I am using FireDac controls to connect with my db.
To navigate through the result sets i then use TBindNavigator.
This is a very handy component. However it lacks support for rearanging the buttons.
Here is an image of the control:
What i try to achieve is:
I downloaded the trial Version of TMS components and even their control (https://www.tmssoftware.com/site/dban.asp) isn't able to rearanche the buttons.
I am wondering if this is possible?
In order to achieve this, you need to create class inherited from dbnavigator, like e.g. :
type TNewDBNavigator = class(TDBNavigator);
It's needed because Buttons in TDBNavigator are protected.
Buttons are declared as:
Buttons: array[TNavigateBtn] of TNavButton;
And their order:
TNavigateBtn =
(nbFirst, nbPrior, nbNext, nbLast, nbInsert,
nbDelete, nbEdit, nbPost, nbCancel, nbRefresh);
If You had trouble with "hacking" VCL components, there is
nice article at delphi.about.com:
At this link
The other approach would be creating a set of custom buttons and modify their behaviur the way You want them to.
Best regards
Some users of our application will have read-only access to many of our pages, in our current web forms app this means they see the form, but all of the fields are disabled. We're looking at MVC 3 and searching for the cleanest, most idiomatic way of implementing this functionality.
Some ideas so far:
Some combination of a global action filter and edit templates.
A custom Html helper, something like Html.SecureTextBox etc...
I'm leaning towards number 1, but I'm wondering if any of you guys/gals with more MVC experience have solved this problem in a better way.
I agree with using a base view model, or perhaps just an interface with a "CanEdit" type of property. If you go the interface route, you could set the property in an ActionFilter in the OnActionExecuted method.
To tie it to the view, creating a new HtmlHelper would be pretty easy. I'd use TextBoxFor as the base class, since it has access to the view's model. You can then inspect the property and create the necessary HTML attribute. However, with going this route you will need to create a new helper for each type of input control you need (textbox, select list, etc).
Without knowing all the details of what you are doing, a much simpler idea would be to not provide a Save button for read-only users. The Save button would be driven by one property in the view model (or ViewData, if you like).
Several other people mentioned that a server-side restriction is still needed to prevent people from bypassing the client-restrictions. You will need an action filter for this. This link has a good idea about that.
My preference would be to set a variable in a common base view model (or ViewData), using a global action filter, and then use a bit of jquery to dynamically disable the input fields, delete buttons etc.
$(':input').attr('readonly', true);