Skip to main content

Fields are cleared but just when I press F5



I don't know if it is a common problem, but this strange problem is giving me some headache... I'm having an strange behavior, my application has a lot of dialogs, and when user opens one, the dialog should show default content. The problem is that I clear all bean's properties before show the dialog, but sometimes it appears that the form isn't cleared!! For example, this is one of the dialogs that are having this problem:





how it should be This image show how the dialog appears the first time I open it, all fields are cleared and the second radio is selected. If I change the radio selection and enter something in the input field, the datatable immediately shows the data accordingly with the search. So, if I click in "Cancelar" (cancel in portuguese), this dialog is closed, like expected.





Then I open this dialog again and:





how it is shown after oppened after cancel action The fields store the last edition user made. I thought I wasn't clearing the bean, but if I just press F5 (refresh) the dialog is shown like in the first image. I don't know why, but some fields aren't updated!!





My dialogs are created using this template:







<ui:component>

<hrgi:popup id="#{idPopup}" titulo="#{titulo}" renderizar="#{popup.visivel}"

bordaConteudo="#{bordaConteudo eq null?true:bordaConteudo}">

<f:facet name="cabecalho">

<ui:insert name="cabecalho"></ui:insert>

</f:facet>

<f:facet name="conteudo">

<h:panelGroup id="#{idPopup}Conteudo" layout="block" style="width:100%">

<p:focus/>

<ui:insert name="conteudo">Nenhum conteúdo definido!</ui:insert>

</h:panelGroup>

</f:facet>

<f:facet name="botoes">

<h:panelGroup style="width:100%">

<h:panelGrid id="#{idPopup}PainelMensagens" style="width:100%">

<p:messages/>

</h:panelGrid>

<ui:insert name="barraDeBotoes">

<h:panelGroup layout="block" style="width:100%">

<p:commandButton value="CANCELAR" styleClass="hrgi-botao-popup"

immediate="true" update="@form"

action="#{controladorPopup.fechar}"/>

<p:commandButton value="OK" styleClass="hrgi-botao-popup"

action="#{controladorPopup.submit}" update="@form alerta #{atualizar}">

<f:param name="REQUIRED" value="true"/>

</p:commandButton>

</h:panelGroup>

</ui:insert>

</h:panelGroup>

</f:facet>

</hrgi:popup>

</ui:component>







is my own dialog component...





Could someone explain me why it is happening??


Comments

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.