You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by omid p <ve...@gmail.com> on 2011/01/03 06:17:31 UTC
passing information in tr:inputListOfValues
Hi,
As far as i know we can easily pass parameters to dialog box with
LaunchEvent whe using
tr:commandButton however tr:inputListOfValues does not have any
launchListener,
How can i pass information in dialog box while using tr:inputListOfValues ?
Regards
Re: passing information in tr:inputListOfValues
Posted by Walter Mourão <wa...@gmail.com>.
This is the expected behavior. The page flow scope does not 'goes back' from
the dialog. To return values you have to use the returnFromDialog method
(the second parameter is a Map to return many values).
Walter Mourão
http://waltermourao.com.br
http://arcadian.com.br
http://oriens.com.br
On Thu, Jan 6, 2011 at 6:53 AM, omid p <ve...@gmail.com> wrote:
> Hi,
> finally i successfully send parameters to diloag box but i can not send
> params from dialog box to parent page am i missing sth ?
>
> <tr:form>
> <tr:inputListOfValues label="Select" value="(Empty)"
> action="dialog:valueDialog"
> >
> <tr:setActionListener from="K"
> to="#{pageFlowScope.myval}"/>
>
> </tr:inputListOfValues>
> <tr:outputText
> value="#{pageFlowScope.myvar.firstName}"></tr:outputText>
> <tr:commandButton text="getLov Val"></tr:commandButton>
>
> </tr:form>
>
> Dialog.jspx
>
> <tr:form>
> <tr:outputText value="#{pageFlowScope.myval}"></tr:outputText>
> <tr:commandButton text="Select user "
> action="#{listBean.select}"></tr:commandButton>
> </tr:form>
>
> Code behind
>
> public String select(){
> User user = new User("omid", "p");
>
> RequestContext requestContext = RequestContext.getCurrentInstance();
>
>
> requestContext.returnFromDialog(user.getLastName(), null);
> requestContext.getPageFlowScope().put("myvar", user); //this has no
> effect
>
> return "";
> }
>
> i can't get myvar
>
Re: passing information in tr:inputListOfValues
Posted by omid p <ve...@gmail.com>.
Hi,
finally i successfully send parameters to diloag box but i can not send
params from dialog box to parent page am i missing sth ?
<tr:form>
<tr:inputListOfValues label="Select" value="(Empty)"
action="dialog:valueDialog"
>
<tr:setActionListener from="K"
to="#{pageFlowScope.myval}"/>
</tr:inputListOfValues>
<tr:outputText
value="#{pageFlowScope.myvar.firstName}"></tr:outputText>
<tr:commandButton text="getLov Val"></tr:commandButton>
</tr:form>
Dialog.jspx
<tr:form>
<tr:outputText value="#{pageFlowScope.myval}"></tr:outputText>
<tr:commandButton text="Select user "
action="#{listBean.select}"></tr:commandButton>
</tr:form>
Code behind
public String select(){
User user = new User("omid", "p");
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.returnFromDialog(user.getLastName(), null);
requestContext.getPageFlowScope().put("myvar", user); //this has no
effect
return "";
}
i can't get myvar
Re: passing information in tr:inputListOfValues
Posted by Andrei Zagorneanu <az...@gmail.com>.
You can use actionListener and RequestContext for passing the parameters
using pageFlowScope.
Best regards,
Andrei Zagorneanu
On Mon, Jan 3, 2011 at 07:17, omid p <ve...@gmail.com> wrote:
> Hi,
> As far as i know we can easily pass parameters to dialog box with
> LaunchEvent whe using
> tr:commandButton however tr:inputListOfValues does not have any
> launchListener,
> How can i pass information in dialog box while using tr:inputListOfValues ?
> Regards
>