-
1. Re: How to update the browser title with A4J?
sergeysmirnov Oct 16, 2007 8:26 PM (in response to ccsilva)head does not allow inside. So, it is not a good idea to put there a4j:outputPanel.
If you provide id for the h:outputText, it will generate also. So, you are in trouble again.
Looks like that replacing the title with javascript is only the legal way. -
2. Re: How to update the browser title with A4J?
ccsilva Oct 17, 2007 7:02 AM (in response to ccsilva)Hi SergeySmirnov,
Thanks for you reply!!!
Are you talking I should use something like a4j:jsFunction ? or Should I create my own JavaScript function?
Thanks again!!!
Claudiney -
3. Re: How to update the browser title with A4J?
ilya_shaikovsky Oct 18, 2007 6:37 AM (in response to ccsilva)Try to serialize the beans propery with new title using data attribute and call your JS function which will change the title to newest in oncomplete handler.
-
4. Re: How to update the browser title with A4J?
ccsilva Nov 2, 2007 9:10 AM (in response to ccsilva)Hi,
Great suggestion. I followed your suggestion and I did:
1. JavaScript code<script language="JavaScript"> <!-- function trocarTitulo(titulo) { document.title = titulo; } --> </script>
2. JSF Code<a4j:commandLink value="#{page.name}" action="#{siteHelperBean.openPagina}" reRender="panelSubMenu, panelBody, panelNavegacao" data="#{siteBean.title}" oncomplete="javascript:changeTitle(data);"> <a4j:actionparam name="palavraChave" value="#{pagina.palavraChave}"/> </a4j:commandLink>
Now, it is working fine! But I have a doubt: Should I insert the code data="#{siteBean.title}" oncomplete="javascript:changeTitle(data);" in all commandLinks?
There are a way to detect all ajax requests and do this automatically without repeat the code in all commandLinks?
Thanks!!!
Claudiney -
5. Re: How to update the browser title with A4J?
ccsilva Nov 2, 2007 9:13 AM (in response to ccsilva)I already tried some Listeners but without success. I think I confused some concepts.
Could someone tell me what component/concept I should use?
Thanks again!!!
Claudiney -
6. Re: How to update the browser title with A4J?
ilya_shaikovsky Nov 2, 2007 9:34 AM (in response to ccsilva)May be try to use some hidden input.. in other case I'm afraid you should repeat this code in your controls.
-
7. Re: How to update the browser title with A4J?
ccsilva Nov 2, 2007 9:40 AM (in response to ccsilva)Do you think that: Should I have only a <a4j:form> in my page entire page, with a hidden input to try get all ajax requests?
Thanks!
Claudiney -
8. Re: How to update the browser title with A4J?
ccsilva Nov 5, 2007 6:03 AM (in response to ccsilva)Hi,
Please, Someone has a suggestion?
Thanks!!!
Claudiney