I want to add simple list/combo box with action script 3 . but i have not found anything in internet.
Can anyone give me sough rough idea with some dummy values
thanks
I writing a Struts 2 application. The main operation I'm trying now is to read from the action call a List and display it in the form of a table in the JSP.
I've searched the net and check out a lot of examples, but in vain.
Can someone point out to a good working example?
Hi I'm using struts 2.
I'm trying to reload a target div from a javascript by using jquery to target the div and a struts action that loads the content.
Does anyone know how to do this?
The problem is how I use (javascript) jquery to do this.
BR, Tobias
Hi,
why should i use a component instead of an action that renders a partial?
If actions can render partials, when is better using components?
Give me light about it..
Javi
I am building a sample app to demonstrate SearchView with filter and other Action Bar items.
I am able to successfully run this app on 4.2(Nexus 7). But it is not running on 2.3. I googled about the issue. Came to know that i should use SherLock Action bar. I just went to http://actionbarsherlock.com/download.html, downloaded the zip file and added the library as informed in the video: http://www.youtube.com/watch?v=4GJ6yY1lNNY&feature=player_embedde by WiseManDesigns. But still I am unable to figure out the issue.
Here is my code:
SearchViewActionBar.java
public class SearchViewActionBar extends Activity implements SearchView.OnQueryTextListener
{
private SearchView mSearchView;
private TextView mStatusView;
int mSortMode = -1;
private ListView mListView;
private ArrayAdapter<String> mAdapter;
protected CharSequence[] _options = { "Wild Life", "River", "Hill Station", "Temple", "Bird Sanctuary", "Hill", "Amusement Park"};
protected boolean[] _selections = new boolean[ _options.length ];
private final String[] mStrings = Cheeses.sCheeseStrings;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
setContentView(R.layout.activity_main);
// mStatusView = (TextView) findViewById(R.id.status_text);
// mSearchView = (SearchView) findViewById(R.id.search_view);
mListView = (ListView) findViewById(R.id.list_view);
mListView.setAdapter(mAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,
mStrings));
mListView.setTextFilterEnabled(true);
//setupSearchView();
}
private void setupSearchView() {
mSearchView.setIconifiedByDefault(true);
mSearchView.setOnQueryTextListener(this);
mSearchView.setSubmitButtonEnabled(false);
//mSearchView.setQueryHint(getString(R.string.cheese_hunt_hint));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.searchview_in_menu, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
mSearchView = (SearchView) searchItem.getActionView();
//setupSearchView(searchItem);
setupSearchView();
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu menu)
{
if (mSortMode != -1)
{
Drawable icon = menu.findItem(mSortMode).getIcon();
menu.findItem(R.id.action_sort).setIcon(icon);
}
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
String c="Category";
String s=(String) item.getTitle();
if(s.equals(c))
{
System.out.println("same");
showDialog( 0 );
}
//System.out.println(s);
Toast.makeText(this, "Selected Item: " + item.getTitle(), Toast.LENGTH_SHORT).show();
return true;
}
protected Dialog onCreateDialog( int id )
{
return
new AlertDialog.Builder( this )
.setTitle( "Category" )
.setMultiChoiceItems( _options, _selections, new DialogSelectionClickHandler() )
.setPositiveButton( "SAVE", new DialogButtonClickHandler() )
.create();
}
public class DialogSelectionClickHandler implements DialogInterface.OnMultiChoiceClickListener
{
public void onClick( DialogInterface dialog, int clicked, boolean selected )
{
Log.i( "ME", _options[ clicked ] + " selected: " + selected );
}
}
public class DialogButtonClickHandler implements DialogInterface.OnClickListener
{
public void onClick( DialogInterface dialog, int clicked )
{
switch( clicked )
{
case DialogInterface.BUTTON_POSITIVE:
printSelectedPlanets();
break;
}
}
}
protected void printSelectedPlanets()
{
for( int i = 0; i < _options.length; i++ ){
Log.i( "ME", _options[ i ] + " selected: " + _selections[i] );
}
}
public void onSort(MenuItem item)
{
mSortMode = item.getItemId();
invalidateOptionsMenu();
}
public boolean onQueryTextChange(String newText) {
if (TextUtils.isEmpty(newText)) {
mListView.clearTextFilter();
} else {
mListView.setFilterText(newText.toString());
}
return true;
}
public boolean onQueryTextSubmit(String query)
{
mStatusView.setText("Query = " + query + " : submitted");
return false;
}
public boolean onClose()
{
mStatusView.setText("Closed!");
return false;
}
protected boolean isAlwaysExpanded()
{
return false;
}
}
The weird thing is that my app was working perfectly on Sat, and when I check it out on Monday (after doing nothing to it) I kept getting this problem:
This behaviour is only happening on my production server. When I try to login or create a new user or do something that interacts with a form I am getting an unknown action error. A simple retrieval of rows does not throw this error however.
I don't have all CRUD operations in most of my controllers because it's not necessary - but Rails always looks for the one that doesn't exist - it seams so anyway.
If I make a mistake in the form that would normally throw a validation message to the user it will throw this error too, does that mean it has something to do with the model too (I'm not too Rails experienced and didn't know if that would be the case or not)?
This is a general error I am getting - I have super_exception_notifier gem installed, so that's what all the extra params are.
Processing SessionsController#new (for OMITTED at 2010-04-12 09:11:12) [GET]
Rendering template within layouts/application
Rendering sessions/new
Completed in 3ms (View: 2, DB: 0) | 200 OK [http://OMITTED.com/session/new]
Processing SessionsController#show (for OMITTED at 2010-04-12 09:11:14) [GET]
ActionController::UnknownAction (No action responded to show. Actions: create, destroy, error_class_status_codes, error_class_status_codes=, error_layout, error_layout=, exception_notifiable_notification_level, exception_notifiable_notification_level=, exception_notifiable_silent_exceptions, exception_notifiable_silent_exceptions=, exception_notifiable_verbose, exception_notifiable_verbose=, http_status_codes, http_status_codes=, and new):
dragonfly (0.5.3) lib/dragonfly/middleware.rb:13:in `call'
passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.9) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:400:in `start_request_handler'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:351:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:349:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:209:in `start'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
This is what one of my forms looks like (nothing special)
<% form_tag session_path do -%>
<p><%= label_tag 'Username' %><br />
<%= text_field_tag 'login', @login %></p>
<p><%= label_tag 'password' %><br/>
<%= password_field_tag 'password', nil %></p>
<p><%= label_tag 'remember_me', 'Remember me' %>
<%= check_box_tag 'remember_me', '1', @remember_me %></p>
<p><%= submit_tag 'Log in' %></p>
<% end -%>
It looks like dragonfly is the culprit doesn't it, here's the section from the gem files it says is being naughty:
module Dragonfly
class Middleware
def initialize(app, dragonfly_app_name)
@app = app
@dragonfly_app_name = dragonfly_app_name
end
def call(env)
response = endpoint.call(env)
if response[0] == 404
13 -->> @app.call(env)
else
response
end
end
I don't know what goes on behind the scenes here so I probably haven't been looking in the right place to fix this issue. Like I said it only throws this in a production environment, which guess is what the 'env' variable is referencing.
Thank you for your time! I've spent nearly my whole day trying to figure this out! :(
Cocos2d-android - I have an animation which has 5 Frames they are close cropped images. Now I want Sprite to do animation as well as Move in X direction.i.e. I have a player running which gets collided with obstacle and falls down .. Now I want sprite to run animation as well as moveBy in -ve x direction
gameOverAnimation =CCSprite.sprite("gmovr00")
gameOverAnimation.setAnchorPoint(0, 0);
gameOverAnimation.setPosition(340.0f, 200.0f);
addChild(gameOverAnimation,10);
CCIntervalAction action1 = CCAnimate.action(mEndAnimation, false);
action1.setDuration(1.0f);
CCIntervalAction delay = CCDelayTime.action(0.68f);
CCMoveBy actionBy = CCMoveBy.action(1.0f, CGPoint.ccp(-340,0));
CCIntervalAction seq1 = CCSpawn.actions(action1,actionBy);
//CCSpawn spawn = CCSpawn.actions(action1, actionBy);
CCSequence sequence1 = CCSequence.actions(seq1,CCCallFuncN.action(this,"gameOver"));
gameOverAnimation.runAction(sequence1);
Above code makes animation run first then moved in y direction
Thanks for the help..
And can some one explaing me the concept of time with frame Animation or good example ?
OK, so I took for granted some imaginative uses of WaitForAll but lacking that, here is how I am using. First, I have a nice little class called Parallel that allows me to spin together a list of tasks (actions) and then use WaitForAll, so here it is, WaitForAll's 15 minutes of fame ...
First Parallel that allows me to spin together several Action delegates to execute, well in parallel.
public static class Parallel
{
public static ParallelQuery Task(Action action)
{
return new Action[] { action }.AsParallel();
}
public static ParallelQuery> Task(Action action)
{
return new Action[] { action }.AsParallel();
}
public static ParallelQuery Task(this ParallelQuery actions, Action action)
{
var list = new List(actions);
list.Add(action);
return list.AsParallel();
}
public static ParallelQuery> Task(this ParallelQuery> actions, Action action)
{
var list = new List>(actions);
list.Add(action);
return list.AsParallel();
}
}
Next, this is an example usage from an app I'm working on that just is rendering some basic computer information via WMI and performance counters. The WMI calls can be expensive given the distance and link speed of some of the computers it will be trying to communicate with. This is the actual MVC action from my controller to return the data for an individual computer.
public PartialViewResult Detail(string computerName)
{
var computer = this.Computers.Get(computerName);
var perf = Factory.GetInstance();
var detail = new ComputerDetailViewModel()
{
Computer = computer
};
try
{
var work = Parallel
.Task(delegate
{
// Win32_ComputerSystem
var key = computer.Name + "_Win32_ComputerSystem";
var system = this.Cache.Get(key);
if (system == null)
{
using (var impersonation = computer.ImpersonateElevatedIdentity())
{
system = computer.GetWmiContext().GetInstances().Single();
}
this.Cache.Set(key, system);
}
detail.TotalMemory = system.TotalPhysicalMemory;
detail.Manufacturer = system.Manufacturer;
detail.Model = system.Model;
detail.NumberOfProcessors = system.NumberOfProcessors;
})
.Task(delegate
{
// Win32_OperatingSystem
var key = computer.Name + "_Win32_OperatingSystem";
var os = this.Cache.Get(key);
if (os == null)
{
using (var impersonation = computer.ImpersonateElevatedIdentity())
{
os = computer.GetWmiContext().GetInstances().Single();
}
this.Cache.Set(key, os);
}
detail.OperatingSystem = os.Caption;
detail.OSVersion = os.Version;
})
// Performance Counters
.Task(delegate
{
using (var impersonation = computer.ImpersonateElevatedIdentity())
{
detail.AvailableBytes = perf.GetSample(computer, "Memory", "Available Bytes");
}
})
.Task(delegate
{
using (var impersonation = computer.ImpersonateElevatedIdentity())
{
detail.TotalProcessorUtilization = perf.GetValue(computer, "Processor", "% Processor Time", "_Total");
}
}).WithExecutionMode(ParallelExecutionMode.ForceParallelism);
if (!work.WaitForAll(TimeSpan.FromSeconds(15), task => task()))
{
return PartialView("Timeout");
}
}
catch (Exception ex)
{
this.LogException(ex);
return PartialView("Error.ascx");
}
return PartialView(detail);
}
hi, i defined this route:
context.MapRoute("SearchEngineWebSearch", "{culture}/{style}/search/web/{query}/{index}/{size}",
new
{
controller = "search",
action = "web",
query = "",
index = 0,
size = 5
},
new
{
index = new UInt32RouteConstraint(),
size = new UInt32RouteConstraint()
});
and form to post parameter to that:
<% using (Html.BeginRouteForm("SearchEngineWebSearch", FormMethod.Post))
{ %>
<input name="query" type="text" value="<%: ViewData["Query"]%>" class="search-field" />
<input type="submit" value="Search" class="search-button" />
<%} %>
but form rendered with problem. why?
thanks in advance ;)
Hi All,
I am a .NET programmer working with a Flash designer on a project. The design is that they will create a flash UI (implemented with AS2) to present a questionnaire. After it is completed by an end user, the will send me (a .net web service of some form) the answers to the questionnaire, I will perform a calculation, and I will send a response back (the response will likely be a single integer, though it may be a touple of (integer score, string description).
Neither myself nor the designer is knowledgeable of Action Script. Does anyone have a snippet for such web service calls in AS2? Are there any soap libraries for AS2 that we could use, or should I expose a RESTful interface? Can it be as simple as having the designer concat the questionnaire answers into the query string of the service URL? What would be a typical data format for my response (xml, json, plain text)
Thanks in advance for your help.
Frank
Hi,
I'm using Wix to create an installer for a Silverlight application.
When I install the application the virtual directory that has been created has the execute permission checked for the *.dll handler mapping (IIS 7 Web site VDir Handler Mappings *.dll Edit Feature Permissions Execute).
When I browse to the application it cannot download its satellite assemblies in ClientBin. If I uncheck the execute permission in IIS the handler becomes disabled and the application now works.
I don't want to have to do this manually. Does anybody know how to modify the handler mapping permissions in Wix or a Custom Action?
Thanks
I have these 2 routes :
routes.MapRoute("Agenda", ConfigurationManager.AppSettings["eventsUrl"] + "/{year}/{month}", MVC.Events.Index(), new { year = DateTime.Now.Year, month = DateTime.Now.Month });
routes.MapRoute("AgendaDetail", ConfigurationManager.AppSettings["eventsUrl"] + "/{year}/{month}/{day}", MVC.Events.Detail(), new { year = DateTime.Now.Year, month = DateTime.Now.Month, day = DateTime.Now.Day });
And it work perfectly with this code :
<a href="<%= Url.Action(MVC.Events.Detail(Model.EventsModel.PreviousDay.Year, Model.EventsModel.PreviousDay.Month, Model.EventsModel.PreviousDay.Day))%>" title="<%= Model.EventsModel.PreviousDay.ToShortDateString() %>"><img src="<%= Links.Content.images.contenu.calendrier.grand.mois_precedent_png %>" alt="événement précédent" /></a>
Except when I get to do the link to today, if it's today, il will point only to www.myurl.com/agenda, witch is the value of CnfigurationManager.AppSettings["eventsUrl"]. What am I doing wrong? It's like if it's today, it point bak to the default agenda...
Thanks for the help!
Hello. I am trying to submit a form with method GET and action "index.php?id=3". The problem is that it jumps to the url specified but it cuts off "?id=3" part. I need that so I can identify an user. Any ideas on how I could submit the whole url ? I don't want to change this method, by design is much complex than I told you here. It's a simple version.
Any ideas ? Thanks.
Doing some development in Flash Builder 4 using Action Script 3.0. I'm trying to have some code run each time the form is displayed. The form is not always recreated, but sometimes hidden and reused. Visual Basic used to have an Activate event that does similar to what I want.
I tried Render, but that fires every time the form changes (via click, text-edit, etc.)
We tried the FlexEvent.ADD, but it only fires when the form is first created, same as creation_complete.
Is there a good resource that shows the form "life cycle" and all the events and when they are fired and in what order?
TIA!
NOTE: I'm trying to get our forms to close when the ESC is pressed.
Hey fellas,
I've got a custom view inside of a UIBarButtonItem, set by calling -initWithCustomView.
OK, so the view renders fine, but when I tap it, it doesn't call the method that I set as the UIBarButtonItem's action property.
Oh, and I have verified that my -deselectAll method works fine.
Here's my code:
UIImageView *SOCImageView = [[ UIImageView alloc ] initWithImage:[ UIImage imageNamed: @"cancel_wide.png" ] ];
SOItem.leftBarButtonItem = [[ UIBarButtonItem alloc ] initWithCustomView: SOCImageView ];
[ SOCImageView release ];
[ SOItem.leftBarButtonItem setTarget: self ];
[ SOItem.leftBarButtonItem setAction: @selector( deselectAll ) ];
Thanks a million
I have a component done in JSF 1.x, this component has a command button as follows
<h:commandButton ... action="#{templateController.next}" />
Where templateController was passed as an EL binding and can be any object that implements a certain interface. The generic implementation of next() was just executing code and then returning an empty string causing the same page to refresh:
public String next() {
.....
return "";
}
Now I am trying to port that component to JSF 2, my problem is that an empty string doesn't cause the same page to refresh anymore, instead, the framework tries to redirect to a page called ".jsf" i.e it just appends .jsf to whatever the outcome is. My question is how to return an outcome that causes the current page to refresh. My component is generic and I don't know before hand the name of the page it is going to be used on.
Thanks
i have a master page and a child aspx page, coneected to each other. the master page has the form in it. Now the child page has checkboxes, whose value i would like to pass to another child page with same master page behind it.
Can i change the action=abc.aspx and method=post?
How can i send all the checkbox values (checkbox.text = [email protected]) to the next page?
there are lots of these values that need to pass to nex tpage.
I saw people asking about best book for learning spring, and I came across manning.spring in action was recommended most of the time so I decided to give it a go.
The thing is the author offers some pretty reasonable explanations, puzzle by puzzle it gets in your head, than you just need to code it and you're done, you get it(this is how I work don't know about the others).
When it comes to the code its very disapointing, I went trought the Knight example like 2 or 3 times by now and I see its incorrect in the book, I mean its hard already for people eager to learn and why not a note somewhere in the book like pseudo-code or something.
The knight example in the first chapter is missing two classes QuestFailedException and HolyGrail I mean other people must have noticed this, why is everyone recommending this book without saying at least it has some errors(like many others do), was anyone actually been able to compile and this first chapter example?
Hi.
I have a C# ASP.NET MVC project but my controllers are written in F#.
For some reason, the following code doesn't work properly.
namespace MvcApplication8.Controllers
open System.Web.Mvc
[<HandleError>]
type ImageController() =
inherit Controller()
member x.Index (i : int) : ActionResult =
x.Response.Write i
x.View() :> ActionResult
The parameter of the action is seemingly ignored.
http://localhost:56631/Image/Index/1
=
The parameters dictionary contains a null entry for parameter 'i' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Index(Int32)' in 'MvcApplication8.Controllers.ImageController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
The controller otherwise works fine. I know that plenty of people have written F# mvc code, so, any ideas where I'm going wrong?
I am designing a page, with tiny portlets. Now, I personally like my actions on the right side, yet I wonder if there are methodologies that are targeted about usability. After all, most applications are aimed at the user. What about yourself? Do you prefer information to be on top, on the left or on the right? I've you need to take some sort of action, do you prefer buttons on the left?
References to good books and webpages are very welcome!
Is that possible to make a UIToolbarButton pass an object to its target by using some exoteric method (as it seems not to be possible using regular button use)?
I mean something like
UIBarButtonItem *Button = [[UIBarButtonItem alloc] initWithImage:buttonImage
style:UIBarButtonItemStylePlain target:self action:@selector(doSomething:) **withObject:usingThis**];
I know I can trigger a method that will launch the full method with the object, but for the sake of elegance I was trying to minimize the code... I suspect it is not possible, but as you guys out there are insanely good you may come with an transcendental answer... who knows...
I'm attempting to provide a confirmation link in my user welcome email and I'm getting the following Rails error:
Need controller and action!
It makes a fuss about this line:
<p>Please take a moment to activate your account by going to:
<%= link_to confirm_user_url(:id => @user.confirmation_code) %>.</p>
In my development.rb environment, I have the following line:
config.action_mailer.default_url_options = {
:host => "localhost", :port => 3000
}
There's no problem with the @user variable. I've tested the email with things like @user.username and @user.confirmation_code. I'm only getting trouble with url_for and named routes like confirm_user_url.
When I check my routes with rake routes, confirm_user shows up, so it's not an issue with the named route not existing.
I can't seem to figure it out. What gives?
Yes, Im having a little edit profile page, index.php?mode=profile. Lets take the username in the editprofile form as example. The username is already in the username-field. So i changed from "Peter" to "Tom" and press save.
The action is ?mode=profile&edit=true. So now when i have pressed save it has updated the column in the db from Peter to Tom. But this field keeps having the value "Peter" until if i do press refresh (or f5), then "Tom" will appear. Like it hasnt updated in the database anything, although it did but it still shows Peter until next refresh.. like it caches, but it shouldnt cache nothing?
Any help on this? Is it because its on the same "page" / file? what can i do
I would like to remove the isolated storage folders that are created by a .NET application when using My.Settings etc. The setting files are stored in a location like
C:\Users\%Username%\AppData\Roaming\App\App.exe_Url_r0q1rvlnrqsgjkcosowa0vckbjarici4
As per this question StackOverflow: Removing files when uninstalling Wix I can uninstall a folder using:
<Directory Id="AppDataFolder" Name="AppDataFolder">
<Directory Id="MyAppFolder" Name="My">
<Component Id="MyAppFolder" Guid="YOURGUID-7A34-4085-A8B0-8B7051905B24">
<CreateFolder />
<RemoveFile Id="PurgeAppFolder" Name="*.*" On="uninstall" />
</Component>
</Directory>
</Directory>
<!-- LocalAppDataFolder-->
This doesn't support sub-folders etc. Is the only option a custom .NET action or is there a more simple approach for removing these .NET generated setting folders?