You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by daniel ccss <da...@gmail.com> on 2010/06/17 17:36:11 UTC

MyFaces Irian-DoModal example

Hi all,

In this page http://example.irian.at/example-sandbox-2010061704/home.jsf

I found this example:

http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf


I need to open a modal window in which I can edit some values of the window1
and when I press submit in window2 need to refresh the window1 values.
Before showing window2 I need to call an actionlistener to do some
calculations in the backing bean first, then show the modal window2, enter
some values and when I close it call a method in the backing bean again to
do some calculation and finally show the window1 with the refresh
information

1- Window1 button call an actionListener then show Window2 (modal)
2- The user enter some information in Window2 then press a button that call
another method in the backing bean and the winbow2 is closed and the data in
window1 updated.

In the irian page example, when I click
searchOuterForm<http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf#>a
do modal windows appears, but i enter some data in this window and
click
submit the values in the window2 the data is not updated in window1, can
anyone help me??

Thanks

Re: MyFaces Irian-DoModal example

Posted by Mike Kienenberger <mk...@gmail.com>.
Not sure about the environment, but with Richfaces ajax, you can move
the code you have in onclick into oncomplete.    Not sure if that
functionality is also available in JSF 2.0's ajax, but it seems
likely.

On Thu, Jun 17, 2010 at 5:06 PM, Jakob Korherr <ja...@gmail.com> wrote:
> Hi,
>
> You will have to submit the form first to invoke the action listener on the
> server and on the resulting page automatically display the dialog.
>
> You can accomplish that by putting the javascript to open the dialog
> (dojoDialogOuterform.show();) into a t:div which normally is not rendered at
> the end of the page. Then in the action listener you set the rendered
> property of this div to true and thus the dialog will automatically be
> opened after the action listener was called.
>
> Regards,
> Jakob
>
>
> 2010/6/17 daniel ccss <da...@gmail.com>
>
>> Thanks, that´s great, thank you, but....
>>
>> Looking at the example we have this:
>>
>>       <h:outputLink value="#" actionlistener{#bb.doSomethingFirst}
>> *onclick*="dojoDialogOuterform.show();">
>>           <h:outputText value="searchOuterForm"/>
>>       </h:outputLink>
>>
>> What I need is to call an actionlistener before call the onclick. How can I
>> do that??
>>
>>
>> Thanks
>>
>>
>> On Thu, Jun 17, 2010 at 12:46 PM, Jakob Korherr <jakob.korherr@gmail.com
>> >wrote:
>>
>> > Hi,
>> >
>> > In the dojoDialog example the values are not bound to a bean, they are
>> just
>> > static. That's the reason they are not updated. If you want them to be
>> > updated, you will have to bind them to a managed bean (e.g. via
>> > value="#{bean.input}" on the related input component).
>> >
>> > However there is a bug in the example. The dialogs can not be closed via
>> > Cancel. I digged into it and found out that there is a little bug on
>> > ModalDialogRenderer. I will fix this one asap.
>> >
>> > Regards,
>> > Jakob
>> >
>> > 2010/6/17 daniel ccss <da...@gmail.com>
>> >
>> > > Hi all,
>> > >
>> > > In this page
>> http://example.irian.at/example-sandbox-2010061704/home.jsf
>> > >
>> > > I found this example:
>> > >
>> > > http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf
>> > >
>> > >
>> > > I need to open a modal window in which I can edit some values of the
>> > > window1
>> > > and when I press submit in window2 need to refresh the window1 values.
>> > > Before showing window2 I need to call an actionlistener to do some
>> > > calculations in the backing bean first, then show the modal window2,
>> > enter
>> > > some values and when I close it call a method in the backing bean again
>> > to
>> > > do some calculation and finally show the window1 with the refresh
>> > > information
>> > >
>> > > 1- Window1 button call an actionListener then show Window2 (modal)
>> > > 2- The user enter some information in Window2 then press a button that
>> > call
>> > > another method in the backing bean and the winbow2 is closed and the
>> data
>> > > in
>> > > window1 updated.
>> > >
>> > > In the irian page example, when I click
>> > > searchOuterForm<
>> > >
>> http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf#
>> > >a
>> > > do modal windows appears, but i enter some data in this window and
>> > > click
>> > > submit the values in the window2 the data is not updated in window1,
>> can
>> > > anyone help me??
>> > >
>> > > Thanks
>> > >
>> >
>> >
>> >
>> > --
>> > Jakob Korherr
>> >
>> > blog: http://www.jakobk.com
>> > twitter: http://twitter.com/jakobkorherr
>> > work: http://www.irian.at
>> >
>>
>
>
>
> --
> Jakob Korherr
>
> blog: http://www.jakobk.com
> twitter: http://twitter.com/jakobkorherr
> work: http://www.irian.at
>

Re: MyFaces Irian-DoModal example

Posted by Jakob Korherr <ja...@gmail.com>.
Hi,

You will have to submit the form first to invoke the action listener on the
server and on the resulting page automatically display the dialog.

You can accomplish that by putting the javascript to open the dialog
(dojoDialogOuterform.show();) into a t:div which normally is not rendered at
the end of the page. Then in the action listener you set the rendered
property of this div to true and thus the dialog will automatically be
opened after the action listener was called.

Regards,
Jakob


2010/6/17 daniel ccss <da...@gmail.com>

> Thanks, that´s great, thank you, but....
>
> Looking at the example we have this:
>
>       <h:outputLink value="#" actionlistener{#bb.doSomethingFirst}
> *onclick*="dojoDialogOuterform.show();">
>           <h:outputText value="searchOuterForm"/>
>       </h:outputLink>
>
> What I need is to call an actionlistener before call the onclick. How can I
> do that??
>
>
> Thanks
>
>
> On Thu, Jun 17, 2010 at 12:46 PM, Jakob Korherr <jakob.korherr@gmail.com
> >wrote:
>
> > Hi,
> >
> > In the dojoDialog example the values are not bound to a bean, they are
> just
> > static. That's the reason they are not updated. If you want them to be
> > updated, you will have to bind them to a managed bean (e.g. via
> > value="#{bean.input}" on the related input component).
> >
> > However there is a bug in the example. The dialogs can not be closed via
> > Cancel. I digged into it and found out that there is a little bug on
> > ModalDialogRenderer. I will fix this one asap.
> >
> > Regards,
> > Jakob
> >
> > 2010/6/17 daniel ccss <da...@gmail.com>
> >
> > > Hi all,
> > >
> > > In this page
> http://example.irian.at/example-sandbox-2010061704/home.jsf
> > >
> > > I found this example:
> > >
> > > http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf
> > >
> > >
> > > I need to open a modal window in which I can edit some values of the
> > > window1
> > > and when I press submit in window2 need to refresh the window1 values.
> > > Before showing window2 I need to call an actionlistener to do some
> > > calculations in the backing bean first, then show the modal window2,
> > enter
> > > some values and when I close it call a method in the backing bean again
> > to
> > > do some calculation and finally show the window1 with the refresh
> > > information
> > >
> > > 1- Window1 button call an actionListener then show Window2 (modal)
> > > 2- The user enter some information in Window2 then press a button that
> > call
> > > another method in the backing bean and the winbow2 is closed and the
> data
> > > in
> > > window1 updated.
> > >
> > > In the irian page example, when I click
> > > searchOuterForm<
> > >
> http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf#
> > >a
> > > do modal windows appears, but i enter some data in this window and
> > > click
> > > submit the values in the window2 the data is not updated in window1,
> can
> > > anyone help me??
> > >
> > > Thanks
> > >
> >
> >
> >
> > --
> > Jakob Korherr
> >
> > blog: http://www.jakobk.com
> > twitter: http://twitter.com/jakobkorherr
> > work: http://www.irian.at
> >
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Re: MyFaces Irian-DoModal example

Posted by daniel ccss <da...@gmail.com>.
Thanks, that´s great, thank you, but....

Looking at the example we have this:

       <h:outputLink value="#" actionlistener{#bb.doSomethingFirst}
*onclick*="dojoDialogOuterform.show();">
           <h:outputText value="searchOuterForm"/>
       </h:outputLink>

What I need is to call an actionlistener before call the onclick. How can I
do that??


Thanks


On Thu, Jun 17, 2010 at 12:46 PM, Jakob Korherr <ja...@gmail.com>wrote:

> Hi,
>
> In the dojoDialog example the values are not bound to a bean, they are just
> static. That's the reason they are not updated. If you want them to be
> updated, you will have to bind them to a managed bean (e.g. via
> value="#{bean.input}" on the related input component).
>
> However there is a bug in the example. The dialogs can not be closed via
> Cancel. I digged into it and found out that there is a little bug on
> ModalDialogRenderer. I will fix this one asap.
>
> Regards,
> Jakob
>
> 2010/6/17 daniel ccss <da...@gmail.com>
>
> > Hi all,
> >
> > In this page http://example.irian.at/example-sandbox-2010061704/home.jsf
> >
> > I found this example:
> >
> > http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf
> >
> >
> > I need to open a modal window in which I can edit some values of the
> > window1
> > and when I press submit in window2 need to refresh the window1 values.
> > Before showing window2 I need to call an actionlistener to do some
> > calculations in the backing bean first, then show the modal window2,
> enter
> > some values and when I close it call a method in the backing bean again
> to
> > do some calculation and finally show the window1 with the refresh
> > information
> >
> > 1- Window1 button call an actionListener then show Window2 (modal)
> > 2- The user enter some information in Window2 then press a button that
> call
> > another method in the backing bean and the winbow2 is closed and the data
> > in
> > window1 updated.
> >
> > In the irian page example, when I click
> > searchOuterForm<
> > http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf#
> >a
> > do modal windows appears, but i enter some data in this window and
> > click
> > submit the values in the window2 the data is not updated in window1, can
> > anyone help me??
> >
> > Thanks
> >
>
>
>
> --
> Jakob Korherr
>
> blog: http://www.jakobk.com
> twitter: http://twitter.com/jakobkorherr
> work: http://www.irian.at
>

Re: MyFaces Irian-DoModal example

Posted by Jakob Korherr <ja...@gmail.com>.
Hi,

In the dojoDialog example the values are not bound to a bean, they are just
static. That's the reason they are not updated. If you want them to be
updated, you will have to bind them to a managed bean (e.g. via
value="#{bean.input}" on the related input component).

However there is a bug in the example. The dialogs can not be closed via
Cancel. I digged into it and found out that there is a little bug on
ModalDialogRenderer. I will fix this one asap.

Regards,
Jakob

2010/6/17 daniel ccss <da...@gmail.com>

> Hi all,
>
> In this page http://example.irian.at/example-sandbox-2010061704/home.jsf
>
> I found this example:
>
> http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf
>
>
> I need to open a modal window in which I can edit some values of the
> window1
> and when I press submit in window2 need to refresh the window1 values.
> Before showing window2 I need to call an actionlistener to do some
> calculations in the backing bean first, then show the modal window2, enter
> some values and when I close it call a method in the backing bean again to
> do some calculation and finally show the window1 with the refresh
> information
>
> 1- Window1 button call an actionListener then show Window2 (modal)
> 2- The user enter some information in Window2 then press a button that call
> another method in the backing bean and the winbow2 is closed and the data
> in
> window1 updated.
>
> In the irian page example, when I click
> searchOuterForm<
> http://example.irian.at/example-sandbox-2010061704/dojo/dojoDialog.jsf#>a
> do modal windows appears, but i enter some data in this window and
> click
> submit the values in the window2 the data is not updated in window1, can
> anyone help me??
>
> Thanks
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at