0 Replies Latest reply on May 20, 2008 5:37 PM by haefti

    s:button inside view component does not work

    haefti

      Hi!


      I have a problem using <s:button> in a custom view component.


      I have a form with one <h:commandButton> to save the data and a <s:button> to cancel the editing. To leave the view without saving the changes I have a action method which is supposed to be called by the cancel button which works okay if I put the <s:button> tag directly in my xhtml file.


      If I use a custom tag with the <s:button> tag inside and I include this custom tag in my xhtml file then a click on the button leads to


      Exception during request processing:
      Caused by javax.el.PropertyNotFoundException with message: "Target Unreachable, identifier 'assetManager' resolved to null"




      Here is my code.


      The relevant part of the view:


      <h:form>
              <cs:editActionButtonsContainer assetManager="#{vehicleManager}" />
              <s:button value="Cancel_Outside" action="#{vehicleManager.cancel}" propagation="end" styleClass="button" />
      </h:form>




      The view component referenced by the <cs:> tag:


      <h:commandButton value="Save" action="#{assetManager.saveAsset}" styleClass="button" />
      <s:button value="Cancel_Inside" action="#{assetManager.cancel}" propagation="end" styleClass="button" />



      As you can see I used the same tag for the inside and the outside cancel button and both are displayed properly.


      As mentioned above clicking the outside button calls vehicleManager.cancel() as expected but clicking the inside button leads to the output above even though the <h:commandButton> in the view component works as expected so the backing bean vehicleManager is passed successfully.


      Maybe someone has a idea how to solve this problem.


      Thanks for your help!


      Haefti