>>Hi everybody,
>>
>>In few forms I switched from bootstrap nav pills and partial view to the following markup:
>>
>>
>> <div class="col-lg-3 col-md-3 panel-container">
>> <tabset vertical="true" type="pills">
>> <tab heading="@Labels.general" select="selectView('general')" >
>>
>> </tab>
>>
>> <tab heading="@Labels.passes" select="selectView('guestPasses')">
>>
>> </tab>
>>
>> <tab heading="@Labels.history" select="selectView('guestActivity')">
>>
>> </tab>
>>
>> <tab heading="@Labels.userDefined 1"
>> select="selectView('userDefined1')" >
>> </tab>
>>
>> <tab heading="@Labels.userDefined 2"
>> select="selectView('userDefined2')" >
>> </tab>
>> </tabset>
>> </div>
>>
>> <div class="col-lg-9 col-md-9 panel-container">
>> <div data-ui-view data-autoscroll="false"></div>
>> <div data-ui-view="guestPasses" data-autoscroll="false"></div>
>> </div>
>>
>>And I've noticed the behavior change I am wondering if I should live with or can do something about - if I type something that makes control invalid (say, in the text allowing 10 characters type 20), I can see the invalid message when I am on this tab. When I switch to another tab and then go back, that control goes to the original empty state.
>>
>>The code to select view is simple:
>>
>>
>>$scope.selectView = function (viewName) {
>> if ($scope.isNew) {
>> $state.go('new.' + viewName);
>> }
>> else {
>> $state.go('edit.' + viewName);
>> }
>> };
>>
>>and all the ui-views are defined at the top.
>>
>>I am wondering if there is a way to preserve that bad input while switching between tabs or that behavior is expected?
>>
>>Thanks in advance.
>
>Not clear whether you are just losing the validation message or also entered input.
>If the latter then one solution I've seen mooted is to put the model in a service/factory so that it is preserved....
Got an answer here
http://stackoverflow.com/questions/28991995/using-ui-views-and-angularjs-ui-tabs-and-invalid-input Worked nicely although now I have to add this option to all input fields that may be invalid.
If it's not broken, fix it until it is.
My Blog