You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by magdolna holitska <mh...@hotmail.com> on 2007/01/05 17:01:27 UTC

Table refresh problem when using dialog

Hello,

I have a table containing numbers and a link: "Add New".
When the user clicks on the link, a new number will be added to the table.


The problem I have is:
If I have the link outside the table, the number will be added to the list 
and the table will be refreshed properly.

At the other hand, when I place the command link inside the table, the 
number will be added to the list, but the table is not refreshed with the 
new value.

I only noticed this behaviour when I am using it with dialogs. If I just use 
an ActionEvent instead of a ReturnEvent, it works fine.

This is just a simple example that I prepared to point out the issue, but of 
course in the real application I do have values that I am passing and 
retrieving from the dialog.

I also pasted the code below.


Thank you in advance.
Regards,
Magdolna




Example.xhtml:
        <tr:commandLink id="cmdOut" text="Add New"
                        useWindow="true" windowWidth="300" 
windowHeight="400"
                        partialSubmit="true" action="dialog:numDialog"
                        returnListener="#{exampleBean.numDialogReturned}"/>
        <tr:table id="data" value="#{exampleBean.numList}" var="data"
                partialTriggers="cmdIn cmdOut" width="20%">
            <tr:column id="userAction" headerText="User Action">
                <tr:commandLink id="cmdIn" text="Add New"
                                useWindow="true" windowWidth="300" 
windowHeight="400"
                                partialSubmit="true" 
action="dialog:numDialog"
                                
returnListener="#{exampleBean.numDialogReturned}"/>
            </tr:column>
            <tr:column id="num" headerText="Number">
                 <tr:outputText value="#{data}"/>
            </tr:column>
        </tr:table>

ExampleBean.java:
    private List<Integer> numList;
    private int num = 100;

    public List<Integer> getNumList() {
        if (numList == null) {
            numList = new ArrayList();
        }
        System.out.println("numList: ("+numList.size()+"): "+numList);
        return numList;
    }
    public void numDialogReturned(ReturnEvent event) {
        System.out.println("--- RETURN");
        Boolean isAdd = (Boolean)event.getReturnValue();
        if (isAdd)
            numList.add(new Integer(num++));
    }

    // DIALOG
    public void performOK(ActionEvent e) {
        logger.debug("Click OK ");
        RequestContext.getCurrentInstance().returnFromDialog(true,null);
    }
    public void performCancel(ActionEvent e) {
        logger.debug("Click Cancel ");
        RequestContext.getCurrentInstance().returnFromDialog(false,null);
    }

NumDialog.xhtml
    <tr:form>
        <tr:panelFormLayout labelWidth="40%">
           <tr:panelButtonBar>
               <tr:commandButton text="OK" 
actionListener="#{equipmentDetailBean.performOK}"/>
               <tr:commandButton text="Cancel" immediate="true" 
actionListener="#{equipmentDetailBean.performCancel}"/>
           </tr:panelButtonBar>
        </tr:panelFormLayout>
    </tr:form>

_________________________________________________________________
Discover Live.ca, the search engine by the creators of Windows Live 
Messenger http://www.live.com/?mkt=en-ca


Re: Table refresh problem when using dialog

Posted by Simon Lessard <si...@gmail.com>.
Hello,

Thanks for confirming that I messed up when I tried it, I'll retry it where
I used the manual call. :)

On 1/10/07, magdolna holitska <mh...@hotmail.com> wrote:
>
> Hello,
> I tried both Venkata's and Simon's solutions and they both worked.
> Thank you all for your help!
> Regards,
> Magdolna
>
>
>
>
> >From: "venkata guddanti" <ve...@gmail.com>
> >Reply-To: adffaces-user@incubator.apache.org
> >To: adffaces-user@incubator.apache.org
> >Subject: Re: Table refresh problem when using dialog
> >Date: Tue, 9 Jan 2007 14:01:02 -0700
> >
> >Hi Magdolna,
> >
> >Can you change the partialTriggers="cmdIn cmdOut" to
> >partialTriggers="data:cmdln  cmdOut" and see if it works? This is because
> >the table is a naming container.
> >
> >If this does not work, I believe it might be related to the fact that the
> >currency is established for the table when the commandLink action is
> >invoked
> >and the clientId for the commandLink includes the currency.
> >
> >Regards,
> >Venkata
> >
> >
> >On 1/9/07, magdolna holitska <mh...@hotmail.com> wrote:
> >>
> >>Hi all,
> >>
> >>Did anyone had a chance to have a look at the issue I am having below?
> >>
> >>Here are a few more details:
> >>
> >>In the example below I am trying to add one row to a table using PPR.
> >>The command link that opens the dialog is inside the table, in each row.
> >>When the dialog returns a new row should be added to the table,
> >>but for some reason this isn't happening.
> >>
> >>However, if I refresh with the browser, the row is added.
> >>
> >>Any ideas?
> >>Thanks,
> >>Magdolna
> >>
> >>
> >>
> >>
> >>
> >> >From: "magdolna holitska" < mholitska3@hotmail.com>
> >> >Reply-To: adffaces-user@incubator.apache.org
> >> >To: adffaces-user@incubator.apache.org
> >> >Subject: Table refresh problem when using dialog
> >> >Date: Fri, 05 Jan 2007 12:01:27 -0500
> >> >
> >> >Hello,
> >> >
> >> >I have a table containing numbers and a link: "Add New".
> >> >When the user clicks on the link, a new number will be added to the
> >>table.
> >> >
> >> >
> >> >The problem I have is:
> >> >If I have the link outside the table, the number will be added to the
> >>list
> >> >and the table will be refreshed properly.
> >> >
> >> >At the other hand, when I place the command link inside the table, the
> >> >number will be added to the list, but the table is not refreshed with
> >>the
> >> >new value.
> >> >
> >> >I only noticed this behaviour when I am using it with dialogs. If I
> just
> >> >use an ActionEvent instead of a ReturnEvent, it works fine.
> >> >
> >> >This is just a simple example that I prepared to point out the issue,
> >>but
> >> >of course in the real application I do have values that I am passing
> and
> >> >retrieving from the dialog.
> >> >
> >> >I also pasted the code below.
> >> >
> >> >
> >> >Thank you in advance.
> >> >Regards,
> >> >Magdolna
> >> >
> >> >
> >> >
> >> >
> >> >Example.xhtml:
> >> >        <tr:commandLink id="cmdOut" text="Add New"
> >> >                        useWindow="true" windowWidth="300"
> >> >windowHeight="400"
> >> >                        partialSubmit="true" action="dialog:numDialog"
> >> >
> >>returnListener="#{exampleBean.numDialogReturned}"/>
> >>
> >> >        <tr:table id="data" value="#{exampleBean.numList}" var="data"
> >> >                partialTriggers="cmdIn cmdOut" width="20%">
> >> >            <tr:column id="userAction" headerText="User Action">
> >> >                <tr:commandLink id="cmdIn" text="Add New"
> >> >                                useWindow="true" windowWidth="300"
> >> >windowHeight="400"
> >> >                                partialSubmit="true"
> >> >action="dialog:numDialog"
> >> >
> >> >returnListener="#{exampleBean.numDialogReturned}"/>
> >> >            </tr:column>
> >> >            <tr:column id="num" headerText="Number">
> >> >                 <tr:outputText value="#{data}"/>
> >> >            </tr:column>
> >> >        </tr:table>
> >> >
> >> >ExampleBean.java:
> >> >    private List<Integer> numList;
> >> >    private int num = 100;
> >> >
> >> >    public List<Integer> getNumList() {
> >> >        if (numList == null) {
> >> >            numList = new ArrayList();
> >> >        }
> >> >        System.out.println("numList: ("+numList.size()+"): "+numList);
> >> >        return numList;
> >> >    }
> >> >    public void numDialogReturned(ReturnEvent event) {
> >> >        System.out.println("--- RETURN");
> >> >        Boolean isAdd = (Boolean)event.getReturnValue();
> >> >        if (isAdd)
> >> >            numList.add(new Integer(num++));
> >> >    }
> >> >
> >> >    // DIALOG
> >> >    public void performOK(ActionEvent e) {
> >> >        logger.debug("Click OK ");
> >> >        RequestContext.getCurrentInstance
> ().returnFromDialog(true,null);
> >> >    }
> >> >    public void performCancel(ActionEvent e) {
> >> >        logger.debug("Click Cancel ");
> >> >
> >>RequestContext.getCurrentInstance().returnFromDialog(false,null);
> >> >    }
> >> >
> >> >NumDialog.xhtml
> >> >    <tr:form>
> >> >        <tr:panelFormLayout labelWidth="40%">
> >> >           <tr:panelButtonBar>
> >> >               <tr:commandButton text="OK"
> >> >actionListener="#{equipmentDetailBean.performOK}"/>
> >> >               <tr:commandButton text="Cancel" immediate="true"
> >> >actionListener="#{equipmentDetailBean.performCancel}"/>
> >> >           </tr:panelButtonBar>
> >> >        </tr:panelFormLayout>
> >> >    </tr:form>
> >> >
> >> >_________________________________________________________________
> >> >Discover Live.ca <http://live.ca/>, the search engine by the creators
> of
> >>Windows Live
> >> >Messenger http://www.live.com/?mkt=en-ca
> >> >
> >>
> >>_________________________________________________________________
> >>Share your opinion and enter to win! Please complete this survey to
> enter
> >>into a draw for a grand prize of $500 or one of twenty $50 cash prizes.
> >>http://www.youthographyinsiders.com/R.aspx?a=116
> >>
> >>
>
> _________________________________________________________________
> Buy what you want when you want it on Sympatico / MSN Shopping
>
> http://shopping.sympatico.msn.ca/content/shp/?ctId=2,ptnrid=176,ptnrdata=081805
>
>

Re: Table refresh problem when using dialog

Posted by Adam Winer <aw...@gmail.com>.
I think Venkata's suggestions would work.  There is
the oddity for partialTriggers that they're actually
evaluated relative to the parent - the reason being
that without that, cmdOut wouldn't work.  So,
you need the "data:cmdIn" to first go back into
the table.

-- Adam


On 1/9/07, Simon Lessard <si...@gmail.com> wrote:
> Hello Magdolna,
>
> I don't think the naming container trick will work as I already tried it in
> the past. Then again I might have messed up while trying. I was able to
> achieve refresh with a manual call to
> TrinidadContext.addPartialTarget(tableComponent).
> It's really a poor man solution, but it works. I think that issue deserve a
> JIRA entry.
>
>
> Regards,
>
> ~ Simon
>
> On 1/9/07, venkata guddanti <ve...@gmail.com> wrote:
> >
> > Hi Magdolna,
> >
> > Can you change the partialTriggers="cmdIn cmdOut" to
> > partialTriggers="data:cmdln  cmdOut" and see if it works? This is because
> > the table is a naming container.
> >
> > If this does not work, I believe it might be related to the fact that the
> > currency is established for the table when the commandLink action is
> > invoked
> > and the clientId for the commandLink includes the currency.
> >
> > Regards,
> > Venkata
> >
> >
> > On 1/9/07, magdolna holitska <mh...@hotmail.com> wrote:
> > >
> > > Hi all,
> > >
> > > Did anyone had a chance to have a look at the issue I am having below?
> > >
> > > Here are a few more details:
> > >
> > > In the example below I am trying to add one row to a table using PPR.
> > > The command link that opens the dialog is inside the table, in each row.
> > > When the dialog returns a new row should be added to the table,
> > > but for some reason this isn't happening.
> > >
> > > However, if I refresh with the browser, the row is added.
> > >
> > > Any ideas?
> > > Thanks,
> > > Magdolna
> > >
> > >
> > >
> > >
> > >
> > > >From: "magdolna holitska" < mholitska3@hotmail.com>
> > > >Reply-To: adffaces-user@incubator.apache.org
> > > >To: adffaces-user@incubator.apache.org
> > > >Subject: Table refresh problem when using dialog
> > > >Date: Fri, 05 Jan 2007 12:01:27 -0500
> > > >
> > > >Hello,
> > > >
> > > >I have a table containing numbers and a link: "Add New".
> > > >When the user clicks on the link, a new number will be added to the
> > > table.
> > > >
> > > >
> > > >The problem I have is:
> > > >If I have the link outside the table, the number will be added to the
> > > list
> > > >and the table will be refreshed properly.
> > > >
> > > >At the other hand, when I place the command link inside the table, the
> > > >number will be added to the list, but the table is not refreshed with
> > the
> > > >new value.
> > > >
> > > >I only noticed this behaviour when I am using it with dialogs. If I
> > just
> > > >use an ActionEvent instead of a ReturnEvent, it works fine.
> > > >
> > > >This is just a simple example that I prepared to point out the issue,
> > but
> > > >of course in the real application I do have values that I am passing
> > and
> > > >retrieving from the dialog.
> > > >
> > > >I also pasted the code below.
> > > >
> > > >
> > > >Thank you in advance.
> > > >Regards,
> > > >Magdolna
> > > >
> > > >
> > > >
> > > >
> > > >Example.xhtml:
> > > >        <tr:commandLink id="cmdOut" text="Add New"
> > > >                        useWindow="true" windowWidth="300"
> > > >windowHeight="400"
> > > >                        partialSubmit="true" action="dialog:numDialog"
> > > >                        returnListener="#{exampleBean.numDialogReturned
> > }"/>
> > >
> > > >        <tr:table id="data" value="#{exampleBean.numList}" var="data"
> > > >                partialTriggers="cmdIn cmdOut" width="20%">
> > > >            <tr:column id="userAction" headerText="User Action">
> > > >                <tr:commandLink id="cmdIn" text="Add New"
> > > >                                useWindow="true" windowWidth="300"
> > > >windowHeight="400"
> > > >                                partialSubmit="true"
> > > >action="dialog:numDialog"
> > > >
> > > >returnListener="#{exampleBean.numDialogReturned}"/>
> > > >            </tr:column>
> > > >            <tr:column id="num" headerText="Number">
> > > >                 <tr:outputText value="#{data}"/>
> > > >            </tr:column>
> > > >        </tr:table>
> > > >
> > > >ExampleBean.java:
> > > >    private List<Integer> numList;
> > > >    private int num = 100;
> > > >
> > > >    public List<Integer> getNumList() {
> > > >        if (numList == null) {
> > > >            numList = new ArrayList();
> > > >        }
> > > >        System.out.println("numList: ("+numList.size()+"): "+numList);
> > > >        return numList;
> > > >    }
> > > >    public void numDialogReturned(ReturnEvent event) {
> > > >        System.out.println("--- RETURN");
> > > >        Boolean isAdd = (Boolean)event.getReturnValue();
> > > >        if (isAdd)
> > > >            numList.add(new Integer(num++));
> > > >    }
> > > >
> > > >    // DIALOG
> > > >    public void performOK(ActionEvent e) {
> > > >        logger.debug("Click OK ");
> > > >        RequestContext.getCurrentInstance
> > ().returnFromDialog(true,null);
> > > >    }
> > > >    public void performCancel(ActionEvent e) {
> > > >        logger.debug("Click Cancel ");
> > > >        RequestContext.getCurrentInstance
> > ().returnFromDialog(false,null);
> > > >    }
> > > >
> > > >NumDialog.xhtml
> > > >    <tr:form>
> > > >        <tr:panelFormLayout labelWidth="40%">
> > > >           <tr:panelButtonBar>
> > > >               <tr:commandButton text="OK"
> > > >actionListener="#{equipmentDetailBean.performOK}"/>
> > > >               <tr:commandButton text="Cancel" immediate="true"
> > > >actionListener="#{equipmentDetailBean.performCancel}"/>
> > > >           </tr:panelButtonBar>
> > > >        </tr:panelFormLayout>
> > > >    </tr:form>
> > > >
> > > >_________________________________________________________________
> > > >Discover Live.ca <http://live.ca/>, the search engine by the creators
> > of
> > > Windows Live
> > > >Messenger http://www.live.com/?mkt=en-ca
> > > >
> > >
> > > _________________________________________________________________
> > > Share your opinion and enter to win! Please complete this survey to
> > enter
> > > into a draw for a grand prize of $500 or one of twenty $50 cash prizes.
> > > http://www.youthographyinsiders.com/R.aspx?a=116
> > >
> > >
> >
> >
>
>

Re: Table refresh problem when using dialog

Posted by Simon Lessard <si...@gmail.com>.
Hello Magdolna,

I don't think the naming container trick will work as I already tried it in
the past. Then again I might have messed up while trying. I was able to
achieve refresh with a manual call to
TrinidadContext.addPartialTarget(tableComponent).
It's really a poor man solution, but it works. I think that issue deserve a
JIRA entry.


Regards,

~ Simon

On 1/9/07, venkata guddanti <ve...@gmail.com> wrote:
>
> Hi Magdolna,
>
> Can you change the partialTriggers="cmdIn cmdOut" to
> partialTriggers="data:cmdln  cmdOut" and see if it works? This is because
> the table is a naming container.
>
> If this does not work, I believe it might be related to the fact that the
> currency is established for the table when the commandLink action is
> invoked
> and the clientId for the commandLink includes the currency.
>
> Regards,
> Venkata
>
>
> On 1/9/07, magdolna holitska <mh...@hotmail.com> wrote:
> >
> > Hi all,
> >
> > Did anyone had a chance to have a look at the issue I am having below?
> >
> > Here are a few more details:
> >
> > In the example below I am trying to add one row to a table using PPR.
> > The command link that opens the dialog is inside the table, in each row.
> > When the dialog returns a new row should be added to the table,
> > but for some reason this isn't happening.
> >
> > However, if I refresh with the browser, the row is added.
> >
> > Any ideas?
> > Thanks,
> > Magdolna
> >
> >
> >
> >
> >
> > >From: "magdolna holitska" < mholitska3@hotmail.com>
> > >Reply-To: adffaces-user@incubator.apache.org
> > >To: adffaces-user@incubator.apache.org
> > >Subject: Table refresh problem when using dialog
> > >Date: Fri, 05 Jan 2007 12:01:27 -0500
> > >
> > >Hello,
> > >
> > >I have a table containing numbers and a link: "Add New".
> > >When the user clicks on the link, a new number will be added to the
> > table.
> > >
> > >
> > >The problem I have is:
> > >If I have the link outside the table, the number will be added to the
> > list
> > >and the table will be refreshed properly.
> > >
> > >At the other hand, when I place the command link inside the table, the
> > >number will be added to the list, but the table is not refreshed with
> the
> > >new value.
> > >
> > >I only noticed this behaviour when I am using it with dialogs. If I
> just
> > >use an ActionEvent instead of a ReturnEvent, it works fine.
> > >
> > >This is just a simple example that I prepared to point out the issue,
> but
> > >of course in the real application I do have values that I am passing
> and
> > >retrieving from the dialog.
> > >
> > >I also pasted the code below.
> > >
> > >
> > >Thank you in advance.
> > >Regards,
> > >Magdolna
> > >
> > >
> > >
> > >
> > >Example.xhtml:
> > >        <tr:commandLink id="cmdOut" text="Add New"
> > >                        useWindow="true" windowWidth="300"
> > >windowHeight="400"
> > >                        partialSubmit="true" action="dialog:numDialog"
> > >                        returnListener="#{exampleBean.numDialogReturned
> }"/>
> >
> > >        <tr:table id="data" value="#{exampleBean.numList}" var="data"
> > >                partialTriggers="cmdIn cmdOut" width="20%">
> > >            <tr:column id="userAction" headerText="User Action">
> > >                <tr:commandLink id="cmdIn" text="Add New"
> > >                                useWindow="true" windowWidth="300"
> > >windowHeight="400"
> > >                                partialSubmit="true"
> > >action="dialog:numDialog"
> > >
> > >returnListener="#{exampleBean.numDialogReturned}"/>
> > >            </tr:column>
> > >            <tr:column id="num" headerText="Number">
> > >                 <tr:outputText value="#{data}"/>
> > >            </tr:column>
> > >        </tr:table>
> > >
> > >ExampleBean.java:
> > >    private List<Integer> numList;
> > >    private int num = 100;
> > >
> > >    public List<Integer> getNumList() {
> > >        if (numList == null) {
> > >            numList = new ArrayList();
> > >        }
> > >        System.out.println("numList: ("+numList.size()+"): "+numList);
> > >        return numList;
> > >    }
> > >    public void numDialogReturned(ReturnEvent event) {
> > >        System.out.println("--- RETURN");
> > >        Boolean isAdd = (Boolean)event.getReturnValue();
> > >        if (isAdd)
> > >            numList.add(new Integer(num++));
> > >    }
> > >
> > >    // DIALOG
> > >    public void performOK(ActionEvent e) {
> > >        logger.debug("Click OK ");
> > >        RequestContext.getCurrentInstance
> ().returnFromDialog(true,null);
> > >    }
> > >    public void performCancel(ActionEvent e) {
> > >        logger.debug("Click Cancel ");
> > >        RequestContext.getCurrentInstance
> ().returnFromDialog(false,null);
> > >    }
> > >
> > >NumDialog.xhtml
> > >    <tr:form>
> > >        <tr:panelFormLayout labelWidth="40%">
> > >           <tr:panelButtonBar>
> > >               <tr:commandButton text="OK"
> > >actionListener="#{equipmentDetailBean.performOK}"/>
> > >               <tr:commandButton text="Cancel" immediate="true"
> > >actionListener="#{equipmentDetailBean.performCancel}"/>
> > >           </tr:panelButtonBar>
> > >        </tr:panelFormLayout>
> > >    </tr:form>
> > >
> > >_________________________________________________________________
> > >Discover Live.ca <http://live.ca/>, the search engine by the creators
> of
> > Windows Live
> > >Messenger http://www.live.com/?mkt=en-ca
> > >
> >
> > _________________________________________________________________
> > Share your opinion and enter to win! Please complete this survey to
> enter
> > into a draw for a grand prize of $500 or one of twenty $50 cash prizes.
> > http://www.youthographyinsiders.com/R.aspx?a=116
> >
> >
>
>

Re: Table refresh problem when using dialog

Posted by magdolna holitska <mh...@hotmail.com>.
Hello,
I tried both Venkata's and Simon's solutions and they both worked.
Thank you all for your help!
Regards,
Magdolna




>From: "venkata guddanti" <ve...@gmail.com>
>Reply-To: adffaces-user@incubator.apache.org
>To: adffaces-user@incubator.apache.org
>Subject: Re: Table refresh problem when using dialog
>Date: Tue, 9 Jan 2007 14:01:02 -0700
>
>Hi Magdolna,
>
>Can you change the partialTriggers="cmdIn cmdOut" to
>partialTriggers="data:cmdln  cmdOut" and see if it works? This is because
>the table is a naming container.
>
>If this does not work, I believe it might be related to the fact that the
>currency is established for the table when the commandLink action is 
>invoked
>and the clientId for the commandLink includes the currency.
>
>Regards,
>Venkata
>
>
>On 1/9/07, magdolna holitska <mh...@hotmail.com> wrote:
>>
>>Hi all,
>>
>>Did anyone had a chance to have a look at the issue I am having below?
>>
>>Here are a few more details:
>>
>>In the example below I am trying to add one row to a table using PPR.
>>The command link that opens the dialog is inside the table, in each row.
>>When the dialog returns a new row should be added to the table,
>>but for some reason this isn't happening.
>>
>>However, if I refresh with the browser, the row is added.
>>
>>Any ideas?
>>Thanks,
>>Magdolna
>>
>>
>>
>>
>>
>> >From: "magdolna holitska" < mholitska3@hotmail.com>
>> >Reply-To: adffaces-user@incubator.apache.org
>> >To: adffaces-user@incubator.apache.org
>> >Subject: Table refresh problem when using dialog
>> >Date: Fri, 05 Jan 2007 12:01:27 -0500
>> >
>> >Hello,
>> >
>> >I have a table containing numbers and a link: "Add New".
>> >When the user clicks on the link, a new number will be added to the
>>table.
>> >
>> >
>> >The problem I have is:
>> >If I have the link outside the table, the number will be added to the
>>list
>> >and the table will be refreshed properly.
>> >
>> >At the other hand, when I place the command link inside the table, the
>> >number will be added to the list, but the table is not refreshed with 
>>the
>> >new value.
>> >
>> >I only noticed this behaviour when I am using it with dialogs. If I just
>> >use an ActionEvent instead of a ReturnEvent, it works fine.
>> >
>> >This is just a simple example that I prepared to point out the issue, 
>>but
>> >of course in the real application I do have values that I am passing and
>> >retrieving from the dialog.
>> >
>> >I also pasted the code below.
>> >
>> >
>> >Thank you in advance.
>> >Regards,
>> >Magdolna
>> >
>> >
>> >
>> >
>> >Example.xhtml:
>> >        <tr:commandLink id="cmdOut" text="Add New"
>> >                        useWindow="true" windowWidth="300"
>> >windowHeight="400"
>> >                        partialSubmit="true" action="dialog:numDialog"
>> >                        
>>returnListener="#{exampleBean.numDialogReturned}"/>
>>
>> >        <tr:table id="data" value="#{exampleBean.numList}" var="data"
>> >                partialTriggers="cmdIn cmdOut" width="20%">
>> >            <tr:column id="userAction" headerText="User Action">
>> >                <tr:commandLink id="cmdIn" text="Add New"
>> >                                useWindow="true" windowWidth="300"
>> >windowHeight="400"
>> >                                partialSubmit="true"
>> >action="dialog:numDialog"
>> >
>> >returnListener="#{exampleBean.numDialogReturned}"/>
>> >            </tr:column>
>> >            <tr:column id="num" headerText="Number">
>> >                 <tr:outputText value="#{data}"/>
>> >            </tr:column>
>> >        </tr:table>
>> >
>> >ExampleBean.java:
>> >    private List<Integer> numList;
>> >    private int num = 100;
>> >
>> >    public List<Integer> getNumList() {
>> >        if (numList == null) {
>> >            numList = new ArrayList();
>> >        }
>> >        System.out.println("numList: ("+numList.size()+"): "+numList);
>> >        return numList;
>> >    }
>> >    public void numDialogReturned(ReturnEvent event) {
>> >        System.out.println("--- RETURN");
>> >        Boolean isAdd = (Boolean)event.getReturnValue();
>> >        if (isAdd)
>> >            numList.add(new Integer(num++));
>> >    }
>> >
>> >    // DIALOG
>> >    public void performOK(ActionEvent e) {
>> >        logger.debug("Click OK ");
>> >        RequestContext.getCurrentInstance().returnFromDialog(true,null);
>> >    }
>> >    public void performCancel(ActionEvent e) {
>> >        logger.debug("Click Cancel ");
>> >        
>>RequestContext.getCurrentInstance().returnFromDialog(false,null);
>> >    }
>> >
>> >NumDialog.xhtml
>> >    <tr:form>
>> >        <tr:panelFormLayout labelWidth="40%">
>> >           <tr:panelButtonBar>
>> >               <tr:commandButton text="OK"
>> >actionListener="#{equipmentDetailBean.performOK}"/>
>> >               <tr:commandButton text="Cancel" immediate="true"
>> >actionListener="#{equipmentDetailBean.performCancel}"/>
>> >           </tr:panelButtonBar>
>> >        </tr:panelFormLayout>
>> >    </tr:form>
>> >
>> >_________________________________________________________________
>> >Discover Live.ca <http://live.ca/>, the search engine by the creators of
>>Windows Live
>> >Messenger http://www.live.com/?mkt=en-ca
>> >
>>
>>_________________________________________________________________
>>Share your opinion and enter to win! Please complete this survey to enter
>>into a draw for a grand prize of $500 or one of twenty $50 cash prizes.
>>http://www.youthographyinsiders.com/R.aspx?a=116
>>
>>

_________________________________________________________________
Buy what you want when you want it on Sympatico / MSN Shopping 
http://shopping.sympatico.msn.ca/content/shp/?ctId=2,ptnrid=176,ptnrdata=081805


Re: Table refresh problem when using dialog

Posted by venkata guddanti <ve...@gmail.com>.
Hi Magdolna,

Can you change the partialTriggers="cmdIn cmdOut" to
partialTriggers="data:cmdln  cmdOut" and see if it works? This is because
the table is a naming container.

If this does not work, I believe it might be related to the fact that the
currency is established for the table when the commandLink action is invoked
and the clientId for the commandLink includes the currency.

Regards,
Venkata


On 1/9/07, magdolna holitska <mh...@hotmail.com> wrote:
>
> Hi all,
>
> Did anyone had a chance to have a look at the issue I am having below?
>
> Here are a few more details:
>
> In the example below I am trying to add one row to a table using PPR.
> The command link that opens the dialog is inside the table, in each row.
> When the dialog returns a new row should be added to the table,
> but for some reason this isn't happening.
>
> However, if I refresh with the browser, the row is added.
>
> Any ideas?
> Thanks,
> Magdolna
>
>
>
>
>
> >From: "magdolna holitska" < mholitska3@hotmail.com>
> >Reply-To: adffaces-user@incubator.apache.org
> >To: adffaces-user@incubator.apache.org
> >Subject: Table refresh problem when using dialog
> >Date: Fri, 05 Jan 2007 12:01:27 -0500
> >
> >Hello,
> >
> >I have a table containing numbers and a link: "Add New".
> >When the user clicks on the link, a new number will be added to the
> table.
> >
> >
> >The problem I have is:
> >If I have the link outside the table, the number will be added to the
> list
> >and the table will be refreshed properly.
> >
> >At the other hand, when I place the command link inside the table, the
> >number will be added to the list, but the table is not refreshed with the
> >new value.
> >
> >I only noticed this behaviour when I am using it with dialogs. If I just
> >use an ActionEvent instead of a ReturnEvent, it works fine.
> >
> >This is just a simple example that I prepared to point out the issue, but
> >of course in the real application I do have values that I am passing and
> >retrieving from the dialog.
> >
> >I also pasted the code below.
> >
> >
> >Thank you in advance.
> >Regards,
> >Magdolna
> >
> >
> >
> >
> >Example.xhtml:
> >        <tr:commandLink id="cmdOut" text="Add New"
> >                        useWindow="true" windowWidth="300"
> >windowHeight="400"
> >                        partialSubmit="true" action="dialog:numDialog"
> >                        returnListener="#{exampleBean.numDialogReturned}"/>
>
> >        <tr:table id="data" value="#{exampleBean.numList}" var="data"
> >                partialTriggers="cmdIn cmdOut" width="20%">
> >            <tr:column id="userAction" headerText="User Action">
> >                <tr:commandLink id="cmdIn" text="Add New"
> >                                useWindow="true" windowWidth="300"
> >windowHeight="400"
> >                                partialSubmit="true"
> >action="dialog:numDialog"
> >
> >returnListener="#{exampleBean.numDialogReturned}"/>
> >            </tr:column>
> >            <tr:column id="num" headerText="Number">
> >                 <tr:outputText value="#{data}"/>
> >            </tr:column>
> >        </tr:table>
> >
> >ExampleBean.java:
> >    private List<Integer> numList;
> >    private int num = 100;
> >
> >    public List<Integer> getNumList() {
> >        if (numList == null) {
> >            numList = new ArrayList();
> >        }
> >        System.out.println("numList: ("+numList.size()+"): "+numList);
> >        return numList;
> >    }
> >    public void numDialogReturned(ReturnEvent event) {
> >        System.out.println("--- RETURN");
> >        Boolean isAdd = (Boolean)event.getReturnValue();
> >        if (isAdd)
> >            numList.add(new Integer(num++));
> >    }
> >
> >    // DIALOG
> >    public void performOK(ActionEvent e) {
> >        logger.debug("Click OK ");
> >        RequestContext.getCurrentInstance().returnFromDialog(true,null);
> >    }
> >    public void performCancel(ActionEvent e) {
> >        logger.debug("Click Cancel ");
> >        RequestContext.getCurrentInstance().returnFromDialog(false,null);
> >    }
> >
> >NumDialog.xhtml
> >    <tr:form>
> >        <tr:panelFormLayout labelWidth="40%">
> >           <tr:panelButtonBar>
> >               <tr:commandButton text="OK"
> >actionListener="#{equipmentDetailBean.performOK}"/>
> >               <tr:commandButton text="Cancel" immediate="true"
> >actionListener="#{equipmentDetailBean.performCancel}"/>
> >           </tr:panelButtonBar>
> >        </tr:panelFormLayout>
> >    </tr:form>
> >
> >_________________________________________________________________
> >Discover Live.ca <http://live.ca/>, the search engine by the creators of
> Windows Live
> >Messenger http://www.live.com/?mkt=en-ca
> >
>
> _________________________________________________________________
> Share your opinion and enter to win! Please complete this survey to enter
> into a draw for a grand prize of $500 or one of twenty $50 cash prizes.
> http://www.youthographyinsiders.com/R.aspx?a=116
>
>

RE: Table refresh problem when using dialog

Posted by magdolna holitska <mh...@hotmail.com>.
Hi all,

Did anyone had a chance to have a look at the issue I am having below?

Here are a few more details:

In the example below I am trying to add one row to a table using PPR.
The command link that opens the dialog is inside the table, in each row.
When the dialog returns a new row should be added to the table,
but for some reason this isn't happening.

However, if I refresh with the browser, the row is added.

Any ideas?
Thanks,
Magdolna





>From: "magdolna holitska" <mh...@hotmail.com>
>Reply-To: adffaces-user@incubator.apache.org
>To: adffaces-user@incubator.apache.org
>Subject: Table refresh problem when using dialog
>Date: Fri, 05 Jan 2007 12:01:27 -0500
>
>Hello,
>
>I have a table containing numbers and a link: "Add New".
>When the user clicks on the link, a new number will be added to the table.
>
>
>The problem I have is:
>If I have the link outside the table, the number will be added to the list 
>and the table will be refreshed properly.
>
>At the other hand, when I place the command link inside the table, the 
>number will be added to the list, but the table is not refreshed with the 
>new value.
>
>I only noticed this behaviour when I am using it with dialogs. If I just 
>use an ActionEvent instead of a ReturnEvent, it works fine.
>
>This is just a simple example that I prepared to point out the issue, but 
>of course in the real application I do have values that I am passing and 
>retrieving from the dialog.
>
>I also pasted the code below.
>
>
>Thank you in advance.
>Regards,
>Magdolna
>
>
>
>
>Example.xhtml:
>        <tr:commandLink id="cmdOut" text="Add New"
>                        useWindow="true" windowWidth="300" 
>windowHeight="400"
>                        partialSubmit="true" action="dialog:numDialog"
>                        returnListener="#{exampleBean.numDialogReturned}"/>
>        <tr:table id="data" value="#{exampleBean.numList}" var="data"
>                partialTriggers="cmdIn cmdOut" width="20%">
>            <tr:column id="userAction" headerText="User Action">
>                <tr:commandLink id="cmdIn" text="Add New"
>                                useWindow="true" windowWidth="300" 
>windowHeight="400"
>                                partialSubmit="true" 
>action="dialog:numDialog"
>                                
>returnListener="#{exampleBean.numDialogReturned}"/>
>            </tr:column>
>            <tr:column id="num" headerText="Number">
>                 <tr:outputText value="#{data}"/>
>            </tr:column>
>        </tr:table>
>
>ExampleBean.java:
>    private List<Integer> numList;
>    private int num = 100;
>
>    public List<Integer> getNumList() {
>        if (numList == null) {
>            numList = new ArrayList();
>        }
>        System.out.println("numList: ("+numList.size()+"): "+numList);
>        return numList;
>    }
>    public void numDialogReturned(ReturnEvent event) {
>        System.out.println("--- RETURN");
>        Boolean isAdd = (Boolean)event.getReturnValue();
>        if (isAdd)
>            numList.add(new Integer(num++));
>    }
>
>    // DIALOG
>    public void performOK(ActionEvent e) {
>        logger.debug("Click OK ");
>        RequestContext.getCurrentInstance().returnFromDialog(true,null);
>    }
>    public void performCancel(ActionEvent e) {
>        logger.debug("Click Cancel ");
>        RequestContext.getCurrentInstance().returnFromDialog(false,null);
>    }
>
>NumDialog.xhtml
>    <tr:form>
>        <tr:panelFormLayout labelWidth="40%">
>           <tr:panelButtonBar>
>               <tr:commandButton text="OK" 
>actionListener="#{equipmentDetailBean.performOK}"/>
>               <tr:commandButton text="Cancel" immediate="true" 
>actionListener="#{equipmentDetailBean.performCancel}"/>
>           </tr:panelButtonBar>
>        </tr:panelFormLayout>
>    </tr:form>
>
>_________________________________________________________________
>Discover Live.ca, the search engine by the creators of Windows Live 
>Messenger http://www.live.com/?mkt=en-ca
>

_________________________________________________________________
Share your opinion and enter to win! Please complete this survey to enter 
into a draw for a grand prize of $500 or one of twenty $50 cash prizes. 
http://www.youthographyinsiders.com/R.aspx?a=116