sharepoint list redirect with form data - sharepoint

Does anyone know the syntax, or the way to redirect a sharepoint "New Item Form" to a URL and pass values from the form as parameters in the URL?
So if the form as a "lastname" field, I would want the redirect to be something like http://path_to_other_page?name=lastname
I know I need to use something like:
onclick="javascript: {ddwrt:GenFireServerEvent(concat('__commit;__redirect={path_to_other_page.aspx?name=',/dsQueryResponse/Rows/Row/#LastName))}"
Except that's not working for me - I think the "/dsQueryResponse/Rows/Row/#LastName" is not correct - I was just trying to guess from other posts I had seen here...
Anyone?

That looks like something that would work on an edit form rather than a new form - that data is loaded when the page is loaded, not when it is submitted. To get the data in javascript you will need to access the textbox directly - jquery may be helpful.

I think you can use the SharePoint's build in Modal dialog (http://msdn.microsoft.com/en-us/library/ff410058(v=office.14).aspx). Within the modal dialog, you can callback function that will get the parameters from the form page.

Related

Kentico V9 Confirm form submission with javascript history.back

My repeater has enough data where I see my pagination. When I view the detail transformation for any items after the first page, the history.back() button gives me the form submission error.
Short of hard coding the back button, what's the easiest solution to avoid this?
I assume the "history.back()" is your javascript? The pagination is most likely occurring through postback, and any navigation back will require that same post data being sent.
One option is you can make the pagination not postback, but instead URL based. In the "Paging" area of your repeater, set the Mode to "QueryString" and set a querystring key (like "page"). Try that!
Otherwise you will need to do a window.location = "/The/Previous/Url" so it won't event attempt a postback and will simply direct them to the page, but your page you were last on will be lost.
Wrap the webpart in an update panel. In the webpart you can check the box to do this very easy and leave the rest of your configurations the way they are. If other elements on the page require a postback or rely on that webparts values then you may have to wrap all of them in an update panel.

A form link in a document - Domino Designer

A document is where you can view the details .
And a form is something like a document where you can put inputs, choose whatever you want in a dropdown, fill up textfields and etc.
How can I put a link that will redirect to a form, and can be filled up?
Do I need to use appendDocLink?
And I'm very new to Domino Designer, please bear with me.
Add a Button, Action, or hotspot to your form, and give it a formula like this:
#Command[Compose];"": ""; "TheNameOfYourFormGoesHere");
You can find the syntax of the Compose command here.
I recommand not explaining what a form or a document is, but only ask you question...
In order to responde to your question tel us "where you want to put a link" (web / notes client ?)
You don't need appendDoclink.
Look at http://www.ibm.com/developerworks/lotus/library/ls-Domino_URL_cheat_sheet/ you can make a (web) link to "redirect" user to create a new document = fill a form : http://Host/Database/FormName?OpenForm

Modifying sharepoint edit dialog

I have successfully created a feature in sharepoint that modifies the existing edit dialog and adds a custom button to it like this.
and I am aware that I can pass back data when the user clicks the custom button like this.
<CommandUIHandlers>
<CommandUIHandler Command="ActivateUser" CommandAction="/_layouts/MyFeature/MakeUserActive.aspx?ListID={ListId}&ItemID={ItemId}&ItemUrl={ItemUrl}&ListUrlDir={ListUrlDir}" />
</CommandUIHandlers>
As detailed here
I can now handle the list item and perform my required actions on it BUT given that this button has been added in the modify context (IE: Inside the sharepoint edit item dialog) what if you want to save changes to the data itself?
To me it seems like using your custom button would always mean losing any changes the user has made to the data. Is there a way around this?
Good question!
You actually already linked to the solution: Right now you are simply redirecting the user by using a URL as your CommandAction: CommandAction="/_layouts/MyFeature/MakeUserActive.aspx?ListID={ListId}&ItemID={ItemId}&ItemUrl={ItemUrl}&ListUrlDir={ListUrlDir}"
This if course redirects the user to another page without saving the current entry. What you want to do is use Javascript as linked in the MSDN article:
CommandAction="javascript:alert('here be dragons');"
You can either work the the SharePoint Javascript object model here and use something like SP.ListOperation.Selection.getSelectedItems(); or you could use complete custom code.
From your aspx page name I can see you want to "make a use active" (btw: wouldn't "ActivateUser.aspx" be nicer?). If this simply means setting a property in another list you could do that with the SharePoint OM, if it is some custom stuff you would need a webservice which you can call from JavaScript and "activate the user" like that. You can of course always access the current form and pass on the values the user entered. Or you could create a custom save button which does some stuff (activate user) before saving.
Lastly: You can also have postbacks in your custom button where you could do anything you'd like.

Change the action when clicking on a list item

I would like to change the destination URL when clicking on a list item / item title so it will no send me to view the item but will send me to a different URL base on the item.
I am not looking to replace the Links list but to use the list title as URL query filter.
Thanks
You will need to do it using the custom Page / Customize the View Page in the SharePoint Designed. Please refer to this article on how you can achieve it using the SPGridView control
I'm not totally clear on what you'd like to do (maybe screenshot mock ups would help?), but here's some general advice.
If you want to change the behaviour of a control then investigate the properties of the control as kusek has suggested. If the properties don't do what you need then try overriding the control to change what is rendered.
If the above doesn't work out or you want to change how these links render no matter where they appear on the page, then you need to look at a page-level solution. The most common are jQuery that can dynamically replace the URLs with JavaScript, or an HTTP module which is much more low level and will actually alter the HTML rendered to the page.
Hope this helps.

how to hide querystring in asp.net content page?

i have master-content page scenario.I have a link button on content page. that redirects to other page. but with redirection it carrying the parameters. I want to hide this querystring parameters .I tried with POST() in Form tag of master page . but that does not affecting. What have to do ?
There are many ways to carry values from one page to the next. You could store the values in some Session type container, or add them as hidden fields.
If you want a ugly way, you could use a good old frameset.
POST is the answer, but we'll need some code to help more effectively

Resources