Command button to get next value?

i am new to j2me
i have this code which just shows 2x10=20 for now
Code:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class TestMidlet extends MIDlet {
private Form form;
private StringItem testTable1;
private Command testTable1Command = null;
public void startApp() {
     Display.getDisplay(this).setCurrent(getValue(2));
public void pauseApp() {
public void destroyApp(boolean unconditional) {
// form.addCommand(getExitCommand());
//form.setCommandListener(this);
private int getValue(int val){
int total=val*10
return total;
what i want is add a 'NEXT' button(Command button) in the main display or canvas
which clicked shows value of (value+1)x10 and so on
for eg
on first 'NEXT' click it should show 30(ie 3x10)
again pressed shows 40 and so on
i actually want to implement it to a calendar code
next i press on next on january display calendar of feburary should come
suppose calendar is being displayed in getValue function
I want to make concept clear through above simplified example
thanks

Thanks for the encouragement; I am going through the tutorials and also own two books, the Easy HTML-DB book and the Pro Oracle Application Express book. I do find it odd that the books and tutorials don't assume one has already created the database and then wants to create an application after that- such as that they all begin with creating an application from a spreadsheet and talk about uploading data, things I would expect to be done via PL/SQL or some other approach (such as pushing from SAS to Oracle). So these tutorials spend a lot of time on the loading of data as opposed to actually creating a front-end application, which is frustrating to me because I've already got my database all loaded and modeled.
But I will be more specific in questions in the future. If any of you need any SAS help, please ask at the SAS forum (google SAS-L, hosted by Univ. of Georgia).
Thanks :-)
-Mary

Similar Messages

  • Submit Button never gets a Value in ReviewAbsenceCO

    Dear Experts,
    I have a requirement and have to extend ReviewAbsenceCO, my validation should only be fired when user clicks "Submit" button
    To achieve this task I am using the following code in my class , but the Submit button never gets a value it is always null..
    CODE
    (pageContext.getParameter("HrSubmit")!= null)
    I have substituted HrSumit with a few more options like "Submit","submit" and so on, but no effect.
    Please tell me how to get the name of the clicked button.

    Hi ,
    Please make sure that you 're passing the right ID ( HrSubmit ) ??
    to find the button ID , right click on OAF page - > view source - > search by prompt name , you will
    get the id associated to bean , copy it and replace it in the above line you 've mentioned .
    Note : Please make sure that its an submit button , for regular button normally Fire action will be attached , and approach for
    handling regular button would be different .
    --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • GetMaxRows() to get next value

    Hello
    I have a table that has a column of just ID which is just an integer. When i add a new record into the database whats the best way for me to get the next value for ID column. lets say before the insert statement the last row of the table has ID 50. In my insert statement how can i determine that the next value should be 51. i thought of using getMaxRows() and adding one to that everytime i do insert.
    But whenever i do getMaxRows() i just get 0 back. i did something like this
    String max = "Select * from table";
    stmt1 = connection.prepareStatement(max);
    result = stmt1.executeQuery();
    System.out.println("This is max rows"+stmt1.getMaxRows());

    i do think this method will occur some problem...
    think...if u have 50 rows of data...and some day u need to delete data
    ID 49...so the next data ID ur program will produce is ->50...but data ID 50 already exist in database...so maybe ur program will get duplicate of primary key error.
    this is just assumsion.because before that i also think the getMaxRow() can solve my problem...but it doesn't.
    and usually data ID is the primary key... :)
    if u has no primary key u can jus ignore this reply

  • Read table to get next value (Sequence Question)

    Is there a function in line with my_seq_no.nextval that can read a value in the previous field and get the next sequence number? I know how to create a sequence, but I thought that there is something like a getnextval function.
    Thanks.

    Preston,
    The problem is that there is no such thing as a previous value in Oracle.
    You have to specify some way (like maximum number.. etc..) to get the expected value...
    Sometimes , you can see code like....
    insert into emp values
    (select max(empid) + 1 from emp) new_emp_id,
    ''XYZ' ename,
    from dual;As is evident...the above code takes the maximum value from the table emp and gives you the next emp id.
    The problem here is that all the currently logged in users will get the same value for the new empid until someone inserts a record and then.. all the others would have unique constraint errors (if you have the right constraints in place).
    Using sequences is the right way to make sure all the concurrent users get their own unique values for the new values.
    As for the getnextval, one could always come up with a function which just selects the max(col_name)+1 and returns it... but it has the same problems as the insert...select mentioned above.. So i would rather not provide code for such a thing.. I'd be doing more damage than help. Please use a sequence for your case.

  • Create Window with Textbox and Button For getting Input Value

    Hi All,
    I have create plugin application but i want to take input from user. Therefore i want to create window with textbox and button.
    please may i get solution...

    Or if that's all you need to do, just use JavaScript or a form.

  • Get next value in a Multi Record Block

    Hi,
    I've a Multi Record block with 2 items like below.
    pos width
    1 7
    8 5
    13 5
    18 2
    ie pos in next item is sum of pos and width of previous item.I've already implemented this.
    The problem is if the user changes width in a particular record,I want to change next records pos automatically.
    To achieve this,I wrote a when-new-record -instance-trigger as follws:
    if :system.cursor_record=1 then
    :pos:=1;
    elsif :system.record_status='changed' then
    :pos:=:pos+:width;
    end if;
    but even Though I change column width of block,:system.record_status still remain 'INSERT'.
    Pls can u pls tell me how can I acheive this?
    Prashanth Deshmukh

    You cannot use Record Status like that.
    You need to create a procedure that loops through your entire block, keeping track of the pos and width of the prior record to calculate the new pos of each record.
    Your procedure would need to do something like this:
    Declare
        v_Pos  pls_integer := 1;
    Begin
      Go_block('B1');
      First_Record;
      Loop
        Exit when :System.record_status='NEW';
        :B1.pos := v_Pos;
        v_Pos := v_Pos + :B1.width;
        Exit when :System.last_record = 'TRUE';
        Next_Record;
      End Loop;
      First_Record;
    End;

  • Collection binding to radio button: No command button action

    Hi,
    I bound a List collection to radio buttons as below.
    <h:selectOneRadio disabledClass="selectOneRadio_Disabled"
                   styleClass="selectOneRadio" id="radio1" layout="pageDirection" value="#{param.selectedChoideId}">
    <f:selectItems value="#{PollBean.choices}" />
    </h:selectOneRadio>
    I also added a command button to send the value of selected radio item. The item labels and values are displayed properly on run time.
    But when the button is clicked, the JSF lifecycle is started but the execution thread cannot enter phase 4 called "Update Model Value" after phase 3 "Process Validations" and directly jump to phase 6 called "Render Response". By this way, navigation rule is not applied and the execution gets back to the starting page.
    Is there anyone have encountered this problem ever before ? What can cause this problem ?
    Regards.
    UmutRR

    It might be a typical problem of SelectOne/Many.
    Check the types of param.selectedChoideld and PollBean.choices.
    My post will help you:
    http://forum.java.sun.com/thread.jspa?threadID=604798

  • Problem in getting selectOneRadio value placed in dataTable

    I want to get Id bind with selected radio button, whn radio button is selected, the value of backing bean should be set.
    But the problem me facing is, If I check last radio button I get the value and if I get rest of radio buttons my bean value didnt set. Why it happen that only last radio button of data table row works fine.
    I hope I u ppl help me
    <h:dataTable value="#{depositMoneyPageBean.allCreditCardsOfUser}" var="creditCardData"
    >
    <h:column>
        <f:facet name="header">
           <f:verbatim>...</f:verbatim>
       </f:facet>
       <h:selectOneRadio id="selectRadio" value="#  {depositMoneyPageBean.selectedCreditCardId}"  onclick="selectOne(this.form , this)"  >
                                   <f:selectItem itemValue="#{creditCardData.cardId}" />                               </h:selectOneRadio>
      </h:column>
    <h:column>
                                  <f:facet name="header">
                                       <f:verbatim>Payment Method</f:verbatim>
                                  </f:facet>
                                       <h:outputText value="#{creditCardData.cardTypeName}" styleClass="tLabel" />
                             </h:column>
    </h:dataTable>

    Here is a comparable solution: http://balusc.xs4all.nl/srv/dev-jep-dat.html#SelectRowByRadioButton
    With a much better Javascript solution, it only clears out the involved radiobuttons, not the other radiobuttons in the same form, which can be dangerous if you've another radiobuttons for other purposes.

  • Not able to get the value in the next page

    Hi,
    I am newbee for JSF and this question may sound silly. I tried to search through this
    forum, google....but did not find a solution....I hope some one here could please help
    me :-(
    I have Page1 and Page2. Page1 has a h:inputText field and a submit button.
    On click of the "Submit" button in Page1, I have to pass this text value entered by
    the user to Page2. In Page2, I have <h:inputText readonly="true" /> field,
    which will display the value that the user entered in Page1. Also, Page2 has a "Submit"
    button. On click of Page2.Submit button, the value displayed in the Page2.textfield
    is not getting populated to the Page2 bean attribute.
    Here are the code that I am using
    1. Page1:
    <f:view>
    <h:form id="Page1">
         <h:inputText id="primaryKey" required="true" value="#{Page1.primaryKey}" />
         <h:commandButton id="command" value="Submit" action="Page1"/>
    </h:form>
    </f:view>
    2. Page2:
    <f:view>
    <h:form id="Page2">
         // Yes, Value attribute points to Page1.primaryKey to display user entered value in this page.
         <h:inputText id="test" value="#{Page1.primaryKey}" readonly="true" />
         <h:commandButton id="command" value="Submit" action="#{Page2.save()}"/>
    </h:form>
    </f:view>
    3. faces-config.xml
    <navigation-rule>
    <from-view-id>/Page1.jsp</from-view-id>
    <navigation-case>
    <from-outcome>Page1</from-outcome>
    <to-view-id>/Page2.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <managed-bean-name>Page1</managed-bean-name>
    <managed-bean-class>com.Page1Bean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/Page2.jsp</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/success.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <managed-bean-name>Page2</managed-bean-name>
    <managed-bean-class>com.Page2Bean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    4. com.Page1Bean.java
    public class Page1Bean {
         private String primaryKey;
         //getter and setter method below
    5. com.Page2Bean.java
    public class Page2Bean {
         private String test;
         //getter and setter method below
         public String save() {
    Now let me explain my issue, I enter a value in Page1 -> click on submit -> I see this value in the text field of
    Page2. But when I click on submit button of Page2, test attribute is still null. Could you please suggest me what
    am I suppose to do inorder to get this value in Page2Bean when I click on save button?
    Hope to listen from one of you,
    Thank you,
    VinodRamu

    Go here
    http://jsffaq.com/
    Many of your questions will be answered

  • How can i get dynamic values to next page.

    HI!
    I am generating a dynamic rows with some different values.And in the end of each row there is a button .i want as i click that button i can get those values on next page.
    Can any one help me out in this.
    On click i can send values thouugh get or post to next page.But how will i read that on next page.
    Help if any one can.

    Not excatly.But i am trying to solve that problem.Responding early may
    help me.

  • Get Next or Previous Primary Key Value

    I have a dynamic report with a select statement retreiving certain number of records, depending on the user choice. Once the user decides to change a record, he clicks on it and gets forwarded to the form page. On the form page I have two buttons - previous and next record. However, the order of previous and next doesn't consider the result of my report but the whole content of the source table (view). This means, if I click on the button next, it will not pick the next record from my report but the next record in the table, which the user is not interested in. My question is, how do I get it working based on my report query?
    Denes

    I have to preface this with the fact that I have not tested this. Sorry, short on time today.
    Scenario:
    - Report is on page 1
    - Item on page 1 called :P1_DEPTNO is a select list allowing the user to narrow the results.
    - Form is on page 2 with the following items:
    -- P2_EMPNO
    -- P2_ENAME
    -- P2_PREV_EMPNO (hidden)
    -- P2_NEXT_EMPNO (hidden)
    Report on page 1:
    select ename,empno
      from emp
    where deptno = :P1_DEPTNO
    order by ename asc nulls lastSince you HAVE to pre-determine the order, you cannot use column heading sorting.
    Poplate the P2_EMPNO item with a link from this page. Have a process that fires onload like the followin:for c1 in (select ename, prev_empno, next_empno
                 from (
                   -- Inner select to return all rows from page 1. We need this for lead and lag to work their magic.
                   select ename,empno,
                          lag(empno) over (order by ename asc nulls last) prev_empno,
                          lead(empno) over (order by ename asc nulls last) next_empno
                     from emp
                    where deptno = :P1_DEPTNO
                   order by ename asc nulls last
               -- Notice this predicate is not applied until the outter select statement. If we applied this to the inner
    -- statement, it would only return 1 row and lead and lag would return null.
               where empno = :P2_EMPNO)
    loop
        :P2_PREV_EMPNO := c1.prev_empno;
        :P2_NEXT_EMPNO := c1.next_empno;
        :P2_ENAME      := c1.ename;
    end loop;Now all you have to do is add a computation that fires on submit to set the value of :P2_EMPNO to either :P2_PREV_EMPNO or :P2_NEXT_EMPNO depending on which button was pressed. This is not the complete solution, but should get you over the part that you were specifically asking about.
    Let me know how it turns out,
    Tyler

  • How to get the page request parameters in Command Button code

    Hi everyone,
    I am new to JSF and working on some Command Buttons. I put my java code via Edit Event, it works fine. But I don't know how to get some parameters from HttpServletRequest.
    Can anyone give some guidance? It would be much appreciated.
    Mike

    Thanks a lot for your tip. Unfortunately I could not open the link you provided due to some network issue.
    Yes, I intend to get some parameters from URL. I did try to put your code and get the parameters predefined in the URL, however I got the null returned. By the way, I put the following code in the page source part and it works. Just don't know how to get the value being passed to the command button event code.
    <%
    String userID = request.getParameter("u");
    System.out.println("this is from head - the userID is :: " + userID);
    %>
    Thanks again and hope you could give me further advice.

  • How to Create process of Type : Get Next or Previous Primary Key Value

    Hi,
    Can anybody give the steps how to create the page process for type Get Next or Previous Primary Key Value in oracle Express database
    Ramesh j c.

    Hi Justin,
    In oracle 10g XE , we have sample application v2.0
    1. Do you have any Document to create step by step the sample application v2.0 and Is it possible to create all the pages of this sample application v2.0 b by wizard. To recreate or create the demo app, start from the home area,
    next go to application builder,
    then click the create button,
    next choose "demonstration application"
    and then you can choose "Run | Edit | Re-install" the "Sample Application" along with a few other apps.
    2. When we install this sample application v2.0 , which is the sql script is executed or how it is installed. If you want the sample application you can export it after you create it if you want the SQL associated with it.
    3. Whenever the sample application v2.0 is installed, how the encrypted pass word is created for the user demo and admin. This is setup with the application install. I don't believe it is encrypted either. If your wanting SSL there are some threads on here that talk about encrypting content.
    Justin thanks for to create process Get Next or Previous Primary Key Value

  • Regarding Lightroom Slideshow module: When I click on the preview button I get the following error: An internal error has occurred: ?:0: attempt at index a nil value. This occurs with any group of images I select in my catalog.

    Regarding Lightroom Slideshow module: When I click on the preview button I get the following error: An internal error has occurred: ?:0: attempt at index a nil value. This occurs with any group of images I select in my catalog.

    Jeannine,
         If you follow the advice of the previous poster Julie Kmoch and then gradualy add presets back in one at a time you might be able to find the one that is causing the issue. I may be guessing, but I believe the issue has something to do with either an incompatible Preset setting (eg a older preset in newer version of LR) or a corrupt Preset.
    Say you bought LR2 and imported a bunch of Presets from the internet, cuz 'Hey these effects are cool and I don't have to recreate the wheel', and then you upgraded to LR3 (not a clean install) and now one of the Presets that calls a certain slider setting or value that is different in LR3 doesn't work anymore. This might be why it throws the error, but again I am just speculating.
    Location of LR Preset folder in Windows Vista/ Windows 7
    C:/Users/<YourUserName>/AppData/Roaming/Adobe/Lightroom/Develop Presets
    If you do not see the folder AppData, you may need to change the settings in Windows Explorer to 'Show Hidden Files and Folders'. To do that in Windows Vista/ Windows 7, open a Windows Explorer window, Click on Organize, then Foler and Search Options. Then click on the View tab and select the option button next to Show hidden files, folders and drives.
    Hope this helps a bit,
    Glenn

  • Having problem to get the value from radio button

    i am doing my double module project for my degree course and i am also a newbie in JSP. Hope there is someone can help me to solve this problem. Now, i set the value of a radio button to "don't smoke", "smoke lightly", and "smoke heavily". Then i use request.getParameter ("smoking behavior") to get the value selected by the user, but the result is only "don't" or "smoke", which the character after spacing will be not be retrieved. I dun know how to solve it, so can any expert here help me to solve this problem? Thanks for helping.

    Why do you have to use whitespace. If your radio button group is name smokingBehavior - no whitespace, wouldn't it just make sence to have values of don't, lightly and heavily. This would solve the problem easily. If your teacher is being a pain in the a&!, and requires you to use whitespace for your naming variables I guess you could insert %20 between the two words and unescape the value on the server side. This seems like a lot of unnecessary work and a silly solution - good luck!

Maybe you are looking for

  • Viewing attachments to PDF files in Preview

    Hi all, Sometimes files are attached to PDFs so that the attached file (spreadsheet, movie, whatever) comes along with the PDF. It's easy to see the attached files using Acrobat Reader (you click on the paperclip icon), but I can't figure out how to

  • After installing Adobe Flash Player 11, I still get a message that I need to install it.

    After installing Adobe Flash Player 11, I still receive a message that I need to install it to view video.  My control panel says that it is installed.  What should I do?

  • 10g report printing - directly to default printer

    I basically want to know how you can set or retrieve the clients default printer and assign it to des_name on the forms side. Thanks.

  • ASCII (character mode report) with 6i

    The help option specifies to set the report width and height accordingly, however this options are not display under the propery palette for the report node. Where can these options be set ? Any help will be appreciated.

  • Adding a page to Pages 4.3

    Working on a word document in Pages 4.3. I wish to add a blank page to an existing section, but only find a way to split a section. Is there a method for adding this blank page for a photo to the section? Thanks.