2012-09-30 4 views
0

JSF 페이지에 충돌 :

<script type="text/javascript"> 
    $.noConflict(); 
    // Code that uses other library's $ can follow here. 
</script> 
    .......... 

<p:lineChart id="logins" value="#{StatisticsController.weekActivity}" legendPosition="ne" 
           title="Weekly Logins" seriesColors="4D94FF, 1975FF, 005CE6, 0047B2" minY="0" maxY="200"/> 

I을 :

<h:head> 

</h:head> 
<h:body> 
    <div id="test" style="width:850px; height:800px; position:absolute; background-color:transparent; "> 

     <h:form> 
      <h:panelGroup layout="block"> 
       <h:selectOneListbox size="0" id="selectedMenu" value="#{dashboardController.selectedMenu}"> 
        <f:selectItem itemLabel="first" itemValue="0" /> 
        <f:selectItem itemLabel="second" itemValue="1" /> 
        <f:selectItem itemLabel="third" itemValue="2" /> 

        <f:ajax event="change" execute="@this" render="loadMenu" /> 
       </h:selectOneListbox> 
      </h:panelGroup> 

      <h:panelGroup layout="block" id="loadMenu"> 
       <h:panelGroup rendered="#{dashboardController.selectedMenu=='0'}"> 
        MENU 0 
       </h:panelGroup> 

       <h:panelGroup rendered="#{dashboardController.selectedMenu=='1'}"> 
        MENU 1 
       </h:panelGroup> 

       <h:panelGroup rendered="#{dashboardController.selectedMenu=='2'}"> 
        MENU 2 
       </h:panelGroup> 
      </h:panelGroup> 
     </h:form>  
    </div> 
</h:body> 


@ManagedBean 
@ViewScoped 
public class DashboardController implements Serializable{ 

private String selectedMenu; 

@PostConstruct 
public void init() { 
    if (selectedMenu == null || selectedMenu.trim().isEmpty()) { 
     this.selectedMenu = "0"; 
    } 
} 

public String getSelectedMenu() { 
    return selectedMenu; 
} 

public void setSelectedMenu(String selectedMenu) { 
    this.selectedMenu = selectedMenu; 
} 
} 

나는 차트이 코드는 사용을 삭제

<script type="text/javascript"> 
    $.noConflict(); 
    // Code that uses other library's $ can follow here. 
</script> 

AJAX 탭이 작동 중일 때. $.noConflict(); 코드가 충돌하는 것 같습니다. 어떻게이 문제를 해결할 수 있습니까?

+0

'jQuery.noConflict(); – Ohgodwhy

+0

이것은 문제를 해결하지 못합니다. – user1285928

+0

어떤 종류의 충돌입니까? '$'를 사용하는 다른 라이브러리를 사용하고 있습니까? – undefined

답변

2

primefaces 라이브러리에서 jquery include를 제거하고 이미 포함 된 jQuery 만 사용하십시오.

+0

이 작업을 수행하는 방법에 대한 정보를 좀 더 제공해 주시겠습니까? 이 솔루션을 테스트했지만 작동하지 않습니다. http://forum.primefaces.org/viewtopic.php?f=3&t=18685, http://stackoverflow.com/questions/11112058/how-to-use-jquery-with - 프라이 머리 – user1285928

관련 문제