h:outputtext Primefaces中的图像

时间:2016-06-05 12:58:15

标签: jsf primefaces

如何在h:outputText中通过样式类添加图像?以下是我的代码:

.postprocessedtick
{
    background-image: url(resources/images/yes.png);
    height: 25px;
    width: 25px;
}

并且样式类如下:

<!--customers view-->

<div class="container">
    <div class="row">
        <div class="col-md-12">
            <table class="table table-responsive table-striped">
                <tr>
                    <th ng-click="doSort('name')">Name</th>
                    <th ng-click="doSort('city')">City</th>
                    <th ng-click="doSort('order')">OrderTotal</th>
                    <th ng-click="doSort('joined')">Join</th>
                    <th>Orders</th>
                    <th>Delete</th>
                </tr>
                <tr ng-repeat="cust in customers |filter:customerFilter | orderBy:sortBy:reverse" class="repeat-animation">
                    <td>{{ cust.name | uppercase }}</td>
                    <td>{{ cust.city }}</td>
                    <td>{{ cust.orderTotal | currency: 'AED ' }}</td>
                    <td>{{ cust.joined | date}}</td>
                    <td><a href="#/orders/{{cust.id}}">View Orders</a></td>
                    <td class="center"><span class="glyphicon glyphicon-remove delete" ng-click="remove(cust.id)"></span></td>
                </tr>
            </table>
        </div>
    </div>
</div>


/*------------Customer Controller-------------------*/
myApp.controller('CustomersController', ['$scope', 'customersFactory', 'appSettings', function($scope, customersFactory, appSettings) {

    var customers = [];
    $scope.sortBy = 'name';
    $scope.reverse = false;
    $scope.appSettings = appSettings;

    function init() {
        $scope.customers = customersFactory.getCustomers();
    }

    init();

    $scope.doSort = function(propName) {
        $scope.sortBy = propName;
        $scope.reverse = !$scope.reverse;
    }

    $scope.remove = function(customer) {
        customersFactory.remove(customer);
    };

}]);



/* factory remove method*/
factory.remove = function(item) {
    factory.customers = _.reject(factory.customers, function(element) {
        return element.id === item.id;
    });
};

return factory;

我知道primefaces也提供了一个p:graphicimage标签,但由于某些原因我无法在这里解释,我需要在outputText中进行。我检查了inspect元素,我可以看到应用它的样式类,图像链接也很好。我尝试过使用!重要但不起作用。

0 个答案:

没有答案