Default value in an iterationcombo box - rally

Is there any way i can have the current iteration selected (based on the current month/date and comparing it with the start/end dates of the iteration that fall in that month) when the iteration box is loaded. This is to avoid having the user select the iteration and that "change" event then triggering my custom app.
In short i need to configure the iteration combo box to always default to the current iteration, and treat this default as a change event and have the app execute the on ready/change function.

This should be the default behavior:
https://help.rallydev.com/apps/2.1/doc/#!/api/Rally.ui.combobox.TimeboxComboBox-cfg-defaultToCurrentTimebox
Is it not behaving that way? Maybe you can share a bit more code?

Related

Seeking suggestion to count time inside the loop

I am trying to measure/count the time inside the while loop, I tried a couple of methods but couldn't find the solution yet.
Here is my current VI.
 
In short, I am trying to measure the time as long as the "Boolean is on/true" and once it's off/false the time must be displayed.
If something is not clear then please let me know.
I may be repeating Fourier's answer, but typing it in two different forms may be helpful to you since I note you haven't accepted that answer yet.
Remove the outer While Loop. It is superfluous.
Then do this:
In the "turn on" frame, you gather the current Tick Count and stash it in a shift register. In the "turn off" frame, you gather the Tick Count again and subtract. In all the other frames, make sure you wire the two tunnels together so you don't lose your Tick Count. Side note: you probably want Boolean to be an indicator, not a control, so your user cannot click on it and toggle it directly.
You can reach your goal with simpler code. You should use one while loop only with the Event Structure:
When List of Conditions changes, intercept the event (as you are already doing) and register the time when this event happen (with the VI Tick count for example).
in two shift registers,"save" the time you registers in the previous point and the status of your count (a boolean should be enough: counting/not counting).
Then, in the Timeout event you calculate in real time the time passed with the following operation current time (Vi Tick count) - event time (save in the shift register).
You should count time only if your boolean Counting/not counting is True.
When you detect another event List of Conditions Value Change, you should check if you should stop count time or not.
Finally, in the Timeout event or in the List of Conditions Value change event, evaluate the stop condition for your while loop.

Conditional parallelism on LabVIEW

I am writing an application to update the numeric value given user's input value and depending on the user's input value the program checks if it is greater than 10 if it is greater than 10 then the program waits for 1 second and then will have a popup message says "true".
My intention was to call the conditional check, printing true every one second if the user's input value is greater than 10; in other words, the case structure was to be called regardless of the event structure in the same loop infinitely.
But it doesn't seem to work the way I expected. Unless there is user's new input value, getting into the event structure, the program doesn't get to the case structure even though the case structure is in a loop.
Is there any way to call the case structure not dependent to the event structure but I want to use a shift register for the numerical value and also having an event structure and a case structure in parallel.
Thanks.
You've created an Event Structure that handles the Value Change input for your numeric control, so that will do exactly what it says: wait for a Value Change event to happen. When that event is received, the code in its Event Structure frame will execute and then the Event Structure will exit.
It looks as if you've wired a value from the shift register to the timeout terminal of the Event Structure, so I assume you must also have created a Timeout event case? If so, the event structure should stop waiting after the number of milliseconds wired to the timeout terminal.
The value you check in order to decide whether to show your true message is the value that was passed in to the shift register on the previous loop iteration. If the control value changes, that comes from the NewVal terminal in the Value Changed event case. But where does it come from in the timeout case? It looks to me as if you haven't wired it in that case, because the terminal coming out of the event structure has a little dot in it instead of being solid orange. That means you will get a default value for any case where the terminal wasn't wired. The default value for numerics is zero. So if the event structure times out, the value going in to the shift register is zero, you get zero out of the shift register on the next iteration, zero is not greater than 10, so you don't see the message again.
I don't understand what you're trying to do in the event case where you've wired the NewVal terminal to a Value property node of the same control. Can you explain what that is supposed to achieve?
Your question reads as if this is a programming exercise where you have to use these specific LabVIEW structures, so rather than suggest better ways of achieving what you say you want this code to do, I'll leave it to you to decide how to change it. In the meantime though I do recommend re-reading the Event Structure help and the caveats and recommendations it links to.

Getting value of previous selected item (dropDown)

When a user changes the selected item on a dropdown I need to get the PREVIOUS item selected,
EX:
dropdown items:
1) Questions
2) Jobs
3) Tags
4) Badges
User has #2 Selected and then changes to #4 -- How can I get the value of #2 when they change the selection?
Declare an instance variable in your form (WinForms) or window (WPF).
When a user selects an item:
Do what you want to do.
Save the current item index in the instance variable.
In step 1, you can now access the instance variable to get the previously selected item.
Declare a global variable that will contain the previous value.
When the user changes the selection in the combobox, set the variable to the currently selected value. Allow the selection to be changed. You now will have the previous value.
If you need to have the history of changes, then the global variable would be a collection. Then on changed event, add the current selection to the collection.
If your control is bound to data, there is no need to "Squirrel" the old value away, your data provider usually does this for you.
For example, if you are bound to a DataRow, this code will get the previous value.
? = [Your DataRow].item("[Your column name]",OrigialVersion)
This varies based on your data but ultimately, you could always re-query the database to get the original value as well.
Regardless of what you are bound too, if you ask the datasource for it's value during the Validating event of the control, it will have not changed yet so it will give you the old value, which you can then compare against the current selection.
Lastly, if you are not bound to data, I typically store the old value in the TAG property on the GotFocus event of the control. Then you can compare against that.
Hope this provides some other options that might help you, depending on your case.

VB .net datetimepicker reporting wrong value

Ok, so I'm experiencing some strange behavior in datetimepicker fields in my program. I use Short format usually, and use a pair of them for date range selections.
The problem i'm experiencing is if a user is using the keyboard for input. they can tab and arrow through the field like normal to key in a date. However if the date part they are entering doesn't fill it's section of the mask and then they press enter to activate the formdefault without shifting focus away from that portion of the date, then the value of the DTP when the ok_button.click event is run is whatever value it had in it BEFORE they typed their change.
to give a specific example:
A user tabs into the date field. the default date in the field is today's date, 4/14/2015. They type in 1, arrow to the day, put in 1, then arrow to the year and type 14, then press enter. The reported value of the DTP is going to be 1/1/2015. Had they instead actually typed out 2015, or used the arrow to move to another date part or tab to shift focus to another control, the DTP will auto update to fill in the rest of the year.
The same problem would exist if they had typed in a 1 for the month and then hit enter, but would NOT happen if they put in a 12 for the month.
The only solution I can think of, and I haven't yet tried to implement it because it sounds like a real kludge and would require me to go through at TON of forms in the project, would be to change the keypress event for enter to shift focus to the OK button, and THEN invoke the formdefault.
I will say that most of the datetimepicker fields on my forms are actually contained within a user control, so if this is a property that can be changed in the control or tied to an event in the control, it would make updating much, MUCH easier.

Make VB.Net DatePicker Required

I have a datepicker in a vb.net clickonce application. I need to make sure that in order to use the application that selecting a valid date is required. Ideally, I would be able to set the value of the datepicker to null and then programatically create Try Catch logic based on datepicker1.value still being null. Unfortunately, it will not allow me to assign a null or blank value to the datepicker. I cannot create my logic based on any real values of the datepicker because who's to say the value picked is not valid. I've tried setting the value to some outrageous date that no one would pick for the application like 1/1/1970, but then the datepicker opens up at 1/1/1970 and drops that date in as soon as it gains focus. I need a way to validate whether or not someone has selected a date, but am stuck and can't find any real help online. I am not looking to set the customformat = "", so please do not respond with that solution. I need the actual value to be blank or something I can run validation against to know that the user has in fact selected a date.
Set the ShowCheckBox property to true. That will make the control look like this...
When the user selects a date, it will check the checkbox. Then when you need the value...
If datePicker.Checked Then
'user has selected a value
Else
'user has NOT selected a value
End If
Can you use the ValueChanged event to set a flag to tell you they've clicked on a date?
UPDATE
You could also use the OnClick method to set a flag to verify the user actually clicked on the DateTimePicker.