Iterating threw input elements that have almost similar names - vue.js

I am working with vue.js and I have a form that has a lot of inputs, the number of inputs in the form is never the same because I have a couple of areas where the user can add inputs when they want to. the inputs that get added have the same name but differ from a counter.
I have built a method that is going to submit the form and the inputs that are not changed in the form get pulled with this code:
getFormValues (submitEvent) {
debugger;
this.Nr = submitEvent.target.elements.Nr.value
}
but the problem here is that I don't know how to get all the values of inputs with the same name but with different id values so I can iterate threw then and build objects to post in the backend, I don't know how many of thus input is going to be added.

Related

calling RankToPosition() and _onMoveToPositionClicked

I have a situation where i'd like to enter a "3" into a textbox on a user story grid, call something like RankToPosition(3) to move that user story row to position 3 in the current rank. Within the same grid, the idea is to have a textbox on each row, so the row beneath may have a 4 in there, and when i click SUBMIT, the entire table would be processed by using the numbers in the row textbox and calling RankToPosition(#). This is like the Netflix queue. There have been similar questions on here, but my thought is to just call the underlying method alluded to here as "_onMoveToPositionClicked":
https://help.rallydev.com/apps/2.0rc3/doc/source/MoveToPositionMenuItem.html#Rally-ui-menu-item-MoveToPositionMenuItem-cfg-rankRecordHelper
If i could iterate through the table grid, store initial rank values (i realize they're not just integers), and pick the new text values up, run code to call the _onMoveToPositionClicked beneath the scenes, it may accomplish a bulk rank grid for when users have 200+ items to manage, for instance.
Any insight you have for just calling this in custom code would be helpful. Any solution for representing this functionality would be appreciated. I am currently using Rally 2.0rc3.
Thank you for your time
Is it possible to upgrade to a newer version of the App SDK? 2.0rc3 is a very old pre-release. The latest is 2.1: https://help.rallydev.com/apps/2.1/doc/
In any case, the way ranking is performed is relative to another object via the rankAbove or rankBelow parameters. So given the record you want to rerank:
record.save({
params: {
rankAbove: '/hierarchicalrequirement/12345'
}
});

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 load an ObjectModel with submitted values in Prestashop?

I'm using an HelperForm to display my form which has multilang features.
I also created a Model with fields (some are multilang).
The problem is, once the user submit the form, how can I fill the data from the submit form into my new model ?
I tried this :
$instance = new MyModel();
$instance->validateController();
But for some kind of odd reasons, it doesn't save the language fields, only the "direct" fields.
I thought about using validateFields and validateFieldsLang, but they stop at the first encountered error ; I'd like to list all the possible errors at once.
How can I do this?
Are you using it from the front or back office?
Admin controllers have this
$this->copyFromPost($this->object, $this->table);
Thich basically calls the object's validation

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'.

Graph call Error When Getting User Page Information (Ruby on Rails)

I'm having some trouble making some graph calls with Koala.
Graph calls:
#graph_data = #api.get_object("me/books")
#account_data = #api.get_connections("me","accounts")
I have a do loop in my callback.html.erb that shows a table which displays the name of the user's favorite books.
(had to remove the html tags)
#graph.data.each do |data|
data["name"]
end
This code is fine, i get a table with all the book names.
The problem occurs when i want to display the #account_data object, this is supposed to hold the information of all the pages the user is an admin of.
I am expecting a table with the names of all the pages the user is subscribed to.
#account_data should have exactly two array elements since i am admin for two pages.
My understanding is that i should be getting an object that looks like this:
[{field1=>val1,field2=>val2,....}, {field1=>val1,field2=>val2,....}]
I tried using the Graph call #api.get_object("me/accounts") but same problem - blank screen.
Thanks in advance.