hi, i want reset placeholder of view search on the event onshow of my window.
how can do it?
{view:“search”, placeholder:“Cerca prodotto”, id:“search_prodotto”}
on show of my window i want set value “Cerca prodotto” in placeholder.
Thanks
Hi,
ui.window has the onShow
event. The following code will redefine the placeholder:
$$("search_prodotto").define({ placeholder:"Cerca prodotto" });
$$("search_prodotto").refresh();
thanks a lot
i try this code but not work
{view:"search", align:"center", placeholder:"Cerca prodotto",
id:"search_prodotto", name:"search_prodotto", width: 300},
function Add_Ordine(){
$$('datatable_ordini').clearAll();
$$("dataview_prodotti").unselectAll();
$$("search_prodotto").define({ placeholder:"Cerca prodotto" });
$$("search_prodotto").refresh();
showForm("window_ordine");
}
Can you please provide a snippet? In your code the initial value matches the new one, but the method itself works within/without the window:
Hello, sorry but perhaps I expressed myself badly on the object.
The problem is the following:
If I type the product name in the search field, after you close the form and reopen it is written the name of your last search
I see. Placeholder is visible when the text field is empty. So you just need to reset input’s value:
$$("search_prodotto").setValue("")
instead of redefining the placeholder.
thanks! that’s ok!