get text data from end user, with one field having uneditable list of drop down values(others input by end user) - forms

I have a requirement, where some 14-15 fields of data have to be asked from the end user and some processing has to be done for those values.
But one of the values should be pre-filled with a drop down list of values, and user can only select one of the values in that list. Also, the user can add a suffix value to this fixed value(by fixed value i mean value in drop down list selected by end user). So this parameter when sent to the server for processing, is fixed value+suffix.
I want to know if this type of form processing can be done using bean/jsp. Or with any other method.
If you could give me a code sample for implementing this (whether bean or other method) then that would be great.
The processing that has to be done after the user submits all 14-15 values is written as java code. I should be able to invoke this code to do processing.

Of course it can be done using servlets/JSP.
You need to generate apage containing an HTML form. This form will have to contain a select element withh all the fixed options, and a text input where the user has to enter the suffix. When submitted, the servlet/JSP will have to get the submitted values from the request parameters, and do its processing.
A code sample would be too hard to give you. You need to read a whole tutorial about HTML forms, the servlet API and how JSPs work.

Related

How do we POST custom fields from multiple categories in Workfront

I have two custom forms A1,A2,A3 and fields a1,a2,a3 in the forms respectively. I want to create a new project with custom fields from the forms A1, A2. How should we include multiple categoryID in the POST URL
/attask/api/v10.0/PROJ?fields=parameterValues&name=XXX&DE:a1=hello&DE:a2=hello1&categoryID=<A1/A2 category ID - How should i fill it.>
I tried adding this paramter but no luck categoryIDs=5d10971f0022b132ec67f6fb6c60b3a4,5d07244000060f86c04b49527f1
I got the following error "message": "APIModel V10_0 does not support field categoryIDs (Project)"
If you attempt to set a custom field value on an object that does not yet have that field associated to it (no form on the object that contains the field), Workfront will automatically attach an appropriate form. If those forms are the only ones that utilize your fields, you should be able to simply set the field values and be done with it.
However, if you wish to attach specific custom forms without filling out the fields, or if you have a field associated with multiple forms and you want to ensure a specific form is attached, you must first attach the form(s) in one call and then update the fields in another.
To attach a custom form,
PUT <Workfront URL.../<objectID?updates={objectCategories:[{categoryID:`"<custom form ID>`",categoryOrder:<order of form, starting with 0>,objCode:`"CTGY`"}]}
Please note that this will remove any forms not explicitly specified in this call (it does not append) so you'll need to capture any existing forms and re-apply them.
Below API call worked
POST <Workfront URL.../<object>?updates={objectCategories:[{categoryID:`"<custom form ID1>`",categoryOrder:<order of form, starting with 0>,objCode:`"CTGY`"},{categoryID:`"<custom form ID2>`",categoryOrder:<order of form, starting with 0>,objCode:`"CTGY`"}]],name:"`<object_name>`", DE:a1:"hello", DE:a2:"hello1"}

MS-Access: How to create form where user can add results (tblResults) to a tests (tblTests)?

I am creating a database that contains Product information (tblProductInfo), a list of test methods (tblTests), and the results that the product gets (tblResults).
I'm adding forms so that a user can enter the results of a previous or new product. This information will be added once all the testing for that product is done. So, I would like to be able to show a list of the tests from tblTests, and have the user enter the results in a text box of some sort displayed directly next to the tests. I can't figure out a way to do so, where it will then save all the results that the user entered.
I have created a form with a subform, where the subform shows the 2 columns (tests and results) and when I change it to allow DataEntry, it gets rid of all the test names. I need it to keep the test names displayed, but allow entry in the results column.
Any ideas?
Below is a screenshot of an example of what I would like, although I need the Results column to be empty.
Create a continuous subform with only the tblresults as the recordsource, and for the header or each field of results use the related test as the label is how I would do it. Set allow additions to yes, allow edits to no allow deletions to no.

GWT + Editor: Avoid removing violation messages and wrong input

We implement in our GWT/GXT project displays that contain in most cases a filter form and a grid to show the filtered data. Displays are implemented with UiBinder and the "Gwt Editor Framework".
The user wants to have validations on the filter form. To do the validation we use JSR303 bean validation. The validation must apply on each change of a field in a filter form. The user wants also to have a kind of automatic fill a field based on the input in a second field (lets say a number range from and to). That works all perfect - but...
We struggle in a particular situation:
The user starts to type in some data in the filter form.
He puts a wrong value in a field that has to be parsed into a date (for example).
He continues typing into following fields which then cause an automatic prefill of a second field.
The result is currently, that the wrong value he typed into the date field is removed and the violation message as well.
Our current implementation will do a flush() to get the values the user typed in already. After that we fill a attribute in the model (based on the input) and do an edit(model). If there are some violation messages because of a wrong input in a different field in that filter form, the value is removed. That happens on field that need a parse (date, time, number).
The question is now:
Is there a way to keep the wrong value and the violation message as well?
Thank you for any replay!

MS Access 2003 findfirst method doesnt work in Load() event of form

After a few days of frustration, I have decided to present this issue here for resolution. Searches through countless forums and help sites have not presented any similar issue. The following details the problem with a FindFirst method in MS Access 2003:
Tables and Forms: Customer Info Table > Service Details Table as a one-to-many relationship with referential integrity and cascading updates enabled (there may be more than one service detail for each customer). A search form allows user to select ‘customer’ and ‘service provider’ (a field in table Service Details) sending that information to open a main form/subform to enter service data related to ‘customer’ using ‘service provider’ (text string) as criteria. There may be more than one ‘service provider’ per ‘customer’ (i.e. each Service Detail entry may have a different ‘service provider’ for the same ‘customer’).
Objective: The main form (with subform, both based on select queries) should open to the specified record/subrecord.
Current Method: A combo box on the main form (not the search form) allows user to select appropriate ‘service provider’ using the FindFirst method (combo box created by wizard). This works but not what is intended. The ‘service provider’ criteria is initially selected in the search form and passed into the main form (as a global variable for now), so the combo box selection on the main form becomes redundant and could cause confusion for the user (they could accidentally enter data for the wrong service details).
Problem: I assumed copying the code from the AfterUpdate() event of the combo box to the Load() event of the main form would be adequate, but it does nothing, no errors, just loads the first available Service Details record instead of the selected one using ‘service provider’ as criteria.
Tests: I have inserted message boxes to check the criteria value for the ‘service provider’ selected, and everything seems ok, both in and out of the FindFirst method inserted in the Load() event of the main form. I have tried a DLookup(), DoCmd.Findrecord and setting the default of the combo box to the criteria passed from the search form, but still only the first ‘service provider’ record is displayed, instead of the one selected in the search form.
Code:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Service Provider] = '" & [g_serviceProvider] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
This produces no errors, and hovering over the g_serviceProvider variable with the mouse in debug mode shows the correct string value. This code works perfectly in the AfterUpdate() event of the combo box, but does nothing when inserted into the Load() event of the form, even though the values are indeed passed (checked using message boxes to display data at each stage of the execution).
I am at a loss of why this only works for the combo box but not in the Load() event of the form. I suspect the problem is in the recordsource of the form (select query), as the recordsource of the combo box uses a SELECT expression based on the same query as the form. I have had no success with coding the recordsource to use with the FindFirst method within the Load() event, as that produces errors (cannot find any relevant examples to work from). Any ideas? Thanks in advance.
Ok, I finally figured it out. The actual problem was the form loading the Current() event multiple times when opening the form to a specific record. This was happening on pretty much every form where an existing record is being displayed. It seems to be an artifact of the form opening and record selection of MS Access 2003 (don't know about newer versions, but I have read several other posts concerning this issue).
There is a dirty work around, by using a count of the number of times the Current() event runs when a form is opened. I have found that for a "virgin" form (blank form ready to accept input with blank record source (table)) the Current() only runs one time. If there is any existing records, but the form is blank ready to input a new record, the Current() will run twice. When displaying a record that already exists that must populate a form, the Current() will run three times before all of the data loads enough to make the selection through coding rather than through a combo box (which loads with the control). Subform Current() seems to run one more time than the parent form.
To check to see if and how many times any event occurs, insert a simple message box in the suspected block of the form's VBA code.
Creating a simple counter, coded in the Current() event block of the main form, solved the problem.

Fill-in-the-blank Story Generator

I'm interested in creating a fill-in-the-blank story generator for kids. I want to create a form where they can put in the names of characters and other things and have that data populate a pre made story. After they hit SUBMIT they would be taken to a follow up page with their input and the story in plain text. I'm pretty new to this but very eager to learn. What would be the best way to go about creating this form that generates stories?
It seems you would need two database tables - one for storing the original story templates and another one for storing the generated texts.
The challenging part with the template database is signifying the parts where there can be user input. One idea - place a special format code inside the text in the following manner:
Once upon a time, in a forest far away, lived ::00001::.
Assuming you are loading that template as it is in an element inside a form (I would avoid textfields for this purpose and just place the text).
After the text is loaded into the web page (javascript onload), replace your markers with input fields (I'd use jquery for that). You can use jquery to search an elements text/innerHtml and replace it with another html element. Here is an idea how to do that. The replacement of markers with inputs can be done in a javascript while loop, as long as there is "::" in the text of the element.
Then your ::00001:: could be replaced for example with:
< input type='text' id='input00001' name='input[00001]'/>
Then, when the user submits the form, you can get the values for each field and store them to a second database with the given ids. This way, you will be able to reload them later (same process, only instead of inputs, you would replace the codes with their corresponding values).
This way, in the second database table you only save the input values and not the whole text, to save up memory. Probably in the second table you would like to store the id of the field, the value, perhaps a template id (so that you know for which story template it corresponds) and a user id or at least a timestamp, in case you can have many generated stories for the same template.
Hope this helps!