To call a bean function to set a property value with hx:ajaxRefreshRequest

I have an input box
I need to output some text onto an output box,When the input box value changes
I am using Ibm jsf implementation and RSA 7.0,JSF 1.1 implementation
I know how to call a bean property's setter method using this hx:refresh submit and associated behaviours and target actions.
As explained in this tutorial
http://www.ibm.com/developerworks/rational/library/06/1205_kats_rad2/
But my aim is to call a bean function other than the setter method,because i could do some business logic there and give output.This is possible via setters too,but i believe thats a poor programming practice.
Hope ppl have got a clear picture of my problem.
Help me in this.

You can use any jsf implementation you want, I suggested you only the steps to accomplish the task but I don't know the components you are using...
You can also accomplish the task without Ajax at all using "classic" http requests but it will be very frustrating for your users...
Catch client side event (input value change) -> fire an action that update the model -> update presentation layer with up to date model values

Similar Messages

  • Call managed bean function using javascript

    Any one help me how to call managed bean function through Javascript onload() event.

    What do you want to do after all? Isn't the constructor/initblock of the bean sufficient? Which JSF version/implementation are you using?

  • User defined function to set a default value of a column

    Hi All
    Can we use user defined function to set a default value of a column ??
    for example:
    create or replace  function test1  return number is
    begin
    return 10;
    end;
    create table testt
    (id  as test1,
      name varchar2(20));
    error:
    ORA-02000: missing ( keywordThanks
    Ashwani

    174313 wrote:
    MichaelS for showing example to use function in table ddl , otherwise i was thinking we cannot use function in table ddl as per error I received.That was an example of a virtual column.
    ORA-04044: procedure, function, package, or type is not allowed hereUsing PL/SQL code like that raises 2 basic problems. If that PL/SQL code for the calculating the column default breaks, what happens to the SQL insert statements against that table. These will need to fail as the table definition depends on the PL/SQL code. This is problematic as this dependency simply increases the complexity of the SQL object.
    The 2nd issue is performance. PL/SQL code needs to be executed by the PL/SQL engine. This means a context switch from the SQL engine to the PL/SQL engine in order to determine the default value for that column. Context switching is a performance overhead.
    So even if it was possible to use a PL/SQL function as parameter for the SQL default clause, I would not be that keen to use it.

  • Exception setting property value with CGLIB ( in hibernate)

    My hbm.xml file is:
    <hibernate-mapping>
    <class name="com.dst.fourx.model.codeModel.CodeGroupDisplay" table="CODE_GROUP_DISPAY1">
    <composite-id name="codeGroupDisplayKey" class="com.dst.fourx.model.codeModel.CodeGroupDisplayKey">
    <key-property name="nlsLanguage" type="java.lang.String" column="LANG_CD" />
    <key-many-to-one name="codeGroupCode" class="com.dst.fourx.model.codeModel.CodesGroup" column="CD_GRP_CD" />
    </composite-id>
    <property name="createDate" column="CREATE_DT" type="java.util.Date" not-null="true"/>
    <property name="createUserCode" column="CREATE_USER_CD" type="java.lang.String" not-null="true"/>
    <property name="updateDate" column="LAST_MOD_DT" type="java.util.Date"/>
    <property name="updateUserCode" column="LAST_MOD_USER_CD" type="java.lang.String"/>
    <property name="displayText" column="DISPLAY_TXT" type="java.lang.String" not-null="true"/>
    </class>
    <query name="findAllEditableCodeGroups">
    <![CDATA[from CodeGroupDisplay]]>
         </query>
    </hibernate-mapping>
    I m getting the following error while running the above query:
    org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.dst.fourx.model.codeModel.CodeGroupDisplayKey.setCodeGroupCode
         at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:63)
         at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:262)
         at org.hibernate.type.ComponentType.resolve(ComponentType.java:447)
         at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:182)
         at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:759)
         at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:292)
         at org.hibernate.loader.Loader.doQuery(Loader.java:412)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
         at org.hibernate.loader.Loader.doList(Loader.java:1593)
         at org.hibernate.loader.Loader.list(Loader.java:1577)
         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
         at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
         at com.dst.fourx.core.impl.ao.dao.actions.HibernateNamedQueryAction.execute(HibernateNamedQueryAction.java:79)
         at com.dst.fourx.core.impl.ao.dao.BaseDAOHibernate.execute(BaseDAOHibernate.java:129)
         at com.dst.fourx.core.impl.ao.dao.AddEditCodeDAO.getAllFundingTypes(AddEditCodeDAO.java:47)
         at com.dst.fourx.core.impl.ao.dao.AddEditDAOTest.testGetCreditBankAccts(AddEditDAOTest.java:29)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: net.sf.cglib.beans.BulkBeanException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
         at com.dst.fourx.model.codeModel.CodeGroupDisplayKey$$BulkBeanByCGLIB$$ae2c0401_2.setPropertyValues(<generated>)
         at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:59)
         ... 32 more
    Caused by: java.lang.ClassCastException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
         ... 34 more

    check the setter method for the property LANG_CD in com.dst.fourx.model.codeModel.CodeGroupDisplay.
    it must be like -
    setNlsLanguage(CodesGroup xyz) { ... }
    The paremeters must be objects, not the type of the database column. We can specify the actual field in CodesGroup which acts as the foreign key in CodeGroupDisplay in the "property-ref" attribute of <many-to-one> element in the mapping file for CodeGroupDisplay.
    This worked for me. Hope it works for you too.

  • I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query parameter to report parameter i need to pass distinct values. How can i resolve this

    I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
    parameter to report parameter i need to pass distinct values. How can i resolve this

    Hi nancharaiah,
    If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
    None
    Specify values
    Get values from a query
    If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
    sample is for your reference:
    Select distinct field_name  from table_name
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Set dynamic Property Value

    Hi Expert,
    Can we set Property values dynamicly from BPC excel.
    eg/ Let say we have Dimension called Project which has a ID Proj1 with property FM_AMT.
    Can we set this FM_AMT from the BPC excel ? do we have any Function ?
    Regards
    Gayu

    Hi Gayu,
    You can use EVPRO to get this property in BPC excel. The syntax is =evpro(appname, Member, property). In your case, it is
    =evpro("App","Proj1","FM_AMT")
    Hope this helps.
    Regards,
    Shoba

  • Setting default property value in custom componenty

    I'm a Flash newbie trying to build a custom component using
    Flash MX 2004. basically it's an enhanced version of the standard
    label component. Everything seems to work fine except when trying
    to set default text or assigning a text value in the "properties"
    window (the field displays in the properties window, but any value
    typed into it does not appear during movie playback). Currently,
    the text can be seen only in authoring mode, not when the movie
    plays. The only way for the text to displayed during playback is to
    set it up through code. Does anybody know what I'm doing wrong? .as
    file content follows.
    class CustomComponents.FormFields.lblFieldLabel extends
    MovieClip {
    private var objFieldLabel:MovieClip;
    private var strText:String = "";
    function lblFieldLabel() {
    init();
    public function init():Void {
    public function get displaytext():String {
    return strText;
    [Inspectable(defaultValue="display text", type="String")]
    public function set displaytext(val:String):Void {
    strText = val;
    objFieldLabel.text = strText + ":";
    }

    I have posted a response to your duplicate post here Set a default value in Custom.pll

  • Set Column Default Value with Workflow

    How to set Column Default Values using a workflow.
    <input alt="Mark as abusive!" id="ctl00_m_g_e11f6e6d_9b4b_42d7_97fb_486623821166_ctl12_ctl03_abuseButton_710" name="ctl00$m$g_e11f6e6d_9b4b_42d7_97fb_486623821166$ctl12$ctl03$abuseButton_710" src="http://www.sharepointforum.nl/_layouts/images/TOZIT/SharePointForums/abuse/abuse.png"
    style="border-width:0px;" title="Mark as abusive!" type="image" />
    15 seconds ago
    After I add an item including metadata in a List, a Workflow starts to create a Library Folder with rootfolder, subfolder and sub-subfolder names based on the List first three column values. 
    I like that the unique created library subfolder automatically receives several additional List column values in its Column Default Value with that workflow.
    After done, documents added to this subfolder are automatically populated with Metadata from the parent Subfolder.
    Workflow standard function can be used  to populate the folder Column Value to this but not the Column Default Value.
    Does someone has a solution how to set Column
    Default Value using a workflow?
    I like to use such workflow in Sharepoint 2010.
    Thank in advance.

    Hi,
    I think it cannot be achieved by workflow.

  • Calling JSP bean function on button OnClick

    Hi-
    A NewBie question....
    I have a .jsp page and supporting .java bean.
    I registed the bean in .jsp page using <jsp:useBean ...>
    I want to fire a function defined in that bean on the click of a button which is defined in the .jsp page
    So I am doing something like this... seems like not the correct way to do since it fires this script all the time, not just when the button is clicked.
    <input name='click1' type='Submit' value='Click1' onClick='<% testBean.click1Clicked (); %>'/>
    Thanks for your help.

    Hi Kishor-
    Thanks for the reply.
    I realize that might be the case, as u explained in your two points.
    so now I have created a hidden input field and use it's value as a way to communicate between javascript and jsp. and in bean's function I check the value of this hidden field, which will be set by the OnClick's javascript and then proceed accordingly.
    Is this the correct way to accomplish what I am trying to?
    Thanks again

  • My page has a button that, when clicked, calls a Java function that sets a PageLegend and changes an image but then FireFox reloads the page switching everything back to original values. What's up?

    This is happening with an ASP page. Not sure when it started, but the page used to work fine. The Java script is listed in the troubleshooting section. The button calls nextPic() which calls showPic(). After nextPic processes the page is reloaded.

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Using calc script function when setting substitution variable value

    I would like to be able to execute the below, but this wont work since it is a combination of MaxL and calc script syntax:
    alter database 'App'.'DB' set variable 'Var1' @PARENT("Day 1");
    The following does not work either for the same reason:
    set A = @PARENT("Day 1");
    echo $A;
    alter database 'App'.'DB' set variable 'Var1' $A;
    Is there a correct way to do the above, and is it even possible? Or will the variable literally have to contain the value "@PARENT("Day 1")" to be later parsed in a calc script?

    Hi James. I was hoping that 'query database' with the 'member info' option was going to include the parent in the result set, but it's just a bunch of storage / consolidation properties so no luck there.
    The only idea i could come up with (and this is getting pretty clunky) would be to use MaxL to execute a report script (or MDX query, but the output would be different and probably harder to parse):
    //ESS_LOCALE English_UnitedStates.Latin1@Binary
    {SUPHEADING}
    {TABDELIMIT}
    <ROW("YourDimension")
    <PARENT &YourSubVar
    !This spits out a tab delimited file containing just one line - the name of the parent of the member named in &YourSubVar, and one data value, tab delimited. You could then parse the output in cmd (I'm assuming you're on Windows) using FOR /F to grab the first value and then pass it back in to a subsequent MaxL command to update the value of the second subvar (as referenced in your fix).

  • Set and get values with vector

    I have a class that that querys a db and sets a value of the result to a vector array. Is it possible to set and retrieve that vector array using the set and get methods?
    ex:
    my class:
    sql = "Select ...";
    Vector fName = new Vector();
    rs = sqlStatement.executeQuery(sql);
    if (rs != null) {
    while (rs.next()) {
    fName.add(rs.getString("fName") + "");
    rs.close();
    setFName(fName);
    how would I set up the set and get methods???
    thanks

    I am unsure of what you are asking:
    A Vector has set and get methods for it, you use indexes of the array to say what element you want to work with.
    If you are asking how do you know what elements of the Vector contain which data columns, you have to remember how you put them in.
    If you are asking if you can use set to load the Vector: then NO, you have to have elemenets already there to change, use the add method.
    If you are asking how to access the elements of the Vector you use an Enumeration:
    for(java.util.Enumeration e = v.elements(); e.hasMoreElements();){
    s = (java.lang.String) e.nextElement();
    vl.add(s.substring(0, 12));
    If you are asking something else: please elaborate what you want--my brain may not be very functional this morning.

  • Is it possible to set multiple textfield value with a for=loop

    JTextField W1HourTF=new JTextField(8);
    JTextField W2HourTF=new JTextField(8);
    JTextField W3HourTF=new JTextField(8);
    JTextField W4HourTF=new JTextField(8);
    I have created the above 4 textfields, I want to set all the text field editable using a for loop.
    Is there any method which can do it? Example :
    for (i=0,i<=4,i++)
    WHourTF.setEditable(true); // where i is based on the loop time

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.border.*;
    class JTEXTFIELD extends JFrame
         JTextField [] jTextFieldArray = {jTextField1, jTextField1, jTextField2, jTextField3};
    ========================================================================
    How come I get error :
    JTEXTFIELD.java:9: cannot resolve symbol
    symbol : variable jTextField1
    location: class JTEXTFIELD
    JTextField [] jTextFieldArray = {jTextField1, jTextField1, jTextField2,
    jTextField3};

  • Setting form attribute value with php

    i am having trouble setting the checked attribute value of a
    radio button based on the url parameter search. if search == all
    then checked == checked else checked == unchecked.
    <input type="radio" name="search" value="all"
    checked="<?php if ($_GET["search"] == "all") { echo"checked";}
    else { echo"unchecked";} ?>" />
    what am i doing wrong?

    This code should work
    <input type="radio" name="search" value="all" <?php if
    ($_GET["search"] == "all") { echo "checked";} ?> />

  • How to call PL/SQL function and pass parameter to ODI variable?

    Can I call PL/SQL function and assign a return value to an ODI variable? Also can I assign ODI variable to IN paramter and assign OUT parameter to ODI variable? What ODI doc has that information?
    Thanks

    Hi,
    Refer this http://odiexperts.com/how-to-use-plsql-procedures-and-functions-in-odi
    Thanks,
    Sutirtha

Maybe you are looking for

  • How to fetch Signature in to my custom script configured in qc02 from DSAL

    Hi All, In my requirement I need to get the signature from DSAL tcode for a particular material(may be BULK or FINISHED) while executing QC22 tcode.I already got the remaining data in to the form like QALS-KTEXTMAT , QALS-CHARG,MCH1-VFDAT and MCH1-HS

  • Video Formats in Flash CS4

    I recently upgraded to CS4. Previously in CS3 I was Importing Quicktime .mov files using the Import Video command. In the dialog that would appear, I would choose progressive download and ON2 VP6 and Flash CS3 would then initiate a progress bar with

  • Bridge/templates not working. should i reinstall ?

    so ya .. when i click the command to open existing templates, or the view from bridge, nothing happens. . . was wondering if i did anything wrong. or if i should reinstall. btw i am on cs4 , imac 3.06 GHz intel core 2 duo, 2gb ram. NOT snow leopard

  • The "Edit" option in Dutch is lowercase

    The "Edit" option in Dutch begins with a lowercase letter instead of upercase like all the other options.I've searched for a way to report this but did not find any so that's why I'm putting this here.It's been like this for a couple of versions alre

  • Tomcat, Oracle 9i and Chinese Characters

    Dear Group, we are using an application based on oracle 9i and tomcat 5.0. I copied the "ojdbc14.jar" and "nls_charset12.jar" to my common/lib directory of Tomcat. The application works fine until I insert chinese characters via the web form from our