windows phone 8 longlist selector .how to find the new item is added in the longlist selector.currently i am using ItemRealized event - windows-phone-7

I am currently using ItemRealized event to get the newly added item in the loglist selector but the problem is ,it fired during pageload .during pageload i added more than 20 items to list ,that time i don't want to fire itemrealized event.
any other way equal to ItemRealized .or how to achieve this problem .

If you are using MVVM pattern means You can Bind your LongListSelector.ItemSource to your ViewModel ObservableColection<T>.ObservableColection implies INotifyColectionChanged SO you will Get ColectionChangedEvent.

Related

Kendo ListView and MVVM 'edit template' cancel button resets bound data to initial state

I have a Kendo ListView bound to an Observable object and all is working well.
I'm able to:
Add items to the list
Edit existing items by using the edit template below
Delete items
One oddity though is when I switch an item to edit view and click Cancel it resets all data back to the original data. So if I started with one item with say name and amount fields, I edit the item and change the amount, then add two more items to the list all is well. But then I click edit on any of the items and immediately click cancel, from here it removes all the additional items I added and resets the data for the first item back to what it was at the beginning.
Why would the cancel action do that?
This dojo snippet shows the exact problem I'm having: http://dojo.telerik.com/IKowo
Kendo version 2016.3.1118
EDIT:
One further development, I found a forum post on Telerik stating that you have to have an ID column and a schema:model:id setup otherwise things won't work as expected.
I've updated the dojo snippet as follows: http://dojo.telerik.com/IKowo/2
Since adding the ID to the mix it looks like the amounts aren't being affected by the cancel button but the newly added items still get removed.
Follow the example provided here by telerik
//Binding Listview to local data array & Perform CRUD
http://dojo.telerik.com/eWih/2
The Only Requirement for the cancel event not deleting the new Items is:
The id field should be kept 0 when adding the new item to the datasource
It should be incremented / Updated in the datasource transport.create event (REQUIRED)
happy coding!

How to add data in popup using primefaces and ajax call

I am new in JSF, facing a problem while executing GET AJAX request.
I have a icon with a counter (number), once I will do mouse over to the icon it shows a kind of small popup with small list (3 items), kind of same behavior as we have in Social networking sites (Notification icon). Till here All good. Now in my pop up at bottom side, I added a text says "Show more". This should get 3 more items/ notification from the DB via Ajax call and add the response in the popup (without closing the popup), then in total there should be 6 items.
I am not sure how exactly I can achieve this, Please help.
Using <h:outputText value="show more}"> in my xhtml.
In my bean I have a method to getMoreNotification().
Recently I tried with <p:remoteCommand>, but not sure how I can add responce/ data in popup.
Thanks in advance.
Not that difficult
Create a list which is initially populated with 3 items
Create a <p:overlay> with IN that <p:overlay> e.g. a <p:dataList> that shows these list mentioned in 1. Give this component an id, e.g. 'notifications'
When clicking on the 'show more' commandLink, execute the getMoreNotification() via an actionListener and IN that method update the list mentioned in 1. Also make sure you have an update attribute that contains the value of the <p:dataList>.

Am I using marionettejs properly?

hi i've been using backbonejs for almost 2 years now and am just starting out on marionettejs with my first app at this website.
the reason for my question is that in my app i have a Layout with a 2 composite view rendered as dropdown list and table (which updates itself whenever we change the selection on the dropdown list).
what i did was for the "change" event on my dropdown list, i have an MyApp.vent.trigger() which i have a listener at the MyApp.addInitializer() function that updates the other compositeview (the table below the dropdown list). actually for the whole app i have almost 6 of this triggers inside itemViews and compositeViews and listeners are inside the addInitializer() for some of the other functions.
i just want to know if i did this right? or is this how dev in marionettejs normally is?
thank you
Yes, that's the recommended idea. However, you don't necessarily need to use the top-level vent attribute: each sub-app and view has their own (scoped) event manager. In addition, you don't necessarily need to add the listener in an addInitializer.
Here's an example (from my Marionette book):
trigger an event at the view scope: https://github.com/davidsulc/marionette-gentle-introduction/blob/master/assets/js/apps/contacts/list/list_view.js#L15 This uses the triggers hash, but you could also do this.trigger("my:event") from within the view, like here: https://github.com/davidsulc/marionette-gentle-introduction/blob/master/assets/js/apps/contacts/list/list_view.js#L29
listening to the events (and retriggering them if necessary): https://github.com/davidsulc/marionette-gentle-introduction/blob/master/assets/js/apps/contacts/list/list_controller.js#L48 and https://github.com/davidsulc/marionette-gentle-introduction/blob/master/assets/js/apps/contacts/list/list_controller.js#L38
Hope this helps !

updating observable collection in windows phone 7 application

am developing a windows phone which contains database.I've a list box which binds observable collection to display the data retrieved from database. I am able to add and delete rows without any problem.After add or delete, listbox gets updated. But when i update a particular column, updating is working fine in database but in the display page i.e in listbox updated value is not reflected. To see the changes in database i need to relaunch the application.
Can any one tell me how to bind listbox at run time.
To reflect the changes of the properties, you need to implement the INotifyPropertyChanged interface in your data model class.So whenever the value of a property is changed you call the NotifyPropertyChanged() function, which will tell the binded UI Element to update its value.
The ObservableCollection just ensures that the binded listbox gets updated when an item gets added or deleted from it.
In order to see changes in a particular item, the item class must implement the INotifyPropertyChanged interface!

Jqgrid Edit Form Change Event of Select doesnt fire when scrolling thorugh records

I have been following this example, http://www.ok-soft-gmbh.com/jqGrid/DependendSelects2.htm, as it is just what I need. I have got it working but it doesnt work when scrolling through records. If you bring up the form and scroll from a UK record to a US record, the list doesnt change. The onChange event only fires when the user selects from the select drop down.
Is there a way around this?
Thanks for your help.
James
My old demo uses 'change' event handler defined in the dataEvents property of the editoptions. In the dataEvents array one can define other event handlers.
You need just bind keyup to the column exactly like it's described in the answer. In the body of the event handler you can do the same actions as in the body of the 'change' event handler (you can place the code in a function and call it from the both handlers). In the way you should be able to solve the problem.
UPDATED: I updated the old answer and another one which was origin for the demo which you used. The new demo support the navigation buttons (the buttons to edit the 'next' or the 'previous' row) in the editing form.

Resources