Dynamic reference to buttons

Hi all,
I'd like to make dynamic references to togglebuttons (I'm using netbeans). In pseudo code, I would like to be able to do something like:
For(int i = 1, i<10, i++){
buttonName = toggleButton;
buttonName.concat(numToString(i));
convert buttonName to handler 'handle'
handle.setSelected(true);
With classes, it seems to me that I could use Class.forName, but I have no idea how to make this work for an interface element, and I can't find it on the web.
Any help is welcome, thanks!
Edited by: jefke33 on Jun 20, 2009 1:12 PM
Edited by: jefke33 on Jun 20, 2009 1:13 PM

You can't invoke methods on bits of String as if they were references to objects. (Java isn't like PHP in this regard.)
You can, however, use arrays as db suggested.
Let's say I have a hundred toggle buttons. I might give them names like "okButton" "exitButton" etc. Or I might make them elements of an array of buttons, buttonArr.
And I have a method toggle(int) that accepts an integer as input and verifies that the argument is within the range 1 to 100, throwing an exception if it is not. This method is intended to select the toggle button that corresponds to the integer it receives as input as selected. So the method would be implemented as
buttonArr.setSelected(true);

Similar Messages

  • Dynamic action on button click

    Hi:
    I need some help.
    I am trying to create a dynamic action on the click of a specific button.
    I have set the Event to 'click" and the Selection Type to "DOM Object", but I do not know how to reference the button. I am using a standard template button and #BUTTON_ATTRIBUTES# is not included in the template - I am not sure how to include it in order to be able to specify an id for the button.
    Can someone give me some guidance on the steps I msut take to implement a dynamic action on the click of a button.
    Thanks.
    Bruce

    Bruce,
    edit your button template and add #BUTTON_ATTRIBUTES# to the button-tag of your button
    e.g.
    <button value="#LABEL#" onclick="#LINK#" class="button-gray" type="button" #BUTTON_ATTRIBUTES#>
    <span>#LABEL#</span>
    </button>
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Dynamic Reference to Registered XSD

    I generate docs from SELECT like this,
    <span style="color:red;">(I do not store this type of doc in DB/XDB)</span>:
    <div style="color:blue;">
    SELECT '&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;' || chr(10) ||
    xmlelement
    (&quot;ReinsuranceXfer&quot;,
    xmlattributes
        ('http://blah.com/blah2/types/common' AS &quot;xmlns&quot;,
         'http://www.w3.org/2001/XMLSchema-instance' AS &quot;xmlns:xsi&quot;,
         'http://blah.com/blah2/types/common http://blah3/xmlschemas/Sales_v1.xsd'
         AS &quot;xsi:schemaLocation&quot;),
     xmlelement
        (&quot;SalesTransactions&quot;,
         xmlattributes('DirectTransactions' AS &quot;xsi:type&quot;).......
    </div>
    the schema &quot;Sales_v1.xsd&quot; is XDB-registered.
    In stead of hard-coding <strong>&quot;Sales_v1.xsd&quot;</strong> in PL/SQL or View definition
    I want to DYNAMICALLY reference the value, so when I switch to
    version 2, registering the new schema (deleting the old one)
    the value <strong>&quot;Sales_v2.xsd&quot;</strong>
    can be dynamically referenced.
    Is there a better/&quot;smarter&quot; way to achieve the dynamic reference
    than this ?
    <div style="color:blue;">
    SELECT substr(any_path, instr(any_path, '/', -1) + 1) xsd
        FROM resource_view
       WHERE any_path LIKE '%Sales%.xsd';
    </div>
    thanks
    10gr2

    You can't invoke methods on bits of String as if they were references to objects. (Java isn't like PHP in this regard.)
    You can, however, use arrays as db suggested.
    Let's say I have a hundred toggle buttons. I might give them names like "okButton" "exitButton" etc. Or I might make them elements of an array of buttons, buttonArr.
    And I have a method toggle(int) that accepts an integer as input and verifies that the argument is within the range 1 to 100, throwing an exception if it is not. This method is intended to select the toggle button that corresponds to the integer it receives as input as selected. So the method would be implemented as
    buttonArr.setSelected(true);

  • Service Registry XSD dynamic reference not working

    Hi ,
    I have published an employee canonical schema to service registry. I have referenced it in my BPEL in my wsdl file as follows
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
                   <import namespace="http://systinet.com/uddi/demo/employeeList" schemaLocation="employees.xsd" id="uddi:company:HR:EmployeeCanonical" />
              </schema>
    I have deployed the BPEL and is working fine. When I updated the service registry to point to the lastest version of canonical file , the BPEL is not reflecting to the new version. I have bounced both bpel server and reg. service but still no difference.
    please let me know how I can dynamically reference the xsd in service registry.
    appreciate your help.
    thanks
    Srini

    Hi
    I am having trouble making the BPEL and Systinet to work together. I have Systinet and BPEL installed separately on 2 different servers. I deployed my web services and registered them in UDDI. I created a new BPEL process and added a partner link to refer to one of the web service I have registered in UDDI. When I create the partner link, it is forcing me to give the wsdl and it also gives an error message " There are no partner link types defined in current wsdl. Do you want create that will by default create partner link type for you?". If I say "NO' then deployment fails. If I say "Yes", then it creates a new wsdl file on the local server etc and gives "<Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>soapenv:Server.userException</faultcode>
    <faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 75164a0815ea471a:-3be8c246:117cc377894:-537b. Please check the process instance for detail.</faultstring>". Any help is appreciated.

  • Dynamically reference :old.column_ name in trigger

    Hi all,
    I am writing an application for which i would like to include a limited audit trail.
    I have a form that is based on a table with approx 100 columns and wish to write the :old.column_name value on fields that have been updated, along with userid and date/time to an "audit" table.
    I think that I can do this by using the Before_update trigger and then the IF UPDATING ('column name') condition. However, for maintenance and readabiility, I wish to be able to dynamically reference the :old.column_name value, which I cannot get working.
    I know it can be done with a large IF statement, but due to the number of columns involved, this can lead to a maintenance nightmare. Also, if I can get this working, I want to include the procedure in a library for other applications, thus the need for dynamically referencing the table and column names.
    My proposed logic for the before_update trigger is:
    Declare Vcolumn_name Varchar2(50)
    Get column names for table (using select cursor)
    loop through cursor
    Vcolumn_name := column name
    IF UPDATING (Vcolumn_name) then
    insert userid, timestamp, :old.Vcolumn_name into audit table
    end IF
    next cursor row
    :old.Vcolumn_name is where I am having trouble.
    Is this possible?
    Thanks
    Peter

    The pre-update trigger won't store the value of the old.column . If you are querying the data and then updating then use the POST-QUERY trigger to store the current values in global variables. In the PRE-UPDATE trigger assign the global variables to the columns of the audit tables.
    For instance in the PRE-FORM trigger initialize the global variables :
    :GLOBAL.VAR1 := ' ';
    :GLOBAL.VAR2 := ' ';
    In the POST-QUERY trigger
    :GLOBAL.VAR1 := :BLOCK.COLUMN1;
    :GLOBAL.VAR2 := :BLOCK.COLUMN2;
    In the PRE-UPDATE trigger
    INSERT INTO AUDIT_TABLE (COL1, COL2)
    VALUES(:GLOBAL.VAR1, :GLOBAL.VAR2);
    Hope this helps.

  • Dynamic actions on button and dynamic column name

    Hi!ynam
    I want to create a dynamic action on button click in my tabular form.
    I have a select list with values of my column names (P7_X_COLUMN) and a text field where users input values for update (P7_X_UVALUE).
    My idea is that when they click the button, they update selected column to desired value in all rows.
    However, I get the following error:
    ORA-06550: line 5, column 5: PL/SQL: ORA-01747: invalid user.table.column, table.column, or column specification ORA-06550: line 4, column 1: PL/SQL: SQL Statement ignored (Go to error)
    It seems to me that I have not referenced the column name correctly, I thought it was the same as referencing values. How do I do that?
    This is my code:
    begin
    update "#OWNER#"."IZV_SLOG_DET"
    set :P7_X_COLUMN=:P7_X_UVALUE;
    end;
    Regards,
    Ivan

    I got it to work, but the query is too big. Can anyone help me with how to get it to work?
    I tried breaking it into more varchar2 strings, but i always get the same error:
    Error processing row.
    ORA-01461: can bind a LONG value only for insert into a LONG column
    declare  
    l_table_name varchar2(30) := 'IZV_SLOG_DET_POM'; 
    l_sql_stmt varchar2(32762);
    begin
    l_sql_stmt := 'update ' || l_table_name || ' set ' || :P7_X_COLUMN || ' =''' || :P7_X_UVALUE|| '''' ||
    'where'||
    'nvl(MSR_PRD_ID,1) = nvl(nvl(''' || :P7_X_MSR_PRD_ID || '''' || ',MSR_PRD_ID),1) and' ||
    'nvl(SRC_STM_ID,1) = nvl(nvl(''' || :P7_X_SRC_STM_ID || '''' || ',SRC_STM_ID),1) and' ||
    'nvl(OZNAKA_KOMITENTA,1) = nvl(nvl(''' || :P7_X_OZNAKA_KOMITENTA || '''' || ',OZNAKA_KOMITENTA),1) and' ||
    'nvl(RSP,1) = nvl(nvl(''' || :P7_X_RSP || '''' || ',RSP),1) and' ||
    'nvl(OZNAKA_RETKA,1) = nvl(nvl(''' || :P7_X_OZNAKA_RETKA || '''' || ',OZNAKA_RETKA),1) and' ||
    'nvl(OZNAKA_IZVJESCA,1) = nvl(nvl(''' || :P7_X_OZNAKA_IZVJESCA || '''' || ',OZNAKA_IZVJESCA),1) and' ||
    'nvl(MBR_KOMITENTA,1) = nvl(nvl(''' || :P7_X_MBR_KOMITENTA || '''' || ',MBR_KOMITENTA),1) and' ||
    'nvl(KOMITENT_NEREZ,1) = nvl(nvl(''' || :P7_X_KOMITENT_NEREZ || '''' || ',KOMITENT_NEREZ),1) and' ||
    'nvl(ZUPANIJA,1) = nvl(nvl(''' || :P7_X_ZUPANIJA || '''' || ',ZUPANIJA),1) and' ||
    'nvl(DRZAVA,1) = nvl(nvl(''' || :P7_X_DRZAVA || '''' || ',DRZAVA),1) and' ||
    'nvl(SEKTOR_NEREZIDENTA,1) = nvl(nvl(''' || :P7_X_SEKTOR_NEREZIDENTA || '''' || ',SEKTOR_NEREZIDENTA),1) and' ||
    'nvl(VRSTA_POVEZANOSTI,1) = nvl(nvl(''' || :P7_X_VRSTA_POVEZANOSTI || '''' || ',VRSTA_POVEZANOSTI),1) and' ||
    'nvl(INSTRUMENT,1) = nvl(nvl(''' || :P7_X_INSTRUMENT || '''' || ',INSTRUMENT),1) and' ||
    'nvl(VALUTA,1) = nvl(nvl(''' || :P7_X_VALUTA || '''' || ',VALUTA),1) and' ||
    'nvl(OTKAZNI_ROK,1) = nvl(nvl(''' || :P7_X_OTKAZNI_ROK || '''' || ',OTKAZNI_ROK),1) and' ||
    'nvl(IZVORNO_DOSPIJECE,1) = nvl(nvl(''' || :P7_X_IZVORNO_DOSPIJECE || '''' || ',IZVORNO_DOSPIJECE),1) and' ||
    'nvl(VRSTA_INDEKSACIJE,1) = nvl(nvl(''' || :P7_X_VRSTA_INDEKSACIJE || '''' || ',VRSTA_INDEKSACIJE),1) and' ||
    'nvl(VALUTA_INDEKSACIJE,1) = nvl(nvl(''' || :P7_X_VALUTA_INDEKSACIJE || '''' || ',VALUTA_INDEKSACIJE),1) and' ||
    'nvl(PORTFELJ,1) = nvl(nvl(''' || :P7_X_PORTFELJ || '''' || ',PORTFELJ),1) and' ||
    'nvl(UTRZIVOST_KREDITA,1) = nvl(nvl(''' || :P7_X_UTRZIVOST_KREDITA || '''' || ',UTRZIVOST_KREDITA),1) and' ||
    'nvl(ZNACAJKE_KAPITALA,1) = nvl(nvl(''' || :P7_X_ZNACAJKE_KAPITALA || '''' || ',ZNACAJKE_KAPITALA),1) and' ||
    'nvl(RIZICNA_SKUPINA,1) = nvl(nvl(''' || :P7_X_RIZICNA_SKUPINA || '''' || ',RIZICNA_SKUPINA),1) and' ||
    'nvl(UGRADJENI_DERIVAT,1) = nvl(nvl(''' || :P7_X_UGRADJENI_DERIVAT || '''' || ',UGRADJENI_DERIVAT),1) and' ||
    'nvl(ODNOSNA_VARIJABLA,1) = nvl(nvl(''' || :P7_X_ODNOSNA_VARIJABLA || '''' || ',ODNOSNA_VARIJABLA),1) and' ||
    'nvl(PREDZNAK,1) = nvl(nvl(''' || :P7_X_PREDZNAK || '''' || ',PREDZNAK),1) and' ||
    'nvl(VRSTA_IZNOSA,1) = nvl(nvl(''' || :P7_X_VRSTA_IZNOSA || '''' || ',VRSTA_IZNOSA),1) and' ||
    'nvl(KOMITENT_PBR,1) = nvl(nvl(''' || :P7_X_KOMITENT_PBR || '''' || ',KOMITENT_PBR),1) and' ||
    'nvl(UDJELI_POVEZ_C,1) = nvl(nvl(''' || :P7_X_UDJELI_POVEZ_C || '''' || ',UDJELI_POVEZ_C),1) and' ||
    'nvl(AR_ID,1) = nvl(nvl(''' || :P7_X_AR_ID || '''' || ',AR_ID),1) and' ||
    'nvl(AU_ID,1) = nvl(nvl(''' || :P7_X_AU_ID || '''' || ',AU_ID),1) and' ||
    'nvl(AR_BUSS_ID,1) = nvl(nvl(''' || :P7_X_AR_BUSS_ID || '''' || ',AR_BUSS_ID),1) and' ||
    'nvl(MTI_CCY_TP_ID,1) = nvl(nvl(''' || :P7_X_MTI_CCY_TP_ID || '''' || ',MTI_CCY_TP_ID),1) and' ||
    'nvl(REG_NO,1) = nvl(nvl(''' || :P7_X_REG_NO || '''' || ',REG_NO),1) and' ||
    'nvl(REG_SFX,1) = nvl(nvl(''' || :P7_X_REG_SFX || '''' || ',REG_SFX),1) and' ||
    'nvl(JMBG_ID_NO,1) = nvl(nvl(''' || :P7_X_JMBG_ID_NO || '''' || ',JMBG_ID_NO),1) and' ||
    'nvl(IP_ID,1) = nvl(nvl(''' || :P7_X_IP_ID || '''' || ',IP_ID),1) and' ||
    'nvl(TAX_ID_NO,1) = nvl(nvl(''' || :P7_X_TAX_ID_NO || '''' || ',TAX_ID_NO),1) and' ||
    'nvl(INSTRUMENT_OLD,1) = nvl(nvl(''' || :P7_X_INSTRUMENT_OLD || '''' || ',INSTRUMENT_OLD),1) and' ||
    'nvl(PREDZNAK_OLD,1) = nvl(nvl(''' || :P7_X_PREDZNAK_OLD || '''' || ',PREDZNAK_OLD),1) and' ||
    'nvl(NAPOMENA,1) = nvl(nvl(''' || :P7_X_NAPOMENA || '''' || ',NAPOMENA),1) and' ||
    'nvl(NOVI_POSAO_F,1) = nvl(nvl(''' || :P7_X_NOVI_POSAO_F || '''' || ',NOVI_POSAO_F),1) and' ||
    'nvl(LISTA_SUMARNA,1) = nvl(nvl(''' || :P7_X_LISTA_SUMARNA || '''' || ',LISTA_SUMARNA),1) and' ||
    'nvl(LISTA_REKAP,1) = nvl(nvl(''' || :P7_X_LISTA_REKAP || '''' || ',LISTA_REKAP),1) and' ||
    'nvl(DZS_IDY_CL_ID,1) = nvl(nvl(''' || :P7_X_DZS_IDY_CL_ID || '''' || ',DZS_IDY_CL_ID),1) and' ||
    'nvl(HNB_IP_CL_ID,1) = nvl(nvl(''' || :P7_X_HNB_IP_CL_ID || '''' || ',HNB_IP_CL_ID),1) and' ||
    'nvl(NO_DYS_OO,1) = nvl(nvl(''' || :P7_X_NO_DYS_OO || '''' || ',NO_DYS_OO),1) and' ||
    'nvl(POSTOTAK1,1) = nvl(nvl(''' || :P7_X_POSTOTAK1 || '''' || ',POSTOTAK1),1) and' ||
    'nvl(POSTOTAK2,1) = nvl(nvl(''' || :P7_X_POSTOTAK2 || '''' || ',POSTOTAK2),1) and' ||
    'nvl(POSTOTAK3,1) = nvl(nvl(''' || :P7_X_POSTOTAK3 || '''' || ',POSTOTAK3),1) and' ||
    'nvl(BNK_ID,1) = nvl(nvl(''' || :P7_X_BNK_ID || '''' || ',BNK_ID),1) and'||
    'nvl(ID,1) = nvl(nvl(''' || :P7_X_ID || '''' || ',ID),1) and' ||
    'nvl(ID_RETKA,1) = nvl(nvl(''' || :P7_X_ID_RETKA || '''' || ',ID_RETKA),1) and' ||
    'nvl(DATUM_STANJA,1) = nvl(nvl(''' || :P7_X_DATUM_STANJA || '''' || ',DATUM_STANJA),1) and' ||
    'nvl(IZNOS,1) = nvl(nvl(''' || :P7_X_IZNOS || '''' || ',IZNOS),1) and' ||
    'nvl(IZNOS_ACTUAL,1) = nvl(nvl(''' || :P7_X_IZNOS_ACTUAL || '''' || ',IZNOS_ACTUAL),1) and' ||
    'nvl(ACT_AR_BAL_KN,1) = nvl(nvl(''' || :P7_X_ACT_AR_BAL_KN || '''' || ',ACT_AR_BAL_KN),1) and' ||
    'nvl(ACT_AR_BAL,1) = nvl(nvl(''' || :P7_X_ACT_AR_BAL|| '''' || ',ACT_AR_BAL),1) and' ||
    'nvl(IZNOS_ACTUAL_OLD,1) = nvl(nvl(''' || :P7_X_IZNOS_ACTUAL_OLD || '''' || ',IZNOS_ACTUAL_OLD),1) and' ||
    'nvl(ACT_AR_BAL_KN_OLD,1) = nvl(nvl(''' || :P7_X_ACT_AR_BAL_KN_OLD || '''' || ',ACT_AR_BAL_KN_OLD),1) and' ||
    'nvl(ACT_AR_BAL_OLD,1) = nvl(nvl(''' || :P7_X_ACT_AR_BAL_OLD || '''' || ',ACT_AR_BAL_OLD),1) and' ||
    'nvl(EXG_RT_CRD_RSK_F,1) = nvl(nvl(''' || :P7_X_EXG_RT_CRD_RSK_F || '''' || ',EXG_RT_CRD_RSK_F),1) ';
    execute immediate l_sql_stmt; 
    end;

  • How do i dynamically reference the contents of an item in a where clause

    I have a select statement that references an item i.e. 'where sysdate=:diary.day1' at the moment, however i want to use this select to loop through every day of the week, so on the fist record it will change depending on where you are in the loop either 'where sysdate=:diary.day1' or 'where sysdate=:diary.day2' etc. I tried using a variable for this but it just uses the characters ':diary.day1' and not the contents of this item.

    Not sure what you want but dynamic reference the content of an item may be done with NAME_IN builtin.
    WHERE sysdate = TO_DATE( NAME_IN(var), 'fmt')
    where var is a variable which contain item name, for example 'DAIRY.DAY1'
    P.S. SYSDATE function contain not only date but time portion too.
    So very little chances that this equation will be true

  • Creating a Function logic for dynamically created XML buttons

    Hi!
    It's me...... again! Now I've dynamically created some buttons using XML. They're spread around the stage and I've modified a tooltip script to give each button a tooltip on Mouse_Over. But to se the logic and make it work using AS3 is hard (for me). I want a function that accept to parameters: Tooltip text and  Object to tooltip.
    In my code I get this error msg when initiating the function on dynamically created buttons:
    1118: Implicit coercion of a value with static type flash.display:Sprite to a possibly unrelated type flash.display:MovieClip.
    I beleive there are more than one thing here needing a fix.
    Can someone have a look and give me a pointer?
    Thanks
    function contentTooltip(ttt:String, ttclip:MovieClip):void {
        ttclip.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
        function mouseOverHandler(e:MouseEvent):void {
            ttip.descr.text=ttt;
            ttip.x=stage.mouseX;
            ttip.y=stage.mouseY-15;
            ttclip.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
            ttclip.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
            ttip.visible = true;
        function mouseOutHandler(e:MouseEvent):void {
            ttip.visible = false;
            ttclip.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
            ttclip.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        function mouseMoveHandler(e:MouseEvent):void {
            ttip.x=stage.mouseX;
            ttip.y=stage.mouseY-15;
    contentTooltip("Scale button",scale_btn);
    contentTooltip("Hide button",hide_btn);

    I totally agree with what Ned says and suggests. Nevertheless, I would like to support your thinking process.
    From the way you wrote the tooltip functionality it is apparent to me that you conceptualize as a programmer. Again, as Ned said, nested functions are evil. BUT, in a way, what classes accomplish is encapsulation/nesting of properties and functions under the same umbrella. It actually feels that what timeline does in general is nesting named functions within a single function we have no access to.
    How you wrote the code is actually a blueprint for a class that could handle the functionality. You, perhaps, are very ready to start coding with classes - not on the timeline.
    With that said, for the sake of theory, here is how your functionality can be rewritten on timeline:
    scale_btn.toolTip = "Scale button";
    test_btn.toolTip = "Test button";
    hide_btn.toolTip = "Hide button";
    scale_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    test_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    hide_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    var overTarget:MovieClip;
    function mouseOverHandler(e:MouseEvent):void {
         overTarget = e.currentTarget;
         ttip.descr.text = overTarget.toolTip;
         ttip.x = stage.mouseX;
         ttip.y = stage.mouseY - 15;
         overTarget.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
         overTarget.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
         setChildIndex(ttip, numChildren - 1);
         ttip.visible = true;
    function mouseOutHandler(e:MouseEvent):void {
         ttip.visible = false;
         overTarget.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
         overTarget.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); 
    function mouseMoveHandler(e:MouseEvent):void {
         TweenMax.to(ttip, .5, { x:stage.mouseX, ease:Quart.easeOut } );
         TweenMax.to(ttip, .5, { y:stage.mouseY - ttclip.height / 2, ease:Quart.easeOut } );
         //ttip.x=stage.mouseX;
         //ttip.y=stage.mouseY-ttclip.height/2;

  • Dynamic Creation of Buttons and Actions HELP

    Hi there,
    I have got a problem (or maybe even two) with the dynamic Creation of buttons. The code below creates the buttons.
    My main problem is, that the parameter created for the button's action isn't propagated to the assigned event handler. I get a null, though the name of the parameter in the event handler and the name of the parameter added to the action are the same.
    Could it also be that I'm always using the same action? I.e. does wdThis.wdGetAddElementAction() always return the same action instance? If yes, how can I create individual actions for each button?
    Any help is appreciated!
    Cheers,
    Heiko
    "    for(int i=rootContainer.getChildren().length; i<wdContext.nodeFeature().size();i++)
                   IPrivateVCT_Feature.IFeatureElement featureElement = wdContext.nodeFeature().getFeatureElementAt(i);
                   IWDTray featureTray = (IWDTray) view.createElement(IWDTray.class, featureElement.getName());
                   IWDCaption header = (IWDCaption) view.createElement(IWDCaption.class, featureElement.getName()+"_Header");
                   header.setText(featureElement.getName());
                   featureTray.setHeader(header);
                   featureTray.setExpanded(false);
                   rootContainer.addChild(featureTray);
                   IWDButton button = (IWDButton) view.createElement(IWDButton.class, featureElement.getName()+"_Button_AddElement");
                   IWDAction actionAddElement = wdThis.wdGetAddElementAction();
                   actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
                   button.setOnAction(actionAddElement);
                   button.setText("Add Element");
                   featureTray.addChild(button);

    Hi Heiko,
    You have done everything correctly....except for 1 line
    in the code...
    Replace the following line in your code:
    actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
    Replace the above line with this code:
    button.mappingOfOnAction().addParameter("featureIndex",i);
    Actually in your code, you are not associating the parameter with the button...
    Note that addParameter(...) comes with two signatures: addParameter(String param, String value) and addParameter(String param, int value). You can use any of them based on yuor need.
    Hope it helps,
    Thanks and Regards,
    Vishnu Prasad Hegde

  • Dynamic text in buttons : instance name goes "instanceX"

    Hi,
    Another weird one (for me at least !)
    I've added a dynamic text to a button and named it, say,
    myTxt.
    If I put this button on stage as a movieclip I can target
    text as
    :_level0.btn1.myTxt
    If I put the button on stage as the button it really is,
    debugger tells
    me text instance is now : _level0.btn1.instance1
    Why ?
    Thanks in advance.
    PJ

    because buttons aren't movieclips and don't have timelines.
    so you can't reference items on, what appears to be a button
    timeline, with normal dot notation.
    the only real mystery is why flash allows you to apply an
    instance name to an object on that button's pseudo timeline.

  • How to call a dynamic URL on 'button press' event, in MVC-based BSP

    Hi,
    My requirement is as below:
    On selecting a row in table view, and pressing a button, I need to open a browser.
    The Browser URL depends on the row selected.
    The key field from table view, is added at the end of the URL string.
    Shortly, I can say that, I am getting a value on row selection & want to pass it to button event.
    In Views Section, there are 2 tags- (1)table view & (2)button.
    Right now, I have put the code for getting the key field, in DO_HANDLE_DATA method.
    In Button's OnClientClick method, I have called the Javascript to open the browser.
    If I now write the code to concatenate the key field value to form the dynamic URL in 'OnClick' method,
    it will be called only after the browser is opened.
    (as OnClick event is executed only after OnClientClick event is executed)
    Could anyone please tell me what event (and in which tag) can be used to solve this.
    Is there any event which is triggered, as soon as the row is selected, &  before the button press event is triggered ?
    Would really appreciate responses made to this query.
    Thanks,
    Nisha Vengal.

    Hi Nisha,
    The crux of your issue here is that you want to call the event triggered with onClick before calling the event triggered on onClientClick. This can be achieved by the following code in the function called on the onClientClick.
    function fn_button()
               htmlbSL(this,2,'b_row_selection:onInputProcessing()');
               window.open("new_page",target="BLANK");
    Here, fn_button is the javascript function called on button click, and b_row_selection is the event triggered on the onClick event of row selection.
    Try this out and let us know if it works for you.
    Regards,
    Saurabh

  • How can I dynamically reference a sheet based upon the contents of a cell

    I'm using Numbers to store specifications for various products. Each sheet stores specifications in a standard manner (i.e. same table and cell names) and the sheet is named according to the name of the product.
    On another sheet I've got a dropdown list containing the names of the product tabs. I'd like to dynamically pull data for a particular product when it's sheet is selected in the dropdown list by using the dropdown cell in a reference like:
    =B1::STC::A4, where B1 is the dropdown list and STC::A4 is the product specification table and cell reference.
    When I use this, the B1 reference fails.
    Any suggestions would be greatly appreciated.
    Thanks.

    Amos,
    you will have to use the indirect function to convert the string you are creating into a valid reference.
    Note:  The Sheet names, Table names and cell references must all match exacty.
    If the sheets are named "B1", "C1" and "D1" and the popup menu is in the cell A1 and contains the strings:
    B1
    C1
    D1
    The table name is "STC"
    then you can create a valid reference like this:
    = indirect(A1&"::STC::A4")
    if the table name were also dynamic and were stored in cell A2 you could create the reference like this:
    = indirect(A1&"::"&A2&"::A4")

  • CRM5.2 UI-Call a dynamic URL on button click

    Hi all, 
               My requirement is to call a dynamic url on the click of a button in the overview page. I have added a custom button in  the method  IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS , and the related code in do_handle_event.I have created a custom method for the button event. I have enhanced a custom controller and created an attribute.In the custom method created for the button event, I have written the code for retrieving the parameters to be passed to the url.
    In the layout of the view associated with the display view , I have written the following code for calling the URL in a new window.
    <%
    DATA: lr_cuco_EMA TYPE REF TO ZL_BP_CONT_BPCONT_IMPL,
          lv_url TYPE string,
          lv_url1 type string,
          lv_count type i.
      lr_cuco_EMA ?= controller->get_custom_controller( 'ZBP_CONT/BPCONT' ).
      check lr_cuco_EMA is bound.
      if lr_cuco_EMA->gv_VALUE is not initial.
      if lr_cuco_EMA->gv_COUNT IS NOT INITIAL.
      clear lr_cuco_EMA->gv_COUNT.
      endif.
      LV_URL = lr_cuco_EMA->gv_VALUE.
      Concatenate 'http:/' LV_URL  into LV_URL1.
      Concatenate '"http:/' LV_URL '"' into LV_URL.
        lv_count = lr_cuco_EMA->gv_COUNT mod '2'.
        if lv_count Ne 0.
      lv_url = lv_url1.
    endif.
      %>
         <scrpt language="Javascript">
            window.open(<%= lv_url%>).focus();
          </script>
       <%
             lr_cuco_EMA->gv_COUNT = lr_cuco_EMA->gv_COUNT + 1.
             clear lr_cuco_EMA->gv_value.
             clear lv_count.
             clear lv_url.
             clear lv_url1.
             ENDIF.
    %>
    But here my URl is getting called alternate times.If I do not write the code  by using the variable GV_COUNT the url is getting called only the first time of the button click  and to call the URL again you need to navigate back to the search page and again back to the overview page and click on the button.
    Can anyone help me regarding this? I want the URL to be called in a new page on every button click.
    Thanks in Advance,
    Chandana

    Hi Nisha,
    The crux of your issue here is that you want to call the event triggered with onClick before calling the event triggered on onClientClick. This can be achieved by the following code in the function called on the onClientClick.
    function fn_button()
               htmlbSL(this,2,'b_row_selection:onInputProcessing()');
               window.open("new_page",target="BLANK");
    Here, fn_button is the javascript function called on button click, and b_row_selection is the event triggered on the onClick event of row selection.
    Try this out and let us know if it works for you.
    Regards,
    Saurabh

  • Assign values dynamically to radio button

    I am creating an online test. I will need to display answer choices from the table. I created radio buttons for these answer choices and I could put the labels dynamically by using      
    Set_Radio_Button_Property('block_name.radio_group_name', 'radio_button1',LABEL,cursor_name.field_name);
    Now I have problem to set radio button values dynamically. Should I use when_radio_changed event?
    Any help would be appreciated.

    I really appreciate your help.
    My intention is to display the test on the screen.
    That means I need to display all questions and answer
    choices for each one dynamically. Based on the answer
    choice type (radio button or checkbox or drop down
    etc) I will need to assign the values to them and
    display on the screen. So far I could display
    questions and answer choices on the screen and set
    the label property for each radio button.
    Do you know what is the syntax to assign value to
    each radio button? First I will need to store user's
    answers in a table. For that I need to know what
    answer they selected. I wasn't sure how to do that.
    ThanksAs I said, the values cannot be assigned dynamically. Thus you will store the answers in code (perhaps in an array?) and your radio buttons will be 1,2,3,4 etc.
    In WHEN-RADIO-CHANGED you can retrieve the value from the array using the radio button value. Then store that value.
    e.g. Your screen shows
    What is the sound of one hand clapping?
    o Blue
    o Yes
    o 12
    These labels will be set dynamically, but the values for the radio buttons will be 1,2,3. If they pick "Yes", your radio button will be 2. You then get the value you really want from answer_array(2), where you put it when you retrieved the question details. Then you insert that into your users_answers table.

  • Dynamic sizing of buttons

    I am working on a flex application where I want the button
    sizes to appear based on the size of the browser window and the
    resolution of the screen so I don't want to hard code the width of
    the buttons.
    <mx:Button id="submitButton" label="SQL"
    styleName="navButtonSkin"
    width="80" textAlign="center"/>
    <mx:Button id="submitButton1" label="SQL1"
    styleName="navButtonSkin"
    width="80" textAlign="center"/>
    But when I change it to:-
    <mx:Button id="submitButton" label="SQL"
    styleName="navButtonSkin"
    width="20%" textAlign="center"/>
    <mx:Button id="submitButton1" label="SQL1"
    styleName="navButtonSkin"
    width="820%" textAlign="center"/>
    It doesnt seem to work.
    Now if I change it to
    <mx:Button id="submitButton" label="SQL"
    width="{getButtonWidth()}" textAlign="center"/>
    and have a function:-
    private function getButtonWidth():int{
    var w:int = 15/100*summaryPanel.width;
    return w;
    where summaryPanel is a container holding the buttons, thats
    failing as well since in this case the summaryPanel.width always
    turns out to be zero at the time when the button sizes are
    calculated. What else can I do and how can I work around it?

    Try doing the calcualations in-line. getButtonWidth() is a
    function, and thus hard to bind to.
    <mx:Button id="submitButton" label="SQL"
    width="{15/100*summaryPanel.width}" textAlign="center"/>
    Since summaryPanel.width is reference directly in the
    binding, the compiler will automatically adjust the button's width
    for you whenever summaryPanel's width changes.

Maybe you are looking for

  • I am try to download a CSV file and have it directly open in excel. It only opens in new page and not in excel. how do I get it to do that.

    In internet explorer I use to be able to click on a download link to have a csv file open in excel. I have never been able to open this download file before with Firefox. It turns out that I can no longer do it with Explorer either. I have sent this

  • Itunes won't recognise ipod touch

    When I try to connect ipod touch get error message that cannot be used as requires itunes version 10.5 or later. Tried to download latest as suggested but no change.  I have itunes on windows xp machine and no problem connecting to nano, classic or s

  • Zen Vision:M track list

    I looked through other threads and didn't see an exact answer to this. My Vision:M wants to list all songs alphabetically. Even when I play an individual album without using playlists, the songs on each album are listed alphabetically. Can this be ch

  • Suppressing certain pages of a report

    I need to build a large report that contains multiple reports (30 or so reports in all). I want the user to be able to select from a parameter form which reports the large report will contain. Is there a way to set a trigger for each page that depend

  • Archiving question

    GR55 is standard SAP transaction that has various report groups tied to it. Once GR55 is executed for one report group, SAP has the data source button to select archived data as source for the report. For example, report group 8A20 and 8A24 both read