A minor misconception in mapping struts 1.2 - struts

What does this following code do?
mapping.getInputForward()
Does is sends the control back to the struts-config file?
Does it send the control to the action form?
Thanks.

It returns the forward names as the "input" property of the action in question.
It can be used to return to a form page on validation failure, for example.

Related

DNN get params in view are not available in edit

I am creating a dnn module. The content depends on the param in the url.
I want to be able to edit this content in the 'edit content' mode. However when i go to edit content the param in the url is no longer accessible because it is the parent document. How do i go about passing this value from the view.ascx to the edit.ascx?
Try storing the param in cookies or localstorage. Then you should be able to access it. Of course the user will be able to modify it but you can do a check that the user has not modified it by storing a server side encryption or somthing like that.
A workaround is to have a field where the user enters this parameter. But i know this isn't a very good solution. I am guessing that you will have to override the dotnetnuke core to do this (yes i know it sucks).
I hope I am understanding the question properly.
To pass parameters from your View to Edit controls, you should first make sure they are registered properly in the module definition. You default View should have an empty controlkey and your Edit should be registered with a control key, for example "addedit".
When creating a link between your view control and edit control, use the EditUrl() method of PortalModuleBase. When passing a parameter, for example an id of the item you want to load into your edit control, you can pass them as arguments in the EditUr method.
Example (in my view.ascx.cs):
lnkEdit.NavigateUrl = EditUrl("id", "16", "addedit");
This will assign a module view link to the edit.ascx (assuming the controlkey in the definition is addedit) passing in a url parameter "id" with value 16.
See my DNN Module Views tutorial for a complete lesson on how to do DNN module views and navigation.
http://www.dnnhero.com/Premium/Tutorial/tabid/259/ArticleID/204/Introduction-and-Module-Definition-basics-in-DNN-Part-1-6.aspx

Retrieve the configuration parameter in adobe livecycle

I have set a configuration parameter containing a path in adobe livecycle process. I want that path to be reflected in a fragment source file property of an xdp. Is there a way to retrieve the value of configuration parameter in adobe live cycle designer? will it be done using javascript in designer ?
If I understand your question correctly, here is what you are doing:
In a LiveCycle process orchestration, you are reading in a configuration parameter.
You have a form with a fragment embedded in it and you would like to read in a the configuration parameter.
Your form is probably saved on the LiveCycle server.
Since the process orchestrations are called at runtime, you can't call a variable/configuration parameter during design time. If you want to read it in at runtime, I would suggest the following approach:
Add a setValue component that injects the runtime parameter into a hidden field ( if you just need to read the value and perform some calculation based on it) or a visible field.
Test your rendered from to ensure that the variable value is injected correctly into the template.
Do let me know if you have any other questions.
Thanks,
Armaghan.

Persist CMultiFileUpload selection through input validation

I'm using a CMultiFileUpload control in one of my forms like this:
$this->widget('CMultiFileUpload', array(
'name' => 'neueAnhaenge',
));
When input validation for some other form element fails and the input form is rendered again, a previous selection in this control is gone (as expected).
How do I repopulate this control, what do I have to do in my controller, is there a way to prepopulate this?
Thanks in advance.
For file fields it is rather impossible to reset the values assigned to it after it has been sent to the server.
One way to solve this would be to get the uploaded files, store them temporarily on the server and modify the form so it sends a reference to the file on the server.
A much better way would be to use Ajax or Client side validation of form fields to ensure no validation error occures when form has been sent. You can enable these options for CActiveForm: $enableClientValidation and $enableAjaxValidation.

How to add code to SharePoint 2010 master page

I have created custom master page with custom elements included according to this link: http://msdn.microsoft.com/en-us/library/gg447066.aspx
I want to have a Suggestions form in header area where users can leave their comments/suggestions on what functionality they would like to have.
For example:
User goes to company team site and notes that it would be great to have a clock on it
User fills the Suggestions form and the suggestion is emailed to me
Now I decide will I implement/develop it or not
I have placed all html elements and now I need code implementation. My question is: "How to code html elements to achieve desired functionality?".
Tried to follow up through this solution to add code behind masterpage: http://rburgundy.wordpress.com/2010/03/10/sharepoint-2010-custom-masterpage-with-code-behind-file-%E2%80%93-part-2/
but I get an error which I don't know how to handle.
Here is the error:
Parser Error Description: An error occurred during the parsing of a
resource required to service this request. Please review the following
specific parse error details and modify your source file
appropriately. Parser Error Message: Could not load the assembly
'Branding102, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=84d1d0117dd4046d'. Make sure that it is compiled before
accessing the page.
Source Error: Line 1:
I need to implement _starter.cs file as code-behind masterpage.
Don't bother with webparts in your master page.
Delegate control is your friend.
http://msdn.microsoft.com/en-us/library/ff650763.aspx
http://fyeomans.com/2011/05/16/make-your-sharepoint-2010-master-page-extensible-with-delegate-controls/
You can write your delegate control to be full postback or Ajax, implementation is up to you.
Personally, having webparts in masterpage is a no-no for me, that's what page layouts are for. In masterpage, delegate control is THE prefered method to have custom html/code rendering.
http://edwin.vriethoff.net/2007/10/02/how-to-send-an-e-mail-with-attachment-from-sharepoint/
Something like this within a web part and then add a web part to your master page.
Hope this helps

POST a HTML Form programmatically?

I need to POST a HTML form to a 3rd party website (a Mass-SMS texting system).
In the past I've done this by forwarding to a page containing a form I've pre-populated and hidden (using display:none), then I've ran a javascript function at the end of the page to automatically submit this form.
However I'm hoping theres someway I can do all this programmatically (as I don't care about the response, and the user doesn't need to see the page the form is being posted to).
How can I do this? Cheers
You could use a WebClient.UploadValues method to send an HTTP POST request to a remote server from your code behind. Just fill up the name/value collection with the values coming from the hidden fields.
If you're willing to get into PHP, you can very easily use cURL for this.
Otherwise it's going to be quite difficult using just Javascript.
See here for a detailed tutorial.