You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Bruno Aranda <br...@gmail.com> on 2005/11/01 03:08:23 UTC

Re: __LINK_TARGET__ changed to _link_hidden_?

You could use the forceId attribute of the t:inputHidden component.
For instance:

<t:inputHidden id="myId" forceId="true" />

will render a input type="hidden" component with clientId 'myId'. So
you can use this id safely in your code...

Regards,

Bruno

2005/10/31, CONNER, BRENDAN (SBCSI) <bc...@sbc.com>:
> Out of curiosity, did the rendered ID of the hidden field that
> represents a form's commandLinks get changed within the past couple of
> months from __LINK_TARGET__ to _link_hidden_?  We had some code in our
> Tiles framework to automatically click a link on our page, and this
> assumed that the hidden field would be called __LINK_TARGET__, and this
> suddenly stopped working.  Upon viewing the HTML source, we found that,
> if we changed our reference from __LINK_TARGET__ to _link_hidden_, our
> auto-click worked again.
>
> If this change occurred, my next question is: How can we refer to this
> hidden field in a manner that protects us against changes to its name?
>
> - Brendan
>

Re: __LINK_TARGET__ changed to _link_hidden_?

Posted by Airton Carrara <li...@gmail.com>.
Yes, that is..

To complet the idea:
http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
.

Thanks a lot.

Regards,
Airton



2005/11/22, Bruno Aranda <br...@gmail.com>:
> So, your interest is to pass some values to the next page? Then it is
> not necessary to use the inputHidden components. If you want, you can
> pass the parameters with the command component and do whatever logic
> you need with this parameters in the backing bean:
>
> <h:commandButton value="Send"
> actionListener="#{yourBean.doSomethingWithTheParams}" action="rBean">
>     <f:param name="raId" value="#{var.ra}"/>
>     <f:param name="rbId" value="#{var.rb}"/>
>     <f:param name="rcId" value="#{var.rc}"/>
> </h:commandButton>
>
> You can also use t:updateActionListener component to implement faster
> a master-detail effect. See the example [1] to see how it works.
>
> Regards,
>
> Bruno
>
> [1] http://www.irian.at/myfaces/masterDetail.jsf
>
> 2005/11/21, Airton Carrara <li...@gmail.com>:
> > hmm.. not exactly. See:
> >
> > ...
> > <h:column>
> >  <h:form>
> >    <t:inputHidden id="raId" forceId="true" value="#{var.ra}"/>
> >    <t:inputHidden id="rbId" forceId="true" value="#{var.rb}"/>
> >    <t:inputHidden id="rcId" forceId="true" value="#{var.rc}"/>
> >    <h:commandButton value="Send" action="rBean"/>
> >  </h:form>
> > </h:column>
> > ...
> > (ra, rb and rc comes from a database)
> >
> > The last column of this table has buttons, on every row.
> > When clicked, this page must send the data (ra, rb and rc values) to
> > another page/servlet/class/etc..
> >
> > On that class, the target that receive the request, I need get these values.
> > How to access "raId" or "rbId" or "rcId" on the java code to work with
> > its value (ra, rb or rc)?
> >
> > Thanks,
> >
> > Regards,
> > Airton
> >
> >
> > 2005/11/21, Bruno Aranda <br...@gmail.com>:
> > > I am not sure if I understand what you mean, but you can use
> > > forceId/forceIdIndex also inside dataTables. The next snipped comes
> > > from the myfaces examples [1]:
> > >
> > > <t:dataTable value="#{forceIdBean.choices}" var="choice">
> > >             <h:column>
> > >                 <t:inputText id="widget" value="#{choice}"
> > > forceId="true" forceIdIndex="true"/>
> > >             </h:column>
> > >  </t:dataTable>
> > >
> > > Then, you can access to your element using the id widget[x], where x
> > > is the index...
> > >
> > > Hope that helps,
> > >
> > > Bruno
> > >
> > > [1] http://www.irian.at/myfaces/forceId.jsf
> > >
> > >
> > > 2005/11/21, Airton Carrara <li...@gmail.com>:
> > > > Hi Bruno.
> > > >
> > > > How to use this id on the code?
> > > >
> > > > Suppose:
> > > >
> > > > ... <h:dataTable... var="users" ... <h:column> ...
> > > >
> > > > <t:inputHidden id="myId" forceId="true" value="#{users.name}"/>
> > > > ...
> > > >
> > > > where "name" is coming from a database. How to use "myId" and its
> > > > value on a target page/bean?
> > > >
> > > > Thanks a lot,
> > > >
> > > > Regards,
> > > > Airton
> > > >
> > > >
> > > > 2005/10/31, Bruno Aranda <br...@gmail.com>:
> > > > > You could use the forceId attribute of the t:inputHidden component.
> > > > > For instance:
> > > > >
> > > > > <t:inputHidden id="myId" forceId="true" />
> > > > >
> > > > > will render a input type="hidden" component with clientId 'myId'. So
> > > > > you can use this id safely in your code...
> > > > >
> > > > > Regards,
> > > > >
> > > > > Bruno
> > > > >
> > > > > 2005/10/31, CONNER, BRENDAN (SBCSI) <bc...@sbc.com>:
> > > > > > Out of curiosity, did the rendered ID of the hidden field that
> > > > > > represents a form's commandLinks get changed within the past couple of
> > > > > > months from __LINK_TARGET__ to _link_hidden_?  We had some code in our
> > > > > > Tiles framework to automatically click a link on our page, and this
> > > > > > assumed that the hidden field would be called __LINK_TARGET__, and this
> > > > > > suddenly stopped working.  Upon viewing the HTML source, we found that,
> > > > > > if we changed our reference from __LINK_TARGET__ to _link_hidden_, our
> > > > > > auto-click worked again.
> > > > > >
> > > > > > If this change occurred, my next question is: How can we refer to this
> > > > > > hidden field in a manner that protects us against changes to its name?
> > > > > >
> > > > > > - Brendan
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: __LINK_TARGET__ changed to _link_hidden_?

Posted by Mike Kienenberger <mk...@gmail.com>.
Unfortunately, this isn't legal JSF.

You'd have to use h:commandLink instead of h:commandButton.
h:commandButton does not take f:param values.

On 11/22/05, Bruno Aranda <br...@gmail.com> wrote:
> So, your interest is to pass some values to the next page? Then it is
> not necessary to use the inputHidden components. If you want, you can
> pass the parameters with the command component and do whatever logic
> you need with this parameters in the backing bean:
>
> <h:commandButton value="Send"
> actionListener="#{yourBean.doSomethingWithTheParams}" action="rBean">
>     <f:param name="raId" value="#{var.ra}"/>
>     <f:param name="rbId" value="#{var.rb}"/>
>     <f:param name="rcId" value="#{var.rc}"/>
> </h:commandButton>
>
> You can also use t:updateActionListener component to implement faster
> a master-detail effect. See the example [1] to see how it works.
>
> Regards,
>
> Bruno
>
> [1] http://www.irian.at/myfaces/masterDetail.jsf
>
> 2005/11/21, Airton Carrara <li...@gmail.com>:
> > hmm.. not exactly. See:
> >
> > ...
> > <h:column>
> >  <h:form>
> >    <t:inputHidden id="raId" forceId="true" value="#{var.ra}"/>
> >    <t:inputHidden id="rbId" forceId="true" value="#{var.rb}"/>
> >    <t:inputHidden id="rcId" forceId="true" value="#{var.rc}"/>
> >    <h:commandButton value="Send" action="rBean"/>
> >  </h:form>
> > </h:column>
> > ...
> > (ra, rb and rc comes from a database)
> >
> > The last column of this table has buttons, on every row.
> > When clicked, this page must send the data (ra, rb and rc values) to
> > another page/servlet/class/etc..
> >
> > On that class, the target that receive the request, I need get these values.
> > How to access "raId" or "rbId" or "rcId" on the java code to work with
> > its value (ra, rb or rc)?
> >
> > Thanks,
> >
> > Regards,
> > Airton
> >
> >
> > 2005/11/21, Bruno Aranda <br...@gmail.com>:
> > > I am not sure if I understand what you mean, but you can use
> > > forceId/forceIdIndex also inside dataTables. The next snipped comes
> > > from the myfaces examples [1]:
> > >
> > > <t:dataTable value="#{forceIdBean.choices}" var="choice">
> > >             <h:column>
> > >                 <t:inputText id="widget" value="#{choice}"
> > > forceId="true" forceIdIndex="true"/>
> > >             </h:column>
> > >  </t:dataTable>
> > >
> > > Then, you can access to your element using the id widget[x], where x
> > > is the index...
> > >
> > > Hope that helps,
> > >
> > > Bruno
> > >
> > > [1] http://www.irian.at/myfaces/forceId.jsf
> > >
> > >
> > > 2005/11/21, Airton Carrara <li...@gmail.com>:
> > > > Hi Bruno.
> > > >
> > > > How to use this id on the code?
> > > >
> > > > Suppose:
> > > >
> > > > ... <h:dataTable... var="users" ... <h:column> ...
> > > >
> > > > <t:inputHidden id="myId" forceId="true" value="#{users.name}"/>
> > > > ...
> > > >
> > > > where "name" is coming from a database. How to use "myId" and its
> > > > value on a target page/bean?
> > > >
> > > > Thanks a lot,
> > > >
> > > > Regards,
> > > > Airton
> > > >
> > > >
> > > > 2005/10/31, Bruno Aranda <br...@gmail.com>:
> > > > > You could use the forceId attribute of the t:inputHidden component.
> > > > > For instance:
> > > > >
> > > > > <t:inputHidden id="myId" forceId="true" />
> > > > >
> > > > > will render a input type="hidden" component with clientId 'myId'. So
> > > > > you can use this id safely in your code...
> > > > >
> > > > > Regards,
> > > > >
> > > > > Bruno
> > > > >
> > > > > 2005/10/31, CONNER, BRENDAN (SBCSI) <bc...@sbc.com>:
> > > > > > Out of curiosity, did the rendered ID of the hidden field that
> > > > > > represents a form's commandLinks get changed within the past couple of
> > > > > > months from __LINK_TARGET__ to _link_hidden_?  We had some code in our
> > > > > > Tiles framework to automatically click a link on our page, and this
> > > > > > assumed that the hidden field would be called __LINK_TARGET__, and this
> > > > > > suddenly stopped working.  Upon viewing the HTML source, we found that,
> > > > > > if we changed our reference from __LINK_TARGET__ to _link_hidden_, our
> > > > > > auto-click worked again.
> > > > > >
> > > > > > If this change occurred, my next question is: How can we refer to this
> > > > > > hidden field in a manner that protects us against changes to its name?
> > > > > >
> > > > > > - Brendan
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: __LINK_TARGET__ changed to _link_hidden_?

Posted by Bruno Aranda <br...@gmail.com>.
So, your interest is to pass some values to the next page? Then it is
not necessary to use the inputHidden components. If you want, you can
pass the parameters with the command component and do whatever logic
you need with this parameters in the backing bean:

<h:commandButton value="Send"
actionListener="#{yourBean.doSomethingWithTheParams}" action="rBean">
    <f:param name="raId" value="#{var.ra}"/>
    <f:param name="rbId" value="#{var.rb}"/>
    <f:param name="rcId" value="#{var.rc}"/>
</h:commandButton>

You can also use t:updateActionListener component to implement faster
a master-detail effect. See the example [1] to see how it works.

Regards,

Bruno

[1] http://www.irian.at/myfaces/masterDetail.jsf

2005/11/21, Airton Carrara <li...@gmail.com>:
> hmm.. not exactly. See:
>
> ...
> <h:column>
>  <h:form>
>    <t:inputHidden id="raId" forceId="true" value="#{var.ra}"/>
>    <t:inputHidden id="rbId" forceId="true" value="#{var.rb}"/>
>    <t:inputHidden id="rcId" forceId="true" value="#{var.rc}"/>
>    <h:commandButton value="Send" action="rBean"/>
>  </h:form>
> </h:column>
> ...
> (ra, rb and rc comes from a database)
>
> The last column of this table has buttons, on every row.
> When clicked, this page must send the data (ra, rb and rc values) to
> another page/servlet/class/etc..
>
> On that class, the target that receive the request, I need get these values.
> How to access "raId" or "rbId" or "rcId" on the java code to work with
> its value (ra, rb or rc)?
>
> Thanks,
>
> Regards,
> Airton
>
>
> 2005/11/21, Bruno Aranda <br...@gmail.com>:
> > I am not sure if I understand what you mean, but you can use
> > forceId/forceIdIndex also inside dataTables. The next snipped comes
> > from the myfaces examples [1]:
> >
> > <t:dataTable value="#{forceIdBean.choices}" var="choice">
> >             <h:column>
> >                 <t:inputText id="widget" value="#{choice}"
> > forceId="true" forceIdIndex="true"/>
> >             </h:column>
> >  </t:dataTable>
> >
> > Then, you can access to your element using the id widget[x], where x
> > is the index...
> >
> > Hope that helps,
> >
> > Bruno
> >
> > [1] http://www.irian.at/myfaces/forceId.jsf
> >
> >
> > 2005/11/21, Airton Carrara <li...@gmail.com>:
> > > Hi Bruno.
> > >
> > > How to use this id on the code?
> > >
> > > Suppose:
> > >
> > > ... <h:dataTable... var="users" ... <h:column> ...
> > >
> > > <t:inputHidden id="myId" forceId="true" value="#{users.name}"/>
> > > ...
> > >
> > > where "name" is coming from a database. How to use "myId" and its
> > > value on a target page/bean?
> > >
> > > Thanks a lot,
> > >
> > > Regards,
> > > Airton
> > >
> > >
> > > 2005/10/31, Bruno Aranda <br...@gmail.com>:
> > > > You could use the forceId attribute of the t:inputHidden component.
> > > > For instance:
> > > >
> > > > <t:inputHidden id="myId" forceId="true" />
> > > >
> > > > will render a input type="hidden" component with clientId 'myId'. So
> > > > you can use this id safely in your code...
> > > >
> > > > Regards,
> > > >
> > > > Bruno
> > > >
> > > > 2005/10/31, CONNER, BRENDAN (SBCSI) <bc...@sbc.com>:
> > > > > Out of curiosity, did the rendered ID of the hidden field that
> > > > > represents a form's commandLinks get changed within the past couple of
> > > > > months from __LINK_TARGET__ to _link_hidden_?  We had some code in our
> > > > > Tiles framework to automatically click a link on our page, and this
> > > > > assumed that the hidden field would be called __LINK_TARGET__, and this
> > > > > suddenly stopped working.  Upon viewing the HTML source, we found that,
> > > > > if we changed our reference from __LINK_TARGET__ to _link_hidden_, our
> > > > > auto-click worked again.
> > > > >
> > > > > If this change occurred, my next question is: How can we refer to this
> > > > > hidden field in a manner that protects us against changes to its name?
> > > > >
> > > > > - Brendan
> > > > >
> > > >
> > >
> >
>

Re: __LINK_TARGET__ changed to _link_hidden_?

Posted by Airton Carrara <li...@gmail.com>.
hmm.. not exactly. See:

...
<h:column>
 <h:form>
   <t:inputHidden id="raId" forceId="true" value="#{var.ra}"/>
   <t:inputHidden id="rbId" forceId="true" value="#{var.rb}"/>
   <t:inputHidden id="rcId" forceId="true" value="#{var.rc}"/>
   <h:commandButton value="Send" action="rBean"/>
 </h:form>
</h:column>
...
(ra, rb and rc comes from a database)

The last column of this table has buttons, on every row.
When clicked, this page must send the data (ra, rb and rc values) to
another page/servlet/class/etc..

On that class, the target that receive the request, I need get these values.
How to access "raId" or "rbId" or "rcId" on the java code to work with
its value (ra, rb or rc)?

Thanks,

Regards,
Airton


2005/11/21, Bruno Aranda <br...@gmail.com>:
> I am not sure if I understand what you mean, but you can use
> forceId/forceIdIndex also inside dataTables. The next snipped comes
> from the myfaces examples [1]:
>
> <t:dataTable value="#{forceIdBean.choices}" var="choice">
>             <h:column>
>                 <t:inputText id="widget" value="#{choice}"
> forceId="true" forceIdIndex="true"/>
>             </h:column>
>  </t:dataTable>
>
> Then, you can access to your element using the id widget[x], where x
> is the index...
>
> Hope that helps,
>
> Bruno
>
> [1] http://www.irian.at/myfaces/forceId.jsf
>
>
> 2005/11/21, Airton Carrara <li...@gmail.com>:
> > Hi Bruno.
> >
> > How to use this id on the code?
> >
> > Suppose:
> >
> > ... <h:dataTable... var="users" ... <h:column> ...
> >
> > <t:inputHidden id="myId" forceId="true" value="#{users.name}"/>
> > ...
> >
> > where "name" is coming from a database. How to use "myId" and its
> > value on a target page/bean?
> >
> > Thanks a lot,
> >
> > Regards,
> > Airton
> >
> >
> > 2005/10/31, Bruno Aranda <br...@gmail.com>:
> > > You could use the forceId attribute of the t:inputHidden component.
> > > For instance:
> > >
> > > <t:inputHidden id="myId" forceId="true" />
> > >
> > > will render a input type="hidden" component with clientId 'myId'. So
> > > you can use this id safely in your code...
> > >
> > > Regards,
> > >
> > > Bruno
> > >
> > > 2005/10/31, CONNER, BRENDAN (SBCSI) <bc...@sbc.com>:
> > > > Out of curiosity, did the rendered ID of the hidden field that
> > > > represents a form's commandLinks get changed within the past couple of
> > > > months from __LINK_TARGET__ to _link_hidden_?  We had some code in our
> > > > Tiles framework to automatically click a link on our page, and this
> > > > assumed that the hidden field would be called __LINK_TARGET__, and this
> > > > suddenly stopped working.  Upon viewing the HTML source, we found that,
> > > > if we changed our reference from __LINK_TARGET__ to _link_hidden_, our
> > > > auto-click worked again.
> > > >
> > > > If this change occurred, my next question is: How can we refer to this
> > > > hidden field in a manner that protects us against changes to its name?
> > > >
> > > > - Brendan
> > > >
> > >
> >
>

Re: __LINK_TARGET__ changed to _link_hidden_?

Posted by Bruno Aranda <br...@gmail.com>.
I am not sure if I understand what you mean, but you can use
forceId/forceIdIndex also inside dataTables. The next snipped comes
from the myfaces examples [1]:

<t:dataTable value="#{forceIdBean.choices}" var="choice">
            <h:column>
                <t:inputText id="widget" value="#{choice}"
forceId="true" forceIdIndex="true"/>
            </h:column>
 </t:dataTable>

Then, you can access to your element using the id widget[x], where x
is the index...

Hope that helps,

Bruno

[1] http://www.irian.at/myfaces/forceId.jsf


2005/11/21, Airton Carrara <li...@gmail.com>:
> Hi Bruno.
>
> How to use this id on the code?
>
> Suppose:
>
> ... <h:dataTable... var="users" ... <h:column> ...
>
> <t:inputHidden id="myId" forceId="true" value="#{users.name}"/>
> ...
>
> where "name" is coming from a database. How to use "myId" and its
> value on a target page/bean?
>
> Thanks a lot,
>
> Regards,
> Airton
>
>
> 2005/10/31, Bruno Aranda <br...@gmail.com>:
> > You could use the forceId attribute of the t:inputHidden component.
> > For instance:
> >
> > <t:inputHidden id="myId" forceId="true" />
> >
> > will render a input type="hidden" component with clientId 'myId'. So
> > you can use this id safely in your code...
> >
> > Regards,
> >
> > Bruno
> >
> > 2005/10/31, CONNER, BRENDAN (SBCSI) <bc...@sbc.com>:
> > > Out of curiosity, did the rendered ID of the hidden field that
> > > represents a form's commandLinks get changed within the past couple of
> > > months from __LINK_TARGET__ to _link_hidden_?  We had some code in our
> > > Tiles framework to automatically click a link on our page, and this
> > > assumed that the hidden field would be called __LINK_TARGET__, and this
> > > suddenly stopped working.  Upon viewing the HTML source, we found that,
> > > if we changed our reference from __LINK_TARGET__ to _link_hidden_, our
> > > auto-click worked again.
> > >
> > > If this change occurred, my next question is: How can we refer to this
> > > hidden field in a manner that protects us against changes to its name?
> > >
> > > - Brendan
> > >
> >
>

Re: __LINK_TARGET__ changed to _link_hidden_?

Posted by Airton Carrara <li...@gmail.com>.
Hi Bruno.

How to use this id on the code?

Suppose:

... <h:dataTable... var="users" ... <h:column> ...

<t:inputHidden id="myId" forceId="true" value="#{users.name}"/>
...

where "name" is coming from a database. How to use "myId" and its
value on a target page/bean?

Thanks a lot,

Regards,
Airton


2005/10/31, Bruno Aranda <br...@gmail.com>:
> You could use the forceId attribute of the t:inputHidden component.
> For instance:
>
> <t:inputHidden id="myId" forceId="true" />
>
> will render a input type="hidden" component with clientId 'myId'. So
> you can use this id safely in your code...
>
> Regards,
>
> Bruno
>
> 2005/10/31, CONNER, BRENDAN (SBCSI) <bc...@sbc.com>:
> > Out of curiosity, did the rendered ID of the hidden field that
> > represents a form's commandLinks get changed within the past couple of
> > months from __LINK_TARGET__ to _link_hidden_?  We had some code in our
> > Tiles framework to automatically click a link on our page, and this
> > assumed that the hidden field would be called __LINK_TARGET__, and this
> > suddenly stopped working.  Upon viewing the HTML source, we found that,
> > if we changed our reference from __LINK_TARGET__ to _link_hidden_, our
> > auto-click worked again.
> >
> > If this change occurred, my next question is: How can we refer to this
> > hidden field in a manner that protects us against changes to its name?
> >
> > - Brendan
> >
>