What's the best way to set different View Value and Model Value in Vue2? - vuejs2

I have a use case where I need to show a value different from the model value.
It's an Autocomplete where when the user selects a value, I want to show a custom template which has user's image, email and address whereas the actual model value should be Email Address only.
I Angular, I could have achieved this using Parser & Formatter but couldn't find any such thing in Vue.
Any help would be appreciated.

Related

How to Personalize window behavior in odoo 8 livechat

How to Personalize window behavior in Odoo 8
Goals for now are:
add fields asking visitors Name, Email and Concern, As you can see at first image "A" the customer name is "Visitor"
change visitors name base on his/her Name input
change the design (background color, font, etc)
I already search on odoo documentation but no tutorials for Live Chat customization.
TIA
The appearance and the behaviour of the live_chat window is defined in the files addons/im_chat/static/src/js/im_chat.js, addons/im_chat/static/src/xml/im_chat.xml and addons/im_livechat/static/src/js/im_livechat.js
Depending on your needs your will have to modify these files. For the needs you have outlined in your question you have to:
1) add fields asking visitors Name, Email and Concern, As you can see
at first image "A" the customer name is "Visitor"
You have to modify the send_welcome_message function on the im_livechat.js in order for you to send a custom initial message and you have to change the im_chat.Conversation_message_bubble template in order to give each "text bubble" a different look (for example to insert a textbox asking for user's info)
2) change visitors name base on his/her Name input
When you collect your data, the user's name is saved in the variable defaultUsername in im_livechat.js, you will have to set it there
3) change the design (background color, font, etc)
All of this can happen from changing the template with the name = im_chat.Conversation_message_bubble from the im_chat.xml file accordingly.

Can we send multiple Properties in Json of Analytics(IBM MobileFirst)

I was asked for a usecase where I have to filter ActionEvents on type of Page that action is being is being called from.
Example
use case: I have a login page and I have to capture analytics of its events
Can I do something like this
String json = {"PageLevel":"LoginPage","ActionLevel":"LoginButton"};
WLAnalytics analytics=new WLAnalytics();
analytics.log(message, new JSONObject(json));
Will this work... can we create custom chart with first property being ActionLevel and filter it as per PageLevel.
No this will not work. Custom analytics can only be logged in key value pairs i.e. you cannot send two key value pairs in one JSON object. This is a good idea though, I recommend you submit an RFE.
Submit a Feature Request

RSA Archer user cannot specify a date in the future / past

Has anyone any good patterns for RSA Archer validation which prevents a user from saving the record when a given date specified is in the future (or past)?
Currently I am catching this using calculated fields after the data has been saved, in a data exceptions report. But ideally I would like to catch this early prior to the user saving the record.
I would suggest that you use custom object in this case.
So remove the basic onclick attribute of the SAVE and APPLY button.
In your custom object, check if the entered date matches the system date (or the time-zone you need). Set a flag. Based on the flag value, you can call the actual function call of the SAVE or APPLY button.
Hope that helps!
Alex,Tanveer is correct. You have to use a Custom Object with embedded JavaScript code to implement described functionality.
You will need to create a function that will validate the value entered by the end user and either accept it or make user correct himself.
Now, you have two options how to do it:
1. You can attach your validation function to the Save and Apply buttons as Tanveer described. I have shared a similar code in the following question before. You can review it here: LINK
2. You can attach your validation function to the element you plan to validate directly. So when user is done with given input element and input element loses focus your function will be called. Here is a sample code with jQuery:
$('#elementid').blur(function() {
// validate entered value here
// if required show a pop-up message
WarningAlert(msg, title);
});
Good luck!

How to display custom fields in rally?

I have a ruby script that is trying to pull up some custom fields from Rally, the filter works just fine ( the filter contains one of the custom fields i want to pull up) but when I try to display it, it doesn't show up in the list (the value returned for all custom fields is blank, while appropriate values are returned for FormattedID, Name, Description).
Here's the link [link]http://pastebin.ubuntu.com/6124958/
Please see this post.
Do you fetch the fields?
What version of WS API are you using? If it is v2.0 is c_ prepended to the name of the field in the code?
How is the field spelled in your code and how that spelling compares to Name and Display Name of the field in UI?
There is another reason why custom fields might not appear (other than the versioning and 'c_' issues nickm mentioned). I just found this out after a ton of head banging. The Rally SDK's ui stuff will filter out all fields that are hidden (such as _ref, or other 'hidden' custom fields) so you cannot view them in your apps in grids, charts, etc. For example, when constructing a Rally.ui.grid.Grid, a class called Rally.ui.grid.ColumnBuilder is constructed and it executes a command on the columns of the chart that look like this:
_removeHiddenColumns: function (columns) {
return _.filter(columns, function (column) {
return !column.modelField || !column.modelField.hidden;
});
},
As you can see, if you try to display any fields that are hidden (like _ref for example) in a grid, the column gets removed. So, although you may be fetching the custom fields, they will not show up unless those fields are not 'hidden'.

Validate number of attributes with date_select

I'm doing something like the following: Validate number of nested attributes.
I'm checking for existence of at least one nested attribute.
This was working fine when I was using a text input for the date but I've changed it to use a date_select instead and now the same validation code shows an error saying that not enough have been chosen.
When it fails validation and reloads the form it also doesn't "build" an instance of the nested attribute either so it just shows my "[+]" link
Anybody got any ideas?
Failing everything I'll just have to put the text field back (probably using type=date).
Col
I decided to just put the text field back.