Accessing GridPanel base parameters - asp.net

I have search box and a GridPanel with paging. You enter search criteria click a button and the results display in the GridPanel...simple
I have notice a bug, when I search for something that returns 5 pages of records, go to the last page, then perform another search that returns 1 page I am on page 5 of 1.
The start page parameter is in the BaseParameters of the GridPanel, how can I access this to reset it back to 0 when a new search is performed?
This is probably very easy but I am completely new to ext.net

you can invoke the changePage() method of the PagingToolbar. This method excepts an Integer for the desired page number. Check out the link below for more details.
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.PagingToolbar-method-changePage
Thanks,
Gav

Related

Drupal 7 : Pass submitted value from webform to confirmation page and another webform

In Drupal 7 I have two webforms.
When a user submits the first webform, I have the confirmation redirect. I would like to populate one of the fields in the confirmation page (and second webform) with one of the submitted values from the first form.
Then I will list the second webform in the same confirmation page (webform1)
Schema
Any idea how I can achieve this?
Thanks
I used this method to retrieve the value for confirmation page:
recupere the value
But I want to retrieve the value in the second webform
How can I do this?
And how can I list form results in confirmation page (form1)?
Here you have two option to do this.
Store the field value in $_SESSION and get that value.
Webform id is fixed, you can get result by using webform id with relevant userid and add to that result in
hook_form_alter(&$form, &$form_state, $form_id)}{
if($form_id == 'webform_client_form_YOURWEBFORMID'){
}
using this you can able to get this value.

Asp.net how to suggest multiple words inside textbox

Summary: I'm doing a web app to manage products in a warehouse. So I have a db with list of products and quantities. I have one page for unload products when they are used. On that page I have a textbox in which users write the note on how the product has been used.
Request: when users type inside the textbox I'd like a popup to appear showing products that contains the entered characters. More than 1 products is possible. Also users enters quantity of the used products, so I'd like that my app can update the db with new value.
For example:
I have a product named "AAA batteries" and I have 10 in stock.
I also have "9V batteries" 5 in stock.
User write "Used 3 AAA batteries and 4 9V batteries"
While typing I'd like popup appear suggesting "AAA batteries" etc.
Then I'd like to update the db subtracting 3 AAA and 4 9V.
It's ok to use delimiter characters
User press a button to save the note (db should be updated at this point)
Is this possible? I'm already using the ajax autocomplete extender but it can't do exactly what I want. I did a lot o searches but I can't find the right direction, can you help me? Thanks

How to call multiple FormView.Inserts from 1 button click

vb.net, .NET 4.0, sql server 2008 backend.
I have a webpage which contains 3 formviews, each within their own Panel. As the user traverses the page, depending on which step they're on, a certain formview will be visible. After the process is complete, the user will click the Submit button and The button onclick event calls each FormView.Insert statement. Each Formview inserts into a separate table. The issue is that if the last FormView.Insert throws an exception, the first 2 Inserts have already been executed successfully.
My question is, and I hope this isn't too vague but...What is my best option at this stage?
1. Create a single Stored Procedure to handle each Insert in order to handle if one of the Inserts throw an error?
Thank you.

Enter number in one textbox and get word as output in another textbox

This Question was asked in interview but i was unable to answer it
please any one can tell me how to do this ?
i have two textboxs txtInput and txtOutput
When user clicks the btnSubmit, he should get the number written in txtInput in words in txtOutput. Eg. if user enters 100 in txtInput, he should get hundred in txtOutput
Prumably this is JS. If it is the you can setup an event listener on the submit button and disable the default behavior. Pass the input value to a function that builds the number string and update the dom element for the output textbox with that return result.
If you're using a round trip to the server for the calculation then just ignore all the dom stuff and return the page with the appropriate values set.
If you're using a front end framework then this gets easier but more specific to the framework.
thanks ..found solution here
.NET convert number to string representation (1 to one, 2 to two, etc...)

Auto-Incrementation in InfoPath 2010 Form

I have a form in which I am attaching a workflow to. The form has a number that will be auto-generated. For example the first number will be 1, the next time the form is opened the number should be 2, so on and so forth. The issue I am having is: in the Default Value under the Text Box Properties I have the Value as: count(mynumber QuoteNumber) +1. When the form is generated the first and only number is 2 the number begins at 2 and never increases. Can someone help me with this or explain what I may be doing wrong? Thank You. I'm not using visual studio.
Rachel: I have fought with this problem since InfoPath 2007. Here is how I do it.
Since you say you are attaching a workflow, I assume you are using the from in SharePoint.
1 - create your form library in SharePoint
2 - use InfoPath to design the form. When you publish the form to SP, make sure you promote AT LEAST the ID field you want to auto-inc. (I usually promote every field in my forms, 'cause I like to use them like SP lists.)
3 - In SP, create one new form and manually set the ID field to the starting number for your form series.
4 - return to InfoPath designer and re-open your form template.
5 - create a new data source to receive data from your SP form library and specify your form library as the source, and the ID field as a data element. Name the data source something like “ID Lookup”.
6 - open the properties of the field you want to auto-inc on your form and, in the default value box, select function, then choose the MAX function.
And add “+1” after the function to increment by 1.
Now, double-click in the field are of the Max function. You will see a dialog showing your form fields. Notice the drop-down at the top of the dialog – here you can choose the data source (notice I named mine “sales Contracts” in this example). If you select the data source you created in step 5, you will see a dialog showing you a couple of data branches.
Expand the ‘dataFields’ branch until you see the field you want to auto-inc. Click on this.
Your formula dialog will look something like:
max(ID_X0020) + 1
With your field name instead of the 'ID' in the Max function – the function will now return the Maximum value of the field IN THE FORM LIBRARY, plus 1.
Save the form in InfoPath and try previewing it. You will probably get a security warning – your InfoPath form is grabbing data from your SharePoint library on the fly. You may even get asked to re-enter your password (I usually do). When the new, blank form is displayed in InfoPath preview, you should see you ID field filled in with a value one greater that the number in that field of your SP library.
There is one huge Gothca with this method - if users re-open a completed form to edit it, the formula will probably try to replace the ID number. If your users don't edit the forms after they are submitted, the this will work for you.
Hope this makes sense.
You aren't doing anything wrong - you just have to change how you think about "forms" a bit. Remember a form is just like a word document template. Suppose you save a word document on your hard drive with a blank spot to fill in your name. Later you open the template, type your name, and save a copy as V1.doc. When you go back and open the template again - your name is not there because it was saved in V1.doc. Everytime you open the template you start again from scratch.
Infopath forms that you design and that the user fills out are templates (.xsn files). When the user fills it out and saves it they are really saving a copy which is only data (.xml files). The .xsn template doesn't change when users interact with it.
So to answer your question - there is no way directly in InfoPath to cleanly keep track of an auto incrementing ID. You will need to tap into some code (webservice, sharepoint, etc) to do that. You could also consider making the ID a GUID (which infopath does support) but it won't be auto incrementing and it won't look "clean" if it has to be displayed/used by real people.

Resources