【问题标题】:Selection Disabled in ListShuttle after Using Jquery to Show ListShuttle on Radio Clicked JQuery使用 Jquery 在 Radio Clicked JQuery 上显示 ListShuttle 后,ListShuttle 中的选择被禁用
【发布时间】:2011-12-12 10:01:39
【问题描述】:

我正在使用 Jquery 根据单选按钮值显示/隐藏 ListShuttle 组件。 虽然我能够显示/隐藏 ListShuttle 组件,但我无法在 ListShuttle 中选择任何值。我还明确指定了 render="true" 但仍然没有成功。在使用 JQuery 之前,有一个 with 单选按钮和一个在单击单选按钮时呈现的。

对于 Jquery,我删除了 .之后我无法在 ListShuttle 中选择任何值..

我在页面上还有一个 ListShuttle。但是对于这个组件,我没有做任何修改,但是在使用 JQuery 之后,我也无法在这个 listshuttle 中选择值。这也使用 and

代码sn-p是:

    <h:selectOneRadio id="region"  border="0" label="Region Name" value="#{Bean.Region}" required="true" styleClass="intro" onchange="showRegionShuttle()">
<f:selectItem id="india" itemValue="All" itemLabel="All" />
<f:selectItem id="region" itemValue="Region" itemLabel="Region" />
</h:selectOneRadio> 
 </rich:panel>
</h:panelGroup>
<h:panelGroup/>

<rich:message  for="region"  styleClass="error_messages" showDetail="true"/>
<h:panelGroup/> 
</h:panelGrid>   
<h:panelGrid columns="6">
 <h:outputLabel value="Name *" id="regionLabel" styleClass="intro" escape="false" rendered="true"  /> 
<rich:spacer height="30" width="20"/> 
<h:outputLabel value=" : " styleClass="intro" id="colonLabel" escape="false" rendered="true" />
<h:panelGroup>  
<rich:listShuttle id="calListShuttle" sourceValue="#{Bean.regionSourceList}"  targetValue="#{Bean.targetList}" rendered="true" var="itemsRegion" fastOrderControlsVisible="false" orderControlsVisible="false" targetRequired="true" >

<rich:column >
<h:outputLabel value="#{itemsRegion}"/>
</rich:column >                                 
</rich:listShuttle>
</h:panelGroup>    
<h:panelGroup />
<h:panelGroup />
<rich:message  for="calListShuttle"  styleClass="error_messages" showDetail="true"/>
<h:panelGroup /> 
</h:panelGrid>
</rich:layoutPanel> 
 </rich:layout>
<rich:spacer height="20" width="18"></rich:spacer>

JQuery 代码是

function showRegionShuttle()
{
    jQuery("input:radio[@name='frmOffer\\:region']").click(function() { 
        var radioValue=jQuery("input[name='frmOffer\\:region']:checked").val();
        if(radioValue=="All")
        {
            jQuery("#frmOffer\\:regionLabel,#frmOffer\\:colonLabel,#frmOffer\\:calListShuttle").hide("fast");
        }
        else
        {
         jQuery("#frmOffer\\:regionLabel,#frmOffer\\:colonLabel,#frmOffer\\:calListShuttle").show("fast");
        }   
    });
}

可能有什么问题... 为什么在包含 JQuery 时我无法在 ListShuttle 中选择一个值。

【问题讨论】:

    标签: jquery jsf components richfaces


    【解决方案1】:

    添加 Rich Faces 附带的 JQuery 脚本文件将解决该问题。此外,当使用 richFaces jquery 文件时,很明显您需要使用 JQuery Tag 否则 Jquery 不会触发...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-14
      • 1970-01-01
      • 1970-01-01
      • 2014-07-30
      • 2014-11-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多