SelectOneRadio in several rows...
Hi All,
I am struggling to generate the below layout with <h:selectOneRadio>
radio1 | text1 | text11
radio2 | text2 | text22
radio3 | text3 | text33
Can any one help me how to get the above layout with <h:selectOneRadio>
Thanks
cvam
The Sun JSF Mojarra doesn't provide this functionality. I can suggest you to extend it with the Tomahawk component library. It has an extented t:selectOneRadio which adds the "spread" option to the "layout" attribute. This enables you to define the t:selectOneRadio once and place the t:radio items anywhere in the page. Also see this article: [http://wiki.apache.org/myfaces/Display_Radio_Buttons_In_Columns]
Similar Messages
-
If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper; in others one is created for each song. Why? How can I get one image per album every time?
If I add artwork by dragging a jpg to the artwork area after selecting several rows, in some instances a single icon is created in the flipper; in others one is created for each song. Why? How can I get one image per album every time?
-
Looping SelectedItem values in HttpService to Update Several Rows in Database in Flex
Hi,
My client wanted me to create something that allows certain
DataGrid to display to allow users to edit and update the database
records. The only dilemma I am having here is how to actually
create something from Flex's end to allow users update several rows
of the database at once. Since everything in my datagrid would be
defined as selectedItem whenever a user accesses the entry, how can
I get Flex to recognize each of the updated variables while I
update the database?
Another question is, if I do something like
dg2.selectedItem.id, it would only display the "selectedItem," and
since I intend to loop every single one of the values as such in
the datagrid to be updated, is it possible to do something like dg.
.id? I tried to do this, and I kept on getting errors.
If anyone could refer me to some examples on how to get this
to start, it would be great.
Thanks in advance.
Alice
This is the current code I have:
<mx:HTTPService id="save_scenario" method="POST" url="
http://localhost/save_scenario.php"
useProxy="false">
<mx:request xmlns="">
<scenario_name>{scenario_name}</scenario_name>
<id_no>{dg2.selectedItem.id}</id_no>
<region_name>{dg2.selectedItem.region_name}</region_name>
<population>{dg2.selectedItem.population}</population>
<market>{dg2.selectedItem.market}</market>
</mx:request>
</mx:HTTPService>Thanks, but I think I will be a little more explicit here
about what I really wanted to know. My impression is that if I have
a DataGrid and that I would like to allow users to edit certain
entries within the actual grid and have all of it saved to the
database, I could use a for loop and just update everything without
paying attention to what has really been updated, but I have been
struggling with how to pass it all to the variables side.
Currently, I could update things one entry a time, by using the
code I provided earlier, but is there a way of which I can have it
all posted to the HTTPService in one go?
Note: I tried using dg.
.id_no in the for loop to iterate over the variables I intend to
post, but I don't think I am allowed to do so, do I?
Alice
Attached is what I used in a PHP script to allow the code
loop around the users' edits, how could I do the similar thing in
Flex by assigning the index variable to something more dynamic?
Attach Code
<?php
if(!isset($_POST['npop'])){
// this is where the user will select how many pops to insert
?>
<form method="post">
<input type="text" name="npop" value="Type in how many
post values">
<input type="submit" value="Continue">
</form>
<?
} else {
if(!isset($_POST['pop'])){
$pop = $_POST['npop'];
// when the user has selected the N number of pops
// its time to create the N input elements
?>
<form method="post">
<input type="hidden" name="npop"
value="<?=$pop;?>">
<input type="hidden" name="pop" value="0">
<?
for($i = 1;$i <= $pop; $i++){
echo "<h3>Pop $i</h3>";
// now comes the 5 input elements..
// add them as u like naming them in the following pattern,
// or whatever prefix
?>
Market: <input type="text" name="a<?=$i;?>"
value="0"><br />
IM_accept: <input type="text" name="b<?=$i;?>"
value="0"><br />
IM_defer: <input type="text" name="c<?=$i;?>"
value="0"/><br />
CR_accept : <input type="text" name="d<?=$i;?>"
value="0"><br />
FC_accept : <input type="text" name="e<?=$i;?>"
value="0"><br />
<?
?>
<input type="Submit" value="Submit form">
</form>
<?
} else {
$pop = $_POST['npop'];
// when the user has submitted the pops,
// they will be inserted to N rows in the table.
for($i = 1; $i <= $pop; $i++){
$a = $_POST['a'.$i]; $b = $_POST['b'.$i]; $c =
$_POST['c'.$i];
$d = $_POST['d'.$i]; $e = $_POST['e'.$i];
$sql = "insert INTO table VALUES('$a', '$b', '$c', '$d',
'$e')" . "\n";
echo $sql;
$myFile = "testFile.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, $sql);
fclose($fh);
echo "POPs were recorded. Thank you";
?> -
Table: Span field over several rows
Hi,
It would like to display the entries in a table each in three lines
+-----------------------------+------------+---------------+----------+----------------------+
| Field 1 Pause Traveltime Hours Field 5 |
| Task Location |
| Description |
+-----------------------------+------------+---------------+----------+----------------------+
Is it possible to span one cell over several rows?
Greetings, VanessaHi Vanessa,
If you not really need a table, but more a tabular layout, you may consider using the RowRepeater control.
This way you have total control how your 'rows' look like. You could for instance use a VerticalLayout in a RowRepeater cell to allow 3 items in a vertical layout. -
Deleting several rows from a query
I have a query with several rows that have a field with the
string "2 by 4" that I would like to delete. There are other rows
where this same field is "2 by 2" and I don't want to delete those
rows.
What's the syntax? Can I use structdelete? Or is this
data-structure an array?Use the where clause of your sql to select only the records
you want. If you actually need all the records you are getting now,
and you also want a subset of those records, use query of queries
to get your subset. -
Delete the data in several rows without deleting formulas?
Hello, Is there a clever way to delete data on several rows at a time without also deleting the formulas or formatting in the columns?
As far as I can tell, "data," "values," and "numbers" are all the same thing, and formulas act upon the data as necessary. I have several columns of data, then a column that figures a percentage, in currency, of the previous column. The totals for all the numbered data is added at the bottom. I found that if I delete the entire row, however, I also delete the formula. I wanted to find out how to do this quick and easy, without deleting the formula. I decided it's easier to delete just the data from the cells previous to the formula column, which leaves the formula intact. Then I must also delete the entries (data) in the rows following the formula.
There are also occasions when I wish to move several rows down, but I found that by doing this, I also delete the formula, and it must be re-entered manually. I just wish there was a way to keep the formula intact, but apparently the only way to do that is to delete only the columns that do not contain a formula.
Perhaps it's that I'm not familiar with spreadsheets. I've used Filemaker Pro for several years, and find it more user-friendly than Numbers.
Thanks for your suggestion. -
Finding a combination of data in several rows and on the same column
In a table I have two cloumn
ID
and
ID6 that repersent joined account that have several partners ID
for example:
ID ID6
====== ===========
11215 6100
11152 6100
11242 6101
11523 6101
11125 6101
11254 6101
there is about 60,000 rows
I have a table with several ID in a row and I need to find the missing ID6 if it exist (not all ID are join account) and put it in that row if exist
the table look like this
11523,11125,11254, 11242
11658,15662
11458
11215,11152
there is about 5,000 rows
I use plsql developer.
How do I do that ?
ELISolution
SELECT ID
FROM T2
MODEL
RETURN UPDATED ROWS
PARTITION BY (ROWNUM RN)
DIMENSION BY (0 I)
MEASURES (ID)
( ID [FOR I FROM 1 TO NVL(LENGTH(REGEXP_REPLACE(ID[0],'[^,]','')),0) + 1 INCREMENT 1]
= REGEXP_SUBSTR(ID[0],'[^,]+',1,CV(I)))
MINUS
SELECT TO_CHAR(ID) ID
FROM T1
Demo
SQL> WITH T1 AS ( SELECT 11215 ID,6100 ID6 FROM DUAL UNION ALL
2 SELECT 11152,6100 FROM DUAL UNION ALL
3 SELECT 11242,6101 FROM DUAL UNION ALL
4 SELECT 11523,6101 FROM DUAL UNION ALL
5 SELECT 11125,6101 FROM DUAL UNION ALL
6 SELECT 11254,6101 FROM DUAL
7 ), T2 AS (
8 SELECT '11523,11125,11254,11242' ID FROM DUAL UNION ALL
9 SELECT '11658,15662' FROM DUAL UNION ALL
10 SELECT '11458' FROM DUAL UNION ALL
11 SELECT '11215,11152' FROM DUAL
12 )
13 SELECT ID
14 FROM T2
15 MODEL
16 RETURN UPDATED ROWS
17 PARTITION BY (ROWNUM RN)
18 DIMENSION BY (0 I)
19 MEASURES (ID)
20 ( ID [FOR I FROM 1 TO NVL(LENGTH(REGEXP_REPLACE(ID[0],'[^,]','')),0) + 1 INCREMENT
1]
21 = REGEXP_SUBSTR(ID[0],'[^,]+',1,CV(I)))
22 MINUS
23 SELECT to_char(ID) id
24 FROM T1
25 /
ID
11458
11658
15662
SQL> -
SQL query, generating several rows by a value in a field
I am using Oracle database. Imaging I have a table with a row as following
col1 | col2 | col3
'Str1' | 'Str2' | 4
The value from col3=4 should generate 4 rows as following:
col1 | col2 | col3
'Str1' | 'Str2' | 1
'Str1' | 'Str2' | 2
'Str1' | 'Str2' | 3
'Str1' | 'Str2' | 4
After several hours in front of the screen and stil no luck - how can I create such a select query???You're mixing up the 'standard' WITH clause and Recursive Subquery Factoring (which NEEDS a UNION ALL) (see: http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#i2129904).
This should work on 10.2:
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> with t as (select 'str1' col1, 'str2' col2, 4 col3 from dual
2 )
3 select col1
4 , col2
5 , level col3
6 from t
7 connect by level <= col3;
COL1 COL2 COL3
str1 str2 1
str1 str2 2
str1 str2 3
str1 str2 4
See here as well: http://technology.amis.nl/2009/09/01/oracle-rdbms-11gr2-goodbye-connect-by-or-the-end-of-hierarchical-querying-as-we-know-it/ -
Update several rows with single query (easy question, I guess)
Hi all!
I have table with two columns - name and value.
I populate it with several sql queries:
insert into settings (name, value) values ('company_name', 'My Company');
insert into settings (name, value) values ('company_address', 'Company Address 12');
insert into settings (name, value) values ('company_city', 'South Park');
How can update rows with company_name and company_city in single query?
Thank you in advance!How can update rows with company_name and company_city in single query?I guess something like this was meant:
update settings set value = ??? where name in ('company_name ', 'company_city');But it's still unclear to me what should be used instead of question marks... :)
Regards. -
Use Preparedstatement to delete several rows from database
Hello everyone,
I am trying to delete multiple rows from database at one time using Preparedstatement.
It works well when I tried in SQL directly,the sql query is as follows:
delete from planners_offices where planner ='somename' and office in ( 'officeone', 'officetwo', 'officethree')
I want to delete those 3 rows at one time.
But when I am using preparedstatement to implement this function, it does not work. It did not throw any exception, but just does not work for me, the updated rows value always returns "0".
Here is my simplified code:
PreparedStatement ps = null;
sqlStr = " delete from PLANNERS_OFFICES where planner = ? and office in (?) "
Connection con = this.getConnection(dbname);
try
//set the sql statement into the preparedstatement
ps = con.prepareStatement(sqlStr);
ps.setString(1,"somename");
ps.setString(2,"'officeone','officetwo','officethree'");
int rowsUpdated =ps.executeUpdate();
System.out.println(rowsUpdated);
//catch exception
catch (SQLException e)
System.out.println("SQL Error: " + sqlStr);
e.printStackTrace();
catch (Exception e) {
e.printStackTrace();
} finally {
this.releaseConnection(dbname, con);
try{
ps.close();
}catch (SQLException e){
e.printStackTrace();
rowsUpdated always give me "0".
I tried only delete one record at one time, "ps.setString(2, "officeone");", it works fine.
I am guessing the second value I want to bind to the preparedstatement is not right, I tried several formats of that string, it does not work either.
Can anyone give me a clue?
Thanks in advance !
Rachelthe setString function in a preparedStatement doesn't just do a replace with the question mark. It is doing some internal mumbojumbo(technical term) to assign your variable to the ?.
If you are looking to do your statement, then you will need to put in the correct of # of question marks as you need for the in clause.
delete from PLANNERS_OFFICES WHERE PLANNER = ? and office in (?,?,?)
If you need to allow for one or more parameters in your in clause, then you will need to build your SQL dynamically before creating your prepared statement.
ArrayList listOfOfficesToDelete ;
StringBuffer buffer = new StringBuffer("DELETE FROM PLANNERS_OFFICES WHERE PLANNER = ? AND OFFICE IN (");
for(int i = 0; i < listOfOfficesToDelete.size(); i++ )
if( i != 0 )
buffer.append(",");
buffer.append("?");
buffer.append(")");
cursor = conn.prepareStatement( buffer.toString() );
cursor.setString(1, plannerObj);
for(int i = 0; i < listOfOfficesToDelete().size(); i++ )
cursor.setString(i+1, listOfOfficesToDelete.get(i) );
cursor.executeUpdate() ; -
Fact Table with a metric repeated in several rows
Hi!!
I've got a little problem and I don't know how to face it.
I'm using OBIEE and I've got this case:
One fact table like this:
Order_Number - Q.Received - Supplier - Invoice_Number - Q.Inv.
1 - 10 - S1 - I1 - 2
1 - 10 - S1 - I2 - 8
2 - 10 - S1 - I3 - 10
So, for an order Number, I can have more than one Invoice Number, but the quantity Received is always 10, because is a metric refered to the Orden, not to de Invoice, but this quantity (10) I find it in two rows, not in one row. It's like having two fact tables mixed (invoices and orders).
My problem is:
If in the logical field Q.Received I don't aggregate de column, when in Answers I try to know the Quantity of units received by supplier S1, the report says 10, that is incorrect. It should be 20.
If in the logical field Q.Received I aggregate de column, when in Answers I try to know the Quantity of units received by supplier S1, the report says 30, that is incorrect too.
I've tried to separate it in two fact tables by views like this:
Fact1: Orders
Order_Number - Q.Received - Supplier
1 - 10 - S1
2 - 10 - S1
Fact2: Invoices
Order_Number - Invoice_Number - Q.Inv.
1 - I1 - 2
1 - I2 - 8
2 - I3 - 10
...and I've created a dimension with Order_Number, but the report:
Order_Number - Q.Received - Q.Inv.
...doesn't work.
-If I try without jerarquies, OBIEE goes only to the first one and if I select a field from Fact2 says that there isn't a mapping for this field.
-If I try with jerarquies for the only dimension I have, with a grand total level and a child level, selecting the lowest level for all tables, error is: "None of the fact tables are compatible with the query request "
Can anybody help me? I'm having nightmares with this issue.
Thanks a lot in advance.Hi,
Okay. I assume you have the 2 facts:
Fact1: Orders
Order_Number - Q.Received - Supplier
1 - 10 - S1
2 - 10 - S1
Fact2: Invoices
Order_Number - Invoice_Number - Q.Inv.
1 - I1 - 2
1 - I2 - 8
2 - I3 - 10
create a business model with the following logical tables:
Order Dim,
QTY Received,
QTY Invoiced
drag/drop Order_number from Fact1 to the logical table Order Dim (this will create a logical column Order_number).
drag/drop Order_number from Fact2 to the logical COLUMN Order_number. (This will give you a second Logical Table Soruce with 1 logical table column.)
drag/drop Q.Received from Fact1 to logical table QTY Received
drag/drop Q.Inv. from Fact2 to logical table QTY Invoiced
Assign key to LT Order Dim
and draw Business Model Diagram.
This should give you the possibility to report the quantity received and invoiced per order number
Regards
Message was edited by:
wobiee1 -
Coulmn heading in several rows using 'Delimited' option
Hello folks -- I am using Oracle Reports 6i and when generating a File to 'Delimited' to produce a Text file, I am getting the Column headings repeated in every row. So, all the columns are being produced in every row and every column and then data is being produced.
My ultimate goal is to open the Text file in Excel and save it as an Excel file.
I noticed that Oracle Reports 9i has the option of 'Delimited Data' which works fine. Is there a work around in Reports 6i? Maybe by using Format Triggers?
Any help is greatly appreciated.
ThanksI found the problem.
Since the headings are also in a Repeating Group, the Heading were appearing on every row along with the data. Here is what you should do as its working for me:
1. Remove the Headings from the Layout completely.
2. Add the Headings in the SQL Statements and do a UNION with the Main Query. Add a dummy column at the end for the Ordering BY so the row with the headings show up on the top row followed by the data.
3. Don't include the order_id column in the Layout.
Hint: Do a TO_CHAR for every column in the Main Query as the Headings will be Character field
Thanks!
Edited by: Roxyrollers on Sep 24, 2012 4:00 PM -
SelectOneRadio in several columns...
Hi All,
I am struggling to generate the below layout with <h:selectOneRadio>
radio1 | text1 | text11
radio2 | text2 | text22
radio3 | text3 | text33
Can any one help me how to get the above layout with <h:selectOneRadio>
Thanks
cvamPlease don't doublepost. Continue here: [http://forum.java.sun.com/thread.jspa?threadID=5298597]
-
Keeping only one row with information from several rows?
Hi,
I have a table with companies. The companies appearing more then once in the table, with different information in different columns. How do I keep one row from each company with all information..?
Example:
Company State City Country
CompA WA Seattle null
CompA null null USA
CompB null null USA
CompB TX null null
...and so on.
And I want out of this:
CompA WA Seattle USA
CompB TX null USA
Any tips?declare @temp table
company char(6),
state char(10),
city char(20),
country char(10))
insert into @temp values ('CompA','WA','Seattle',null),('CompA',null,null,'USA')
,('CompB','Tx',null,null),('CompB',null,null,'USA')
select max(company),MAX(state),MAX(city),MAX(country) from @temp
group by company
--Prashanth -
How to auto divide a one-line string into several rows in jsf?
<h:outputText value="#{msgs.aim}" styleClass="content_text_darkblue"></h:outputText>
for example, the #{msgs.aim} will be a long string that one line cannot output. how can i make it auto-break according to the row length instead of show a horizontal scrollbar?
in raw html code, i know i can include the content inside a <p> tag. but in jsf, i found it impossible to do in this way, although i tried to use <f:verbatim> tag
can any1 give me some idea about this?Hello,
Why not <h:inputTextarea> ? It makes this automatically for you and you can user readonly="true" to render it as a fictive outputTextarea...
See example:
<h:inputTextarea value="#MyBean.description}" rendered="true" required="false" rows="20" cols="80" id="description" readonly="true" />
Hope you agree.
sunjavero
Maybe you are looking for
-
my computer wont finish downloading itunes it says that the apple application support was not found and it tells me to uninstal it and download itunes again n i did so n it keeps doing the same thing, even tho i have downloaded itunes before in this
-
Use of C-calls in file browser
Hello I have a question pertaining to the use of C-calls in a class that I'm writing. The purpose of the class is to allow a user to browse files on either the current application server or a remote application server. Additionally the browser would
-
Exception message 30 & Reschedule date
Hi All, This is about the exception message 30 which is displayed in MD04 and the rescheduling date.How is this date determined and what does the exception message signify. how the system determines this dates?Also, what is the criteria for this resc
-
Finding the mean of a series of complex numbes to generate an avergage FFT spectrum
Hi All I have a a 2d array of complex numbers. In fact I have a 10 x 133210 array that represents the complex result of a series of ffts taken from the time series of 10 mics. For example Frequency :::::: 1Hz 2 Hz 3Hz 4Hz 5H
-
Transfered from MS to UB. The Highlight seection in Multisim button in UB remains stippled out for some reason. Would be a nice feature if I could get it to work. Any suggestions? Thanks! Regards, Who