0

I have a composite component that have a dialog... Inside the dialog I have the following piece of code:

                    <p:commandButton id="selectButton" icon="ui-icon-check" oncomplete="lookupDialog.hide();" update=":#{cc.clientId}:#{cc.attrs.fieldId}_panelGrid">
                        <f:setPropertyActionListener target="#{cc.attrs.targetValue}" value="#{entity}" />                          
                    </p:commandButton>

So, when the button is clicked, the dialog vanishes, but the property isn´t set. There is no errors, no warnings, nothing! So I simply don´t know what is happening...

If you need anymore details, please just say so! :)

***EDIT

This is a related question, but not really what I want to do... Pass Argument to a composite-component action attribute

I just need the propertyActionListener to work. Here some extra information:

    <cc:attribute name="targetValue" required="true"/>      

the value:

    targetValue="#{acaoController.entity.responsavel}"

Where inside the bean (acaoController) I have an entity... And inside the entity I have another object, that is "responsavel".

Community
  • 1
  • 1
Marco Noronha
  • 115
  • 1
  • 9
  • 31

1 Answers1

0

Try checking setters and getters of responsavel getting called when you close the dialog box. Otherwise you can use Flash to pass on the value between components. In the action method of command button,

    Flash flash = FaceUtil.getFacesContext().getExternalContext().getFlash();
    flash.put("entity",entity);

And you can extract the value like this:

    Flash flash = FaceUtil.getFacesContext().getExternalContext().getFlash();
    responsavel = (Responsavel) flash.get("entity");
shashdr
  • 83
  • 2
  • 8
  • Thanks for the reply. I´ll try that, but that solves only half of my problem (not discribed on the question because it is huge). Anyway, i´l feedback when I am done testing. Just to leave some information, I think the problem is that I have one form inside another. A form with components for input screen (normal insert/edit form)... And inside my component I have more forms (two more). I´ll try leaving only one form and see if everything will work normally. – Marco Noronha Jan 04 '13 at 10:52
  • My suggestion, never have a form inside a form. – shashdr Jan 04 '13 at 15:57
  • I want to remove it, but I think it´s not possible right now. I´ll put this part of the project on standby . No time to change it :( – Marco Noronha Jan 04 '13 at 18:15