I have a controller Employee , in that i have the action detail . The detail action prints like the attached image.alt text http://www.freeimagehosting.net/uploads/7bfae5ce57.png
Suppose there is a save pdf button, i need to print this page as .pdf.. How can i do this ? Pls help me
Thanks in advance
Nisanth
Probably you would need to implement another view to Detail action, which would use all given information (as it does now for printing HTML) to create a PDF document. Then you could use Context Switch action helper to trigger using PDF View instead of what is displayed now.
Related
I'm trying to put TinyMCE on my website. I figured out how to get it to show up, but I'm lost on how to process the content. In their example, they just have a link that references the top of the page and clicking on it somehow magically causes their dump.php script to execute. I don't understand what's going on here. Here is the link:
http://www.tinymce.com/tryit/basic.php
The "Submit" button at the bottom is really a link in a span element with href="#". The form action is dump.php. I want to know how they configured this to run without an actual submit button. Any help in understanding this is greatly appreciated!
To Get Content From Tinymce You Can Use GetContent Method of Currently ActiveEditor Instance
tinyMCE.activeEditor.getContent();
method is used to getting Content .. to Set The Content
tinyMCE.activeEditor.setContent("I Want Text To Be in Tinymce");
to find a perticular element in tinymce get body and find element
var body = tinyMCE.activeEditor.getBody();
$(body).find("#elem_id")
to get a full html
tinyMCE.activeEditor.getDoc().documentElement.innerHTML
hope that helps ..
Since I use PHP, I found this which is also useful:
http://www.tinymce.com/wiki.php/TinyMCE3x:How-to_implement_TinyMCE_in_PHP
I'm new with the objective-c programming, but so far i manage to do a custom splitview which parse an rss link of news list in tableview on the rootview. When the link selected it will open the url in detailed view.The problem is i can only show the full html in uiwebview. What i want is that the detail view to display only text and the image (just like the BBC-News app), I tried the stringWithContentsOfURL and stripped the html tag, but it display the whole string from head to footer. I just wanted the body content. Is there anyway i can achieve that? Thanks in advance.
If you use the XMLParser then you should apply didStartElement method use this method and make a check for what ever part you want with simple syntax
if([elementName isEqualToString:#"body"])
use this type of if/else check to refine what ever that you want and save in an array according to your data Class then when you retrive data at the time of detail view use this array and tie with particular data whatever you want to show in your details view.
Like:-
label.text = array.title;
Hope this will help you...
I have an rss feed with only one item in it.I am trying to go straight to showing its details without having to go through a table view to do it.
I have a different rss feed working in my app that has multiple items. I have this working with a table view.I was looking online and all I could find was how to display a feed through a table view.
Does anyone know how to display the singular item from the feed in an app?
or of any online tutorials?
Any and all help much appreciated.
Just parse the feed and insted of showing in tableview ,show it in a label or textview .
I don't understand what u trying to ask through your question. It sounds simple but can you elaborate or give url of Rss feed links for understaning ur query...
If you've parsed your data already, you have it stored in a set of variables, right?
So now you just want a particular data to display in detail view for this if you use (UIWebView for DetailView) used this or a particular you wish to publish in the details view:-
– loadHTMLString:baseURL:
Sets the main page content and base URL.
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
Parameters
string
The content for the main page.
baseURL
The base URL for the content.
k...
I am new to grails and i got stuck with another issue.
I have two form's in my single GSP search.gsp and have two actions in my controller serach and results.
Now when i click on search button in one of my GSP file it takes me to search action which renders me search.gsp.At this time it should display me only first form in it. when i click results button in that form it will take me to results action.which has code line.
redirect(action:"search",params:[merchants:merchant,address:address])
this will take me back to search action but now i want to display 2nd form in search.gsp..
My problem is
how can i make search action once to run with out parameter's and once with parameter's?
how to determine in GSP from which action its been called?
with Advance thanks.
Depending on how different your forms are, you may want to consider having two separate GSP files (e.g., search.gsp and results.gsp). Use render(view:'action', model:[...]) to render a different view in the controller. This is often clearer that a single file with lots of conditionals.
Otherwise, you can find out the action using ${params.action}, so for example:
<g:if test="${params.action == 'search'}">
Text to show if the action is search
</g:if><g:else>
Text to show if the action is results
</g:else>
I would suggest you to separate your result page as template (_search.gsp), and render it from your result action. So that's how you will have different forms in different files.
By the way template is nothing but an ajax response, google it for detail about template in grails.
I have a one form tag inside my Index.aspx view. Index.aspx contains several partial views and using the same model to render them.
Now when any partial view is posting the form with submit button form is posted to OneActionMethod. But I want for some partial views to post form to OtherActionMethod.
How can I achieve this, without using action links, just with submit button in this particular patial view?
I`ve wrote the update in comments to this question. Answer is still not clear to me.
i believe a little javascript will get ur job done. u have to hook the submit event of the form and change the action attribute of the form. remember action is attribute of form not of a submit button. in jquery u can do something like
$("#myform").submit(function(){
if(isFirstSubmitButton){
$(this).attr(FirstAction);
}
else if(isSecondSubmitButton)
{
$(this).attr(SecondAction);
}
return true;
});
You sound like you are trying to program "WebForms" style in MVC.
Why do you have one big form enclosing all of your partials? Separate them into unique forms, and have each one post to it's appropriate action.
EDIT: With your further clarification, the only thing I can think of (aside from redesigning to use individual forms, which does lead to problems if they want to share data), is to post to a single action, and then route the request to a private member within the controller for ActionA or ActionB depending on a particular form element.