Can't use binding property of a commanButton inside a datatable

I have commandButtons inside a datatable.
The datatable is iterated over ArrayList containing custom PageSnippets objects, which look like this :
public class PageSnippet {
          private int index = 0;
          private String name = null;
          private String id      = null;
          private UICommand upBtn = new UICommand();
          private UICommand downBtn = new UICommand();
          public PageSnippet (int index, String name, long id, int snippetCount) {
               this.index = index;
               this.name = name;
               this.id = String.valueOf(id);
               setBtnsVisibility(snippetCount);
           * getters
          public String getId() {
               return id;
          public int getIndex() {
               return index;
          public String getName() {
               return name;
          public UICommand getUpBtn() {
               return upBtn;
          public UICommand getDownBtn() {
               return downBtn;
           * Sets button visibility.
          public void setBtnsVisibility (int snippetCount) {
               upBtn.setRendered(index > 1);
               downBtn.setRendered(index < snippetCount);
     }The two buttons are binded to the the pageSnippet's upBtn and downBtn objects in order to set their rendered status:
<h:commandButton
actionListener="#{pageEditBean.moveSnippet}" type="submit"
image="../images/btn_up.png"
binding="#{snippet.upBtn}"/>I got null nuinter exception, datable variable snippet is reported null
and getter method of the backing bean getPageSnipets is not called at all.
I got null nuinter exception even when rendered property of the datatable is false.
When I remove binding property of the buttons everything works fine.
When instead of binding property I use rendered property of the commandButton and in the getter metthods I return boolean:
public boolean getUpBtn() {
               return downBtn.isRendered();
          } Everything is OK as well.
MyFaces 1.1.5
JSDK 1.4.2_08
Tomcat 4.1.3
Have anybody encountered such problem?
Is there any workaround?
Or can anybody confirm that binding a commandButton to a backing UICommand object inside a datatable works for him?
thanks in advance

Thanks a lot.
You're right, the backing bean has request scope.
I found out (the hard way) that there's a bug in JSF that prevents a commandButton from working, when the button's rendered property is binded to a backing bean's property.
But this solution works.
But I got another problem:
When I click the button, I got java.lang.NoSuchMethodError
Even clicking the button outside the datatable returns the exception.
Again, when I set the bean's scope to session it works.
I don't understand that, except for the datatable business, commandButtons with other request scope beans work well.
Thanks

Similar Messages

  • How can i use a Property as Link in the Resource Renderer Setings

    Hi to all,
    i have created a Propertry with the name SFS_NewsLink.
    The content of this Property is
    http://<server>.<domain>/path/sitemap
    Now, how can i use this property in the Visible Propertis? i dont will use use the default "contentLink" i will use as Link the content from the SFS_NewsLink.
    how can i do this? have envery one any ideas?
    Best Regards
    Thomas

    Hello Thomas,
    You can modify your Collection Renderer and Resource Renderer to achieve this functionality.
    Check this weblog, to get ideas:
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3648
    Greetings,
    Praveen Gudapati

  • I can not use the property of Touch ID to buy apps from Apple Store. !!!

    I can not use the property of Touch ID to buy apps from Apple Store. !!!
    Knowing that I have to activate the property of the settings, but they only work when you open the lock and does not work with me to buy the apps in Apple store !!
    And I'm sad and very upset by this  problem and I bought this phone in order to enjoy this feature and this experience But this did not happen !!  

    Hi I BOSS,
    If you are having issues using Touch ID to make purchases from the iTunes Store, you may find the Purchasing section of the following article helpful:
    iPhone 5s: Using Touch ID
    http://support.apple.com/kb/HT5883
    Regards,
    - Brenden

  • HT5312 I can not use my account to buy applications inside because I forgot the answers safety questions

    I can not use my account to buy applications inside because I forgot the answers safety questions

    You need to contact Apple. Click here, phone them, and ask for the Account Security team.
    (86795)

  • Hi -- am an iMovie11 user and want to know if Motion 5 can be used for additional transitions, titles etc. inside iMovie?

    Hi -- am an iMovie11 user and want to know if Motion 5 can be used for additional transitions, titles etc. inside iMovie?
    <Email Edited by Host>

    As far as functionality goes, I don't see anything wrong. when it comes to efficiency you need to keep some general pointers in mind. These issues which I'm bringing up will not affect your code currently since your array sizes are small but can start creating memory fragmentaion and slow down the software if your array sizes are much larger and the software runs for a long period of time.
    1. Try not to use Build Array. Each time you use a built array labview creates a copy in the memory. Try to initilized your arrays and replace the subsets.
    2. as much as you can try not index arrays or unbundle cluster multiple times. try to perform as many tasks as possbile in one shot. (this was evident in your second loop)
    Besides that it's looking good. 
    I made a few modifications to your code and attached it. I wanted to give you a different take on it as it relates to being able to control the inputs and outputs programitically, if you had a look up table. I didn't make the same modifications to your second loop but I can guide you through what needs to be done if you would like to move in this direction. Again your original code is well done for someone who is new to labview so don't feel like you need to follow the new VI design. Just try to remove the build array and multiple indexing as a good programming habbit.
    www.movimed.com - Custom Imaging Solutions
    Attachments:
    Channel Testing.vi ‏41 KB

  • Can I use bind variable instaed of writing static COLUMN Name

    Hi , I am having a table containing id and column names, the data is stored against that id in other tables. Now I wish to update data into another table so that it goes into apppropriate column without using decode function.
    I am trying to do this:
    EXECUTE IMMEDIATE 'update TEST set :1 = :2
    where PROJECT_ID= :3 and UNIQUE_ID= :4' using P_DEST_COLUMN, P_TEXT_VALUE, P_PROJ_ID, P_TASK_UID;
    the values P_DEST_COLUMN, P_TEXT_VALUE, P_PROJ_ID, P_TASK_UID are populated using a cursor in PL/SQl
    Is this statement valid? If not can you tell me how to do it as I am getting some error I am unable to comprehend.
    thanks
    Rishabh

    Column names cannot be substituted at run-time as bind variables. If you need to specify the column name at run-time, you'd need to construct a new string and execute that string dynamically, i.e.
    EXECUTE IMMEDIATE 'UPDATE test SET ' || p_dest_column || ' = :1 ' || ...From a data model standpoint, storing column names as data elements in another table is generally a rather poor idea. It's likely to make ad-hoc reporting nearly impossible and to cause a lot more parsing than would otherwise be required.
    Justin

  • Can't use bind variable in a function

    This is a repost from my earlier post at
    URGENT: Problem creating the report using Procedure
    The problem is when I bind a variable in a function, I get REP-0002. Please look at the following steps to reproduce
    ===
    set serveroutput on
    create or replace
    package Q_REP_test
    as
    type drec is record
    sdate date
    type dreccursor is ref cursor return drec;
    Procedure Get_sysdate(retdate out dreccursor);
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor);
    end q_rep_test;
    show errors
    create or replace
    package body q_rep_Test
    as
    procedure Get_sysdate(retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate retdate from dual;
    end;
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate+no_of_days retdate from dual;
    end;
    end q_rep_test;
    show errors
    ===
    Invoke the SP as follows:
    ===
    function QR_1RefCurDS return q_rep_test.dreccursor is
    tempc q_rep_test.dreccursor ;
    begin
    q_rep_test.add_days_tocurdate(:p_1,tempc);
    return tempc;
    end;
    ===
    1. Create a report
    2. create an user parameter(p_1)
    3. add a pl/sql as above
    4. run it(to verify the report works)
    5. save it.
    6. close the report
    7. Open it again, you get an as
    "REP-0002: Unable to retrieve a string from the Report Builder Message file". Now it is corrupted and can't be used at all.
    Please treat this as urgent and help me.
    Thanks

    Hi ,
    Though you have stated it as Oracle92iDS check whether it has the 9.0.2.2 patchset applied. If not please try applying the latest Patchset 9.0.2.2 for Oracle9i Reports.
    To download the patch goto Metalink &lt;http://metalink.oracle.com/metalink/plsql/ml2_gui.startup&gt; and search for Patch# 2842923.
    This Patchset is for iAS and iDS.
    In either case, please let me know the results.
    Thanks,
    Vinod.

  • How can I use the property 'top left visible cell' in a table?

    Hi! I use a table in my program and I want to show the top left cell of the table every time when the user clicks a button .I don't know how to do this. If I use a multicolumnListbox I can select the property 'top left visivle cell'. Is it possible with a table ?
    Thanks for any help.

    Yes, it's possible - use the "index value" property to set top-left cell for arrays and tables. See example attached.
    Attachments:
    Index_value_ex.vi ‏30 KB

  • How can i use visible property

    I want to display some components in some specified actions. how can i handle visibility of a component dynamically.
    regards

    Hi Naga,
    1) Under your context, create attributes of type "visbility". (create an attribute and change it's type to Local Dictionary -> com.sap.ide.webdynpro.uielementdefinitions->Visibilty)
    2) Bind the Visbility property of the required UI element to this attribute.
    3) When required chnage the visbilty as below:
    WDContext.currentContextElement().set<attribute name>(WDVISIBILTY.VISBILE);
    /* Makes the UI element visible */
    WDContext.currentContextElement().set<attribute name>(WDVISIBILTY.BLANK)
    /* Makes the UI element invisbile , but it takes up the space on the screen */
    WDContext.currentContextElement().set<attribute name>(WDVISIBILTY.NONE)
    /* Makes it invisible and doesn't take up space too */
    Hope this helps,
    Best Regards,
    Nibu.

  • In Smartforms can i use table type which has table inside table

    Hi ,
    I would like to know whether in Form Interface can we declare table type which has a table and one of its field is again a table( Nested tables)..
    Can we declare like that ?? Need your suggestions please...
    Rgds.,
    subash

    Yes, we can.
    Check Smartform LB_BIL_INVOICE
    Importing parameter IS_BIL_INVOICE TYPE LBBIL_INVOICE
    Regards,
    Naimesh Patel

  • How to use postback property for JSF to reneder a popup only once

    Hi All,
    I'm using java script function to show a JSF page as popup. I have called the javascript function on page load of another JSF page.
    How do i make sure that the popup is getting rendered only once and not everytime the page is getting refreshed .
    Can i use postback property in JSF page for this purpose ?
    Thanks in Advance.

    try postback..
            Boolean postBackValue = (Boolean)resolveExpression("#{adfFacesContext.postback}");
            Boolean defaultBooleanValue = new Boolean("false");
            if (postBackValue.equals(defaultBooleanValue)) {
      public static Object resolveExpression(String expression) {
        FacesContext ctx = FacesContext.getCurrentInstance();
        Application app = ctx.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = ctx.getELContext();
        ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
        return valueExp.getValue(elContext);
      }

  • How can I use TrueSequenceFactory with multiple sequences

    In the post "How to use existing Oracle sequences using KODO" answered
    by Marc Prud'hommeaux a "sample code" was given. But seems to me that
    example will only work with a single Oracle sequence for the entire
    system. Is this right?
    How can I use TrueSequenceFactory with primary-keys and their
    respective existing sequences? Can you (SolarMetric guys) provide me a
    sample code?

    The problem is that you are using application-identity. When you
    specify an objectid-class, we treat is automatically as application
    identity. To resolve this, I would recommend removing both the
    objectid-class and identity-type atributes from your class. With
    "objectid-class" in place, we asssume that you wil take care of identity.
    Eduardo Bobsin Machado wrote:
    I'm using Kodo 2.4.0, Oracle 9i, JBoss 3.0.4, the Kodo jars are in the
    JBoss' lib/ext.
    Well, I'll show what I have...
    This is the script of my table:
    CREATE TABLE LINEUP_VOYAGE (
    VOYAGEID NUMBER (10) NOT NULL,
    VESSEL_NAME VARCHAR2 (1000) NOT NULL,
    CONSTRAINT PK_LINEUP_VOYAGE
    PRIMARY KEY ( VOYAGEID ) ) ;
    This is an excerpt of my .jdo file:
    <class name="LineupVoyage" objectid-class="LineupVoyageId"
    identity-type="datastore">
    <extension vendor-name="kodo" key="table" value="LINEUP_VOYAGE"/>
    <extension vendor-name="kodo" key="sequence"
    value="LINEUP_VOYAGEID_SEQ"/>
    <extension vendor-name="kodo" key="pk-column" value="VOYAGEID"/>
    <extension vendor-name="kodo" key="lock-column" value="none"/>
    <extension vendor-name="kodo" key="class-column" value="none"/>
    <field name="vesselName">
    <extension vendor-name="kodo" key="data-column"
    value="VESSEL_NAME"/>
    </field>
    <!--field name="id" primary-key="true">
    <extension vendor-name="kodo" key="data-column"
    value="VOYAGEID"/>
    </field-->
    </class>
    As you can see, the "id" field is commented.
    And this is my class:
    package br.com.fertimport.entity;
    import java.util.*;
    public class LineupVoyage {
         private String vesselName;
    //     private long id;
    //     public LineupVoyage(long id) { this.id = id; }
    //     public long getId() { return id; }
    //     public void setId(long id) { this.id = id; }
         public String getVesselName() { return vesselName; }
         public void setVesselName (String vesselName) { this.vesselName =
    vesselName; }
    The "id" attribute is commented.
    Now the questions...
    To use ClassSequenceFactory must the identity-type of my entities be
    application or datastore?
    Is the "objectid-class" parameter required in this case?
    As you see, all references to the "id" property are commented. Can I
    use this property to represent my object id?
    If not, how can I identify my object with something like a long?
    The last question is related to my architecture: one VM with the EJBs
    (entity and session) and another VM with the web classes and JSPs,
    connected by a session facade. I don't want to use any Kodo or JDO stuff
    in the web tier. Is this possible?
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Can I use just IAC to create a PDF Binder?

    Hi All,
    I just started looking at the SDK, and normally I'd read it until I found my answer, but the boss wants something done by yesterday.
    I have a stand-alone Visual C++ app that creates a number of different files, such as ACAD drawings, PDF files, Word docs, etc.  My users all have Acrobat Pro 9.  I'd like to be able to use just IAC to get Acrobat to convert a list of files to PDF, then bind them all together in one PDF, all with just one click of a button by the User.  I've looked at the PDFBinder Sample, but this requires making a Plug-In, and then accessing the Plug-In via IAC.  I was hoping there would be a more direct way just using IAC.  The documents imply IAC can give you control "just like a user", and since a user can create a Binder PDF, I was hoping IAC could let me do it, without having to use Plug-Ins or JavaScript.
    So, can anyone point me to any classes in the IAC API that will do this?  Or am I stuck using the sample PDFBinder way?
    Thanks for your time!

    You can do this using the JSObject & JavaScript via IAC - but it's quite difficult from C++ as it was designed for more COM-orientred languages such as VB & .NET.
    It would actually be easier to do it from C++ as a plugin + your own IAC.

  • Can we change the property of each element of an array using property node or by other methods?

    Hello all,
    Can we change the property of the elements of an array. For example:
    I have an array of combo-boxes. Can i have such a scenario that different combo-boxes of the array will have different items to select an item.
    I am able to set the different "values" in different combo-boxes bu using "to be more specific class" property node.
    But i could not set the different item list in different combo-boxes.
    Please give me the solution.

    Thanks a million dave!!!!!
    I have learnt a very new and innovative thing...
    I just wanna ask you one more question in the above context.
    Can i have listbox or combo-box in a table just like in an excel sheet where we can have listbox by using "data validation" property for different cells having different list.Can i have this in labview. Because for this i have to super-impose the combo-boxes on the table and treat them separately.
    We have to take those combo-box values and put in table and then store it.I have attached one VI to show the scenario.
    And this is the alternative solution of the array problem which u have already given. So please suggest me between the two or any alternative solution.
    Thanks,
    Ankit Madaan
    Attachments:
    Recording _Table.vi ‏19 KB

  • Can I use property loader in a main sequence to load properties in subsequence?

    Hi, I have been trying to use the property loader to load test limits and local variabels into subsequences from the main sequence.
    I can export all the properties for my main sequence and all the subsequences contained within by selecing <all sequences> in the export function.
    When I try to load the exported file back in using the property loader I get differant errors depending on the format I exported/imported it with.
    For text or csv files iget error -17100
    "The file format is incorrect near the section 'StationGlobals'.  Make sure that you are using start and end markers correctly."
    For an xl format I get error -18 
    "Property loader step failed to import or export properties.
    310 property value(s) were found.
    43 property value(s) were imported from 920 row(s) of data"
    There is no where near 920 rows of data or 320 properties in the exported file.
    If i use the property loader to load properties in just main it works fine, is there extra formating I need to do to the file before importing it or is it not possible to load properties into a subsequence from a property loader in main?
    Solved!
    Go to Solution.

    Hi,
    I have tried several sequences and building the propertyloader file using the export tool,
    Moving the End_Mainsequence to the bottem did not help.
    I can load values into a single sequence with no problem it is only when I try to load properties into a sub sequence from the main sequence that I have issues.
    Attached is a more simple example of what I am trying to acheive. 
    Kind regards,
    Hugo
    Attachments:
    Sequence File 2.seq ‏9 KB
    Test.csv ‏2 KB

Maybe you are looking for