标签: clientid

在 f:ajax 渲染中引用复合组件 ID

我正在编写一个复合组件,用于包装输入元素,并在其下方添加一个“可选字段”名称和 h:message 元素。这是组件(在 input.xhtml 文件中):

<composite:interface/>
<composite:implementation>
  <div>
  #{component.children[1].setStyleClass(component.children[1].valid ? '' : 'inputError')}
    <composite:insertChildren/>
  </div>
  <h:panelGroup styleClass="optional" 
      rendered="#{!component.parent.children[1].required}" 
      layout="block" >
    #{msgs['common.optional.field']}
  </h:panelGroup>
  <h:message id="msgId" 
       for="#{component.parent.children[1].id}" errorClass="error"/>
</composite:implementation>
Run Code Online (Sandbox Code Playgroud)

同样,该组件的预期用途是包装一个 h:input* 元素,该元素应该是它在 using 页面中的第一个和直接子元素。

在使用页面中,我会写:

    <h:form id="f1">
    <h:panelGrid border="0" columns="2" style="width: 80%">
        <f:facet name="header">
            <col width="40%" />
            <col width="60%" />
        </f:facet>
        <h:outputLabel styleClass="sectionBody" for="i1"
            value="Input 1"></h:outputLabel>
            <my:input id="ii1">
            <h:inputText id="i1" size="20" maxlength="20" tabindex="0"
            required="true" label="Input 1">
            </h:inputText>
            </my:input>
        <h:outputLabel styleClass="sectionBody" for="i2"
            value="Input 2"></h:outputLabel>
            <my:input id="ii2">
            <h:inputText id="i2" size="20" maxlength="20" tabindex="0"
                label="Input 2"> …
Run Code Online (Sandbox Code Playgroud)

jsf clientid composite-component ajax-update

3
推荐指数
1
解决办法
3333
查看次数

如何在Android Google Analytics V4中获取clientId?

我正在尝试在Android中自动设置Analytics clientId.(设置它在Android API文档中解释为setClientId())

当我尝试使用tracker.get("clientId")它时返回空.任何想法的人?

提前致谢!

java android analytics get clientid

3
推荐指数
1
解决办法
3173
查看次数

外部js文件jquery函数似乎没有得到clientId

我使用externel javascript文件,我有这个,

function getdropdownvalue()
{
   alert($("#<%=DLState.ClientID%>"));
}
Run Code Online (Sandbox Code Playgroud)

但它似乎没有得到我的dropdown的clientId ...任何建议......

jquery file clientid external-js

2
推荐指数
1
解决办法
2068
查看次数

在ASP.NET C#中获取.ClientID的问题

我在AJAX工具包的AsyncFileUpload的uploadError javascript函数中有以下内容:

function uploadError(sender, args) {
    document.getElementById("<%# uploadResult.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMessage() + "</span>";
}
Run Code Online (Sandbox Code Playgroud)

不幸的是,ClientID调用返回Null,因此javascript错误.

我还注意到,一旦页面加载,我的控件都没有通常的.NET格式:EG:

<asp:Label runat="server" Text="Select an image to upload it to this stock item...." ID="uploadResult" /> 
Run Code Online (Sandbox Code Playgroud)

通常会像这样呈现:

<span id="ctl00_ContentPlaceHolder1_uploadResult">Choose a webstock file to upload...</span>
Run Code Online (Sandbox Code Playgroud)

但是使用这个文件它呈现为:

<span id="uploadResult">Select an image to upload it to this stock item....</span>
Run Code Online (Sandbox Code Playgroud)

我认为这是同一个问题,但不知道为什么会发生这种情况.

javascript asp.net ajax clientid

2
推荐指数
1
解决办法
5万
查看次数

将clientID传递给javascript并提取值,澄清

原谅noob的问题,但我正试图让我的脑袋缠绕在这里.我在listview中有一些用于提交一些信息的控件.我在这里运行一个测试模式来做这个,但是我得到了对象未定义的错误.我所看到的关于此的所有文章都含糊不清.在这个例子中,我试图传递文本框的id,然后从javascript中的值中提取值.你能告诉我我做错了什么吗?

<form id="form1" runat="server">
        <asp:ScriptManager runat="server" />
        <script type="text/javascript">
            function ClientIDS(id) {
                var info = document.getElementById(id).value;
                alert(info);
                return false;
            }
        </script>
        <asp:ListView runat="server" ID="lsvTest">
            <ItemTemplate>
                <asp:TextBox runat="server" ID="txtTextBox" />
                <asp:Button runat="server" ID="btnSubmit" Text='<%#Eval("Name") %>' OnClientClick="ClientIDS('<%=txtTextBox.ClientID %>')" />
            </ItemTemplate>
        </asp:ListView>

    </form>
Run Code Online (Sandbox Code Playgroud)

谢谢

javascript asp.net jquery clientid

2
推荐指数
1
解决办法
4312
查看次数

Microsoft Translator API Java,如何使用Azure获取客户端新ID

Translate.setClientId( "东西"); Translate.setClientSecret( "something1");

我之前使用以下语法成功运行了我的代码,但是,有50%的时间我会收到错误消息:TranslateApiException:找不到与请求凭据关联的活动Azure市场转换器订阅.:

我的应用程序订阅了Microsoft正在使用的OLD网站,但我认为问题正在发生,因为他们正在使用Azure.现在,我的应用程序订阅了Azure,我订阅了Microsoft Translator API服务.想知道如何将其设置为Azure提供的新ClientID,ClientSecret.

这是我首先订阅的"旧"网站:https: //datamarket.azure.com/home/

java azure clientid

2
推荐指数
1
解决办法
1772
查看次数

在ASP.NET中强制客户端ID

我知道在ASP.NET的下一个版本中,我们最终能够在System.Web控件上设置clientids而不用框架以准智能的方式为我们做这件事,例如:

id="ctl00__loginStatus__profileButton"
Run Code Online (Sandbox Code Playgroud)

有没有人知道一个好的方法同时强制上面的id类似的东西

id="profileButton"
Run Code Online (Sandbox Code Playgroud)

主要原因是在动态地向页面添加控件时操纵jQuery中的clientids.我能看到的问题是改变ID会破坏Viewstate吗?

asp.net clientid

0
推荐指数
2
解决办法
3189
查看次数