Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf <;a4j:commandbutton>;操作属性为';t在添加<;h:消息>;并将ajax事件转换为所需的inputtext_Jsf_Richfaces - Fatal编程技术网

Jsf <;a4j:commandbutton>;操作属性为';t在添加<;h:消息>;并将ajax事件转换为所需的inputtext

Jsf <;a4j:commandbutton>;操作属性为';t在添加<;h:消息>;并将ajax事件转换为所需的inputtext,jsf,richfaces,Jsf,Richfaces,在中,我有一个禁用的inputtext,它从属于类DocumentBean的列表中显示作者。我还有一个显示作者姓名的。当从菜单中选择一个作者时,作者将被添加到上面提到的列表中,并出现一个新的禁用inputtext 下面是上面描述的代码: Autor: <a4j:outputPanel id="teste"> <a4j:repeat value="#{insertDocController.docController.documen

中,我有一个禁用的inputtext,它从属于类
DocumentBean
列表中显示
作者
。我还有一个显示作者姓名的
。当从菜单中选择一个作者时,作者将被添加到上面提到的
列表中,并出现一个新的禁用
inputtext

下面是上面描述的代码:

  Autor:
          <a4j:outputPanel id="teste">
            <a4j:repeat value="#{insertDocController.docController.documentBean.authorList}" var="author">
            <br />
            <h:inputText value="#{author.name}" disabled="true" />
             <br />
             <a4j:commandButton type="submit" action="#{insertDocController.removeAutor(author.uri)}" 
             value="Remover" render="teste" />
            </a4j:repeat>

          <br />
            <h:selectOneMenu id="chooseAuthor" value="#{insertDocController.selectedAuthorUri}">
                  <f:selectItem noSelectionOption="true" itemLabel="selecione" itemValue=""/>
                  <f:selectItems value="#{insertDocController.authorValues}" var="author"
                  itemValue="#{author.uri}" itemLabel="#{author.name}"/>     
               </h:selectOneMenu> 
           <a4j:commandButton type="submit" action="#{insertDocController.addAuthor()}"
            value="Inserir" render="teste" />
            <br />
          </a4j:outputPanel>
在同一个
xhtml
页面上有一个inputtext。一切正常,输入文本如下:

Title: <h:inputText id="input"
        value="#{insertDocController.docController.documentBean.title}">
        </h:inputText> 
   Title: <h:inputText id="input"
            value="#{insertDocController.docController.documentBean.title}"
            required="true" requiredMessage="Campo Obrigatorio">
            <f:ajax  execute="@this input" render="message" event="blur"/>
            </h:inputText>         
            <h:message for="input" id="message" style="color:red"/>
如果我在输入文本重新开始工作之前将其打开。
有什么问题吗?谢谢大家!

您需要指定
execute
属性

删除作者


用于添加作者按钮



希望有帮助。

嗨!我阅读了您最近的帖子,并应用了您建议的立即删除()、添加作者()和。在我这样做之后,它开始调用addAction方法,但是在中选择的值总是空的。是的,因为我被问题的请求弄糊涂了,所以我用正确的方法更新了答案。请回顾@LucianeI使用的javax2、RICHFACES 4.3.3和MOJARRA 1.2。My没有进程属性,它有执行属性。我按你说的那样使用了execute,现在它开始工作了。非常感谢你!你帮了大忙!哦,是的,我有错误的版本文档,我已经很久没有使用Richfaces了:现在是Primefaces时代了!我不知道现在Primefaces的使用越来越多。我刚开始使用JSF,选择它是因为我觉得它很漂亮。。很高兴认识你
   Title: <h:inputText id="input"
            value="#{insertDocController.docController.documentBean.title}"
            required="true" requiredMessage="Campo Obrigatorio">
            <f:ajax  execute="@this input" render="message" event="blur"/>
            </h:inputText>         
            <h:message for="input" id="message" style="color:red"/>
<a4j:commandButton type="submit" action="#{insertDocController.removeAutor(author.uri)}" 
             value="Remover" render="teste" />
<a4j:commandButton type="submit" action="#{insertDocController.removeAutor(author.uri)}" 
         value="Remover" render="teste" execute="@this"> 
</a4j:commandButton>
<a4j:commandButton type="submit" action="#{insertDocController.addAuthor()}"
        value="Inserir" render="teste" execute="@this, chooseAuthor">
</a4j:commandButton>