IBM BPM: Is it possible to hide a column of a table dynamically based on user choice? - uitableview

Since I'm new to this technology (Coach UI) I wanted to know an information, is it possible to delete a column based on the user's choice?
That is, I have a modal that contains the column fields and if I choose to hide a column it hides it dynamically.
Thank you in advance for the reply, I have been on this problem for 2 days :(

Configurations of Controls in BPM can be either provided with values or bound to a variable.
Binding configuration item to a variable will give you the ability to change it dynamically, by changing the value of that variable.
For your request, you can click on the purple icon next to Columns (image bellow) to switch to binding mode, then select a varible of type TableColumn (This BO is available in the UI Toolkit itself, open the BO to check the documentation).

Related

ComboBox with hidden keys

Is it possible in vaadin 12 to have comboboxes such that it displays a user-friendly value but behind the scenes it stores a hidden code? I found this example from 5 years ago but it doesn't apply to Vaadin 12 comboboxes: https://vaadin.com/forum/thread/7821327/combo-box-hidden-values
(If there's a good, reasonably clean way to do it, please point me in the right direction! I would think this is a common sought-after feature)
Items are assigned to ComboBox either directly using setItems or indirectly through setDataProvider.
The item itself is not sent to the browser and shown in the dropdown. Instead, for each item ComboBox generates a string label that is shown in the UI and an internal id that is used on the server for mapping back to the original item instance when the user makes a selection.
The generated id is internal to ComboBox and has no external meaning. In particular, it's not based on any value in the item itself such as the item's primary key in the application's database.
The label is by default based on doing toString() for each item. You can customize how the label is created by assigning an item label generator callback that receives an item instance and returns the label string to use for that item.
If you for example have a combo box for selecting persons, then you could configure it in e.g. this way:
ComboBox<Person> personSelector = new ComboBox<>();
personSelector.setItems(allPersons);
personSelector.setItemLabelGenerator(person ->
person.getFirstName() + " " + person.getLastName());
If I understand you correctly, there is built-in feature in ComboBox for this, the method is called setItemLabelGenerator(..), which allows to define e.g. lambda expression that returns String which is used for ComboBox items instead of the property from underlying data object.
The linked Forum discussion you found is about similar thing in our previous generation of the framework, there has been some renaming of the API here.

How to use values from one section of view dynamically in a different section before submit?

We have a need where sections could be added and removed dynamically in one screen which need to be used in a different section in the same screen dynamically before submit.
Adding/removing, binding is the easier part which I have done, but the part I am struggling with is not seeing the values from the earlier section that get entered in the later section which the values are referenced/used again.
There is no value in the backing bean for the first section which when used later in the other section show blank which makes sense as submit has not occurred, but how to use the values entered in first sections that should be available in the model to be used in the later section?
Example:
Primary family member - adds other family members in the first section.
The primary and secondary family members should show in different subscriptions/memberships that they could be a part of and all this is on the same form.
I have a hard time explaining the issue, hopefully you have understood and are able to suggest a solution? I hope I dont have to define and use valuechangelisteners to each field.
We are using JSF2, Richfaces 4 and omnifaces.

Possibility to write a code to put auto names for controls using different rules in Orbeon Form Builder

We all know that when we create new control in FB it gives its name control-1. When we create the next control it give its name control-2 an so on. Is it possible to write a rule for giving names to controls? For instance: For specific column in grid, column with name A, give to all controls in this column name which starts with A_ suffix?
As a form author, you can change the name of a control after you add it in Form Builder. However, if you want to change the default naming scheme, you would have to change code in Orbeon Forms. Currently, this is done with controlName(nextId(doc, "control")) in ToolboxOps.scala.

groovy: save gsp state

I have 2 gsp's say, "a.gsp" and "b.gsp".
"a.gsp" have combobox, from which user can select options.
My question is that, if the user shift to "b.gsp" and then come back to "a.gsp", the combobox selected option should be still there.
How to achieve this ?
You can do multiple things to achieve this. Depending on your requirements you may:
Use javascript and cookies.
Pass the value selected in the combobox into the controller when you naviate to b.gsp and into a hidden field in b.gsp, but then you have to pass it back to the controller once more when you want to see a.gsp.
Pass the selected value inside session/flash scope
From your question it sounds like you are not fully embracing Grails' MVC architecture and using controllers correctly to prepare data and pass structured data through to your view.
To begin with, rename your controller actions and views to something meaningful rather than a,b. Even if just for testing a small sample, as taking shortcuts can lead to long term bad habits...
Secondly, if you are using a tag then you would use the value attribute to indicate what should be selected.
Read about the tag and its attributes here : http://grails.org/doc/2.1.0/ref/Tags/select.html
Give us more details and perhaps we can help.
Thanks for the clarification, so I'm assuming that there could be any number of ways a user might leave the current a.gsp page and come back, but whatever happens you want the browser to remember the selected option. In this case I would use the jQuery cookie library, its very small, won't impact performance as you're doing very litte work and should be very quick for you to setup.. See: https://github.com/carhartl/jquery-cookie
Set a cookie in an onChange handler based on your selects val() value.
When your page loads (document ready), if you get a value when reading the cookie, then try and set the select value.

Add calculated column with checkboxes to datagrid

In my application I have a TcxGrid (devexpress datagrid) that displays the data returned from a stored procedure.
Now I would like to add a column showing checkboxes from which the values cannot come from the database but are calculated internally.
When the checkboxes are clicked, some internal logic needs to be triggered.
Any suggestions?
#boris, I recommend you use the Support Center site of DevExpress for this type of question, there are thousands of articles to DevExpress products.
Anyway I leave here a link to something that might help ;)
How to set up an unbound item in a data-aware View
Are you creating the view at runtime or at designtime?
I sort of cheated when I did this at runtime, and returned a static value as one column from my query:
select false as processed,col1,col2 from table where true
I could then safely attach the dataset, and I had my new column to play with.
You would then perhaps use the properties.onChange or properties.onEditValueChanged for your logic code.

Resources