Forcing custom item renders to refresh - apache-flex

I have an AdvancedDataGrid. One of the columns in the grid displayed with help of custom render. During the application run, I set another custom render to the same column. When I scroll data in the grid (change values for the custom renders) they display new view correctly.
I want that they dispaly new view automatically (when I set them): so I think I have to call them and tell tham to refresh rgeir views. Any idea how to do this?

Use invalidateList()

Related

Navigating between views in flex

I am trying to develop a mobile application using flex. Whenever I use 'navigator.popView()' to go back to the last view that was shown, it loads a new view on to the screen, instead of using the old one itself.
On the first screen, I have a TextInput into which I enter some text, when I push next and then push back the TextInput is empty. I want to retain the text in the TextInput.
It is advisable not to keep views in memory by default, so discarding old views and creating new ones is really the desired behavior. You should bind the content of your TextInput to a variable and store and retrieve only its text value.

Flex/QNX scrolling gallery

I was hoping someone could give me some guidance on building an image gallery which loads images dynamically for a PlayBook application.I've uploaded a quick mockup of what I am trying to achieve, I want to dynamically load images into a QNX TileList or Flex equivalent and as the user scrolls through the list I want to call another 'page' of images dynamically. I have already produced an example which uses a custom cell renderer to dynamically load images but I am having problems when I attempt to identify when the user has reached the end of the list.
I have tried using the lastVisibleItem property of the list while the user is scrolling to identify if the last item visible in the list is also last in the DataProvider (so I know when I need to call for more images) but when I add images to the DataProvider it takes me back to the start of the list, can anyone tell me the reason for this?
Any advice on a different approach or how to modify the TileList would be greatly appreciated.
The scrollPosition automatically gets reset to 0 when you update the dataProvider. I've done workarounds that store the current scrollPosition before updating the dataProvider and then re-set it after the update to the dataProvider has completed. Let me know if you need some code sample and I'll see if I can dig something up.
Another option would be to use dataPaging. Here is a good example of how to do that:
http://www.jamesward.com/2010/10/11/data-paging-in-flex-4/

Custom Controls and States

I've got an <mx:Button> in my application, I have 10 items in an XML Node. What I'd like to do is when the button is clicked show the next 5 XML Nodes.
How do I achieve this?
My code is as follows at the mo :
<mx:Button x="1380.65" y="582.65" styleName="rightButton"/>
The style is just setting the up / over and down states of the button. But I want it to function and show the XML nodes in groups of 5.
How are you displaying the first five items?
If you're displaying things in a list or DataGrid, I believe you can set the verticalScrollPosition to scroll the list via a button click.
If you are displaying items using TextInputs, custom component, or other non-renderer-based classes, you just need to manually write some code to update the display elements based on the currently displayed index and what is next.
Can you offer a running sample? That may us direct you!

DRUPAL: customize dropdown Views filter

I'm using Views dropdown filter (with tags) and it works great. However I would like to customize it in this way:
1 - remove button "Apply" and automatically update Views (at the moment I'm updating it with Ajax)
2- allow my customer to change the order of the dropdown items (specifying top items)
3- select multiple items without having to press the SHIFT button on keyboard (do not unselect other items if new items are selected)
http://dl.dropbox.com/u/72686/viewsFilter1.png
Let's suppose the items in the image are tags... something like this:
http://dl.dropbox.com/u/72686/viewsFilter2.png
thanks
Use jQuery to .hide() the Apply button, and then set a handler on the filter fields so that whenever one of them is changed (i.e., by the user), the Apply button registers a click.
Hmm, can't help with this one. You might be stuck writing a custom module that hooks into the Views API.
Sounds like the Sexy Exposed module would solve this problem?
I'm using the following code to keep the items selected and it works.
$('#edit-tid option').click(function() {
$(this).toggleClass("selected");
$("option:not(.selected)").removeAttr("selected");
$("option.selected").attr("selected", "selected");
//submit request
$('#edit-submit-Portfolio').click();
});
When a request is submitted the page is refreshed. The selected items are still selected (class="selected") but the javascript code do not keep them selected.. I don't understand why, since they have the correct class attribute.
So.. it doesn't work after refresh, even if the html code is the same (the same class="selected" attribute is assigned to the same items).
thanks
I've solved point 1 and 2, installing better exposed filter module from drupal website.

ListView Edit item Position

I have a Listview in my aspx page with Insert template and Edit template. and a Add New LinkButton.
When a user clicks on Add New LinkButton I am able to specify Insertitem Position so that the Insert TEmplate appears at the bottom of the listview. But how to I make the edititem template to appear at the bottom like the Inserttemplate
Its not available for the EditItemTemplate.
You'd have to actually save the original position, move the item in the data source itself (probably IList compatible), rebind the view, trigger editing on the new position, then swap the data item back to the original position.
I wouldn't recommend it. It's nonintuitive behaviour for users anyway; when I decide to edit something I should either be able to edit in place or edit on an entirely separate form. It's very rarely good UI design to shuffle items around while users are working on them, especially if you have any sort of scrolling/paging going on.

Resources