-
1. double click and css file problem
boy18nj Feb 17, 2011 4:21 PM (in response to kemaltaskiran)Please post your code.
-
2. Re: double click and css file problem
kemaltaskiran Feb 18, 2011 3:40 AM (in response to boy18nj)Hi Aman,
This is our template file main-template.xhtml contains contentPanel as in the below,
...........
<f:view contentType="text/html">
<f:loadBundle basename="messages" var="msgs" />
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h:outputStylesheet library="css" name="style.css" />
<h:outputStylesheet library="css" name="layout.css" />
</h:head>
<h:body class="main-template">
<div id="content" class="content"><ui:insert name="content">
............
<a4j:outputPanel id="contentPanel">
<ui:include src="#{pageViewIdGenaratorBean.contentPage}" />
</a4j:outputPanel>
</ui:insert></div>
</h:body>
</f:view>
.............
pageViewGeneratorId.contentPage is changed managed bean,
@ManagedBean(name = "pageViewIdGenaratorBean")
@SessionScoped
public class PageViewIdGenaratorBean implements Serializable {
...............
private String contentPage = "/pages/content/mainPage.xhtml";
public void sayfaSec(ActionEvent event) {
FacesContext context = FacesContext.getCurrentInstance();
String pageId = context.getExternalContext().getRequestParameterMap().get("page");
if (pageId.equalsIgnoreCase("userPage")) {
contentPage = "/content/userPage.xhtml";
}
}
..............
}
Our userPage.xhtml is,
<rich:panel>
<f:facet name="header">
User Add
</f:facet>
<h:form id="userAddForm">
.....................................
<h:panelGroup style="width:100%;">
<h:commandButton
action="#{userBean.add}" value="OK"
style="margin-right:15px;">
<f:param id="userParamAdd" name="page" value="userPage"></f:param>
<f:ajax render=":contentPanel" execute="@form"></f:ajax>
</h:commandButton>
.................................
</h:form>
</rich:panel>
Thank you for response, I will add the source code for css problem, and also in the post the double click problem is mentioned,
http://community.jboss.org/thread/162853?tstart=0
Kemal
-
3. Re: double click and css file problem
kemaltaskiran Feb 18, 2011 4:42 AM (in response to boy18nj)Hi Aman,
Our css related problem occurs code in the below. And its picture is in the attached picture.
My table code is,
<rich:extendedDataTable value="#{kullaniciBean.kullaniciListesi}"
selection="#{kullaniciBean.selection}"
style="width:800px;" var="kullanici"
id="kullaniciTable" rows="10">
<a4j:ajax execute="@form" event="selectionchange"
listener="#{kullaniciBean.selectionListener}"
render=":contentPanel" />
<rich:column>
<f:facet name="header">
<h:outputText value="Giriş Adı " />
</f:facet>
<h:outputText value="#{kullanici.girisAdi}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Adı" />
</f:facet>
<h:outputText value="#{kullanici.adi}" />
</rich:column>
------------------------------------
</rich:extendedDataTable>
<rich:dataScroller for="kullaniciTable" maxPages="5" />
Regards,
Kemal
-
tablenoncss.jpg 40.6 KB
-
-
4. double click and css file problem
liuliu Feb 18, 2011 9:38 AM (in response to kemaltaskiran)hi,
Could you try set contentPage default value to "userPage.xhtml"?
liu
-
5. double click and css file problem
kemaltaskiran Feb 18, 2011 12:05 PM (in response to liuliu)Hi liu,
I am setting the contentPage default value "userPage.xhtml", but double click problem continues, hovewer css file for table is loaded but after changing the contentPage and then setting the contentPage "userPage.xhtml" table css file is not loaded again.
Regards,
Kemal
-
6. double click and css file problem
boy18nj Feb 18, 2011 5:04 PM (in response to kemaltaskiran)1) In your h:commandButton, use following attribute- onclick="document.getElementById(this).submit()"
2) CSS File not loading, make you have directory structure in your war file-
/resources/css/styles.css
-
7. Re: double click and css file problem
kemaltaskiran Feb 19, 2011 10:51 AM (in response to boy18nj)Hi Aman,
While I am setting the onclick event as you say but problem is continues, hovewer as Liu said that when I am setting the default page userPage this problem solved for userPage or default page whichever I set, but when I am changing the contentPage dynamically as other page, this problem contiunes.
The css file is not our css file, richfaces table default css file, while we looking with firebug we couldn't see this file for table in the situation of which can be seen in picture.
Kemal
-
8. double click and css file problem
rfcasallasm Feb 20, 2011 2:58 PM (in response to kemaltaskiran)Hi, I'm having the same problem (double-click issue), i'm using facelets... maybe it is the problem?... there is not strange code... just a usual form:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="/template/main.xhtml">
<ui:define name="title">
<h:outputText value="#{msg['createAccount.title']}"/>
</ui:define>
<ui:define name="content">
<h:form id="createAccountForm">
<h:messages globalOnly="true" errorClass="errorClass" infoClass="infoClass" fatalClass="fatalClass" warnClass="warnClass" />
<h:panelGrid columns="3" border="0">
<h:outputLabel value="#{msg['createAccount.firstName']}" for="firstName" />
<h:inputText label="#{msg['createAccount.firstName']}" value="#{accountBean.user.firstName}" id="firstName" required="true">
<f:validateLength minimum="3" maximum="45" />
<rich:validator />
</h:inputText>
</h:panelGrid>
<h:panelGrid columns="2" border="0" width="80%">
<a4j:commandButton render="createAccountForm" value="#{msg['createAccount.createAccount']}" action="#{accountBean.createAccount}" />
<a4j:commandButton render="createAccountForm" value="#{msg['createAccount.cancel']}" onclick="document.getElementById(this).submit()" action="cancel" immediate="true" />
</h:panelGrid>
</h:form>
</ui:define>
</ui:composition>
-
9. double click and css file problem
liuliu Feb 21, 2011 3:47 AM (in response to kemaltaskiran)hi,
i think the problem is ui:include. your "userPage.xhtml" is not present when creat view phase. so i suggested change the default page.
Could you try just reload your page(F5 or reenter the url) after navigate in userPage?
liu
-
10. Re: double click and css file problem
kemaltaskiran Feb 21, 2011 9:58 AM (in response to liuliu)Hi,
I try to relaod after navigation and this works, but problem is continues. Finally we find a solution that we remove the forms in the contentPages that means inside of ui:define and insert a form outside of ui: include, than we refresh this form with f:ajax, than it works, so as you said this problem is related with ui:define.
Kemal
-
11. double click and css file problem
ilya40umov Mar 6, 2011 1:43 AM (in response to kemaltaskiran)Isn't it the same problem? See: