logo
down
shadow

Select many checkbox selected items return null when there is nested ui:repeat


Select many checkbox selected items return null when there is nested ui:repeat

Content Index :

Select many checkbox selected items return null when there is nested ui:repeat
Tag : jsf , By : August
Date : November 23 2020, 01:01 AM

like below fixes the issue Look closer at , particularly at the associated bean.
<ui:repeat value="#{dprEdit.mainCategories}" var="mainCatvar">
    <ui:repeat value="#{mainCatvar.subCategories}" var="subCategory">
        <h:selectManyCheckbox value="#{dprEdit.selectedProblems}">
            <f:selectItems value="#{subCategory.problems}" />
<h:selectManyCheckbox value="#{dprEdit.selectedProblems[subCategory]}">
private Map<SubCat, String[]> selectedProblems = new HashMap<>();
<h:selectManyCheckbox value="#{subCategory.selectedProblems}">

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How to select Parent Checkbox when a Child is selected inside ng-repeat


Tag : javascript , By : meodudang
Date : March 29 2020, 07:55 AM
Hope this helps HERE is the working solution based on your fiddle.
JS
$scope.select = function(index){
    if(index === 0){
        $scope.slaves.forEach(function(slave, ind){
            $scope.slaves[ind].isChecked = $scope.slaves[0].isChecked;
        });
    }
    else {
        var anyChild = false;
        for(var i = 1; i < $scope.slaves.length; i++){
            anyChild = anyChild || $scope.slaves[i].isChecked; 
        }
        $scope.slaves[0].isChecked = anyChild;
    }
}
<div ng-repeat="slave in slaves">
    <input type="checkbox" ng-model="slave.isChecked" ng-click="select($index)" />
    {{slave.name}} -  {{ slave.description }}
</div>
var parent = {
   ... // parent data
   childeren : [child_1, ... , child_N] // array of children
} 

Select All checkbox to select nested angular ng-repeat checkboxes?


Tag : javascript , By : Phil Austin
Date : March 29 2020, 07:55 AM
Hope that helps Plunker of my answer: http://plnkr.co/edit/d4cV1VP5iPj58ePGvZNR
Note: I didn't change all of the carriers, just the first one in the Plunker
<ul class="entitlement-countries list-inline">
    <li ng-repeat="ec in c.countries">
        <div class="checkbox-inline">
            <label>
                <input type="checkbox" name="{{ec.name | slug}}" ng-model="ec.selected" ng-change="checkAllCountriesSelected(c)"> {{ec}}
            </label>
        </div>
    </li>
    <li ng-if="c.countries.length > 0">
        <div class="checkbox-inline">
            <label>
                <input type="checkbox" name="{{c.name | slug}}_selectall" ng-model="c.selectAll" ng-change="checkAllCountriesSelected(c)"> Select all
            </label>
        </div>
    </li>
</ul>
$scope.carriers = 
  [{
    "name": "UPS",
    "selected": false,
    "selectAll": false,
    "hasPaymentOptions": false,
    "isSelectable": true,
    "value": "",
    "countries": [
        { name: "USA", selected: false },
        { name: "UK", selected: false },
        { name: "Canada", selected: false },
        { name: "Germany", selected: false },
        { name: "Australia", selected: false }
     ]
   },etc
$scope.checkCountryToggled = function checkCountryToggled (carrier) {
    var carrierCountriesSelected = getSelectedCountries(carrier);

    if (carrierCountriesSelected.length === carrier.countries.length) {
        carrier.selectAll = true;
    } else {
        carrier.selectAll = false;
    }
};

function getSelectedCountries (carrier) {
    var selectedCountries = filterFilter(carrier.countries, function (country) {
        return country.selected;
    });

    return selectedCountries || [];
}

$scope.checkSelectAllToggled = function (carrier) {
    if (carrier.selectAll) {
         selectAllCountries(carrier);
    }
};

function selectAllCountries (carrier) {
    angular.forEach(carrier.countries, function (country) {
        country.selected = true;
    });
}        

AngularJS - nested ng-repeat with select/option, get/set the selected value


Tag : javascript , By : Tom D
Date : March 29 2020, 07:55 AM
like below fixes the issue I am trying to set two ng-repeat loops, one of which, the nested one, is a select/option drop down. I checked other similar posts, but still not sure how to define the ng-model in HTML to get/set the default value/option in the select box.
<select ng-model="student.courseId" ng-options="course.name as course.id for course in courseList">

AngularJS - Filter already selected items from ng-select inside ng-repeat


Tag : javascript , By : Felix Almeida
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , So I found a solution with a bit of help from lodash. Change ng-options to this:
ng-options="locale.value as locale.label for locale in availableLocales($index)"
scope.availableLocales = function(localizationIndex) {
        return scope.localeNames.filter(function(locale) {
          return !_.find(scope.localizations, function(localization, idx) {
            if (localizationIndex === idx) return false;
            return localization.language === locale.value;
          });
        });
      };

Why is the Span that's nested in a Label preventing other nested items' ability to click to select checkbox?


Tag : javascript , By : John Bentley
Date : March 29 2020, 07:55 AM
Hope that helps Figured it out.. there was preventDefault() on the parent component to handle click events for some other behaviour. Just had to remove that..
Related Posts Related QUESTIONS :
shadow
Privacy Policy - Terms - Contact Us © scrbit.com