Call jQuery function when rendering component via ajax

Asked

Viewed 52 times

0

I have a little problem that is:

I have a component RichFaces more specifically the rich:listShuttle id "migrarId". Inside that component I have a input who owns a placeholder that is generated via jQuery every time the page is loaded.

The problem is that input has a ajax with the event "onkeyup" that when I type and delete something he reRenderize the entire component of rich what ends up doing the placeholder disappear.

`<h:inputText styleClass="filtroOrigem" id="filtroOrigem" value="#{migrarUsuarioManagedBean.filtroOrigem}">
 <a4j:support requestDelay="1000" event="onkeyup" ajaxSingle="true" process="filtroDestino" action="#{migrarUsuarioManagedBean.filtrarDestino}" reRender="migrarId" />
</h:inputText>`

    $(document).ready(function() {
            $('input.filtroOrigem').attr("placeholder", "Digite Chave, Nome ou Unidade");
    });

I was wondering if there’s any way to generate the placeholder whenever this component is rendered via ajax not when the page is loaded.

  • If you have any value in the input the placeholder does not appear! When you reRenderize the field you are leaving some value in the input? If the placeholder is not going to appear...

  • What intrigued me is why do this with jQuery, instead of putting the placeholder directly in the input.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.