标签: richfaces

rich:clientId,rich:component和rich:element之间有什么区别?

我的意思是这三个富有面孔的论点:

#{rich:clientId('id')}
#{rich:element('id')}
#{rich:component('id')}
Run Code Online (Sandbox Code Playgroud)

例如在这些方法中调用(actionListener):

 <a4j:support event="onchange" ajaxSingle="true"
    actionListener="#{Bean.actionReset('#{rich:clientId('id')}')}"              
    oncomplete="jsFunction(this.value).text;" />
Run Code Online (Sandbox Code Playgroud)

jsf richfaces

4
推荐指数
1
解决办法
3199
查看次数

对于a4j:jsFunction,reRender或oncomplete是否先发生?

我有一个运行的jsFunction,并希望在重新渲染完成后执行javascript.我猜测"oncomplete"中的javascript被称为 - 后重新渲染,但不确定.有什么想法吗?

谢谢.

javascript richfaces ajax4jsf

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

您是否真的不能在RichFaces中使用任何纯HTML?为什么?

有人可以指向我或解释是否属实,你不能在JSF或JSF库(如RichFaces)中使用普通的HTML标签吗?

我们在JBOSS服务器上使用JSF 1.2,RichFaces 3.3.3和Facelets.

有人对我说,我们只能使用<rich:><f:><a4j:>和他们所提供的组件.原因是JSF组件树会中断,您可能会有不需要的行为.或者在某些时候失去JSF树结构以及与之相关的功能.

我试图使用普通<h1>标签并被告知不使用它并使用<a4j:outputPanel>替代(渲染为a <div>)并将其设计为看起来像标题.

我很难相信这一点.

html java jsf richfaces facelets

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

在不使用Javascript的情况下选择JSF中的All复选框

我试图使用一个复选框选择/取消选中数据表中的所有复选框.当我试图在服务器上设置它时,我无法这样做.我一直在寻找解决方案,但无法在服务器端获得如何完成.

这是代码.

xhtml文件###

<rich:column styleClass="center-aligned-text">
         <f:facet name="header">
          <h:selectBooleanCheckbox id="selectAll" title="selectAll" valueChangeListener="#{workspace.selectAllComponents}">
           <a4j:support event="onclick" reRender="listcomponents"/>
          </h:selectBooleanCheckbox>
         </f:facet>

         <h:selectBooleanCheckbox id="selectComponent" 
          value="#{workspace.selectedComponentIds[componentInfo.id]}">
         </h:selectBooleanCheckbox>
        </rich:column>
Run Code Online (Sandbox Code Playgroud)

Java文件

// Select All and delete
 public void selectAllComponents(ValueChangeEvent event){

  // If the check all button is checked, set all the checkboxes as selected 
  if(!selectAll)
  {
   changeMap(selectedComponentIds,true);
   setSelectAll(true);
  }
  else // If the button is unchecked, unselect all the checkboxes
  { 
   changeMap(selectedComponentIds,false);
   setSelectAll(false);
  }
 }

 public void changeMap(Map<Long,Boolean> selectedComponentMap, Boolean blnValue){
  if(selectedComponentMap != null){
   Iterator<Long> itr = selectedComponentMap.keySet().iterator();
   while(itr.hasNext()){ …
Run Code Online (Sandbox Code Playgroud)

jsf richfaces

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

java.lang.IllegalStateException:Parent不为null,但此组件不相关

我在运行JSF程序时遇到以下异常.

    org.apache.jasper.JasperException: An exception occurred processing JSP page /pages/general/internalServerErrorPage.jsp at line 44

    41:             <link rel="shortcut icon" href="<%=request.getContextPath()%>/resources/images/infomindzicon.ico" type="image/x-icon" />
    42:         </head>
    43:         <body id="sscmsMainBody">
    44:             <h:form id="internalServerErrorPageForm" binding="#{ServerErrorBean.initForm}">
    45:                 <rich:page id="richPage" theme="#{LayoutSkinBean.layoutTheme}"
    46:                            width="#{LayoutSkinBean.layoutScreenWidth}"
    47:                            sidebarWidth="0">
Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.IllegalStateException: Parent was not null, but this component not related
    at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
    at org.apache.jsp.pages.general.internalServerErrorPage_jsp._jspService(internalServerErrorPage_jsp.java:207)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
Run Code Online (Sandbox Code Playgroud)

这个例外的含义是什么?如何解决这个问题?


更新:我的代码如下,

public HtmlForm getInitForm() {
    validateSession();
    return initForm;
}
Run Code Online (Sandbox Code Playgroud)

验证会话方法是

private void validateSession() {        
    HttpSession session …
Run Code Online (Sandbox Code Playgroud)

java jsf jsp richfaces

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

将Richfaces添加到Eclipse Palette?

我正在使用Eclipse 3.6,并希望将Richfaces添加到Palette.有人可以提供源代码或解释如何做到吗?

eclipse richfaces palette

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

Ajax-呈现一个不同形式的表

data table在选择日期时遇到问题<rich:calendar>.我<a4j:ajax>用于渲染但没有效果.这是代码示例:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:composite="http://java.sun.com/jsf/composite">

    <rich:panel header="#{lang.reportPanelHeader}" id="panel" rendered="#{navigation.reportRendered}" width="700px" style="margin-left:250px">
        <a4j:status onstart="#{rich:component('statPane')}.show()" onstop="#{rich:component('statPane')}.hide()" />
        <h:form id="data_table_form">
            <rich:dataTable value="#{validateReportAction.reportList}" var="report" iterationStatusVar="it" id="data_table" rows="5">
               <rich:column>
                   <f:facet name="header">#</f:facet>
                   #{it.index  + 1}
               </rich:column>

               <rich:column>
                   ....
               </rich:column>

                <f:facet name="footer">
                    <rich:dataScroller page="#{validateReportAction.page}" />
                </f:facet>
            </rich:dataTable>
        </h:form>

        <rich:popupPanel id="statPane" autosized="true" style="border: none; background-color: #e6e6e6;">
            ....
        </rich:popupPanel>

        <div id="bottom">
            <h:form id="calendarForm">
                <div id="left">                
                    <div class="input" id="test_cal">
                        <rich:calendar 
                            dataModel="#{calendarModel}" …
Run Code Online (Sandbox Code Playgroud)

ajax richfaces jsf-2

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

h:selectOneMenu默认项为null,清除空项值,必填字段

您好,我遇到以下代码问题:

<h:selectOneMenu id="selectTipoAutorizacion"
                                                    value="#{autorizacion.codigoTipoAutorizacion}"
                                                    required="true">
                                                    <f:selectItems
                                                        value="#{cc.attrs.controller.getListaTiposAutorizacion(autorizacion)}"
                                                        var="tipoAutorizacion"
                                                        itemLabel="#{tipoAutorizacion.nombreTipoAutorizacion}"
                                                        itemValue="#{tipoAutorizacion.id.codigoTipoAutorizacion}" />

                                                    <a4j:ajax event="change" execute="@this"
         listener = #{myListener.listener}                                                                                      render="selectAutorizador" />
                                                </h:selectOneMenu>
Run Code Online (Sandbox Code Playgroud)

问题是默认选择的值始终是标记的第一个.这会打扰用户,导致根据所选项目值加载一些数据...但是,直到更改事件发生时才会加载该信息(a4j:ajax标记),所以现在用户必须选择另一个项目,然后选择前一个以查看默认的项目相关信息.

我通过在开头加载默认的项目相关信息来解决问题,但是用户不喜欢这个.因为它可能导致混乱.所以问题是......我怎么能避免这种行为?我想要的是selectOneMenu加载一个明确的值(如果没有任何f:selectItems).非常感谢.

richfaces jsf-2

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

如何在richfaces之后加载自定义css?

我找到了这个帖子https://community.jboss.org/thread/202276?tstart=0,其中用户ramkumarps在richfaces加载他们的css后显示加载自定义CSS的方法,但我不想在内容被加载后加载它加载.

有没有办法让它在richfaces之后加载并仍在head标签中?

css jsf richfaces jsf-2

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

java.lang.IllegalArgumentException:找不到属性类的Setter

我想实现一个包含行编辑的表.

我在展示中找到了这个例子,但我得到了这个错误的时间:

  • javax.servlet.ServletException:找不到属性类的Setter
  • java.lang.IllegalArgumentException:找不到属性类的Setter

我的xhtml

           <a4j:status onstart="#{rich:component('statPane')}.show()"
                onstop="#{rich:component('statPane')}.hide()" />

            <h:form id="form">
                <rich:dataScroller for="dataTableId" maxPages="8" />
                <rich:extendedDataTable id="dataTableId" rows="200"
                    value="#{declarationReglementaireModel.detailCurrentDecReg.decReg.listLigneTa3SDTO}"
                    var="ligneTA3" frozenColumns="2"
                    style="height:300px; width:800px;" selectionMode="none">

                    <rich:column width="35px">
                        <h:panelGrid columns="1" cellpadding="2">

                            <a4j:commandLink class="lien_detail" render="editGrid"
                                execute="@this"
                                oncomplete="#{rich:component('editPane')}.show()">
                                <span class="icone icone-edit icone-align-center" />
                                <a4j:param value="1"
                                    assignTo="#{modifDecRegTa3Model.currentLigneTa3Index}" />
                                <f:setPropertyActionListener target="#{modifDecRegTa3Model.editedRow}"
                                    value="#{ligne}" />
                            </a4j:commandLink>

                        </h:panelGrid>
                    </rich:column>
                    <rich:column width="150px" sortBy="#{ligneTA3.idTitre}"
                        sortOrder="ascending">
                        <f:facet name="header">Référence Titre</f:facet>
                        <h:outputText value="#{ligneTA3.idTitre}">
                        </h:outputText>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            <h:outputText value="a" />
                        </f:facet>
                        <h:outputText value="#{ligneTA3.vlColA}">
                        </h:outputText>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            <h:outputText value="b" /> …
Run Code Online (Sandbox Code Playgroud)

jsf richfaces

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

标签 统计

richfaces ×10

jsf ×6

jsf-2 ×3

java ×2

ajax ×1

ajax4jsf ×1

css ×1

eclipse ×1

facelets ×1

html ×1

javascript ×1

jsp ×1

palette ×1