How to change a h:outputText value in the current form on key pressed event

Hello Suners,
Greetings! I'm developing my first JSF web application and i'm trying to figure a way out to change outputText value when key pressed on another inputText so that when the user is typing his name for example he can see the letters showing respectively in the outputText.
I managed to do it onchange but the user must focus out of the inputText to see his name in the outputText which is not right and the form must submit onchange event which is annoying.
<h:inputText value="#{login.username}" title="name" id="name" required="true" onchange="this.form.submit()" >
                            <f:validateLength maximum="10" minimum="1"/>
                            <f:validator validatorId="myValidator"/>
                            <f:valueChangeListener type="classes.MyListener"/>
</h:inputText>Is there any listener i can associate with the "onkeypress" attribute? Can anyone help me to do that with JSF?
King Regards,

hi, with JSF 2 you got the ajax tag, just tried it and it works fine :)
<h:inputText id="myinput" value="#{back.name}">
    <f:ajax execute="@this" event="keyup" render="outtext"/>
</h:inputText>
<h:outputText id="outtext" value="#{back.name}"/>or before JSF 2
<h:outputScript name="jsf.js" library="javax.faces" target="head"/>
<h:inputText id="myinput" value="#{back.name}" onkeyup="jsf.ajax.request(this, event, {render: 'outtext'}); return false;"/>
<h:outputText id="outtext" value="#{back.name}"/>The name property is a simple String in the bean.
Hope this helps
Edited by: hereps on Aug 21, 2010 7:18 AM

Similar Messages

  • How to get the value of the current form values after "save" in MD form

    Hi,
    I am trying to run a procedure using the form values right after I save the current records in a master-detail form. When I pass the value using p_session.get_value to the procedure, there is only null value passed. I checked the package body generated and found that the OnReset function runs immediately following the saving of the current records and this onReset function is called within the OnSave procedure. So when I save the current changes, I loose the values in the p_session. Any PL/SQL code I write after OnSave, does not get any p_session value.
    Interestingly, in case of just one table form, the OnReset is not within the OnInsert function and it is possible to get the p_session values. OnReset runs after OnInsert and within this two functions we can write any pl/sql code on the Insert button PL/SQL handler.
    I have the following questions:
    1. Why is the procedure written differently in case of master-detail form ? Why is the OnReset inside the OnSave ? How do we write codes which we want to execute before onReset and after OnSave ?
    2. I want to run a procedure after onSave and before OnReset. How do I do that ? Do I have to change the package manually ?
    3. If the above is not possible, I can also try to store the values I need to run the procedure before I save in some variable. How do I do that ? It seems I cannot declare variables to store session values inside the pl/sql event code on Save button, because it gives me error. The variable declaration code goes in between the begin and end of genesys.. procedure and that is not allowed in pl/sql
    Please help me with this. I definitely need to run a procedure after saving for almost all of my forms. Otherwise I am not sure what to do with my development. I am completely stuck with this. Thanks a lot for helping me out.
    Mainak

    Never mind. I found the answer.

  • How can i transfer a field value in the main report to its sub-report?

    <p><font face="Arial" size="2">How can i transfer a field value in the main report to its sub-report?</font></p><p><font face="Arial" size="2">Please eloberate with example if possible!</font></p><p><font face="Arial" size="2">Thanks...</font></p><p> </p>

    <p>You can do a couple of things - one would be to pass the information using the data linking expert.  Right click on the subreport, choose &#39;Change Subreport Links&#39; and select the field(s) you are wanting to pass to the subreport.  CRW will build parameters and a record selection formula for you in the subreport, and if that&#39;s what you want, then great.  But you can also remove the selection formula from the subreport and work with the parameter fields in the subreport however you would like.</p><p>Alternatively, you can look to passing Shared variables back and forth from the main and subreport.  this link talks about the method to do this: http://diamond.businessobjects.com/node/251</p><p> </p>

  • How to change keyword in many pictures at the same time?

    I gave a big series of pictures the wrong keywords. Now, I can't figure out how to change them (besides one by one...).
    If I select e.g. 10 pictures in Library-mode, how to change keywords on them all at the same time?

    Make sure you are in Grid View, primary monitor (if you have two), select 10 pictures and type (or delete) the keywords in the Keywording panel in the left upper corner.
    Make sure the Metadata->Show Metadata for Target Photo Only is unchecked in the menus. Otherwise your edits will only apply to the primary selected (most selected) image.

  • How do I pass a null value to the reportDocument?

    I'm using CR 2008 and VS 2005. 
    I am using a stored procedure as the datasource for one of my report, which we run using the C# API.   The stored procedure is expecting a NULL in certain cases and I find I cannot pass a NULL with my current code:
    // Here I get the parameter
    // If we are dealing with an empty string or a NULL value, let's give it
                            // a value of a space so that Crystal's DLLs don't choke.
                            if ((value.Length == 0) || (value == "NULL"))
                                value = " ";
                            arrParams.Add(value);
    Object strParam = arrParams<i>;
    this.reportDocument1.SetParameterValue(num, strParam);
    The stored procedure parameter type is INT so in the report it shows up as NUMBER.
    How do I get a NULL value to the stored procedure?
    Thanks.

    See if this does the trick:
    Dim crParameterDiscreteValue As New CrystalDecisions.Shared.ParameterDiscreteValue()
    crParameterDiscreteValue.Value = Nothing
    C# would look something like;
    CrystalDecisions.Shared.ParameterDiscreteValue crParameterDiscreteValue;
    crParameterDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
    crParameterDiscreteValue.Value = null;
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • How to change async to sync after deploying the process.? Thanks

    How to change async to sync after deploying the process.? Thanks

    you'd need to change the base wsdl, the generated one (_Name.wsdl) and the bpel.file .. and remove the generated classes .. (all in domains/you_domain/tmp/your_process dir)
    the wsdl needs to get the output msg to the input msg instead of a callback porttype, the same needs to be in the generated wsdl (don't forget to remove the callback role in plnk session).. and the bpel process needs to have a reply instead of the invoke ..
    this is what you would need to do .. BUT, maybe we can find a better solution for you, if you elaborate on the usecase..
    during design time this is easier :-)
    regards clemens

  • How to change to a new phone. I currently have an iphone 5.  Just got a new iphone 6 as a gift. I want to switch over to my new phone on my own instead of going back to the store

    How to change to a new phone. I currently have an iphone 5.  Just got a new iphone 6 as a gift. I want to switch over to my new phone on my own instead of going back to the store

    Back up the old phone and restore the new one from that backup, follow these articles:
    Transfer content from an iPhone, iPad, or iPod touch to a new device - Apple Support
    How to back up your devices using iCloud or iTunes - Apple Support

  • When I use Photoshop CS 6 to edit video, I don't know how to change video speed after I converted the clip to smart object?

    When I use Photoshop CS 6 to edit video, I don't know how to change video speed after I converted the clip to smart object? The clip color turns purple and it only allows me to add motion but not change the clip duration and speed anymore.

    Thanks for the reply and as a work around method I used the Photoshop to do all the adjustments then export the video to iMovie to finish the final cut. I also have a problem to paint or clone on a blank video layer created in Photoshop. It tells me the time is beyond the target frame time, I don't understand the message. Can you explain to me what did I do wrong? Thanks a lot!
    John Wang
    801-3618742
    [email protected] 
    http://johnwanggallery.shutterfly.com  

  • State machine custom task workflow how to pass one task field value to the next task field

    i am using ItemMetadata.xml to pass value from list to custom task first value its passing the but second value is showing as null
    plus how to pass one custom task value to the next custom task
    i.e one supervisor approver comments submitted field i want to see on department manager approval custom task which is the next approver from supervisor
    ows_firstfield=""
    ows_SecondField=""
    the above ows fields are from list
    in this i am unable to retrive the second value in the task form this is my first query?
    second query is that how can we pass one task field value to next approver task field value?
    any idea
    MCTS,ITIL

    What type of workflow is this?  IS this Visual Studio or SharePOint designer or third party (K2, Nintex, etc...)?  YOu should be able to get ahold of the task that was edited via the correlation token, and then grab any value you want from that
    task (wether it be a custom field or a standard worfklow task field). 
    It would help to know what you are using to build the workflow.
    Thanks!

  • How to change Topic's Icon and show the Print Button

    Hi, currently i'm using robohelp html version 8. I have spent quite some time to figure out how to change topic's Icon and show the Print Button in my project. Anyone can help me on this? Btw, i using MX(template) to generate the output with FlashHelp Pro.
    Below is the screenshot for clearer clarification:
    Thanks.

    We would have told you if there was.
    Sorry but a downside of FlashHelp is that your customising options are limited.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • Compare the value of the current and the Last keyframe

    Hey there,
    in our company we built some ad, which is an html5 game (view the attachement). The user is able to move the ball through the labyrinth by tilting/moving the phone using the gyroscope-sensor inside of it.
    Now our ceo asked me if i would be able to make a video out of it for a power-point presentation.
    With a software tool i made a video-screenshot of the iphone screen, with it's interaction.
    After that i imported the video to afx and added the video the iphone-frame and the hand.
    Tracking of the ball didn't worked because of the rotating texture of the ball, but i followed the movement with a null-object.
    Owning the information of the Balls movement in a null-object i connected the hand and the phone to the null-object. Getting the look the hand interacts with the game.
    The movement of the Hand was to much so i divided the movement of the distance by 2 in an expression.
    NOW THE PROBLEM:
    The movement of the ball is just changing the parameter of the "position" not of the "rotation".
    So i would like to the value of the current keyframe and of the last keyframe and get a value which is the difference of them (x-y=new value). But i don't know how to collect the data of these by an expression.
    Could someone help?

    Hey Wow, you guys are really quick here.
    Sorry didn't want to confuse anyone here.
    I will go a little more into it.
    If i am only taking the x value of the position and compare the actual state of x value with the satus of the x value of the keyframe before.
    i will take this two values x1 and x2 to take the difference between them. With this new value.
    i can modify the angle of the rotation between -90 and +90.
    Know what i mean?
    but i am not sure if valueattime works in this case because i need the information dynamic.

  • How can we get a alert message in  the current browser we are using the mom

    how can we get a alert message in the current browser we are using the moment we have entered some data in
    the table...
    I need a popup alert the moment a new record is added in a table... in apex database is 11g xe..
    The idea is I am using a apex application. .The moment new data is added in the table ..I am alerted by a message window..that a new record has been added...
    Thanks
    Edited by: pauljohny on Jun 11, 2012 10:23 AM

    pauljohny wrote:
    how can we get a alert message in the current browser we are using the moment we have entered some data in the table...
    "Current browser"? When viewing anything, or just when using an APEX app?
    Ans .. Just when using apex app....even if the apex app is minimised ..The current browser will be the one where I am using apex app...
    What i am looking for some scheduler .. to check ..in the table every 5 minute for change if there is a change..then a popup alert be shown...
    Split it into [at least] 2 components, database and browser. I'd expect someone calling themself a "DBA Architect" to have some ideas about the database side of things, even if not clued up on JavaScript and AJAX?
    I dont think its a database isssue... When i say to check every 5 minutes ..it could be easily done via dbms_scheduler ...I am having issue in getting the popup alert message...
    in apex... Dont know wether there is a plugin like modal window(available from skill builder) which shall help in this scenario,.Or might be have to use java scripting and ajax ..
    and if it is that (Java scripting and Ajax) .....then shall have to be familiar with java scripting and Ajax...and this shall be a bit time consuming..
    Had a feeling this could be accomplished via java scripting and ajax.. ...but still looking for some easy way..

  • Creation of a Query to show the values for the current month and the last 12 months data.

    Dear All,
    Good day!
    I have to create a Query with the below requirement.
    I have to create a Query to show the values for the current month and the last 12 months data.
    Can you please guide me how to achieve this ??
    thank you,
    Regards,
    Hema

    Hema
    explain the exact problem..? as you mentioned you want to create query to show values for current month and last 12 months.. so I think you want to show values for 12 months from current data.. you can achive this by multiple way..
    you can have selection screen and field with date .. and restrict based on system current date and 12 months before or you can handle this at your target.. .. I mean there are multiple ways to restrict data by date range..
    for some more hints..
    http://www.forumtopics.com/busobj/viewtopic.php?t=34393&sid=7fba465d0463bf7ff5ec46c128754ed6
    http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/how-to-display-last-12-months-in-report-based-on-todays-date-3231850
    http://scn.sap.com/thread/3217381
    search on SDN you will get many other ways..
    Thanks,
    Bhupesh

  • How do I create a new calendar for the current year, using last years calendar's birthday's/photos and comments from the lower pages?

    Each year for the past 5 years I make a family calendar and send copies to all he family members around the globe.  I hate that I have to recreate all the birthdays and special occasions from scratch, and re-drag all the photos onto these dates, in the lower half of the page of each month on the new calendar.  How can I create a new calendar for the current year and port all of these photos/comments into the new calendar from last years calendar, to save having to redo all this work!!  I am not talking about the upper half page of the photos only...I am referring to the calendar page of each month.
    Thanks in advance. 
    Colin

    Welcome to the Apple Discussions. Open iWeb so you see your original site in the left hand pane. Use the File->New Site menu option to create a new site. Give it the name you want.
    Now select a page in your original site and type Command+D. That will duplicate the page. Drag the duplicate page down to the new site and rename it as needed. Do that for the other pages you need in the original site.
    OT

  • How can get the console window name of the current form?

    How can get the console window name of the current form?

    Try the various get methods of the viewObject such as getQuery:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtAnchor.getQuery%28%29/vtTopicFile.bc4jjavadoc%7Crt%7Coracle%7Cjbo%7CViewObject%7Ehtml/

Maybe you are looking for