Set a value into buttons.

I created an application which contain 6 buttons.
The code below display only help to to get the string from Qns1 to Qns6
How do i set a value into each buttons so that when i click on Qns 2 it will get the value from the button and display on another page?
stmt = con.createStatement();                   
rs= stmt.executeQuery("select count(*) AS rowcount from qna;");
rs.next();
count = rs.getInt("rowcount") ;                   
for(int i=0;i<count;i++){
out.println("<button style=\"width:45;height:30\" style=\"background:#FFFF99  \" onClick=\"window.location='winnersQns2'\"><b>Qns"+(i+1)+"</b></button>");
}I need help urgently!
Thanks in advance.
Edited by: shyhigh2002 on Sep 30, 2009 10:23 PM

As BalusC stated jus add a name-value to the button element , for name you can give them the same name but value must contains the indice i:
name='aCommonName' value='"+i+"'on the other side check the value of the request parameter named '*aCommonName*'

Similar Messages

  • How to set a value into ogc:PropertyName

    Hello, I am trying to set a text value into the net.opengis.ogc.PropertyTypeName field. I have used XMLBeans to generate java classes for schemas in net.opengis.ogc. I am now trying to use the Java classes to create xml documents. I cannot figure out how to add a text value to the PropertyTypeField of a spatial operator. Please let me know...Thank you.

    I think, "visibility = false" is a rendered element, which is not display to the user (like a HiddenField). You should find the element in your HTML-code of your browser. A "rendered = false" element should be not rendered into HTML and not to find in the HTML-code.
    Regards
    Majo

  • How to set a value into a component visibility with expression builder?

    Hello,
    I want to set true/false value into a adf component visibility according to a bean object's value. if the object value is null then visibility value will be false, else visibility is true.
    How can I do that without an extra variable definition in the backing bean?
    Thanks, Ali

    I think, "visibility = false" is a rendered element, which is not display to the user (like a HiddenField). You should find the element in your HTML-code of your browser. A "rendered = false" element should be not rendered into HTML and not to find in the HTML-code.
    Regards
    Majo

  • Error while setting a value into an UDF of type date

    Hello,
    i get the following error while trying to set a value to an udf with the type "date":
    Exception from Server: RPC_E_SERVERFAULT
    This code is used:
    objDate = CDate(objLineRecordSet.Fields.Item("U_TESTDATE").Value)
    objDocument.Lines.UserFields.Fields.Item("U_ACTDATE").Value = objDate '### Here comes the error
    The application is in PL 29

    Christian,
    If you search this forum on "date UDF" you will find many posts that may assist you such as this one ...
    Format of string passed to Date/Time Hour UDF
    HTH,
    Eddy

  • How to Set Default Value into a Tabular Form Element

    Hi,
    Hoping someone can assist with my Tabular Form query.
    I am using Oracle ApEx v3.0.1
    I was wondering how one can set a default value to one of my tabular form columns within Oracle ApEx v3.0.1 as I cannot see how to do it?
    Thanks.

    Hi Tony
    can you pl. help me how you resolve this? I have one tabular form and I am trying to set default value as :APP_USER, I type this in default value but somehow it is not displaying this value.
    thanks
    Dax

  • How to set fixed value in doDML

    Hi,
    My application is ADFBC.
    i am getting fixed value in backing_bean.this value is not coming form VO.how to set this value in doDML.because i want to save this fixed value(this value changing in backing_bean from UIpage) into database.
    actually i am using fixed list box values(these are not from VO) in UIPage and after submitting i am getting this vaue in backing_bean and some updatable table is displaying in UIpage.after filling some values in the updatable table and i am pressing commit button then i have to set this value into one table in databse.
    all updated values are saving because i am using ADF table.now i have to save this list value also in one of the column in this table.
    How to set this value into doDML?
    please help me.
    Thanks,

    Have you thought of creating a "transient" attribute in your EO or VO, that stores the fixed list box value? Then in the doDML method you could grab this attribute's value and update the other EO attribute you're interested in.
    Alternatively in the transient attributes setter in the EO, you could write the code to update the other EO attribute.
    Hope this helps.
    Regards,
    CM.

  • Set PDO value from Backbean

    hi there,
    JDeveloper Studio 11.1.1.5.0.
    i have a business object that has 3 element :
    id from type int,
    name from type string,
    family from type string
    and also i have a process data object of this business object(PDO)
    how can i set values to this process data object from backbean by java code?
    Thanks for any help

    I am assuming that you have the bindings of the PDO in your padeDefinition file which is for a page referring to this BackingBean.
    then you can use code like
    ADFUtils.setEL("#{bindings.requestType.inputValue}",<value>);
    where setEL is from reusable static class ADFUtils as below
         * Sets a value into an EL object. Provides similar functionality to
         * the <af:setActionListener> tag, except the from is
         * not an EL. You can get similar behavior by using the following...
         * setEL(to, evaluateEL(from))
         * @param el EL object to assign a value
         * @param val Value to assign
        public static void setEL(String el, Object val) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            ELContext elContext = facesContext.getELContext();
            ExpressionFactory expressionFactory =
                facesContext.getApplication().getExpressionFactory();
            ValueExpression exp =
                expressionFactory.createValueExpression(elContext, el,
                                                        Object.class);
            exp.setValue(elContext, val);
        }

  • Plsss help me: how to set default values in html:file and html:radio

    Hai,
    To set default value to text box i use the following code. It works well.
    <html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
    <html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • Set Default Value in Standard Transaction

    Hi all,
    Does anyone know how to set a input value into a SAP Standard Transaction ?
    That means when calling that transaction, it automatically set a value into it's input box.
    Thank you all.

    hi,
      get the parameter id of the field that has to be populated  in the transaction.
    write these lines in the program from where you call the transaction.
    set parameter id 'KUN' field '30'.
    call transaction 'FD01'.
    When you call the transaction you get the value that is set.
    Regards,
    Sailaja.
    Message was edited by: Sailaja N.L.

  • Problem setting a hidden item value when button clicked with dynamic action or pl/sql process

    Apex 4.1
    Oracle 11g
    I have a page that consists of a main region and several sub regions.  I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
    Three subregions have a contional display where P400_DISPLAY = STORE.  This works in hiding the sub regions.
    Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
    I tried creating a dynamic action for on click of the add button but get the following error:
    The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
    I went to the templates and found:
    Substitution Strings
    Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
    Substitution String
    Referenced
    From
    Description
    #LINK#
    Yes
    Template
    To be used in an "href" attribute
    #JAVASCRIPT#
    No
    To be used in an "onclick" attribute
    #LABEL#
    Yes
    Template
    Button Label
    #BUTTON_ATTRIBUTES#
    No
    Button Attributes
    #BUTTON_ID#
    No
    Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
    I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed.  The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
    Suggestions please on how to fix the template or change the P400_DISPLAY value?

    The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
    So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
    What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
    Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
    Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
    Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
    See the problem?
    Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
    I bet it is the first issue but, take a look at these.
    Cheers,
    -Joe

  • How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi
    Can anyone tell me.
    How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi Mithlesh,
    javascript runs on client side and you cannot assign the value to a Page attribute directly.
    As a workaround,you can use an Inputfield,hidden if required,and set the value using javascript.Then the form will have to be submit to be able to read the value in onInputProcessing and then can be assigned to any variable.
    In Layout
    <head>
    <script language="javascript">
    function pass()
       txt1 = document.getElementById("ip_mrf");
       txt.value = "hello" ;
    </script>
    </head>
    <htmlb:inputField  id="ip_mrf"
                               value="<%=mrf_number%>"
                               visible="FALSE"/>
    in onInputProcessing
    cha1 = request->get_form_field( 'ip_mrf' ).
    where cha1 is the page attribute
    hope this helps,
    Regards,
    Siddhartha
    Message was edited by: Siddhartha Jain

  • Using radio buttons to set the value of a text field

    I have a set of three radio buttons on a form (a performance evaluation). If I select the "1" button, I want 1 to populate in the text field. The same goes for "2" and "3"
    I have not been able to code the buttons correctly for this scenario, and can't figure out how to do it.
    From a previous post, I was able to get check boxes to do what I want, but they won't really work because I can't set them so that only one back may be selected.
    Can this be done?
    Thanks!

    The information for this specific case isn't anywhere. The best that you can do is understand what triggers each of the events, then ask yourself which of those triggers are pertinent to your current issue.
    http://help.adobe.com/en_US/livecycle/es/LiveCycle_Designer_Scripting_Basics.pdf ...
    The above link contains a great deal of information regarding how to use scripts within Livecycle Designer. The section that you would be most interested in in order to learn about the available events can be found under "Events >> List of Events".
    You needed to use the initialize event so that the text field would be updated when the document was opened. This ensure that the text field has the value of the default radio button when it is opened for the first time.
    You needed to use the change event so that, when the use selects a different radio button, the text field is updated with the new value.
    That's about it. That PDF file that I link to above is a bit long, but it's a great place to get a good grasp of the basics of scripts.
    If you have any further questions, feel free to ask. =) Have a good one.
    - Scott

  • How does this program group and cluster these button values into an array?

    In the attached program, there are 6 buttons in a cluster and 1 individual button. These buttons control a bunch of different relays to control power to different components of a single device. Right now the program works in that I can control the 6 buttons, the LED turns on in the board and the power is being transmitted. What I do not understand is how it is doing this.  I ran the program with the highlight execution on and at the start of the read from array component, if say I pressed button 6 and hit ok, it reads #6, where did these get defined and labled? and if i wanted to add another button/relay how do i do this? If someone could explain step by step how this is grouping the relays on the board into an array and then controling them I would really appreciate it. Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Cluster to Array.vi ‏85 KB

    The #6 your seeing is the number of elements in the array not a value for the array. 
    Now for some deeper explainations.   From the code it appears that exactly 1 of 6 valves may be used and an additional valve may be in one of two possible states.
    When the program is run the cluster of buttons is initiallized to all False.  and we enter the outer while loop where a sequence structure starts.  In the first frame of the sequence we initiallize a shift register to hold the current value of "Buttons." and this loop runs unthrottled (Add a wait for next ms multiple to this loop to prevent using 100% of the CPU!) 
    For each iteration the buttons are read and if a change has occured to any value buttons that were previously True are reset to False to prevent opening more than one valve.
    When the user presses OK or stop- the current "Buttons" value is passed to the next frame.  This frame convertsthe 7 boolean values to a integer where each valve is controlled by a seperate bit of the integer (Isolation is bit 6 and bits 0-5 each control a mixing valve)
    Now I'd strongly recommend reworking the DAQmx calls- it is pointless to initiallize the task each time you want to use it- Create the task in the initialzation case and wait until the user exits to destroy the task.  And well a sequence structures are frowned on- (there are better ways to do this)
    As far as adding a relay- right now the relays are associated to the hardware by their index position in the cluster (element 1 = bit 0 etc....) to add a new valve you would need to decide what bit you would use to drive it and code in that bits' value to write a 0 in that bit.  (hint the 40 constant is realy 0x40 right-click>visable items>show radix )
    Let me know if you need further elaboration
    Jeff

  • How to set the value of an radio button using set_radio_button_property

    I'd like to set the value of an radio button dynamically, depending of the situation.
    (=> the value which the object returns to the radio group)
    Means: the 'radio button value' of my object 'rb_1' shall be 1, in other circumstances 99 and so on.
    Is it possible to set this value at runtime ?

    the problem is as Gerd wrote:
    there are two or more radio buttons in an option group.
    Their value depends on the text objext t_field.
    If t_field is "car" the value of radio button 1 shall be 75, button 2: 90 and button 3 115.
    if t_field is "bus" the value of radio button 1 shall be 250, button 2: 275 and button 3 300 and so on.
    My problem is to set the value of the radio buttons at runtime after choosing/typing the value of the text field t_field.
    Message was edited by:
    PatrickM

  • How to read RGB values into Set

    Hi,
    I have been told that to count the total number of unique colors in an image is by reading each pixel RGB values into a set.
    I have checked this and it is true that the set can do this fine if considering only either one channel of the R,G or B (this does not allow me to know the exact number of color exist). However, I am confuse on how to have all three R, G and B values into a set so that the set can consider the whole 3 values of RG and B as a color which can then be differentiated separately.
    I think pixelgrabber allow to getPixel RGB values but I am working with JIU getsample method. Perhaps I missed out other methods in JIU which have the same functionality as in pixelGrabber.
    I am working on an image analysis so I need to figure out this out first.
    I am hoping anyone can help me out with this and I thank you.

    as mentioned, pack the rgb values into an integer.
    instead of a set, you will get better performance and
    memory useage using a sorted, dynamically allocated
    int array. With some minor work, you better this
    structure by using more than one sorted array and a
    cheap rgb mask hashing mechanism. I don't know what
    JIU is, but look at the source of java.awt.Color for
    details on how to pack/unpack rgb values.Hi,
    Thank for your feedback. I have tried to pack the rgb values into an integer. At the moment I just making used of Set (will look into probably ArrayList after I get the rgb values correct). However, I am not sure whether my code is correct (which I doubt) or not. Not sure how the output looks like that. If you could have a look at it and confirm me, I would be very much thanking you.
    the code snippet:
    public void countColour() {
    int r, g, b;
    int[] rgb1DArray = new int[h * w];
    int[] rgb = new int[4];
    Set set = new HashSet();
    int alpha = 255;
    for (int i = 0, cnt = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
    r = intImg.getSample(0, i, j);
    g = intImg.getSample(1, i, j);
    b = intImg.getSample(2, i, j);
    System.out.println(r+ "," g "," +b); // just checking rgb values
    //rgb[0] = alpha;
    rgb[1] = r;
    rgb[2] = g;
    rgb[3] = b;
    System.out.println(rgb[0]+ "," rgb[1] "," rgb[2] "," +rgb[3]);
    rgb1DArray[cnt] = ((rgb[1])<<16)|
    ((rgb[2]<<8))|(rgb[3]);
    System.out.println("rgb["+cnt+"] :" +rgb1DArray[cnt]);
    output:
    Image file size is 230 x 236
    204,221,203
    0,204,221,203
    rgb[0] :13426123
    204,212,191
    0,204,212,191
    rgb[1] :13423807
    180,166,140
    0,180,166,140
    rgb[2] :11839116
    236,209,166
    0,236,209,166
    rgb[3] :15520166

Maybe you are looking for

  • Class Loading on specific diretory

    I am writing a plugin based engine and I want to load up my classes(plugins) from a specific directory besides "classes/com/bla/bla/bla" So, I am using this code: URL[] url = new URL[1]; try { url[0] = new URL("file:think/"); catch (MalformedURLExcep

  • Loading a file when the file is updated

    Is their a way to load a file only when their is something changed in the file?

  • ESS/Leave Reqest Workflow Problem Still in Process when Escallated

    Helo Every one, My leave request workflow is Zworkflow which is working fine in the production.Recently in the last month business request for escalation of leave request when direct manager not approved with in the time frame. So i added latest end

  • How to reset 繁體中文顯示

    How to reset  繁體中文顯示in i Mac, & why can't log in i tunes of showing all before i had i phone.and i need help how to type 繁體中文 in i Mac  similar to i pad.

  • I & O in and out point selection glitch...

    Hi, Having a bit of a nightmare with a weird little glitch that has only just started happening with Premiere CS6. (I don't know if it's relevant, I've now got Pr CC - but still using CS6 on some client projects. And this has only started happening a