我试图通过单击按钮自动聚焦在输入元素上。请参阅打字稿
@ViewChild('envFilter') envFilter: ElementRef;
onFilterSelect() {
    this.envFilter.nativeElement.focus();
}
在 HTML 方面,我有以下内容。
<div [ngClass]="isFilterVisible ? 'item item1' : 'item item1 hide'">
     <div [@filterAnimation]="isFilterVisible" class="filterWrapper">
          <input type="text" class="envFilter" [(ngModel)]="envFilterValue" (keyup)="envFilterChanged(envFilterValue)" #envFilter />
            <!-- {{ envFilter.focus() }} -->
      </div>
</div>
使用时{{ envFilter.focus() }}我能够专注于该字段,但无法专注于任何其他输入框
这里遗漏了一小段 HTML
<div class="pull-right  filter-down filter-down-div item item2">
     <i *ngIf=" envs.length !=0" role="button" (click)="onFilterSelect(envFilter)" class="filter-icon fas fa-search"
            [ngClass]="{'active': isFilterVisible ,'disabled':!isFilterVisible}" role="button"></i>
</div>
该段基本上是一个搜索按钮,单击时会调用前面的 onFilterSelect() 函数
我的代码有问题吗?为什么自动对焦不起作用
我尝试根据java脑中的教程创建Message源,我在尝试将选项设置为有多个消息属性文件时遇到了问题,产生了错误,错误在下面给出
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource' defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.lang.String' for property 'basename'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.util.ArrayList] to required type [java.lang.String] for property 'basename': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:755)
at …我有一个表格,其中最后一列中有一个名为 issue 的按钮。在每一行中,当我单击按钮时,我希望它调用一个从服务器获取特定值的 ajax 函数。来自服务器的值将根据选择的行而有所不同。我目前的代码如下
var $dntb = $("#dntb");
$dntb.on("focusin", function() {
        var i //have to get the row where the button is clicked 
        $("#iss" + i).click(function(event) {
        var sditmId = $("#sditm").val();
        var sdhedId = $("#sdhed").val();
        $.get('getstock', {
               sditmId: sditmId,
               sdhedId: sdhedId
        }, function(response) {
        $("#stk").val(response);
        });
        });
});
请告诉我如何在上面的代码中找到'i'的值,如果这是错误的请告诉我正确的方法
下表给出
<table class="table table-bordered table-striped table-hover" id="dntb">
                        <thead>
                        <th><strong>Sales Order Number</strong></th>
                        <th><strong>Reference Order</strong></th>
                        <th><strong>Order Item</strong></th>
                        <th><strong>Quantity</strong></th>
                        <th><strong>Transport Time</strong></th>
                        <th><strong>Mode of Shipment</strong></th>
                        <th><strong>Delivery Date</strong></th>
                        <th><strong>Actions</strong></th>
                        </thead>
                        <jsp:useBean id="gen" scope="request" class="Common.General"/>
                        <tbody> …