ValueChangeListener
I had asked the following question:
How do I select an item on a ListBox and so I select it running an action? ... without having to press a button? .... I tried to use the 'OnClick' property ... but it does not work ... I also wanted to know how to do this in an 'ADF Read Only Table' ... as soon as the user selected a line .. I wanted you to already executed An action ... but on his 'OnClick' property is not running the action ....
And then Victor told me that I should follow the following steps:
You need to mecher in 2 attributes of your component
1 - autosubmit = "true"
2 - valuechangelistener = "# {nomedobean.nomedomode}"
99] But I made these two steps ... In the valuechangelistener I called the same method as the button called ....
and every time I selected the item .. it did nothing ... it was as if I were updating the screen by clicking on it .. but he did not run the action I wanted him executed ....
How do I select an item on a ListBox and so I select it running an action? ... without having to press a button? .... I tried to use the 'OnClick' property ... but it does not work ... I also wanted to know how to do this in an 'ADF Read Only Table' ... as soon as the user selected a line .. I wanted you to already executed An action ... but on his 'OnClick' property is not running the action ....
And then Victor told me that I should follow the following steps:
You need to mecher in 2 attributes of your component
1 - autosubmit = "true"
2 - valuechangelistener = "# {nomedobean.nomedomode}"
99] But I made these two steps ... In the valuechangelistener I called the same method as the button called ....
and every time I selected the item .. it did nothing ... it was as if I were updating the screen by clicking on it .. but he did not run the action I wanted him executed ....
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
I understood it was for an AF: Selectonechoice
post the codigo of the component and also the method q is called
post the codigo of the component and also the method q is called
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
Select the item that you speak is click on the radion button ??
I find it very difficult you can do this ...
just clicking on the registry directly or selecting the radionbutton and clicking open
I find it very difficult you can do this ...
just clicking on the registry directly or selecting the radionbutton and clicking open
Well ... I tried to do it for a selector too ... but it did not work também ...
VO Post the selection code ....
JSP
in the 'Tableselectone' component, which is where selects and a table does not have the Valuechangelistener property !!
VO Post the selection code ....
JSP
<af:panelForm rows="1">
<af:selectOneChoice value="#{bindings.wplaca.inputValue}"
label="Selecione a O.S. do Transporte"
autoSubmit="true"
valueChangeListener="#{backing_Montagem_transporte.Pesquisar_action}">
<f:selectItems value="#{bindings.wplaca.items}"/>
</af:selectOneChoice>
public String Pesquisar_action() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("ExecuteWithParams1");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
}
return null;
}
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
: D
Next ...
Delete your bean method and then on this line in your JSP should accuse a mistake, then click on the red lamp your left in the direction of the line
Create the method through the red lamp dai and just fill with what you have already done ... The method should receive this parameter 'valuechangeevent'
Thus being
Note: Through the object 'valuechangeevent' that you receive by parameter, and possible to pick up the value selected in the combo, for example
Next ...
Delete your bean method and then on this line in your JSP should accuse a mistake, then click on the red lamp your left in the direction of the line
valueChangeListener="#{backing_Montagem_transporte.Pesquisar_action}">
Thus being
public String pesquisarAction (ValueChangeEvent valueChangeEvent) {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("ExecuteWithParams1");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
}
return null;
}
String valorSelecionado = valueChangeEvent.getValue();
Look Victor ...
I did exactly the way you said ... but it gave the same ... he does as if he had updating the page ... but does not perform the action. ... !!
I even created another method in the Valuechangelistener property ... and then I put the code ... but did not give anything !! ..
I did exactly the way you said ... but it gave the same ... he does as if he had updating the page ... but does not perform the action. ... !!
I even created another method in the Valuechangelistener property ... and then I put the code ... but did not give anything !! ..
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
Michele
As all good fishopath let's go by parts ...
"He does as if he had updated the page"
That's the partial rendered ... this is because of the autosubmit = 'true'
put a break point within your method that I am absolutely sure that it will enter your method .. o que is occurring and that your method is with problems
executewithparams1
Put a breakpoint in this method also
in the end your problem and your code o que I passed you is working
Anything put everything there q agent vê o que do
: Wink:
As all good fishopath let's go by parts ...
"He does as if he had updated the page"
That's the partial rendered ... this is because of the autosubmit = 'true'
put a break point within your method that I am absolutely sure that it will enter your method .. o que is occurring and that your method is with problems
executewithparams1
Put a breakpoint in this method also
in the end your problem and your code o que I passed you is working
Anything put everything there q agent vê o que do
: Wink:
Well .. I put a breakpoint in my bean .. and he passed there ...
I will post my code:
I will post my code:
<af:selectOneChoice value="#{bindings.wplaca.inputValue}"
label="Selecione a O.S. do Transporte"
autoSubmit="true"
valueChangeListener="#{backing_Montagem_transporte.Pesquisar}">
<f:selectItems value="#{bindings.wplaca.items}"/>
</af:selectOneChoice>
public void Pesquisar(ValueChangeEvent valueChangeEvent) {
// Add event code here...
BindingContainer bindings = getBindings();
OperationBinding operationBinding =bindings.getOperationBinding("ExecuteWithParams1");
Object result = operationBinding.execute();
}
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
so ...
as I said
the problem and logia of your
if you are entering the method and why you already understood how you do, now you need you take a look at your logic to hit her because the problem and that your method does not do what you think he had to do
: D
as I said
the problem and logia of your
if you are entering the method and why you already understood how you do, now you need you take a look at your logic to hit her because the problem and that your method does not do what you think he had to do
: D
But when I call the method by the button ... it runs right ... he returns to the research ....
The only thing I did differently is to call this method in the valuechangelistener ....
are sure .. q I do not need to hit any more attribute? !!
The only thing I did differently is to call this method in the valuechangelistener ....
are sure .. q I do not need to hit any more attribute? !!
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
Who returns right when you call in another form ...
The Method of AM or Bean ??
I think I know your problem
do so
The Method of AM or Bean ??
I think I know your problem
Object result = operationBinding.execute();
operationBinding.execute();
Object result = operationBinding.getResult();
I made this change ... but it did not help !! : Cry:
is the following .. I have a CommandButton:
99] What I want is that he does the research only with the change of my selectonechoice .. without I need to have to click on the notion search ....
when I click on the Search button it works directly. ...
Selectonechoice code:
I use this Even "executewithparams1" for both cases ... but in selectonechoice .. it is not showing the search ...
is the following .. I have a CommandButton:
<af:commandButton text="Pesquisar"
disabled="#{!bindings.ExecuteWithParams1.enabled}"
action="#{backing_Montagem_transporte.Pesquisa}"/>
public String Pesquisa() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("ExecuteWithParams1");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
}
return null;
}
99] What I want is that he does the research only with the change of my selectonechoice .. without I need to have to click on the notion search ....
when I click on the Search button it works directly. ...
Selectonechoice code:
<af:selectOneChoice value="#{bindings.wplaca1.inputValue}"
label="Placa"
valueChangeListener="#{backing_Montagem_transporte.pesquisar_solicitacao}"
autoSubmit="true">
<f:selectItems value="#{bindings.wplaca1.items}"/>
</af:selectOneChoice>
public String pesquisar_solicitacao(ValueChangeEvent valueChangeEvent) {
// Add event code here...
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("ExecuteWithParams1");
operationBinding.execute();
Object result = operationBinding.getResult();
if (!operationBinding.getErrors().isEmpty()) {
return null;
}
return null;
}
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
oh michele
I'm having a lot of trouble understanding your doubts always
separate the subjects better, create new topics, separate your doubts better, I know it is not easy when it is starting but I'm just talking so that I can help you in the best
let's do it ..
just do research with the selone is already all implemented ...
] now if you want to update another component that will be fed your search ... there is missing ..
in your component that has the valuechangelistener you will add
partialtriggers = "idoutrocomponent"
and the component that will be updated you will put
id = "idoutrocomponent"
I'm having a lot of trouble understanding your doubts always
separate the subjects better, create new topics, separate your doubts better, I know it is not easy when it is starting but I'm just talking so that I can help you in the best
let's do it ..
just do research with the selone is already all implemented ...
] now if you want to update another component that will be fed your search ... there is missing ..
in your component that has the valuechangelistener you will add
partialtriggers = "idoutrocomponent"
and the component that will be updated you will put
id = "idoutrocomponent"
Sorry ... I'll try to clarify my doubts better !! : Wink: hehe ...
... it's initially the doubt was a .. and so you're going to respond .. you will solve the doubt .. and others are appearing .. . But I will do my best, to separate things ...
Well .. I did what you gave me .. just otherwise the partialtrigger in the component that will be updated .. porque the way you passed me did not work ...
now he is doing the research .. but delayed ... let me explain:
Selectonechoice Incially has no value ... When I change his value the first time .. nothing happens .. already when I change the second time .. it does the research with the previous value ... and so successively .. it is always doing the research with the value that was selected before ...
I do not know if I was clear !! ...
I will pass the code:
Code of one of the components that will receive the research:
... it's initially the doubt was a .. and so you're going to respond .. you will solve the doubt .. and others are appearing .. . But I will do my best, to separate things ...
Well .. I did what you gave me .. just otherwise the partialtrigger in the component that will be updated .. porque the way you passed me did not work ...
now he is doing the research .. but delayed ... let me explain:
Selectonechoice Incially has no value ... When I change his value the first time .. nothing happens .. already when I change the second time .. it does the research with the previous value ... and so successively .. it is always doing the research with the value that was selected before ...
I do not know if I was clear !! ...
I will pass the code:
<af:selectOneChoice value="#{bindings.wplaca1.inputValue}"
label="Placa"
valueChangeListener="#{backing_Montagem_transporte.pesquisar_solicitacao}"
autoSubmit="true" id="placa_pesquisa">
<f:selectItems value="#{bindings.wplaca1.items}"/>
</af:selectOneChoice>
public String pesquisar_solicitacao(ValueChangeEvent valueChangeEvent) {
// Add event code here...
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("ExecuteWithParams1");
operationBinding.execute();
Object result = operationBinding.getResult();
if (!operationBinding.getErrors().isEmpty()) {
return null;
}
return null;
<af:panelLabelAndMessage label="Peso"
partialTriggers="placa_pesquisa">
<af:outputText value="#{bindings.FrotaSolicitacaoView1Peso.inputValue}"
inlineStyle="font-weight:bold;"/>
</af:panelLabelAndMessage>
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
I disturbed myself in the components in ... How good that you were able to solve
it's getting fierce huh ..
I understood what you're turning on .... I'vê never seen it: Roll:
Let me see your 'executewithparams1' .. post it there
a solution soon
and you get the method that is called it in your am and doing with it receives the direct parameter of the combo
how?!?!
named = to the name that you give the parameter in your Method Am
This guy will always have the new value altered in the combo
If your method does not still receive a parameter
you have to take it from the page definition of your jsp and also take from the client interface of your am .. dai put the param there, compile and do All over again Add to the Customer Interface and Page Definition
it's getting fierce huh ..
I understood what you're turning on .... I'vê never seen it: Roll:
Let me see your 'executewithparams1' .. post it there
a solution soon
and you get the method that is called it in your am and doing with it receives the direct parameter of the combo
how?!?!
Map params = operationBinding.getParamsMap();
params.put("nomeParam", (String)valueChangeEvent.getNewValue());
This guy will always have the new value altered in the combo
If your method does not still receive a parameter
you have to take it from the page definition of your jsp and also take from the client interface of your am .. dai put the param there, compile and do All over again Add to the Customer Interface and Page Definition
hehe .. sorry for my ignorance ... but I do not understand very well ;;;
But if the 'executewithparams' is not a method that I created ... where his code is ... you say that of the paidefinition?:
This code that you step We put where? ... in the bean? ...
then the "named" that you say ... would be my "wipla "As the code shows up there? ..
But if the 'executewithparams' is not a method that I created ... where his code is ... you say that of the paidefinition?:
<action id="ExecuteWithParams1" IterBinding="FrotaSolicitacaoView1Iterator"
InstanceName="AppModuleDataControl.FrotaSolicitacaoView1"
DataControl="AppModuleDataControl" RequiresUpdateModel="true"
Action="95">
<NamedData NDName="wplaca" NDType="java.lang.String"
NDValue="${bindings.FrotaSolicitacaoView1_wplaca}"/>
</action>
then the "named" that you say ... would be my "wipla "As the code shows up there? ..
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
yes ... the code and in the bean getting like this ...
and in the page definition I think I will take the param 'ndvalue'
public String pesquisar_solicitacao(ValueChangeEvent valueChangeEvent) {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("ExecuteWithParams1");
Map params = operationBinding.getParamsMap();
params.put("wplaca", (String)valueChangeEvent.getNewValue());
operationBinding.execute();
Object result = operationBinding.getResult();
if (!operationBinding.getErrors().isEmpty()) {
return null;
}
return null;
Hi Victor ... I think my valuechangeevent .. is with some problem .. because when I locked for a fixed value it works normal ... the research ...:
But when I put it like this:
He did nothing ...
] * .. ahh .. and I took the ndvalue ... from the pageedefinition ..
params.put("wplaca", "AAA1231");
params.put("wplaca", (String)valueChangeEvent.getNewValue());
] * .. ahh .. and I took the ndvalue ... from the pageedefinition ..
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
It is wrong yes ... the signature of the method
must be returning void and not string
now work: lol:
must be returning void and not string
now work: lol:
-
- Moderador
- Posts: 1396
- Joined: Fri, 01 Feb 2008 2:06 pm
- Location: Rio de Janeiro - RJ
- Contact:
The section is beautiful but there are some bugs: lol:
does the process again ... erases everything and start again
If it does not work Try to make a use case only to test the functionality
see what you can and me of news
does the process again ... erases everything and start again
If it does not work Try to make a use case only to test the functionality
see what you can and me of news
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest