Page 1 of 1

How to clear components after a query service success?

Posted: Wed Mar 05, 2014 8:11 pm
by Gilbert Gomez

Hello everyone

I bound three "label" component within a DIV panel with a Query Service to my database to present a list based on an specific condition ..then user fills out a form and when this is complete the app saves those data. Until this stage everything runs very well ..but when I want to return to my Start Screen I cannot figure out how to clear those "labels" because they still show the last query service information.

How can I clear my labels which are bound with a query services if they are within a div panel?

Thanks for your help
Have a nice day

Image


How to clear components after a query service success?

Posted: Wed Mar 05, 2014 8:46 pm
by Maryna Brodina

Hello!

Could you clarify if you want to delete all grids remained after previous service execution?


How to clear components after a query service success?

Posted: Fri Mar 07, 2014 8:12 pm
by Gilbert Gomez

Hi Maryna.

Well what I'm trying to do is to clear the screen which have data from the last query... something like "clear button" from a registration form.. to prepare the app to be used again with new data...

What I did was:

  1. Hide input fields --- Appery("txtName").val(""); Appery("txtName").hide();

  2. Clear local storage --- localStorage.setItem("varName", "");

    But I cannot clear the content from those labels which dynamically was added with a database Query Service.. It is possible to do that?

    Thanks


How to clear components after a query service success?

Posted: Fri Mar 07, 2014 9:41 pm
by Maryna Brodina

If you need to refresh label text try this code preAppery("labelName").text("");/pre


How to clear components after a query service success?

Posted: Sun Mar 09, 2014 4:52 am
by Gilbert Gomez

Hi Maryna, thanks for response

But I'm still looking how to clean these labels with text string values added dynamically through a database query service?.. as is shown in the picture below.

Image

I have tried this, but it doesn't work:
pre
1. Appery("txtName").val(""); Appery("txtName").hide();
2. Appery("txtName").text("")
/pre

the only way that I found is applying this function:
pre
function clearLabels()
{
window.location.reload();
}
clearLabels();
/pre

but I think it is not the best way.

Well... maybe I should give a little explanation about context.
The first screen is an input field with a search button ...the basic condition are ..if user introduces a wrong data... the system says "No records with this folio" or even if user does not enter any data and click the search button ..the system says "Missing data" ....But if the system got some results then it displays them through these labels... At this stage everything goes well ...The trouble is ...if you try a second time ..and introduces a new wrong data o new empty search ...the error messages appears just below the list created with the last database query.... the old list disappears just if the system finds new results ...obviously ..because presents the new information.

That's why I'm trying to find a best way to clear these labels if search button is clicked more than once


How to clear components after a query service success?

Posted: Tue Mar 11, 2014 12:38 am
by Alena Prykhodko

Hi Gibert.

If you want to clear your list (implemented by div container) you should use the following code:
pre
jQuery("[name='panelDiv']:not([_tmpl])").remove();/pre


How to clear components after a query service success?

Posted: Wed Mar 12, 2014 1:07 am
by Gilbert Gomez

It was magic...
Thanks a lot Alena... it really works ...It made a huge difference
Thanks again for your response

If I could hug you ..I would
You got an A+
Have a nice day