Prototype of a new template engine for Asp.Net MVC framework that respects HTML and uses CSS-like syntax for model binding....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.
Is there a way to pass data from a View to a Controller so that I can get the data and create a .xls file on the fly?
Any help or thoughts are greatly appreciated.
Greg
One of the most enjoyable things about SQLBits is reading all the blog posts/reviews after the event. We are normally fortunate enough not to have pissed anyone off and so the posts are generally positive. Most pieces are from attendees however this piece is from a wife of a sponsor http://iknowmarketing.wordpress.com/2012/04/02/events-community-vs-commercial/ . Its a nice piece for us as it highlights how we work and that how we focus on making the event personal for all those involved. We deal...(read more)
Could someone give few tips and/or examples how Controller Plugins and Action Helpers are different? Are there situations where particular task could be accomplished with one but not another? For me they both look more or less the same and I'm often having trouble having to decide when to use what... Are there any big differences?
Hello (Sorry for my bad English)
Is it bad practice to assign object to view and call its methods in there?
I use smarty as my template engine.
In my controller I could do like this
1#
$this->view->assign("name", $this->model->getName);
and in my view
<p>{$name}</p>
OR
2#
$this->view->assign("Object", $this->model);
and in my view
<p>{$Report->getName()}</p>
Well my biggest problem is that I have to handle a big amount of data coming out from the MySQL and I thought that if I would made a method that would print out the data while looping mysql_fetch_row. Well at least I know that using html-tags in the model is a bad thing to do.
So I would assign the object to the view to get the result to the right position on the page..
Reading a mysql-result to an array first may cause memory problems am I right? So what is the solution doing things MVC style..
And yes Im using a framework of my own.
Few SEO consultants exchange links mutually for the purpose of increasing the links count without considering the quality of the websites. Google stands against reciprocal link building in non relevant sites.
Hello,
I am using rails 3:
I would like to render a portion of view which is build by a 'notification' method in message class
so I've add in my application.html.erb :
<li><%= render :action => "notification", :controller => "messages" %></li>
The goal of my file notification.html.erb is to display in a red circle the number of notifications in all my pages.
I don't think I am in the good way, any ideas ?
Thanks all :)
I'm using Rails with jQuery, and I'm working on a page for a simple site that prints each record to a table. The only editable field for each record is a checkbox. My goal is that every time a checkbox is changed, an ajax request updates that boolean attribute for the record (i.e., no submit button).
My view code:
<td>
<% form_remote_tag :url => admin_update_path, :html => { :id => "form#{lead.id}" } do %>
<%= hidden_field :lead, :id, :value => lead.id %>
<%= check_box :lead, :contacted, :id => "checkbox"+lead.id.to_s, :checked => lead.contacted, :onchange => "$('#form#{lead.id}').submit();" %>
<% end %>
</td>
In my routes.rb, admin_update_path is defined by
map.admin_update 'update', :controller => "admin", :action => "update", :method => :post
I also have an RJS template to render back an update. The contents of this file is currently just for testing (I just wanted to see if it worked, this will not be the ultimate functionality on a successful save)...
page << "$('#checkbox#{@lead.id}').hide();"
When clicked, the ajax request is successfully sent, with the correct params, and the action on the controller can retrieve the record and update it just fine. The problem is that it doesn't send back the JS; it changes the page in the browser and renders the generated Javascript as plain text rather than executing it in-place.
Rails does some behind-the-scenes stuff to figure out if the incoming request is an ajax call, and I can't figure out why it's interpreting the incoming request as a regular web request as opposed to an ajax request.
I may be missing something extremely simple here, but I've kind-of burned myself out looking so I thought I'd ask for another pair of eyes. Thanks in advance for any info!
at the top of my controller, outside of any method, I have
@@javascript_is_disabled = false
and I have methods that that the view calls and invokes something like this
@@javascript_is_disabled = params[:javascript_disabled]
but when I need the @@javascript_is_disabled in completely different method.. it is always false.
I know it changes in the method with params args... cause those methods behave differently, and appropriately
And ideas?
In my application I have a custom view which requires some text input. As the view in itself doesn't contain any actual views (it's a Surface with custom drawing being done), I have a FrameLayout which contains the custom view and underneath it an EditText -view. When the user does a specific action, the custom view is hidden and the EditText takes over for user input. This works fine, but android:imeOptions seem to be ignored for this view. I'm currently doing this:
InputMethodManager inputMethodManager = (InputMethodManager)parent.getSystemService(Context.INPUT_METHOD_SERVICE);
EditText t = (EditText)parent.findViewById(R.id.DummyEditor);
t.setImeOptions(EditorInfo.IME_ACTION_DONE);
inputMethodManager.showSoftInput(t, 0, new ResultReceiver(mHandler) {
@Override
protected void onReceiveResult(
int resultCode, Bundle resultData) {
// We're done
System.out.println("Editing done : " +
((EditText)parent.findViewById(R.id.DummyEditor)).getText());
}
}
);
It seems that the setImeOptions(EditorInfo.IME_ACTION_DONE) has no effect. I've also tried adding the option to the layout XML with android:imeOptions="actionDone". No help.
Any ideas?
Hi there
So lets suppose we have an action in a controller that looks a bit like this:
public ViewResult SomeAction(int id)
{
var data = _someService.GetData(id);
...
//create new view model based on the data here
return View(viewModel);
}
What I m trying to figure out is the best way to render a diferent view based on the type fo the data.
the "_someService.GetData method returns an data that knows its out type (ie not only you can do typeof(data) but also you can do data.DataType and you ll get an enum value
so I could achieve what I m trying to do doing something kinda like this
public ViewResult SomeAction(int id)
{
var data = _someService.GetData(id);
//I m mapping fields to the viewModel here
var viewModel = GetViewModel(data);
swtich(data.DataType)
case DataType.TypeOne: return View("TypeOne", viewModel); break;
...
}
But this does not seem to be the nicest way, (I dont event know if it would work)
Is this the way to go?
Should I use some sort of RenderPartial Aproach? after all , waht will change in the view is mostly the order of the data (ie the rest of the view would be quite similar)
Cheers
Hi,
I've a file in the config directory, let's say my_policy.txt.
I want to use the content of that file in my controller like a simple string.
@policy = #content of /config/my_policy.txt
How to achieve that goal, does rails provide it's own way to do that?
Thanks
Is there a way to pass data from a View to a Controller so that I can get the data and create a .xls file on the fly?
Any help or thoughts are greatly appreciated.
Greg
Within my site I have controller specific CSS files in addition to my master css file. For example
CSS/
Prodcuts/
product.css
...
Blog/
blog.css
...
masterStyle.css
Where masterStyle.css is the master css file. What I want to do is when the user hits http://www.example.com/Products/ only mySite.css and all css files under Products get included. What is the best way to go about doing this?
i m suffering with Passing values from javascript function to controller in cakephp and get using $_POST.
i have tried it by different ways but didn't get success please suggest........
SQL Views are essential for the database developer. However, it is common to see them misued, or neglected. Joe Celko tackles an introduction to the subject, but there is something about the topic that makes it likely that even the experienced developer will find out something new from reading it.
Get smart with SQL Backup ProGet faster, smaller backups with integrated verification.Quickly and easily DBCC CHECKDB your backups.
Learn more.
Im new to Android and I tried a tutorial for camera API. The tutorial works fine. When I use HTC desire I can see the camera view in both portrait and landscape, but when I use Samsung Galaxy I get a the camera view only in a landscaped view. I tried the following code to rotate the camera view as well..
Camera.Parameters parameters = camera.getParameters();
parameters.setRotation(90);
then the camera doesn't work as expected. (screen splits into 4 and not clear).
Does anyone have an idea for this issue ?
Thanks.
Hi
In my mode I am selecting a field as
$query1 = $this->db->query("SELECT dPassword
FROM tbl_login
WHERE dEmailID='[email protected]'");
How to return dpassword as a variable to my controller
I tried this way return dpassword;
The question may be simple to some others, but I have been struggling with this for a while. The app I want would be like this: first scene/view with two big buttons (no toolbar item), click each one to get into two new scenes. So totally three scenes. In Xcode, what application should I choose? And in storyboard how/should I drag/draw? Thanks.
Update:
thanks for the link, the big-number-user.
I actually read that tutorial before I asked.
A little update on what I got so far:
1, I selected "single view", so there's viewcontroller 1 (VC1) in the storyboard.
2, dragged a navigation controller (NC), and move the initial view arrow pointing to NC
3, control-drag to link NC and VC1, selected "relationship segue root viewcontroller" when some small dialog popup. IS THIS CORRECT?
4, created two additional VC, VC3 and VC4, control-drag link each to NC. selected "push", IS THIS CORRECT?
5, in VC1, I added two buttons, showVC3 and showVC4. NOW I DON'T KNOW how to add IBAction to button showVC3 and showVC4. I tried to control-drag it to ViewController.m file @interface and @end section, but failed.
What should I do next?
Hi, I'm wondering about one thing - let's assume that the user clicks a button, and the asynch controller's action is invoked. What happens, when the asynchronous action takes e.g. 10 seconds? The user has to wait 10 seconds to view the result of the action? If so, are the asynch controllers really helpful ?
Joe Celko delves into the main uses of views, explains how the WITH CHECK OPTION works, and demonstrates how the INSTEAD OF trigger can be used in those cases where views cannot be updatable.
What are your servers really trying to tell you?
Find out with new SQL Monitor 3.0, an easy-to-use tool built for no-nonsense database professionals.For effortless insights into SQL Server, download a free trial today.
<b>Linux.com:</b> "If you work in an educational or training environment where you instruct users on the ins and outs of using computers, or you need to be able to (for whatever reason) control the PC user's use of a machine, the tools available are often quite expensive or quite difficult to use. Neither is the case in the Linux environment, where tools like iTalc are available."