How to use JavaBeans when the number of inputs is variable
I have a problem. The number of textboxes in a HTML form is read from a database. How can I avoid reentry from users? Is it possible to use JavaBeans or may be there is some other way? Thanks in advance.
Well, I meant that when a Jsp page is generated the number of textboxes is read from the database. So it it is apriory unknown. But I have found a solution to this problem: create a bean of String type for each textbox. Thanks.
Similar Messages
-
How-to use Excel for the XML file input?
Hello all,
Following our discussion with Gerhard Steinhuber on the very nice tutorial from Horst Schaude , "How to upload mass data via XML File Input" , I am starting this new discussion.
In the comments section of this previous cited tutorial, Rufat Gadirov explains how to use a generated XML from Eclipse instead of your XSD file as your source in Excel.
However, in spite of all the instructions, I am still facing the same issue in Excel when I try to save my file as XML : "The XML maps in this workbook are not exportable".
What I try to do is to create one or more Sales Orders with multiple Items in it from a XML File Input, using excel to enter data.
The part with the File input is working (if I directly upload my file to the webDAV, it creates a sales order instance with multiple items).
The only missing part is the Excel data input that I cannot make work. Any help on this matter would be greatly appreciated.
Here is my XML file that I try to use as a source in Excel before inputing data from Excel:
<?xml version="1.0" encoding="UTF-8"?>
<p:MySalesOrderUploadedIntegrationInputRequest xmlns:p="http://001365xxx-one-off.sap.com/YUUD0G3OY_" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MessageHeader>
<CreationDateTime>2015-03-02T12:00:00.000Z</CreationDateTime>
</MessageHeader>
<List actionCode="01" listCompleteTransmissionIndicator="true" reconciliationPeriodCounterValue="0">
<MySalesOrderUploaded>
<MySalesOrderUploadedID>idvalue0</MySalesOrderUploadedID>
<MyBuyerID schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeID="token">token</MyBuyerID>
<MyDateTime>2015-03-02T12:00:00.000Z</MyDateTime>
<MyName languageCode="EN">MyName</MyName>
<MyBillToParty schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyBillToParty>
<MyDateToBeDelivered>2001-01-01</MyDateToBeDelivered>
<MyEmployeeResponsible schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyEmployeeResponsible>
<MySalesUnit schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MySalesUnit>
<MyItem>
<MyItemID>token</MyItemID>
<MyItemProductID schemeAgencyID="token" schemeID="token">token</MyItemProductID>
<MyItemDescription languageCode="EN">MyItemDescription</MyItemDescription>
<MyProductTypeCode>token</MyProductTypeCode>
<MyRequestedQuantity unitCode="token">0.0</MyRequestedQuantity>
<MyConfirmedQuantity unitCode="token">0.0</MyConfirmedQuantity>
<MyNetAmount currencyCode="token">0.0</MyNetAmount>
</MyItem>
</MySalesOrderUploaded>
<MySalesOrderUploaded>
<MySalesOrderUploadedID>idvalue0</MySalesOrderUploadedID>
<MyBuyerID schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeID="token">token</MyBuyerID>
<MyDateTime>2015-03-02T12:00:00.000Z</MyDateTime>
<MyName languageCode="EN">MyName</MyName>
<MyBillToParty schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyBillToParty>
<MyDateToBeDelivered>2001-01-01</MyDateToBeDelivered>
<MyEmployeeResponsible schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MyEmployeeResponsible>
<MySalesUnit schemeAgencyID="token" schemeAgencySchemeAgencyID="1" schemeAgencySchemeID="token" schemeID="token">token</MySalesUnit>
<MyItem>
<MyItemID>token</MyItemID>
<MyItemProductID schemeAgencyID="token" schemeID="token">token</MyItemProductID>
<MyItemDescription languageCode="EN">MyItemDescription</MyItemDescription>
<MyProductTypeCode>token</MyProductTypeCode>
<MyRequestedQuantity unitCode="token">0.0</MyRequestedQuantity>
<MyConfirmedQuantity unitCode="token">0.0</MyConfirmedQuantity>
<MyNetAmount currencyCode="token">0.0</MyNetAmount>
</MyItem>
</MySalesOrderUploaded>
</List>
</p:MySalesOrderUploadedIntegrationInputRequest>
Thank you all for your attention.
Best regards.
Jacques-Antoine OllierHello Jacques-Antoine,
I suppose that as you have tried to construct a map from the schema, you have taken the elements from the List level down. In this case I also can't export the map.
But if you take the elements from the level MySalesOrderUploaded down, you'll get the exportable map (screenshots)
Best regards,
Leonid Granatstein -
How To Get rid of Exponential format in datagridview when the number is very large
When the number is very large like :290754232, I got 2.907542E +08. in datagridview cell
I using vb.net , framework 2.0.
how can I get rid of this format?
Thanks in advanceshould I change the type of this column to integer or long ?
The datagridview is binded to binding source and a list ( Of).
Mike,
I'll show you an example that shows the correct way to do this and a another way if you're stuck using strings in exponential format. The latter being the "hack way" I spoke about Friday. I don't like it, it's dangerous, but I'll show both anyway.
In this example, I'm using Int64 because I don't know the range of yours. If your never exceeds Int32 then use that one instead.
First, I have a DataGridView with three columns. I've populated the data just by creating longs starting with the maximum value in reverse order for 100 rows:
The way that I created the data is itself not a great way (there's no encapsulation), but for this example "it'll do".
Notice though that the third column (right-most column) isn't formatted at all. I commented out the part that does that so that I could then explain what I'm doing. If it works, it should look like the first column.
The first column represents an actual Int64 and when I show the code, you can see how I'm formatting that using the DGV's DefaultCellStyle.Format property. That's how it SHOULD be done.
The third column though is just a string and because that string contains a letter in it, Long.TryParse will NOT work. This is where the "hack" part comes in - and it's dangerous, but if you have no other option then ...
You can see that now the third column matches the first column. Now the code:
Option Strict On
Option Explicit On
Option Infer Off
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
With DataGridView1
.AllowUserToAddRows = False
.AllowUserToDeleteRows = False
.AllowUserToOrderColumns = False
.AllowUserToResizeRows = False
.AlternatingRowsDefaultCellStyle.BackColor = Color.Aquamarine
.ReadOnly = True
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
.MultiSelect = False
.RowHeadersVisible = False
.RowTemplate.Height = 30
.EnableHeadersVisualStyles = False
With .ColumnHeadersDefaultCellStyle
.Font = New Font("Tahoma", 9, FontStyle.Bold)
.BackColor = Color.LightGreen
.WrapMode = DataGridViewTriState.True
.Alignment = DataGridViewContentAlignment.MiddleCenter
End With
.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing
.ColumnHeadersHeight = 50
.DataSource = Nothing
.Enabled = False
End With
CreateData()
End Sub
Private Sub CreateData()
Dim longList As New List(Of Long)
For l As Long = Long.MaxValue To 0 Step -1
longList.Add(l)
If longList.Count = 100 Then
Exit For
End If
Next
Dim stringList As New List(Of String)
For Each l As Long In longList
stringList.Add(l.ToString("e18"))
Next
Dim dt As New DataTable
Dim column As New DataColumn
With column
.DataType = System.Type.GetType("System.Int64")
.ColumnName = "Actual Long Value (Shown Formated)"
dt.Columns.Add(column)
End With
column = New DataColumn
With column
.DataType = System.Type.GetType("System.String")
.ColumnName = "String Equivalent"
dt.Columns.Add(column)
End With
column = New DataColumn
With column
.DataType = System.Type.GetType("System.String")
.ColumnName = "Formated String Equivalent"
dt.Columns.Add(column)
End With
Dim row As DataRow
For i As Integer = 0 To longList.Count - 1
row = dt.NewRow
row("Actual Long Value (Shown Formated)") = longList(i)
row("String Equivalent") = stringList(i)
row("Formated String Equivalent") = stringList(i)
dt.Rows.Add(row)
Next
Dim bs As New BindingSource
bs.DataSource = dt
BindingNavigator1.BindingSource = bs
DataGridView1.DataSource = bs
With DataGridView1
With .Columns(0)
.DefaultCellStyle.Format = "n0"
.Width = 150
End With
.Columns(1).Width = 170
.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
.Enabled = True
End With
End Sub
' The following is what I commented
' out for the first screenshot. ONLY
' do this if there is absolutely no
' other way though - the following
' casting operation is NOT ADVISABLE!
Private Sub DataGridView1_CellFormatting(ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) _
Handles DataGridView1.CellFormatting
If e.ColumnIndex = 2 AndAlso e.Value.ToString IsNot Nothing Then
' NOTE! The following is dangerous!
' I'm going to use coercion to force the
' string into a type long. TryParse will
' NOT work here. This can easily throw an
' exception if the string cannot be cast
' to a type long. I'm "depending on" the
' the string to cast. At the very least
' you might put this in a Try/Catch but
' that won't stop it from failing (if
' it doesn't work).
Dim actualValue As Long = CType(e.Value.ToString, Long)
Dim formattedValue As String = actualValue.ToString("n0")
e.Value = formattedValue
End If
End Sub
End Class
Like I said, only use that hack way if there's no other option!
I hope it helps. :)
Still lost in code, just at a little higher level. -
On my IPad 2 home screen, the mail app used to indicate the number of new messages with a number in a red circle, next to the app. This has vanished, I think about the same time as when I upgraded to the new OS. Does anyone know why and how to restore this feature?
Thanks. While you were replying to my question, I went into notifications and figured
it out. Appreciate the quick response! -
With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?
I have developed a form with fields hidden by default, that become visible based on box ticked or radio button selections.
My problem is that, when I close the form and re-open it, it comes back to it's default presentation, regardless of the information already recorded in the form (including in the now hidden fields.
How to correct that
Thanks in advance for any hint you can provide.I've had the same problem. This solved it...
Go to the "Form properties..." in the File-menu. Select "Run-time" to the left and in the box "Scripting" Preserve scripting changes to form when saved: choose Automatically (Script-based state changes are saved locally in an insecure fashion. This option cannot be used for certified forms).
Hope it works for you to... -
In Numbers, when I click on a cell I see the formula, how do I see the number I input inot the cell?
Gerald,
A cell either contains:
1) what you typed (or entered) OR
2) the result of a formula
to enter a formula, select a cell, then type the "=" sign then the formula, then enter
to enter a number oer text, then type the number(s) or text you want, then the enter key
the contents of a cell is the last thing you typed into that cell. If there was a formula, then selecting the cell and typing will result in losing the formula.
B3 will change as you modify the cell contents in B1 and B2 -
I have a friend that just got a new cell phone, it's not a iPhone, but the person that use to have the number that she got did! I can't message my friend, they go out as iMessages to the other person! How can I fix this without turning all my iMessages off?
She needs to call the carrier on her old iPhone and have it removed from her account.
Once she does that you will not be able to use iMessage because that only works Apple to Apple.
You will need to use something else like Skype instead.
Allan -
How do I know when the buffer flushed all the data out?
I am using a very high sampling rate (500000 Hz) and acquire 1024 data points continuously. It takes 370000 data points in 10 second. I use a counter to help with the retrigger PFI line. I have a huge buffer so that I can make sure that the buffer is not overflowed. The code is attached below. My problem is that the data acquisition is done so fast (in 10 seconds) but the processing of the data is not. In :nEvent, I basically save and plot the data. The saving process is not slow. However, our videocard is so SSSSLOOOW and can not keep up with realtime data display. After the user is done collecting the data, they do not want to wait for the screen to plot the data from the buffer. So after the data collection is done, I basically stop the plotting process but we still need to flush the data out from the buffer for saving. My question is that how can I tell when the buffer is empty.
Thanks,
Yajai
m_task = std::auto_ptr<CNiDAQmxTask>(new CNiDAQmxTask("aiTask"));
m_counter = std::auto_ptr<CNiDAQmxTask>(new CNiDAQmxTask("coTask"));
m_task->Stream.Timeout = -1;
//Create a channel
m_task->AIChannels.CreateVoltageChannel(physicalChannel, "",
static_cast<DAQmxAITerminalConfiguration>(DAQmxAITerminalConfigurationRse), minimum, maximum,
DAQmxAIVoltageUnitsVolts);
m_task->Timing.ConfigureSampleClock(counterSource, sampleRate,DAQmxSampleClockActiveEdgeRising,DAQmxSampleQuantityModeContinuousSamples, samplesPerChannel);
m_task->Stream.Buffer.InputBufferSize = samplesPerChannel * 2000;
m_counter->COChannels.CreatePulseChannelFrequency(counterChannel, "coChannel", DAQmxCOPulseFrequencyUnitsHertz, DAQmxCOPulseIdleStateLow, 0, sampleRate, 0.5);
m_counter->Timing.ConfigureImplicit(DAQmxSampleQuantityModeFiniteSamples, samplesPerChannel);
m_task->Control(DAQmxTaskVerify);
m_counter->Control(DAQmxTaskVerify);
m_counter->Triggers.StartTrigger.ConfigureDigitalEdgeTrigger(
referenceTriggerSource, DAQmxDigitalEdgeStartTriggerEdgeRising);
m_counter->Triggers.StartTrigger.Retriggerable = true;
m_taskRunning = true;
m_counter->Start();
// Set up the graph
m_Graph.Plots.RemoveAll();
for (unsigned int i = 0; i < m_task->AIChannels.Count; i++)
m_Graph.Plots.Add();
m_Graph.Plots.Item(i+1).LineColor = m_colors[i % 8];
// Create Multi-channel Reader
m_reader = std::auto_ptr<CNiDAQmxAnalogMultiChannelReader>(new CNiDAQmxAnalogMultiChannelReader(m_task->Stream));
m_reader->InstallEventHandler(*this, OnEvent);
m_reader->ReadMultiSampleAsync(samplesPerChannel, m_data);Yajai,
I'm a little confused about your acquisiton. Do you intend for it to be
finite, or continuous? I'm also unclear about your rates. You state
that you are acquiring 1024 samples at 500kHz, yet you get only 370k
samples in 10 seconds. Are you periodically acquiring 1024 samples at
500kHz? Do you do any reads other than the final m_reader->ReadMultiSampleAsync(samplesPerChannel, m_data)? Could you provide the code where you stop the plotting process?
Thanks,
Ryan V.
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments -
How can I find out the number of pixels a photo has in i photo.
How can I find out the number of pixels a photo has in iphoto.
Do you mean in iPhoto on the MacBook Pro?
The dimensions (width and height iin pixels)are shown in the "Info" panel - multiply the two numbers:
Regards
Léonie
P.S: on an IOS device you see the same information in iPhoto, when you select the photo in an album and click th Info button ( i ). -
How to use shortDesc in the disabled inputtext
hi,all
i encounter a problem,our team must use disabled inputtext when the text is only used to output string.
the reson we don't use outputext is if there is noting in the outputtext,there is nothing displayed.
how to use shortDesc in the disabled inputtext?
here is the code:
<af:inputText value="#{bindings.shortdesc.inputValue}" disable="true"
id="ot2" columns="25" shortDesc="#{bindings.longdesc.inputValue}"
simple="true"/>
thanks allHi,
........... I use JDev 11g ..............
If you make your inputText disabled -----> shortDesc will not be displayed.
You can make a workaround to achieve this by using popup as :
1- add showPopupBehavior inside your inputText as :
<af:inputText label="label1" id="it1" disabled="true">
<af:showPopupBehavior triggerType="mouseOver"
align="endBefore" alignId="it1"
popupId="p1"/>
</af:inputText>2- add a popup which will display your shortDesc text
<af:popup id="p1">
<af:outputText value="Sameh POPUP" id="ot1"/>
</af:popup>I hope it is useful.
Sameh Nassar -
How to use case when function to calculate time ?
Dear All,
May i know how to use case when function to calculate the time ?
for the example , if the First_EP_scan_time is 12.30, then must minus 30 min.
CASE WHEN FIRSTSCAN.EP_SHIFT <> 'R1' AND FIRSTSCAN.EP_SHIFT <> 'R2'
THEN ROUND(CAST((DATEDIFF(MINUTE,CAST(STUFF(STUFF((CASE WHEN SHIFTCAL.EP_SHIFT = 'N1'
THEN CONVERT(VARCHAR(8),DATEADD(DAY,+1,LEFT(FIRSTSCAN.EP_SCAN_DATE ,8)),112) + ' ' + REPLACE(CONVERT(VARCHAR(8),DATEADD(HOUR,+0,SHIFTDESC.EP_SHIFT_TIMETO + ':00'),108),':','')
ELSE LEFT(FIRSTSCAN.EP_SCAN_DATE ,8) + ' ' + REPLACE(CONVERT(VARCHAR(8),DATEADD(HOUR,+0,SHIFTDESC.EP_SHIFT_TIMETO + ':00'),108),':','') END),12,0,':'),15,0,':') AS DATETIME),CAST(STUFF(STUFF(LASTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME)) / 60.0 - 0.25) AS FLOAT),2)
ELSE ROUND(CAST((DATEDIFF(MINUTE,CAST(STUFF(STUFF(FIRSTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME),CAST(STUFF(STUFF(LASTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME)) / 60.0) AS FLOAT),2) END AS OTWORK_HOURDo not use computations in a declarative language. This is SQL and not COBOL.
Use a table of time slots set to one more decimal second of precision than your data. You can now use temporal math to add it to a DATE to TIME(1) get a full DATETIME2(0). Here is the basic skeleton.
CREATE TABLE Timeslots
(slot_start_time TIME(1) NOT NULL PRIMARY KEY,
slot_end_time TIME(1) NOT NULL,
CHECK (start_time < end_time));
INSERT INTO Timeslots --15 min intervals
VALUES ('00:00:00.0', '00:14:59.9'),
('00:15:00.0', '00:29:59.9'),
('00:30:00.0', '00:44:59.9'),
('00:45:00.0', '01:00:59.9'),
('23:45:00.0', '23:59:59.9');
Here is the basic query for rounding down to a time slot.
SELECT CAST (@in_timestamp AS DATE), T.start_time
FROM Timeslots AS T
WHERE CAST (@in_timestamp AS TIME)
BETWEEN T.slot_start_time
AND T.slot_end_time;
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
HT4515 how can i know if the number i am calling is busy or i am on waiting
How can I know if the number I am calling is busy or I am on waiting? Please let me know.
If you get a busy signal when calling a number, it is busy.
-
How to use JavaBean in Form Builder 6i
Hi,
How to use JavaBean in Form Builder 6i (Oracle Developer 6i)?.
i'am using Oracle Sever 8.0.4 and Oracle Developer 6i.
Please give your valuable suggestion
Regards
SeemaI would suggest you start with the sample Java bean code we have
on otn.
http://otn.oracle.com/products/forms
go to the sample code section. -
How to use C:when test... inside column in ADF table
I am using ADF table with below two columns
in First column i have to check the Type of document if it is doc type then i have to use commondlink to download that file ,Otherwise i need to show only text.
for that i added
*<c:when test="{boolean($favoriteType eq 'doc')}">*
which is not working .
please let me know how to use <C:when test... inside column in ADF table
<tr:column sortProperty="favoriteName" sortable="true"
headerText="#{res['favorite.favoritename']}"
width="500" noWrap="false">
<c:choose>
*<c:when test="{boolean($favoriteType eq 'doc')}">*
<tr:commandLink actionListener="#{bindings.downloadFile.execute}"
text="#{row.favoriteName}"
disabled="#{!bindings.downloadFile.enabled}"/>
</c:when>
<c:otherwise>
<af:outputText value="#{row.favoriteName}"/>
</c:otherwise>
</c:choose>
</tr:column>
<tr:column sortProperty="favoriteType" sortable="true"
headerText="#{res['favorite.favoriteType']}" rendered="true">
<af:outputText value="#{row.favoriteType}" id="favoriteType"/>
</tr:column>Hi Frank,
Thanks it is working like cham..
related to same page i am facing new problem which i posted at below thread
How to get row data runtime @ trinidad table , set rowSelection="multiple"
can u reply on same.
Thanks for all help.
Jaydeep -
Hello,
Can anyone show me the way how to re-oder automatically the number of primary key that has been set as auto_increment in mysql database when the row deleted?
example:
No (primary key=auto increment)|
Name |
AGE |
1
| JO
| 21
|
2
| Kyle
| 25
|
3
| Macy
| 30
|
When delete 1 row:
No (primary key=auto increment)|
Name |
AGE |
1
| JO
| 21
|
2
| Macy
| 30
|Hello,
This is not a VB.NET question, best to ask this question in
MySQL forum.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.
Maybe you are looking for
-
Compressor H.264 and Android devices
I'm looking to make videos on our web site as mobile compatible as is practical and have run into a specific issue with compressor. When I tried to play one of our H.264 videos on an Android device I got the picture but no sound. I did some experimen
-
Using dbms_job for the 1st time
I am attempting to use dbms_job for the 1st time and doing some test, but I can't get it to run. Connected to: Oracle Database 10g Release 10.1.0.2.0 - Production SQL*Plus: Release 8.0.6.0.0 - Production on Wed Mar 1 10:36:18 2006 I have alter system
-
pls send me OO ABAP material and some example programs.
-
Strange ports for BIA services (rfc, name)
Hello, I have quite an old BIA system running with BI 7.0 SP09. In TREXADMIN I see quite strange ports associated with rfc and nameserver services. sap41:pago-services1 nameserver sap41:30003 indexserver sap41:30011 other sap41:0 rfc
-
Receiving calls via BT Homehub2
I have today installed a BT homehub2 to work as a router for my computers' connection to the internet. I have a hub phone, also provided by BT, and it can make outgoing calls. Does anyone know if these cost me anything? Is it capable of receiving in