3 Replies Latest reply on May 4, 2010 11:29 PM by gebuh

    disable s:link based in datatable

    gebuh

      I'm trying to enable or disable a link in a datatable based on a users status:



      s:link view="/SomeTable.xhtml"
                              value="edit"
                             propagation="none"
                          id="canEdit"
                          rendered="#{validationAction.getIsValidUser}">
                      <f:param name="someSysid"
                              value="#{_aPerson.sysid}"/>
                  </s:link>





      so if validationAction.getIsValidUser returns true, the link is rendered.  The method it's tied to just returns a random true or false:




      public boolean getIsValidUser(ValueChangeEvent uiEvent) {
                    //temporary for testing
                     Random generator = new Random();
                     int r = generator.nextInt();
                     if(r%2 == 0){
                          this.isValidUser = true;
                     } else {
                          this.isValidUser = false;
                     }
                     return this.isValidUser;
                }



      but no matter what I do, or where I put it(as output, value, etc) I keep getting:
      javax.el.PropertyNotFoundException: /startingtable.xhtml @366,46 value="#{validationAction.getIsValidUser}": Property 'getIsValidUser' not found on type package.ValidationAction_$$_javassist_seam_23


      I have other methods in this class that work fine elsewhere.


      I'm running seam 2.2.0, with jsf, hibernate, and not a lot of experience with seam.


      any idea what I'm doing wrong?



        • 1. Re: disable s:link based in datatable
          sean.tozer

          getIsValidUser isn't really a property, that might be a hint. Try calling it specifically as a method, as in:


          validationAction.getIsValidUser()

          • 2. Re: disable s:link based in datatable
            shin0135

            Beth,


            You are calling a method getIsValidUser() without a parameter in the rendered attribute, while your method getIsValidUser has a parameter of ValueChangeEvent.

            • 3. Re: disable s:link based in datatable
              gebuh

              James S. wrote on Apr 29, 2010 17:14:


              Beth,

              You are calling a method getIsValidUser() without a parameter in the rendered attribute, while your method getIsValidUser has a parameter of ValueChangeEvent.


              That was it, I was copying another bit of code, but it was in the form of
              valueChangeListener="#{someClass.someMethod_also_with_parameters}
              Why is that different?