DataGridCellStyle: Set Background of DataGridCell based on value in a Different DataGrid / DataTable
Hi everyone
I am trying to set the background of a cell in a datagrid based on a value in a different datagrid. Is it possible to specify this in the XAML through binding? I'm using the MVVM pattern and would like to minimise code in the code behind. Please note that
the datagrids are the same dimension, but the dimension is unknown until runtime.
I've copied an image of the two datagrids. Essentially, the second datagrid will contain values of 0 or 1. I would then like to color the cells in the first datagrid a different color based on these values.
CODE:
<DataGrid Style="{StaticResource Style1}" ItemsSource="{Binding Table1, StringFormat=n}" AutoGenerateColumns="True" >
<DataGrid.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding CommandWithParameter}" CommandParameter="{Binding .}"/>
</DataGrid.InputBindings>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="{Binding Table2, Converter={StaticResource WeightConverter} }"/>
</Style>
</DataGrid.CellStyle>
</DataGrid>
Thanks!
You could use a DataTrigger that binds to a column of a row of the other DataGrid like this:
<DataGrid x:Name="datagrid"></DataGrid>
<DataGrid x:Name="datagrid2">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Items[0].num, ElementName=dataGrid}" Value="abc">
<Setter Property="Foreground" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
</DataGrid>
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("num") { DataType = typeof(string) });
dt.Rows.Add("abc");
datagrid.ItemsSource = dt.DefaultView;
datagrid2.ItemsSource = new List<string> {"a", "b", "c" };
Hope that helps.
Please also remember to mark all helpful posts as answer to close your threads and please start a new thread if you have a new question.
Similar Messages
-
Calculate difference based on values from 2 different columns
Hello friends,
I want to basically do something like below which is in T-SQL Format :
SUM(CASE columnA WHEN 'ABC' THEN 1 ELSE 0 END) - SUM(CASE columnB WHEN 'XYZ' THEN 1 ELSE 0 END)
For which I was changing the code to following in Oracle :
SUM(CASE columnA='ABC' THEN 1 ELSE 0 END) - SUM(CASE columnB='XYZ' THEN 1 ELSE 0 END)
But its failing validation with an error message - missing right paranthesis....
Rest of the qry is fine and whenever I add this line it starts failing.
Edited by: Sweta on 11-Sep-2009 09:32Try this
SUM (CASE
WHEN columna = 'ABC'
THEN 1
ELSE 0
END)
- SUM (CASE
WHEN columnb = 'XYZ'
THEN 1
ELSE 0
END)or
COUNT (CASE
WHEN columna = 'ABC'
THEN 1
END)
- COUNT (CASE
WHEN columnb = 'XYZ'
THEN 1
END)Remark : you can use this sythax in oracle
SUM(CASE columnA WHEN 'ABC' THEN 1 ELSE 0 END) - SUM(CASE columnB WHEN 'XYZ' THEN 1 ELSE 0 END)Example
SELECT emp_test.*,CASE ename
WHEN 'SCOTT'
THEN 1
END ind
FROM emp_test
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO IND
7369 SMITH CLERK 7902 1980-12-17 800 20
7499 ALLEN SALESMAN 7698 1981-02-20 1600 300 30
7521 WARD SALESMAN 7698 1981-02-22 1250 500 30
7566 JONES MANAGER 7839 1981-04-02 2975 20
7654 MARTIN SALESMAN 7698 1981-09-28 1250 1400 30
7698 BLAKE MANAGER 7839 1981-05-01 2850 30
7782 CLARK MANAGER 7839 1981-06-09 2450 10
7788 SCOTT ANALYST 7566 1987-04-19 3000 20 1
7839 KING PRESIDENT 1981-11-17 5000 0 10
7844 TURNER SALESMAN 7698 1981-09-08 1500 30
7876 ADAMS CLERK 7788 1987-05-23 1100 20
7900 JAMES CLERK 7698 1981-12-03 950 30
7902 FORD ANALYST 7566 1981-12-03 3000 20
7934 MILLER CLERK 7782 1982-01-23 1300 10
14 rows selected. -
Conditionally set page item based on value of another item
Hello,
I have a form that is used to create/apply changes to records. There is an application item (APP_ITEM_PROFILE)
that is set on login which contains a value for the user's Profile ID. This Profile ID is used through out the
application for authorizations (conditionally present tabs, etc).
I've set a page item on the form equal to APP_ITEM_PROFILE so that the record is stamped
with that user's profile ID when they create a record. Users with different Profile IDs may later make changes to
the record but I want to keep the original Profile_ID on the record.
I am trying to populate the Profile ID conditionally in the form based on the existence of a
record ID. If there is no ID (a new record is being entered), then I want the
Profile ID to be that of the current user (APP_ITEM_PROFILE). If there is an ID (modification is
being made to an existing record), then I want the keep the Profile ID that was originally saved
with the record in MyTable.
I have this as the source for :P11_PROFILE_ID. The type is PL/SQL Expression or Function, Always, replacing... but it
is not working (page not found when page is run):
begin
if :P11_ID is not null
then
select PROFILE_ID
into :P11_PROFILE_ID
from MyTable
where ID = :P11_ID;
elsif :P11_ID is null
then select nv(':APP_ITEM_PROFILE') into :P11_PROFILE_ID from dual;
end if;
end;
Item Descriptions:
ID is the record ID.
:P11_ID is the page item of the record ID (Display as Text, saves state).
PROFILE_ID is the user's Profile ID.
:P11_PROFILE_ID is the page item of the user's Profile ID.
:APP_ITEM_PROFILE is the user's Profile ID that is set on login.
Any help is greatly appreciated.
Thanks,
Matt
Update:
I found one of Scott's answers:
Using IF Else to determine the value of a Item
and modified the above code to:
declare l_ret number;
begin
if :P11_ID is not null
then
select PROFILE_ID
into l_ret
from MyTable
where ID = :P11_ID;
else select :APP_ITEM_PROFILE' into l_ret from dual;
end if;
return l_ret;
end;
It seems to be setting the Profile ID correctly when the ID is not null, but not when a new record is being created. In the latter case, there is no value.
Edited by: mterlesky on May 11, 2009 11:02 PM
Edited by: mterlesky on May 11, 2009 11:52 PM
Edited by: mterlesky on May 11, 2009 11:53 PMThanks. That is putting the value into the page item and session state but that value is not being saved when the record is created. I'm not sure why - here is part of the debug (the "Billing" table is the "MyTable" table in the previous posting). Any thoughts?
On form, before submit:
0.06: Saving g_arg_names=P11_PROFILE_ID and g_arg_values=112
0.06: ...Session State: Saved Item "P11_PROFILE_ID" New Value="112"
After Submit
0.06: ...Session State: Save "P11_PROFILE_ID" - saving same value: "112"
(validations not shown)
0.10: Processing point: AFTER_SUBMIT
0.10: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select BILLING_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P11_ID := get_pk; end;
0.10: ...Session State: Save Item "P11_ID" newValue="452" "escape_on_input="Y"
0.10: ...Do not run process "Get PK for CREATEAGAIN", process point=AFTER_SUBMIT, condition type=, when button pressed=CREATEAGAIN
0.10: ...Process "Process Row of BILLING": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:BILLING:P11_ID:ID|IUD
0.10: ...Process "Update TOTAL_HOURS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_HOURS = ((NVL(CD_90801_UNITS,0)*1.5)+ (NVL(CD_90804_UNITS_B,0)*.5)+ NVL(CD_90806_UNITS,0)+ (NVL(CD_90808_UNITS_B,0)*1.5)+ NVL(CD_90812_UNITS,0)+ (NVL(CD_90814_UNITS_B,0)*1.5)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NV
0.11: ...Process "Update TOTAL_UNITS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_UNITS = (NVL(CD_90801_UNITS,0)+ NVL(CD_90804_UNITS_B,0)+ NVL(CD_90806_UNITS,0)+ NVL(CD_90808_UNITS_B,0)+ NVL(CD_90812_UNITS,0)+ NVL(CD_90814_UNITS_B,0)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NVL(CD_90853_UNITS,0)+ NV
0.11: ...Process "G_TRANS_COUNT_ADD": PLSQL (AFTER_SUBMIT) begin :G_TRANS_COUNT := :G_TRANS_COUNT +1; end;
0.11: ...Session State: Saved Item "G_TRANS_COUNT" New Value="1"
0.11: ...Process "Email_Notification": PLSQL (AFTER_SUBMIT) declare l_body_html varchar2(4000); begin l_body_html := '<p>Billing ID '||:P11_ID||' was entered by '||:P11_PROV_NAME||'.'|| ' More transactions may have been entered by the provider after this one.'||'</p> <p><a
Edited by: mterlesky on May 12, 2009 9:21 AM -
How to change background color in List of Values (LOV) ?
Hiya
In Forms 10g, the background color in list of values (LOV) is White whereas it was grey in Form 6i. Also, the position of 3 buttons i.e. Find, OK and Cancel on LOV is different than what it used to be in Forms 6i.
Is it possible to change the background color and the position of buttons of LOV in Forms 10g ?
Cheers
MayurI would like to share the outcome of this issue.
I had posted this same issue on Metalink yesterday. They (Metalink guys) have confirmed that its an bug in Oracle 10g DS R2 and it would be fixed in subsequent releases.
Following is an official response from Metalink:
This issue has been addressed to Oracle Development to be investigated/fixed in the published Bug:
Bug 1559776 <BACKGROUND COLOR SETTING FOR LOV OBJECT DOES NOT WORK ON WEB>
Cheers
Mayur -
How to set background color in af:inputText in an af:table
Hi,
how to set background color in af:inputText in an af:table depending on the value of af:inputText.
For example, how to set background red if the af:inpuText is empty
ThanksHello Pavo,
it's also possible to take the code from ebitar and use the expression within styleClass instead of inlineStyle.
E.g. you can define a custom style "StyleClassEmptyText" in your skin and set this styleclass if af:inputtext is empty.
By using style classes you can have the same style in the whole application and you are able to change this style on a single point(in the styleclass) for the whole application.
br
Peter -
Insert value into a column based on value of another column
Hi,
I am trying to insert a value into a record based on a column in
the record, using a trigger. The complication arises because
the new value is selected from the same table. For example:
SELECT COL1, COL2, COL3, COL4 from TABLE1
I want to set COL2 and COL3 based on the value of COL4. And to
get the value of COL2 and COL3, I will go back to TABLE1 and set
the condition to TABLE1.COL1 = :NEW.COL4
I cannot seem to execute the trigger as I get the message "ORA-
04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
see it" everytime.
Is this the correct way to achieve what I wanted? Or is there
another way?
Appreciate your feedback. Thank you in advance.Hi,
I am trying to insert a value into a record based on a column in
the record, using a trigger. The complication arises because
the new value is selected from the same table. For example:
SELECT COL1, COL2, COL3, COL4 from TABLE1
I want to set COL2 and COL3 based on the value of COL4. And to
get the value of COL2 and COL3, I will go back to TABLE1 and set
the condition to TABLE1.COL1 = :NEW.COL4
I cannot seem to execute the trigger as I get the message "ORA-
04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
see it" everytime.
Is this the correct way to achieve what I wanted? Or is there
another way?
Appreciate your feedback. Thank you in advance. I'm not sure what you mean when you insert a value into a
record, but if you are setting a value in a column of the same
record using a trigger, then it's easy.
:new.COL2 := ....:new.COL4...
:new.COL3 := ....:new.COL4...
The trigger must be 'INSERT or UPDATE' and 'FOR EACH RECORD'.
If you are setting a different record in the same table, the
solution is much more difficult. -
How to create a new row for a VO based on values from another VO?
Hi, experts.
in jdev 11.1.2.3,
How to create a new row for VO1 based on values from another VO2 in the same page?
and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
How-to declaratively create new table rows based on existing row content (20-NOV-2008)
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
I have tried:
1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
3.add: Create insertinside Createwithparams->Nameddata(amount),
4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
java.lang.NumberFormatException: For input string: "Amount"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
Can anyone give some suggestions?
Thanks in advance.
bao
Edited by: user6715237 on 2013-4-19 下午9:29Hi,CM,
I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
My principal requirement is as follows:
1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
--so it's better to implement it in UI rather than in EO.
2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
--little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
In order to get full information for the requirements of my use case, can take a check at:
How to set default value for a VO query bind variable in a jspx page?
(the end half of the thread: I have a more realworld requirement similar to the above requirement is:
Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
Regards
bao
Edited by: user6715237 on 2013-4-19 下午11:18
JAVE->JAVA -
How to display f4 help for a field based on value of another field
Hello All,
I have 4 fields : Sales Org : VBAK-VKORG, Distrib Channel : RV50A-VTWEG, Div : RV50A-SPART, Sold-to-party : KUAGV-KUNNR.
The second field depends on the first one, the third on the second one and the fourth on the first field.
However, when each of the second third and fourth fields' f4 help is displayed, the values are independent of the previous fields. How do I set the f4 help to display values based on the respective fields?
Regards,
MithunPlease be sure that you are searching the forums before posting. This exact same question was asked just yesterday:
F4 help to input field
In particular study the section and the linked help document for ddic search helps export/importing parameters and the requirements for DDic Structure/table usage for the parameter mapping. -
Set background color when condition applied
hi,
Can anybody tell me how to set background color when condition applied.
My initial plan was to highlight a specify row(Change color) when the third column of this JTable consists of OK word.
int rowCount = table.getRowCount();
for(int i=0 ;i <rowCount ; i++)
String word = table.getValueAt(i,3).toString();
if(word.equals("Word")) {
table.setSelectionBackground(Color.red);
break;
else {
table.setBackground(getBackground());
Thanks.import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
public class TableChanges
public TableChanges()
String[] headers = { "column 1", "column 2", "column 3", "column 4" };
int rows = 18;
int cols = 4;
String[][] data = new String[rows][cols];
for(int row = 0; row < rows; row++)
for(int col = 0; col < cols; col++)
data[row][col] = "item " + (row * cols + col + 1);
JTable table = new JTable(data, headers);
// add custom cell renderer to each column
TableColumnModel columnModel = table.getColumnModel();
for(int j = 0; j < columnModel.getColumnCount(); j++)
TableColumn col = columnModel.getColumn(j);
col.setCellRenderer(new CellRenderer());
// add table model listener to listen for cell edits
// so we can detect our special selection edit value
// which is "word"
TableModel tableModel = table.getModel();
tableModel.addTableModelListener(new ModelListener(table));
JScrollPane scrollPane = new JScrollPane(table);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(scrollPane);
f.setSize(400,400);
f.setLocation(200,200);
f.setVisible(true);
Dimension d = scrollPane.getViewport().getSize();
table.setRowHeight(d.height/rows);
public static void main(String[] args)
new TableChanges();
class ModelListener implements TableModelListener
JTable table;
public ModelListener(JTable table)
this.table = table;
public void tableChanged(TableModelEvent e)
int firstRow = e.getFirstRow();
int lastRow = e.getLastRow();
int colIndex = e.getColumn();
if(e.getType() == TableModelEvent.UPDATE &&
firstRow != TableModelEvent.HEADER_ROW &&
colIndex != TableModelEvent.ALL_COLUMNS &&
colIndex == 2) // column 3 only
String value = (String)table.getValueAt(firstRow, colIndex);
// check for our special selection criteria
if(value.equals("word"))
for(int j = 0; j < table.getColumnCount(); j++)
CellRenderer renderer =
(CellRenderer)table.getCellRenderer(firstRow, j);
renderer.setSpecialSelection(firstRow, j);
class CellRenderer extends DefaultTableCellRenderer
int specRow, specCol;
public CellRenderer()
specRow = -1;
specCol = -1;
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row, int col)
setHorizontalAlignment(JLabel.CENTER);
Color color = Color.black;
if(hasFocus)
color = Color.blue;
else if(isSelected)
color = Color.green.darker();
else if(row == specRow && col == specCol)
color = color.red;
setForeground(color);
setText((String)value);
return this;
public void setSpecialSelection(int row, int col)
specRow = row;
specCol = col;
} -
Populating values in dropdown based on values selected in second dropdown.
Hi,
I have two listboxes on the screen. Based on value chosen in first dropdown, I want to populate the values to be selected in second dropdown. How can i achieve this? I would be glad if anyone can help me out with this requirement.
Thanks,
Ameet<font color=blue>Hi,
<li> Place 2 input fields on screen.
<li>Set Listbox property as it is shown in the below link.
<a href="http://2.bp.blogspot.com/_O5f8iAlgdNQ/SmPSPnRa0tI/AAAAAAAAFCQ/wW_URP-ld6o/s1600-h/drop_down-770536.JPG" target="_new">link to dropdown setting</a>
<li>Set function code to first dropdown box to trigger event when you select value from first dropdown box. So that second one is changed.
<li>Declare variable like below in TOP include of the module pool program.
<pre>DATA: g_drop_1 TYPE char10,
g_drop_2 TYPE char10,
ucomm TYPE sy-ucomm.
TYPE-POOLS vrm.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.</pre>
<li> Use screen flow logic of the screen like below
<pre>"PROCESS BEFORE OUTPUT.
PROCESS BEFORE OUTPUT.
field g_drop_1 MODULE drop_down_1.
field g_drop_2 MODULE drop_down_2.
"PROCESS AFTER INPUT.
PROCESS AFTER INPUT.
field g_drop_1.
field g_drop_2.</pre>
<li>Corresponding code for two drop down boxes.
<pre>&----
*& Module DROP_DOWN_1 OUTPUT
MODULE drop_down_1 OUTPUT.
CLEAR: list[],g_drop_2.
name = 'G_DROP_1'.
value-key = '1'.
value-text = 'value_1'.
APPEND value TO list.
CLEAR value.
value-key = '2'.
value-text = 'value_2'.
APPEND value TO list.
CLEAR value.
value-key = '3'.
value-text = 'value_3'.
APPEND value TO list.
CLEAR value.
value-key = '4'.
value-text = 'value_4'.
APPEND value TO list.
CLEAR value.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
ENDMODULE. " DROP_DOWN_1 OUTPUT
*& Module DROP_DOWN_2 OUTPUT
MODULE drop_down_2 OUTPUT.
CLEAR list[].
name = 'G_DROP_2'.
CASE g_drop_1.
WHEN 1 OR 2.
value-key = '1'.
value-text = 'text1'.
APPEND value TO list.
CLEAR value.
value-key = '2'.
value-text = 'text2'.
APPEND value TO list.
CLEAR value.
WHEN 3 OR 4.
value-key = '3'.
value-text = 'text3'.
APPEND value TO list.
CLEAR value.
value-key = '4'.
value-text = 'text4'.
APPEND value TO list.
CLEAR value.
ENDCASE.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
ENDMODULE. " DROP_DOWN_2 OUTPUT</pre>
Thanks
Venkat.O</font> -
PanelTabbed setting background image to tab
Hi,
I have 2 questions in UI components . I am using Trinidad components.
1) I am having the paneltabbed with 2 tabs, i want to change the background of tabs based on selection(when selected tab1 background should display a.png ,when tab2 is selected tab1 should display b.png, similarly all tabs background image should change dynamically based on selection.
I wrote javascript for onclick event
function TabButtonSelection(){
alert('inside Tab1ButtonSelection');
document.getElementById('Frame1:sdiTab1').style.backgroundImage="url('/images/yellow.jpg')";
document.getElementById('Frame1:sdiTab2').style.backgroundImage="url('/images/grey.jpg')";
but not working. Can you please give any suggestion?
2) Input Date is not displaying calendar(date picker) icon, so i couldn't select date
<tr:inputDate label="Date of Birth" required="true" id="selectInputDate1" shortDesc="Enter date in dd/mm/yyyy format" requiredMessageDetail="Enter date in dd/mm/yyyy format">
<f:convertDateTime pattern="dd/mm/yyyy"/>
</tr:inputDate>
only label and textfield is displayed , i am able to enter date but can't choose from calendar. If i set chooseid for inputdate component full calendar is displayed.
Please provide some solutions.Trinidad Users mailing list should be able to provide answers for Trinidad
http://myfaces.apache.org/trinidad/mail-lists.html
There is no reason you should have to use javascript. You can use skinning and the "selected" pseudo class to style the tabs. -
How to set 'Background Daemon URL' IN CONFIGURATION TAB ?
Hi All,
While running background job shuduling, i am getting following error :
<b>PLEASE SET 'Background Daemon URL' IN CONFIGURATION TAB.</b>
I have the url, but where to set it in configuration tab ?
Regards,
AnubhaChristian,
This URL http://<servername>:port/webdynpro/dispatcher/virsa/ccappcomp/BgJobStart?debug=1 allows you to view the entries in a given table. You can not insert information here, as you've already noticed. You will need to get your database admin involved. They will need to make these entries for you directly at the db level. Once the db has entered the required values you will then be able to validate that the values are there by pointing to this URL and checking table virsa_cc_config.
Hope this helps
Edit: Updated to the URL in this message to reflect the correct one.
Message was edited by:
Michael Penn -
Redirect to 3 diffrent pages based on value in the Auto complete field.
Hi Friends,
I am using an "Auto complete field" in a page for searching(Apex version 4.0). But i need to get values from 3 tables and when clicking on the value redirect to any of the 3 pages based on the value.
For example i am having 3 tables. 1.Customers 2.Sites 3.Employees. When i enter 'c' in the search field i need to get values from 3 tables to be listed in that "auto complete" field. i.e, if i am having customer with name 'cusotmer1', 'customer2' and site with names 'cisc1','cisc2' and employees with name'cid1','cid2' ; when i enter 'c' in the auto complete field all 6 values must be listed in the "auto complete" field and when clicking on 'customer1'/'customer2' need to redirect to page 'customer'. When clicking on 'cisc1'/'cisc2' redirect to "site" when clicking on 'cid1'/'cid2' redirect to employees page. Is there any way to achieve this. Please help.
Regards,
NavHi Nav,
OK - on my page 1, I have a "Text Field with autocomplete" item called P1_SELECTION. The List of Values definition setting for this is:
WITH D AS (SELECT ENAME || ' (Employee)' X
FROM EMP
UNION ALL
SELECT DNAME || ' (Department)' X
FROM DEPT)
SELECT X
FROM D
ORDER BY 1This adds the appropriate suffix to each item to show where the data is from - you can change this if you want as this becomes part of the searchable text.
On page 1, I have a normal SUBMIT button.
Then I have two branches:
1 - settings are:
Branch Type: Branch to Page or URL
Branch Point: On Submit: After Processing (After Computation, Validation, and Processing)
Target Type: Page in this Application
Page: 2 (the employee edit page)
Clear Cache: 2
Set these items: P2_ENAME
With these values: &P1_SELECTION.
Condition Type: Exists (SQL query returns at least one row)
Expression 1:
SELECT 1
FROM DUAL
WHERE :P1_SELECTION LIKE '%(Employee)'When Button Pressed: SUBMIT
2 - settings are:
Branch Type: Branch to Page or URL
Branch Point: On Submit: After Processing (After Computation, Validation, and Processing)
Target Type: Page in this Application
Page: 3 (the department edit page)
Clear Cache: 3
Set these items: P3_DNAME
With these values: &P1_SELECTION.
Condition Type: Exists (SQL query returns at least one row)
Expression 1:
SELECT 1
FROM DUAL
WHERE :P1_SELECTION LIKE '%(Department)'When Button Pressed: SUBMIT
On page 2 (the employee edit form), I have Computation with the following settings:
Item Name: P2_EMPNO
Type: SQL Query (return single value)
Computation Point: Before Header
Computation:
SELECT EMPNO
FROM EMP
WHERE ENAME || ' (Employee)' = :P2_ENAME Condition Type: Exists (SQL query returns at least one row)
Expression 1:
SELECT 1
FROM DUAL
WHERE :P2_ENAME LIKE '%(Employee)'On page 3 (the department edit form), I have Computation with the following settings:
Item Name: P2_DEPTNO
Type: SQL Query (return single value)
Computation Point: Before Header
Computation:
SELECT DEPTNO
FROM DEPT
WHERE DNAME || ' (Department)' = :P3_DNAMECondition Type: Exists (SQL query returns at least one row)
Expression 1:
SELECT 1
FROM DUAL
WHERE :P3_DNAME LIKE '%(Department)'The idea is that we append some fixed text to the end of the names in the autocomplete list. When the user clicks submit after selecting a name, one of the branches will be triggered depending on which fixed text is there. The branch sets the ENAME or DNAME value on the edit page and the computation on that page retrieves the appropriate EMPNO or DEPTNO value to put into the primary key page item (the main "Fetch Row..." process will then use that to get the real data for the record).
Note that this assumes that ENAME and DNAME are unique on their tables - otherwise, the computations will not be able to find a single record and an error would be generated.
Andy -
I can't figure out how to display a name of a field based on values. Here is what I have:
{SEAT_RECORD.TAX_TOTAL1}
{SEAT_RECORD.TAX_TOTAL2}
{SEAT_RECORD.TAX_TOTAL3}
{Tax.ID} - IDs are 1,2 and 3
{Tax.NAME}
I want to assign the {Tax.Name} to the the corresponding {SEAT_RECORD.TAX_TOTAL#}.
I have 3 IDs in Tax.ID (1,2,3). I want to create a text field with the appropriate tax name. {SEAT_RECORD.TAX_TOTAL1} corresponds with {Tax.ID} 1 and therefore should display {Tax.NAME} where {Tax.ID} = 1.
Same for {Tax.NAME} 2 and 3
On my Report I would like to have something like this in the footer section.
(TaxName1) {SEAT_RECORD.TAX_TOTAL1}
(TaxName2) {SEAT_RECORD.TAX_TOTAL2}
(TaxName3) {SEAT_RECORD.TAX_TOTAL3}
Do I need to create a formula or SQL expression? Any help will be appreciated.
Thanks,
-MattThat doesn't work...my footers look like this then...
Group Footer #1a: {Tax.Name} {SEAT_RECORD.TAX_TOTAL1}
Group Footer #1b: {Tax.Name} {SEAT_RECORD.TAX_TOTAL2}
Group Footer #1c: {Tax.Name} {SEAT_RECORD.TAX_TOTAL3}
and the output is pretty crazy.
I need to be able to create a variable like
Set @Tax1 as {Tax.Name} where {Tax.ID} = 1
That way I can just put the variable on a footer along with {SEAT_RECORD.TAX_TOTAL1} and get what I need.
-Matt -
Need to change LOV based on values in other Item ....
Hello All,
I got a required to show LOV based on some value in other column. Let me explain ... suppose in column A has value is A1 then column B should show A11, A12 , A13 and if Column A has value C then cloumn B should show C11, C12 ... etc. The LOV will be static with some pre defined values. So all the LOVs will be defined in forms. We just need to show based on value in column A .
Please suggest.
Thanks.
Edited by: Amit1cs on Apr 18, 2013 7:40 PMAmit1cs wrote:
Hello All,
I got a required to show LOV based on some value in other column. Let me explain ... suppose in column A has value is A1 then column B should show A11, A12 , A13 and if Column A has value C then cloumn B should show C11, C12 ... etc. The LOV will be static with some pre defined values. So all the LOVs will be defined in forms. We just need to show based on value in column A .
Please suggest.Hello Amit,
So far i understand, you can create multiple record group for a single LOV. before display the lov just change or assign the appropriate record group. You may use pre-text-item trigger at column B and set the record group to your LOV.
Hope this helps
Hamid
Maybe you are looking for
-
Update issues with iOS 8.02
-
Cannot connect to iTunes store
I can no longer connect to the iTunes store. I have windows xp, and i just downloaded the latest iTunes update.
-
Can someone tell me how to fix this problem. I guess something went wrong in Oracle AS . <2006-10-06 10:49:29,540> <ERROR> <default.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Failed to handle dispatch message ... exception ORABPEL-0
-
Ipod shuffle 2nd gen not responding??
there is no action or responce from ipod when i turn it on....when i plug into my macbook it jus flashes in itunes an goes away an dat repeats plus the is a notifcation keep popping up sayin iopd was not ejected porperly please eject ipod before remo
-
Ok, I'm trying to adapt to Photoshop after having used Photostudio for ages. The electronic help manual is really awful and isn't answering my question about the cloning tool at all (I just want to copy some cloud onto an empty space of background).