You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by stephan opitz <st...@gmail.com> on 2006/07/13 17:10:28 UTC

general - combine command link with (hidden) value?

first - is it possible to log all submited params in to file or output
of servers log?

second:
how i built input sides with command button is no problem...

but if  i have a commandlink, which should go to a side and has an
hidden value, from which the sides generate output :-/

			<element renderId="2" jsfid="h:commandLink">
				<attributes>
					<set name="id" value="id" />
					<set name="action" value="#{categories.showCats}" />
				</attributes>

				<element renderId="1" jsfid="h:inputHidden">
					<attributes>
						<set name="id" value="category_id" />
						<set name="value" value="#{node.identifier}" />
					</attributes>
				</element>

				<element renderId="2" jsfid="h:outputText">
					<attributes>
						<set name="value" value="#{node.description}" />
						<set name="styleClass" value="nodeFolder" />
					</attributes>
				</element>
			</element>

the commandlink links to another side... the method showCats will be
called, but how i also submit the category_id and ist it usefull to
use some kind of the new functions like init() to prebuilt output data
from db for the given category_id

stephan

Re: general - combine command link with (hidden) value?

Posted by stephan opitz <st...@gmail.com>.
solution will be to save submitted value in a state or session bean -
and get it later :-/ not the best solution

2006/7/14, stephan opitz <st...@gmail.com>:
> ok using the f:param makes it possible to submit value by commandLink...
>
>                        <element renderId="2" jsfid="h:commandLink">
>                                <attributes>
>                                        <set name="id" value="id" />
>                                        <set name="action" value="categoriesBean" />
>                                        <set name="actionListener" value="#{categoriesBean.showCats}" />
>                                </attributes>
>
>                                <element renderId="1" jsfid="f:param">
>                                        <attributes>
>                                                <set name="id" value="categoryId" />
>                                                <set name="name" value="categoryId" />
>                                                <set name="value" value="#{node.identifier}" />
>                                        </attributes>
>                                </element>
>
>                                <element renderId="2" jsfid="h:outputText">
>                                        <attributes>
>                                                <set name="value" value="#{node.description}" />
>                                                <set name="styleClass" value="nodeFolder" />
>                                        </attributes>
>                                </element>
>                        </element>
>
> problem is -> if i want to prepare data for view - like data list,
> depending on submitted value - how is it possible to do this? in the
> jsp or html file the value is given by an other class - how can i use
> my submitted one?
>
> but the actionlistener method is called before the view will built up?
>
> and trying to use ActionEvent event to read out works only fine in teh
> actionlistener or fault is by me?
>
> UIParameter component = (UIParameter)
> event.getComponent().findComponent("categoryId");
> long categoryId = Long.parseLong(component.getValue().toString());
>
>
> stephan
>
> 2006/7/13, stephan opitz <st...@gmail.com>:
> > first - is it possible to log all submited params in to file or output
> > of servers log?
> >
> > second:
> > how i built input sides with command button is no problem...
> >
> > but if  i have a commandlink, which should go to a side and has an
> > hidden value, from which the sides generate output :-/
> >
> >                        <element renderId="2" jsfid="h:commandLink">
> >                                <attributes>
> >                                        <set name="id" value="id" />
> >                                        <set name="action" value="#{categories.showCats}" />
> >                                </attributes>
> >
> >                                <element renderId="1" jsfid="h:inputHidden">
> >                                        <attributes>
> >                                                <set name="id" value="category_id" />
> >                                                <set name="value" value="#{node.identifier}" />
> >                                        </attributes>
> >                                </element>
> >
> >                                <element renderId="2" jsfid="h:outputText">
> >                                        <attributes>
> >                                                <set name="value" value="#{node.description}" />
> >                                                <set name="styleClass" value="nodeFolder" />
> >                                        </attributes>
> >                                </element>
> >                        </element>
> >
> > the commandlink links to another side... the method showCats will be
> > called, but how i also submit the category_id and ist it usefull to
> > use some kind of the new functions like init() to prebuilt output data
> > from db for the given category_id
> >
> > stephan
> >
>

Re: general - combine command link with (hidden) value?

Posted by stephan opitz <st...@gmail.com>.
ok using the f:param makes it possible to submit value by commandLink...

			<element renderId="2" jsfid="h:commandLink">
				<attributes>
					<set name="id" value="id" />
					<set name="action" value="categoriesBean" />
					<set name="actionListener" value="#{categoriesBean.showCats}" />
				</attributes>

				<element renderId="1" jsfid="f:param">
					<attributes>
						<set name="id" value="categoryId" />
						<set name="name" value="categoryId" />
						<set name="value" value="#{node.identifier}" />
					</attributes>
				</element>
				
				<element renderId="2" jsfid="h:outputText">
					<attributes>
						<set name="value" value="#{node.description}" />
						<set name="styleClass" value="nodeFolder" />
					</attributes>
				</element>
			</element>

problem is -> if i want to prepare data for view - like data list,
depending on submitted value - how is it possible to do this? in the
jsp or html file the value is given by an other class - how can i use
my submitted one?

but the actionlistener method is called before the view will built up?

and trying to use ActionEvent event to read out works only fine in teh
actionlistener or fault is by me?

UIParameter component = (UIParameter)
event.getComponent().findComponent("categoryId");
long categoryId = Long.parseLong(component.getValue().toString());


stephan

2006/7/13, stephan opitz <st...@gmail.com>:
> first - is it possible to log all submited params in to file or output
> of servers log?
>
> second:
> how i built input sides with command button is no problem...
>
> but if  i have a commandlink, which should go to a side and has an
> hidden value, from which the sides generate output :-/
>
>                        <element renderId="2" jsfid="h:commandLink">
>                                <attributes>
>                                        <set name="id" value="id" />
>                                        <set name="action" value="#{categories.showCats}" />
>                                </attributes>
>
>                                <element renderId="1" jsfid="h:inputHidden">
>                                        <attributes>
>                                                <set name="id" value="category_id" />
>                                                <set name="value" value="#{node.identifier}" />
>                                        </attributes>
>                                </element>
>
>                                <element renderId="2" jsfid="h:outputText">
>                                        <attributes>
>                                                <set name="value" value="#{node.description}" />
>                                                <set name="styleClass" value="nodeFolder" />
>                                        </attributes>
>                                </element>
>                        </element>
>
> the commandlink links to another side... the method showCats will be
> called, but how i also submit the category_id and ist it usefull to
> use some kind of the new functions like init() to prebuilt output data
> from db for the given category_id
>
> stephan
>