I have a UI with multiple pickers on the screen. The first one being select an age from the list. When I pass to the second picker where we pick a weight with an initial value of 65 kg, it takes as an initial value last chosen index from the age picker. If the age was chosen 21 years, then an initial value of the weight picker becomes 21 kg. Is there any solvation for it? Because third is sex picker, where I have just two values, but an initial value appears empty because on previous was chosen 75 kg.
Found a solution to add key property to widget, so rebuild will run correctly.
return Container(
key: ValueKey(someUniqueValue),
child: ...
);
Related
i have the following code
Listener(
onPointerMove: (detail){
print(detail.position);
}
)
now by default detail.position will give the following
Offest(dy,dx);
now after many test i noticed the max value of dy equal MediaQuery.of(context).size.height
and the same with dx the max value equal MediaQuery.of(context).size.width
lets assume that my MediaQuery.of(context).size.height equal 800 in double, and i wrap my scaffold into Listener widget so if i touch any point (lets say at the bottom at the last point in screen ) so of course i will outputs 800 .
Question what if i want replace the max value with other value lets say from 800 to 1000 ??
in other word when i repeat the same touch process so it will outputs 1000 .
NOTE : i know it is impossible to replace it but i mean I want the output calculations to come based on a maximum value of the value I set and not MediaQuery.of(context).size.height so There is no problem if the value remains the same .
in the fact other value come from image height from server so it is not fixed always it might be even less than original value
i need it the same with width too .
It's purely a math matter
How can i handle with it ?
I have two edit boxes on my simulation experiment screen prior to running the model, one box for a minimum value, and the other for a maximum value.
I want the value within the minimum edit box to be equal to the value within the maximum edit box if the user ever inputs a value that is higher than the latter.
Something like this :
mininum box = 10
maximum box = 15
User tries to do:
minimum box = 20
End result
minumum box = 15
maximum box = 15
I tried this below in the "action" properties of my Edit Box element, but it hasn't worked.
if(min > max){
min = max;
value = Integer.toString(max);
}
Thank you for your help
Write this in the min-box action code:
if (value >= maxEditbox.getValue()) {
minEditBox.setValue(maxEditbox.getValue());
}
How to make infinite scrolling in both directions, up and down. I am using the InfiniteLoader and the List, both are react-virtualized components. I have a list of timestamps with initial date-time range. From there the list should be infinite in both directions. Currently, scroll-down to the bottom of the List will trigger the function _loadMoreRows(). However, I would like to trigger the _loadMoreRows() with the same functionality when scrolling in the direction up.
I have it working now :) Everything is fine. The threshold prop of the <InfiniteLoader> defines the threshold number of indices before the start/end of the List when to prefetch data, i.e. trigger _loadMoreRows().
The first and the last item in this.state.items should have their corresponding loadedRowsMap set to undefined after the initial data fetch.
const items = _getItems(); // fetch items
const rowCount = items.length;
const loadedRowsMap = [];
_.map(this.state.loadedRowsMap,(row,index)=>{
const status = (index===0 || index===rowCount-1) ? undefined : STATUS_LOADED;
loadedRowsMap.push(status)});
scrollToIndex = parseInt(rowCount/2,10);
this.setState({
items, rowCount, loadedRowsMap, scrollToIndex,
});
Before displaying the list, a scrollToIndex prop of the <List> component should be set to the middle of the list, i.e. rowCount/2. This number should satisfy the equation
0 + threshold < scrollToIndex < rowCount - 1 - threshold.
Function _isRowLoaded() will check loadedRowsMap[index]. If it is set to STATUS_LOADED or STATUS_LOADING (internal constants used inside the InfiniteLoader) it will not trigger _loadMoreRows(). If it is set to undefined, then it will trigger _loadMoreRows().
With this setup, trigering _loadMoreRows() works in both scroll directions, up and down.
How can I write the expression in order to change background color for each two rows in SSRS?
I need something like that:
I tried expression
=IIF(Fields!Type.Value="2016 Submitted" , "LightBlue",
IIF(Fields!Type.Value="2015 Submitted" , "LightBlue",
Nothing))
But because some months dont have values it looks like this:
If I try this expression I get below:
=IIF(RunningValue(Fields!Count.Value, CountDistinct, Nothing) MOD 2 = 1, "White", "PaleTurquoise")
Dance-Henry I tried your code
=IIF(RowNumber(Nothing) Mod 4 = 1 or RowNumber(Nothing) Mod 4 = 2, "Aqua","White")
and this is what i got:
You can select the row in design pane and press F4 to setup property BackgroundColor as =IIF(RowNumber(Nothing) Mod 4 = 1 or RowNumber(Nothing) Mod 4 = 2, "Aqua","White")
Captures are attached. Do it accordingly.
RESULT is something like this
After going thru the link https://blogs.msdn.microsoft.com/chrishays/2004/08/30/green-bar-matrix/
Tested and it works well for the Green Bar Effect for Matrix. I will show it step by step here as for later reference.
Step 1: Create the Matrix and add one more column under the innermost row grouping in your matrix. (ColorNameTextbox here)
Step 2: Select the textbox of ColorNameTextbox and press F4 to setup BackgroundColor property as =Value shown below.
Step 3: Select the textbox of Matrix cell and press F4 to setup BackgroundColor property as =ReportItems!ColorNameTextbox.Value shown below.
Step 4: Drag the inner grouping header (ColorNameTextbox) to be as narrow as possible.
Step 5: Preview Pane to check the result.
If you could add a hidden color_group column and populate it with a new number at each point you want to change the color (in your case 1,1,2,2,3,3,4,4) then you could use something like the following (which works for varying size groups):
IIF(RunningValue(Fields!color_group.Value, CountDistinct, Nothing) MOD 2 = 1, "White", "PaleTurquoise")
I had a similar problem where I could not come up with alternating rows because my data has Column Groups that were the RowNumber(Nothing) method to fail. Learning from all the other posts here this is how I resolved it in steps.
I added the following code into the report properties, that provides a function to get the row number, each time it is called. The function increments the row count each time it is called. >>Right click space around the report >> Properties >> Code. Alternatively go to Code Properties Window, when the report is selected.
Add the following lines:
Public Row_Sum As Decimal = 0
Public Function Lookup_Sum( ) As integer
Row_Sum = Row_Sum + 1
Return Row_Sum
End Function
I added a new column at the beginning of the rows called No. that would calculate and show the row number.Right click the first column >>Insert Column>>Inside Group-Left.
On the expression for the new report add this line of code. Also take a note of the name of the TextBox that will have the No. Value. It will be needed in the next step. In my case the TextBox is called TextBox6 (Properties Window). >>Right Click Cell>>Expression.
Add the code:
=Code.Lookup_Sum()
I highlighted the entire row and went to the Background property and added the following expression to compute the row number.
Add the code(TextBox6 is the name Textbox name noted above):
=IIF(VAL(ReportItems!Textbox6.Value) MOD 2, "LIGHTBLUE", "WHITE")
I have created a uitable consists of, say, four columns.
colu={{'Sweet' 'Beautiful' 'Caring'},'numeric', 'numeric','numeric'}
dat={1 2 3 []; 4 5 6 []; 7 8 9 []};
A=uitable('outerposition',[0 0 1 1],'ColumnFormat',colu,'Data',dat);
What I wanted to do now is that when the code is run, and I choose 'Sweet' in the pop-up in the first cell, the cell (1,4) displays dat(1,1), or when I choose 'Beautiful' in the second cell in the first column, the cell (2,4) displays dat(2,1). Unlike in a popupmenu outside a uitable, I am not able to use get(popup,"value').
How could I possibly do what I wanted to? Thanks in advance!
You'll have to use the CellEditCallback property, which is a global callback that gets triggered when any cell is edited.
There are no callbacks you can set on individual cells.
A pseudo-code template that should get you started:
function cellEditCallback(hTable, editEvent)
% get changed index
changedIndex = editEvent.Indices;
if changedIndex is a popup-cell:
% check new value
newValue = editEvent.NewData;
% set data in appropriate cell to corresponding value
...
As an aside, the columnFormat in the example does not match the data. It specifies column 1 as a popup-column, while according to your data, it should be column 4.
I also had to change [] to '' to make the popup work and set('ColumnEditable', logical([0,0,0,1])).
See e.g.
http://www.mathworks.de/products/matlab/examples.html?file=/products/demos/shipping/matlab/uitabledemo.html
for a more comprehensive example uitable application.