How to refresh a rowrepeater in sapui5 - sapui5

I have developed a small application in which I have a row repeater where I will display the recently created records.
Suppose I have some 150 records in a row repeater.
Now the problem is I scroll down to see the 100th record in the row repeater
and after viewing the 100th record I will go back by clicking on back button.
Now if I again click on the row repeater the page is not displaying from the starting record by default its showing from the 100th record means I again need to scroll up to view the 0th record.
How can I overcome this issue?

You can
ensure that the RowRepeater (or it's surrounding view) is destroyed on back and recreated on enter (only way known to me to handle your requirement with UI5)
use jQuery.scrollTop() on re-entering the view with your row repeater
var oRR = sap.ui.getCore().byId("myRowRepeater");
jQuery(".sapUiRrPage", oRR.getDomRef()).scrollTop();

Related

Get selected row details in submit button as alert

I have a table-view that houses many cells. There is a button[submit] after the table view part with in view controller .Table view consists of number from 1 to 100 and a radio button for selection ,while click on any number it changes to selected state. My question is, how can I display the selected numbers as alert while click on submit button
The key thing here is to forget all about the table view. Instead, concentrate on the model data from which the table view is constructed. Each time the user clicks on a number to toggle whether this one of the "selected" rows, you must read that back into the model data (which will obviously need some sort of property saying whether this is a "selected" row of the data). Now the button's job will be trivial: it just cycles thru the entire model data looking for the numbers whose "selected" is true.

Navigating RepeatBox in code

In my Smartface app I have a dataset binded to a RepeatBox.
I am adding new row to the dataset from a function that is running ASYNCRONOUSLY.
I can perfectly see my new row within the RepeatBox but it does not scroll automatically to the new row. If all visible rows of the RepeatBox are filled then new rows come off the screen which is not very user-friendly.
Is there any way to move the RepeatBox to the last row (or to the top row)?
P.S.: moving binded dataset by seek() doesn't help - the RepeatBox stands still
Try this :
RepeatBox.setTopIndex(0, itemIndex, 100);
Use itemIndex as a variable that is incremented each time you add a new row to the dataset. You can calculate how many numbers of rows do you have, make the variable start from that number, not 0.
The values 0 and 100 can be changed according to your design. You can check the links below for information about repeatbox's properties and members :
http://docs.smartface.io/html/M_SMF_UI_RepeatBox_setTopIndex.htm
http://docs.smartface.io/html/AllMembers_T_SMF_UI_RepeatBox.htm

how show only limited content in table view?

I am new for iPhone development. I don't have any idea that How show array in Table view? Now problem is that i am coding to display an array of 85 strength. Now i want to show in slots in table view. for example when first time view did load then table show 10 element and in 11th row show a button Next. When click on Next then show next 15th element and in 16 th row show two button.One is next and second is previous. When click on next then show next 15 element and when click on previous then show previous 10 element. How do and where do in coding part?
I am get data in array from XML parsing. That array i have shown i view did load.In number of row i have written [tmparray count]+1. Tmparray have first ten element.
What i will do next? Thanks in advances..................
Try creating an array method that returns your content array filtered with [NSArray filteredArrayWithPredicate:].

Extjs form submitting multiple times

I'm using a form for edit some records. Each time When Edit link is clicked i'm loading one record data into form, changing the values and updating, its worked fine for the first time.
When i load another record data into form and update it, the present record is updating and the previous record is also updating with the new data.
If i update 3 rows after that when updated the 4th row, 4th row and previous 3 are updating with new data entered for 4th row.
I think form is submitting multiple times,
I used form reset property each time loading the values, but its not worked.
How to do this Please help me
Are you holding your formpanel into a Ext.Window component ? Check if the window is actually closed or hidden. Try putting closeAction: 'close' in your window config.

How do I build a table view for iphone in which when you save it adds a new row instead of replacing the row?

I built an app with a table view that holds frequencies and other data. I would like to select a row, edit it, and then add the new frequencies info to a new row right below the selected row without deleted the selected row.
I'm using core data. Everything works fine using UIBarButtonItem *saveButton method. But it just replaces the row. I also can use add but it puts the new row on the bottom of the tableview.
insertRowsAtIndexPaths:withRowAnimation: will put the row in. You'll have to figure out how to put the right data in it in cellForRowAtIndexPath