Rowset parameter that depends on Component value

Hello All,
Suppose you have a list that is filled from the database, and you want to bind a textArea to a rowset that needs the list.getValue() as a parameter.
The list.getValue() is populated during "Process Validation" phase (or "Apply Request Values" if "immediate").
If the rowset is not filled with parameters, "java.sql.SQLException: execute() never called" is thrown during the earliest "Render Resposne" phase.
Even after putting a hardcoded value in the constructor, trying to set and execute the rowset at later stages (after "Process Validation" or "Apply Request Values"), will not update the textArea.
Is there any way to make this?
Followed is the sample page
Many thanks.
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <jsp:text><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
]]></jsp:text>
    <f:view>
        <html lang="en-US" xml:lang="en-US">
            <head>
                <meta content="no-cache" http-equiv="Cache-Control"/>
                <meta content="no-cache" http-equiv="Pragma"/>
                <title>test Title</title>
                <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
            </head>
            <body>
                <h:form binding="#{test.mainForm}" id="mainForm">
                    <h:selectOneMenu binding="#{test.dropDown}" id="dropDown" immediate="true">
                        <f:selectItems binding="#{test.dropdownSelectItems}" id="dropdownSelectItems" value="#{test.allTypesRowSet.selectItems['COMMAND_TYPE_ID']}"/>
                    </h:selectOneMenu>
                    <h:inputTextarea binding="#{test.textArea1}" id="textArea1" value="#{test.commandTypeRowSet.currentRow['DESCRIPTION']}"/>
                    <br/>
                    <h:commandButton binding="#{test.button1}" id="button1" value="Submit"/>
                </h:form>
            </body>
        </html>
    </f:view>
</jsp:root>
package monitor;
import javax.faces.*;
import com.sun.jsfcl.app.*;
import javax.faces.component.html.*;
import com.sun.jsfcl.data.*;
import javax.faces.component.*;
import com.sun.sql.rowset.*;
import javax.faces.event.PhaseEvent;
public class test extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
    private HtmlForm mainForm = new HtmlForm();
    public HtmlForm getMainForm() {
        return mainForm;
    public void setMainForm(HtmlForm hf) {
        this.mainForm = hf;
    private HtmlSelectOneMenu dropDown = new HtmlSelectOneMenu();
    public HtmlSelectOneMenu getDropDown() {
        return dropDown;
    public void setDropDown(HtmlSelectOneMenu hsom) {
        this.dropDown = hsom;
    private DefaultSelectItemsArray dropdown1DefaultItems = new DefaultSelectItemsArray();
    public DefaultSelectItemsArray getDropdown1DefaultItems() {
        return dropdown1DefaultItems;
    public void setDropdown1DefaultItems(DefaultSelectItemsArray dsia) {
        this.dropdown1DefaultItems = dsia;
    private UISelectItems dropdownSelectItems = new UISelectItems();
    public UISelectItems getDropdownSelectItems() {
        return dropdownSelectItems;
    public void setDropdownSelectItems(UISelectItems uisi) {
        this.dropdownSelectItems = uisi;
    private HtmlInputTextarea textArea1 = new HtmlInputTextarea();
    public HtmlInputTextarea getTextArea1() {
        return textArea1;
    public void setTextArea1(HtmlInputTextarea hit) {
        this.textArea1 = hit;
    private JdbcRowSetXImpl allTypesRowSet = new JdbcRowSetXImpl();
    public JdbcRowSetXImpl getAllTypesRowSet() {
        return allTypesRowSet;
    public void setAllTypesRowSet(JdbcRowSetXImpl jrsxi) {
        this.allTypesRowSet = jrsxi;
    private JdbcRowSetXImpl commandTypeRowSet = new JdbcRowSetXImpl();
    public JdbcRowSetXImpl getCommandTypeRowSet() {
        return commandTypeRowSet;
    public void setCommandTypeRowSet(JdbcRowSetXImpl jrsxi) {
        this.commandTypeRowSet = jrsxi;
    private HtmlCommandButton button1 = new HtmlCommandButton();
    public HtmlCommandButton getButton1() {
        return button1;
    public void setButton1(HtmlCommandButton hcb) {
        this.button1 = hcb;
    // </editor-fold>
    public test() {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
        try {
            allTypesRowSet.setDataSourceName("java:comp/env/jdbc/Monitor");
            allTypesRowSet.setCommand("SELECT * FROM COMMAND_TYPE");
            commandTypeRowSet.setDataSourceName("java:comp/env/jdbc/Monitor");
            commandTypeRowSet.setCommand("SELECT * FROM COMMAND_TYPE where COMMAND_TYPE_ID=?");
             //commandTypeRowSet.setString( 1, "A valid hardcoded value" );
        } catch (Exception e) {
            log("test Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        // </editor-fold>
        // Additional user provided initialization code
    public void beforeApplyRequestValues() {
        try {
        commandTypeRowSet.setString( 1, dropDown.getValue().toString() );
        commandTypeRowSet.execute();
        } catch( Exception e ) {
            log( "beforeApplyRequestValues(): ", e );
    protected void afterRenderResponse() {
        commandTypeRowSet.close();
        allTypesRowSet.close();
    public void beforePhase(PhaseEvent event) {
        log( "BeforePhase 1 " + event.getPhaseId() + " with value " + dropDown.getValue() );
        super.beforePhase( event );
        log( "BeforePhase 2 " + event.getPhaseId() + " with value " + dropDown.getValue() );
    public void afterPhase( PhaseEvent event ) {
        log( "AfterPhase 1 " + event.getPhaseId() + " with value " + dropDown.getValue() );
        super.afterPhase( event );
        log( "AfterPhase 2 " + event.getPhaseId() + " with value " + dropDown.getValue() );
}

Phew, I found the reason, that is textArea is not readonly, so its value is overwritten during "ApplyRequestValues".

Similar Messages

  • How could I pass parameter that depend on values in report from report to form?

    In my case, I want to pass 'gno' and 'qno' values of report
    to form. When click on the button then the form is showed.
    There are automatically values in gno field on form so that user
    don't complete this filed.
    So I create a button on the report . I enter Javascript in
    PL/SQL Code tab in '...after displaying the footer' as follow :
    htp.formOpen
    (owa_util.get_owa_service_path||'portal30.wwa_app_module.link?
    p_arg_names=_moduleid&p_arg_values=1736929105&p_arg_names=_show_h
    eader&p_arg_values=YES&p_arg_names=GNO&p_arg_values=1&p_arg_names
    =QNO&p_arg_values=2');
    htp.formSubmit(null,'New Answer');
    htp.formClose;
    The above code can pass only static value, while I want to
    pass values that depend on value in column of report to form.
    So please tell me how can I pass this value to form. I look
    forward to hearing from all of you. Please!!!!!!
    Thank You

    Thanks for the prompt reply.
    Yes. I am using a Custom Step Type.
    I have attached a trial code which contains the trial VI, sequence and the type palette ini file.
    Please have a look at it.
    Regards,
    Mirash
    Attachments:
    Injection trial.zip ‏35 KB

  • Disabling and or hiding parameter controls depending on the value of a popup

    How should I go about doing this? I've set the flags for the popup param to PF_ParamFlag_SUPERVISE like so
    def.flags = PF_ParamFlag_SUPERVISE;
    PF_ADD_POPUP(
         "Mode",
       6,
       1,
         "Option 1|Option 2|...",
       POPUP_MODE_ID
    And I'm capturing the PF_Cmd_USER_CHANGED_PARAM command like so
    case PF_Cmd_USER_CHANGED_PARAM:
         ERR(UserChangedParam(in_data, out_data, params, output, reinterpret_cast<PF_UserChangedParamExtra *>(extra));
         break;
    static PF_Err UserChangedParam(
        PF_InData* in_data,
        PF_OutData* out_data,
        PF_ParamDef* params[],
        PF_LayerDef* outputP,
        PF_UserChangedParamExtra* extra)
        PF_Err err = PF_Err_NONE;
        if (extra->param_index == POPUP_MODE_ID)
            if (params[POPUP_MODE_ID]->u.cd.value == 2)
                 //Code to enable and show the controls
            else
                 //Cose to disable or hide the controls
        return err;
    Am I doing everything right so far? What code do I need to put in the "if (params[POPUP_MODE_ID]->u.cd.value == 2)" block to disable a parameter? How different would the code be to hide the parameter completely? Can I hid entire topics like I can hide parameters? I'd have a use for all three things, I just can't figure out how to do them.

    I took a look at the Supervisor sample project. I've managed to figure out how to disable controls, which I've done like so:
    AEGP_SuiteHandler suites(in_data->pica_basicP);
    params[CONTROL_ID]->ui_flags |= PF_PUI_DISABLED;
    params[CONTROL_ID]->flags |= PF_ParamFlag_COLLAPSE_TWIRLY;
    ERR(suites.ParamUtilsSuite3()->PF_UpdateParamUI(
        in_data->effect_ref,
        CONTROL_ID,
        params[CONTROL_ID]
    Enabling should be something this instead:
    params[CONTROL_ID]->ui_flags &= ~PF_PUI_DISABLED;
    What I can't figure out, still, is how to hide a control. I've tried to set the PF_PUI_INVISIBLE flag but that did not seem to change anything. It looks like the Supervisor plugin is setting the exact same flag to hide controls but it must have something else that I'm missing.

  • LabVIEW 8.6 propositions on how to build application that acts like reader form specified field dependent on which values been selected

    Hello everyone!
    I am newbie to LabVIEW with some previous experience programming in different languages.
    My goal is to build the application that upon my selection needs to give specific values from previously filled and prepared file.
    For example, I have different types of operations (milling, drilling, turning..) and different grades (type) of steels (Uddeholm steel grades: NIMAX, IMPAX...and about 40 of them). For every operation there are different input data (Coated insert, uncoated). Based of those information application should give out cutting speed and feed rate data that are stored in some file. I understand I can do it in Excel spreadsheet or LV spreadsheet, I would prefer LV because of portability to systems without Office installed on them. I also understand that all those issues concerning input data for output results I can easily solve with case scenario.
    Main issue is decision between different types of files that I can easily address like 2D matrix to get required data, which and how to do it.
    I would like to know what I should acknowledge first before doing any further work?
    And does someone have some simply prepared VI on which I can work my way on?
    If you are willing to help me with guides I would be happy to answer any of your questions.
    Vedran Galeta

    Thank you very much for your reply.
    This application that I am working on is completely static due to communication. It simply needs to provide entry in table depending on selected inputs in front panel, and of course display it front panel. I know what I need to do, as well as the structure. Only thing that I don't know yet how to do it in LabVIEW.
    When I mentioned "LV spreadsheet" I meant on read from file option, you got that right.. The thing is that now I have large amounts (not large in acquisition data point of view, 5 spread sheets, with 45 rows and 15 columns) of data saved in Excell, and my goal would be to get that data in LabVIEW application, for the ease of access. And still leave that xls file as is, due to all connections that he have with smaller xls files. So in compact version of the story I am going to use save as comma separated (or tab, that depends of course) values from Excell with or without extra editing of created file in order to load that file into prepared program structure in LabVIEW. After I manage to do that, of course I will work my way for all other extras that I am gonna put eventually in program structure. So this would be like a backbone, I know it sounds simple. As a matter of fact I would probably be finnished allready in VB but highest demand is to do this in LabVIEW, and I am fully down with that.
    Regards,
    Vedran

  • Actual cost component values

    Hi
    We are facing an issue that actual cost component values in our system are not calculating correctly. We consider that there might be difference in our understanding regarding the calculation of actual cost component values.
    Therefore I want to understand that how actual cost component values are calculated in SAP Material Ledger. I will appreciate if anyone can elaborate this with example and formula, used for calculation.
    Regards

    Hi Saad,
    Please find below about the actual cost calculation in ML.
    In ML single -level and multi-level material settlements are available. Multilevel price determination calculates the periodic unit price for a material. The standard price, the single-level differences cumulated in the period, the differences between planned and actual prices, as well as input material differences (multilevel differences) are all taken into account.
    The material price calculated in multilevel price determination can be used for inventory valuation.
    The actual price for each material can be updated to the material master for the closed period.
    -During price determination, the system carries out the following calculation: 
    =>Daily Transaction
    1) Purchasing XYZ Qty 20 Std : 10, Actual : 11
       Dr) Stock XYZ 200                   CR) GRIR 220
    Purchase price differ XYZ 20
    2) Purchasing ZYX Qty 20 Std : 20, Actual : 22
       DR) Stock ZYX 400                   CR) GRIR 440
    Purchase price differ ZYX 40
    3) Good issue XYZ Qty 15 Std : 10
       DR) Material cost XYZ 150               CR) Stock XYZ 150
    4) Good issue ZYX Qty 15 Std : 20
       DR) Material cost  ZYX 300               CR) Stock ZYX 300
    5) Good receipt  234 Qty 15  Std : 40
      DR) Stock 234 600                    CR) Clearing 600
    6) Good delivery 234 Qty 10  Std : 40
       DR) Material cost  234 400         CR) Stock 234 400
    7) Good receipt  123 Qty 10 Std : 50
        DR) Stock123 500                    CR) Clearing 500
    8) Good issue  123 Qty 5 Std : 50
       DR) Material cost  123 250         CR) Stock 123 250
    9) Good receipt  ABC Qty 10 Std : 60
        DR) StockABC 600                    CR) Clearing 600
    10) Sold ABC Qty 5 Std 60
        DR) COGS 300                          CR) Stock ABC 300
    => Monthly Material Ledger Closing
    1) Single-level price determination
       DR) Stock XYZ  5 ( Current Stock 5 / Total Purchase Qty 20 *  price difference 20) 
       CR) Purchase price differ XYZ 20
    *Transfer price difference to 234  15 ( Good issue  qty 15 / Total Purchase Qty 20 *  price difference 20)
        DR) Stock ZYX  10 ( Current Stock 5 / Total Purchase Qty 20 *  price difference 40) 
        CR) Purchase price differ ZYX 40
    *Transfer price difference to 234  30 ( Good issue  qty 15 / Total Purchase Qty 20 *  price difference 40)
    2) Multi-level price determination
        DR) Stock234  5 ( Current Stock 5 / Total Good receipt 15 *  price difference 15) 
        CR) Transfer price difference to 234 from XYZ  15
    *Transfer price difference to 123 from 234  10 ( Good issue  qty 10 / Total Good receipt 15
           * price difference 15)
        DR) Stock  234 10 ( Current Stock 5 / Total Good receipt 15 *  price difference 30) 
        CR) Transfer price difference to 234 from ZYX 30
    *Transfer price difference to 123 from 234 20
            ( Good issue  qty 10 / Total Good receipt 15 *  price difference 30)
        DR) Stock 123 15  ( Current Stock 5 / Total Good receipt 10 *  price difference 30) 
        CR) Transfer price difference to 123 from 234 30
    * Transfer price difference to ABC from 123 15
                ( Good issue  qty 5 / Total Good receipt 10 *  price difference 30)
        DR) Stock  ABC 7.5 ( Current Stock 5 / Total Good receipt 10 *  price difference 15) 
        CR) Transfer price difference to ABC from 123 15
    *Not allocated price difference 7.5
                ( Sold qty 5 / Total Good receipt 10 * price difference 15)
    3) consumption revaluation
             DR) COGS ABC 7.5                     
             CR) Not allocated price difference 7.5
    => Current Actual Stock Amount
       1) XYZ Qty : 5 Actual Amount : 55 (actual price : 11)
       2) ZYX Qty : 5 Actual Amount : 110 (actual price : 22)
       3) 234 Qty : 5 Actual Amount : 215 (actual price : 43)
       4) 123 Qty : 5 Actual Amount : 265 (actual price : 53)
       5) ABC Qty : 5 Actual Amount : 307.5 (actual price : 61.5)
    I hope you understand the process of actual cost cal in ML.
    Regards,
    chandu.

  • LOV SQL query dependent on column value

    Hi Gurus,
    I have a tabular form, a column of which I would like to display as a dropdown whose list of values is a SQL query containing a where clause on another column value.
    For example, say the tabular form displays questions, and that the answers to the different questions are to be picked in list of values that are different for each question. I have tried the following queries for the dropdown list of values:
    1- select value_text, value_text from list_of_values_table where question_id=#QUESTION_ID#
    2- select value_text, value_text from list_of_values_table where question_id=:QUESTION_ID
    3- select value_text, value_text from list_of_values_table where question_id=&QUESTION_ID.
    In the 3 cases, I get an error when I run the application saying that the SQL statement is incorrect.
    Any ideas?
    Thanks in advance,
    Guillauem

    Anton,
    Yes, I am creating a region based on a sql query. The query is the following:
    select q.id quest_id, q.name, q.data_type_id, q.lov_flag, a.id answer_id, a.answer_text, a.org_id
    from gwb_questions q left join gwb_answers a on q.id=a.question_id, gwb_answers ans right join gwb_orgs o on ans.org_id=o.id
    where q.MODULE_ID=:P2_MODULE_ID and o.id=:P2_ORG_ID
    Now, in the 'answer_text' column, I would like to display a dropdown containing values that come from a separate table and that depend on the value of the quest_id column. So in the Column Attributes for 'answer_text', I selected Select List (query based LOV) for the Tabular Form Element, and I entered the query mentioned before in the List of Values section (select value_text, value_text from list_of_values_table lov where lov.question_id= ?).
    I am not using any API.
    Does that make sense?
    Thanks for your help,
    Guillaume

  • Report parameter startdate has a defaultvalue or a valid value that depends on the report parameter startdate forward dependencies are not valid

    Hi,
    Am trying to develop a report the parameter has an issue, it gives me an error.
    There are 2 parameter (1st is Date range like start and end date and 2nd is Loan number)
    When ever I select date range the Loan number parameter should go blank. If I input a loan number then date range should go blank. 
    What should I do. Please help
    ERROR --report parameter startdate has a defaultvalue or a valid value that depends on the report parameter startdate forward dependencies are not valid

    Hi Kay_MD,
    If there are only two parameters, we can use first parameter charge the second one, but the second one cannot charge the first one in turn. Because parameter forward dependencies are not valid. To achieve your requirement, we can create another parameter
    to control Date_range and Loan_number parameters. For more details, please see:
    Add a parameter named ReportParameter1 with two available values: Date_range and Loan_number.
    Use the following expression as the default value in Date_range parameter:
    =iif(Parameters!ReportParameter.Value="Date_range",1,"") (1 means a useless value)
    Use the following expression as the default value in Loan_number parameter:
    =iif(Parameters!ReportParameter.Value="Loan_number",1,"") (1 means a useless value)
    Please note that the Date_range and Loan_number parameters should enable Allow blank value (“”), and the blank values should also be contained in available values.
    If there are any other questions, please feel free to let me know.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Changing the value of a parameter that has been passed into an SSRS 2008 R2 report

    I support 200+ reports that all use stored procedures and have many drill downs with built in URLs.
    I want to do the below to avoid creating a brand new parameter that I will have to add to literally hundreds of places.
    We have what I'll call Param1 that receives a value from the user.  That Param1 is passed to the stored procedure(s) for the report and also embedded in any Action URLs for drill downs to other reports from that report.  All works great.
    Now I have a need to concatenate a string to whatever value they supplied which provides context for the environment in which they are running.  The reason I want to do this instead of creating a new parameter is because I need this in all my reports
    and as stated above I would have to make 100s of changes to make that happen.  If I can figure out a way to concatenate a value to the existing Param1 value I can greatly reduce the number of changes.
    I can't seem to be able to find a way to modify the value on an existing parameter that is passed into the report prior to report execution.
    I get an error when I simply try to concatenate something to the parameter in its Default property.
    I can't find a way to update a parameter value in the Report Code block.  There don't appear to be any methods available on the Parameter Collection to set the value of a parameter.
    Any ideas?
    Thanks!
    Nathan 

    Create a new parameter. Mark it internal, set it's value by expression to:
    =User!UserId+"MyNewValue"
    and pass it to the proc?
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • PO Form with Terms & Conditions that Change Depending on a Value in Another Field

    Hi - I have read through the relevant topics in this forum and have attempted several of them without luck. I am currently working on a form in which there is an empty JFMain (I do not want to populate fields on this page since I don't want things in this page my "static" header - logos, title, etc. since the Terms and Conditions pages should not show any of this.) On my page 2, I have subforms for all my fields except my Terms and Conditions. (These fields are controlled by a data file.) On my remaining pages I have 3 sets of Terms and Conditions - all about a page long - hard-coded as text and placed in subforms with a dummy field off page to ensure they print. What I want to do is print the subforms from page 2 and then the applicable terms from page 3, 4, or 5 depending on the value in a field located in one of the subforms on page 2. What I currently get is my subforms and then ALL my terms printing. Any thoughts?
    My preamble overrides look like this:
    ^define group:D_HEADER \field$POSITION\reserve".11",in\subformHEADER.
    ^define group:G_HEADER @group:D_HEADER.
    ^define group:dummy!FldNotAvail \groupG_Terms_Private_Commodity
    ^define group:dummy2!FldNotAvail \groupG_Terms_Private_Services
    ^define group:dummy3!FldNotAvail \groupG_Terms_Public
    ^define group:JfEndData!EndData @group:D_end.
    I had to place the JFEndData! statement into the Preamble since the last subform with fields called before the Terms subforms has a global field from another subform above it. For whatever reason, it was duplicating this subform after printing the Terms and Conditions.
    I tried adding a nested if statement into field that will control when I want each subform to print but it was ignored. I also tried hardcoding a group call into the preamble with the logic as well with no results. If someone has example code they can share, this would be great.

    I receive Adobe help forum posts via email and I've been saving a few for the pointers they contain. I have some saved that might help you out a bit...
    A reply to the "Please can some one help me out......." post by Mr BoJangles on 10/29/2007 gives some information about forcing a subfield to be displayed.
    A reply to the "Conditional logic" post by Marco Degl'Innocenti on 8/2/2006 gives information on initiating a subform based on the value of a field in the data stream.
    A reply to the logic post by Marco DeglInnocenti on 2/22/07 also gives information on initiating a subform based on the value of a field.
    I hope these can be of help. If you can't access them on the forum I can repost them.

  • Prompt Group Text value for parameter that has cascading prompts.

    <p>Does anyone know how to get a Prompt Group Text value for parameter that has cascading prompts. C# sample would be great.</p>

    Hi Sateeesh,
             I delete main memory, but does not work. if I display prompt value in list box, it shows as text value, but in 'query prompt selector', it shows as key value. I am using SAP BO 4.0

  • Shading part of a JTable Cell dependent upon the value of the cell

    Hi
    Was hoping some one woudl be able to provide some help with this. I'm trying to create a renderer that will "shade" part of a JTable cell's background depending upon the value in the cell as a percentage (E.g. if the cell contains 0.25 then a quarter of the cell background will be shaded)
    What I've got so far is a renderer which will draw a rectangle whose width is the relevant percentage of the cell's width. (i.e. the width of the column) based on something similar I found in the forum but the part I'm struggling with is getting it to draw this rectangle in any cell other than the first cell. I've tried using .getCellRect(...) to get the x and y position of the cell to draw the rectangle but I still can't make it work.
    The code for my renderer as it stands is:
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.table.TableCellRenderer;
    public class PercentageRepresentationRenderer extends JLabel implements TableCellRenderer{
         double percentageValue;
         double rectWidth;
         double rectHeight;
         JTable table;
         int row;
         int column;
         int x;
         int y;
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              if (value instanceof Number)
                   this.table = table;
                   this.row = row;
                   this.column = column;
                   Number numValue = (Number)value;
                   percentageValue = numValue.doubleValue();
                   rectHeight = table.getRowHeight(row);
                   rectWidth = percentageValue * table.getColumnModel().getColumn(column).getWidth();
              return this;
         public void paintComponent(Graphics g) {
            x = table.getCellRect(row, column, false).x;
            y = table.getCellRect(row, column, false).y;
              setOpaque(false);
            Graphics2D g2d = (Graphics2D)g;
            g2d.fillRect(x,y, new Double(rectWidth).intValue(), new Double(rectHeight).intValue());
            super.paintComponent(g);
    }and the following code produces a runnable example:
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    public class PercentageTestTable extends JFrame {
         public PercentageTestTable()
              Object[] columnNames = new Object[]{"A","B"};
              Object[][] tableData = new Object[][]{{0.25,0.5},{0.75,1.0}};
              DefaultTableModel testModel = new DefaultTableModel(tableData,columnNames);
              JTable test = new JTable(testModel);
              test.setDefaultRenderer(Object.class, new PercentageRepresentationRenderer());
              JScrollPane scroll = new JScrollPane();
              scroll.getViewport().add(test);
              add(scroll);
         public static void main(String[] args)
              PercentageTestTable testTable = new PercentageTestTable();
              testTable.pack();
              testTable.setVisible(true);
              testTable.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }If anyone could help or point me in the right direction, I'd appreciate it.
    Ruanae

    This is an example I published some while ago -
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class Fred120 extends JPanel
        static final Object[][] tableData =
            {1, new Double(10.0)},
            {2, new Double(20.0)},
            {3, new Double(50.0)},
            {4, new Double(10.0)},
            {5, new Double(95.0)},
            {6, new Double(60.0)},
        static final Object[] headers =
            "One",
            "Two",
        public Fred120() throws Exception
            super(new BorderLayout());
            final DefaultTableModel model = new DefaultTableModel(tableData, headers);
            final JTable table = new JTable(model);
            table.getColumnModel().getColumn(1).setCellRenderer( new LocalCellRenderer(120.0));
            add(table);
            add(table.getTableHeader(), BorderLayout.NORTH);
        public class LocalCellRenderer extends DefaultTableCellRenderer
            private double v = 0.0;
            private double maxV;
            private final JPanel renderer = new JPanel(new GridLayout(1,0))
                public void paintComponent(Graphics g)
                    super.paintComponent(g);
                    g.setColor(Color.CYAN);
                    int w = (int)(getWidth() * v / maxV + 0.5);
                    int h = getHeight();
                    g.fillRect(0, 0, w, h);
                    g.drawRect(0, 0, w, h);
            private LocalCellRenderer(double maxV)
                this.maxV = maxV;
                renderer.add(this);
                renderer.setOpaque(true);
                renderer.setBackground(Color.YELLOW);
                renderer.setBorder(null);
                setOpaque(false);
                setHorizontalAlignment(JLabel.CENTER);
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
                final JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
                if (value instanceof Double)
                    v = ((Double)value).doubleValue();
                return renderer;
        public static void main(String[] args) throws Exception
            final JFrame frame = new JFrame("Fred120");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setContentPane(new Fred120());
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }

  • Error  Parameter WI_ID contains an invalid value  in webdynpro abap

    Hi Experts,
    i am working with webdynpro abap and using work flow in my component , here i am getting error and the error is
    Parameter WI_ID contains an invalid value .
    its showing the error in windows parameter : wi_id  and the wi_id is type sww_wiid
    and the same parameter i am using in application parameter .
    can u suggest me how to use this parameter wi_id in window parameter and application parameter and what the type should be for wi_id parameter.and what the value should be for application parameter wi_id.
    her i am giving the complete error  details.
    please give me the requried information if u porvided screen that will be very useful
    The following error text was processed in the system RD1 : Parameter WI_ID contains an invalid value .
    The error occurred on the application server S0164SAPDEV2_RD1_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: HANDLESTART of program /1BCWDY/BP6P95H8W6B71I7VVRPR==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/BP6P95H8W6B71I7VVRPR==CP
    Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_IF_VIEW=====CP
    Method: DISPLAY_TOPLEVEL_COMPONENT of program CL_WDR_CLIENT_COMPONENT=======CP
    Method: INIT of program CL_WDR_CLIENT_APPLICATION=====CP
    Method: IF_WDR_RUNTIME~CREATE of program CL_WDR_MAIN_TASK==============CP
    Method: HANDLE_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
    Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Thanks & Regards.
    khanna

    Hi Nawal Kishor Mittal,
    thanks for the reply,
    i have given the application parameter wi_id with type string also but in 120 client (development) is working fine. when i test in 130 client( testing) its going to dump.
    what should be given to application value i given parameter wi_id and what the value should be there.
    waiting for reply.
    Thanks & Regards.
    Khanna.

  • Moving only one component value into a register AGAL

    Hi
    Do any of you know if there is any way in AGAL of moving a component value from one register to the other without touching the other components in the register? I notice that the following line...
    mov ft1.a, ft0.a
    ...will also overwrite the rgb components in ft1 with the rgb components from ft0. At least it does on my machine. In other words, specifying components may reorder (swizzle) the components, but doesn't mask them to preserve the value of other components in the destination register. Probably because each register is 128 bits wide, so it's easier for the GPU to just do the operation on all four components anyway. I'm trying to implement the technique described here:
    http://http.developer.nvidia.com/GPUGems/gpugems_ch22.html
    Under "22.2.2 Curves". It requires me to process each color component independently.

    "You can't have an HTML form element map to an Oracle PL/SQL procedure parameter that is defined as a TYPE definition"
    Sorry, but this is just plain wrong. Passing values to associative arrays (TYPE xxx IS TABLE OF xxx INDEXED BY BINARY_INTEGER) has been possible at least since OAS 4.0.8.
    The following simple procedure prints the values passed to it from a form with multiple occurrences of in_val
    CREATE OR REPLACE PROCEDURE test_prc (in_val IN owa_util.ident_arr ) IS
    BEGIN
    for i in in_val.first..in_val.last loop
    htp.p(in_val(i));
    end loop;
    END test_prc;
    (owa_util is a SYS package)
    As to the original question, it is very hard to say what the problem is without more details about the error that occurs after the migration.

  • What is parameter id and default component in data element? Help!

    Hi experts,
          In the further characteristics, What is parameter id and default component name in data element? what are they used for?
    Example: S_CARR_ID.
    Thanks
    Gopal

    Hi,
    Parameter ID :- Is used for assigning value to field.
    Suppose u call a transaction in u porgram.
    and u want to assign some value to field before executing the transaction.
    if the field has parameter id u can assign value to field before calling the transaction.
    that is it take the default value from the memmory.
    and u set value in the memmory using parameter id.
    <b>----
    GET PARAMETER -
    </b>
    Basic form 3
    GET PARAMETER ID pid FIELD f.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See ABAP Unicode - Other Changes
    Effect
    First, the value stored under the key pid is transferred from the local SAP memory into the field f. If this key is not available in the local SAP memory, the value stored under the same key pid is transferred from the global user-related SAP memory to the field f.
    A parameter ID can have up to 20 characters. You can find an overview of the keys (parameters) used in the SAP system description or the appropriate function in the ABAP Workbench.
    The Return Code is set as follows:
    SY-SUBRC = 0: A value was read from SAP memory. SY-SUBRC = 4: No value was found in SAP memory under the specified key.
    Notes
    The global user-related SAP memory is available to each user for the entire duration of a terminal session. For this reason, set values are retained when you leave a program.
    You should not use SAP memory for temporary storage because a user's parallel sessions use the same global memory.
    Example
    Read the program name from SAP memory:
    DATA : REPID LIKE SY-REPID.
    GET PARAMETER ID 'RID' FIELD REPID.
    <b>----
    SET PARAMETER -
    </b>SET PARAMETER ID pid FIELD f.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See ABAP Unicode - Other Changes
    Effect
    Writes the contents of the field f to the global user-specific SAP memory and the local transaction-specific SAP memory under the ID pid. Any existing values under the same ID are overwritten.
    Parameter IDs can be up to 20 characters long. They cannot consist entirely of spaces. The SAP system description contains an overview of parameter IDs. You can also produce a list using the ABAP Workbench.
    Notes
    The global, user-specific SAP memory is available to a user for the duration of a single terminal session. Values written to it are retained even when the user exits a program.
    Do not use SAP memory as a temporary storage area, since parallel sessions belonging to the same user all use the same memory area.
    Only store data of the types C, N, D, and T, as well as structures that consist of these types, in the SAP Memory.
    You can create new parameter IDs using the ABAP Workbench.
    Parameter IDs may have a namespace prefix.
    Example
    DATA REPID like sy-repid VALUE 'RSPFPAR'.
    SET PARAMETER ID 'RID' FIELD REPID.
    Message was edited by: Manoj Gupta

  • Binding component value to a property or  to an implicit object?

    Sorry for that newbie question, but it confuses me...
    What is the differnce between binding component value to a property and binding this value to an implicit object? In both cases i can refere to the value inside jsp file by:
    #{MyBean.someValue}.
    The difference is that in first case I need to declare:
    <managed-bean>
    <managed-bean-name>MyBean</managed-bean-name>
    <managed-property>
    <property-name>someValue</property-name>
    <value>value</value>
    </managed-property>
    </managed-bean>In second case I don't need to declare anything.
    When should I use first type of binding and when the second one?
    What are the restrictions in using implicit binding?

    The definition of EasingColorKeyFrame class support Dependency Object.
    https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.media.animation.easingcolorkeyframe.aspx.
    http://stackoverflow.com/questions/8892234/binding-easingcolorkeyframe-value.

Maybe you are looking for