[JBoss Seam] - Re: pages.xml action method fired on ajax requests - must be
by dkane
"pete.muir(a)jboss.org" wrote : This behaviour is to be expected due to the way a:commandButton works.
|
| You could perhaps file a feature request in JIRA and we'll see what we can come up with/whether it is a popular feature.
Was the JIRA issue raised ? I have the same (?) problem with page action and ajax request.
The first version was without page action. My page is master-detail one. Upper panel contains rich:dataTable with ajax support for onRowClick event. Lower panel contains the detail dataset updated and rerednered every time when row in upper (master) dataset is clicked. Standard pattern.
It was fine until I click "refresh" in browser. Browser asked me if form data should be resubmitted, and after that detail dataset got syncronized with previously, not currently selected row.
I decided to use page action to refresh both datasets upon "Reload" click. And then noticed : each row click event with a:support invokes page action.
Any other way to intercept page reload, or tune page action ? Components are session-scoped..
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101543#4101543
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101543
18 years, 5 months
[JBoss Seam] - Re: Entity withiout Injection --- How do construct a efficie
by alessandrolt
Using aspect I kept the annotation @In in Entities, may inject any seam component.
The Aspect intercepting the criation of the Entity and search the annotation @In. After it inject by Component.getInstance("componentName").
Below that the code written in AspectJ:
Using aspect I kept the annotation @In in Entities, may inject any seam component.
The Aspect intercepting the criation of the Entity and search the annotation @In. After it inject by Component.getInstance("componentName").
Below that the code written in AspectJ:
| public aspect InjectEntity{
|
| //intercept the package of Entities
| pointcut inject() : initialization(public br.com.siq.pesquisa.entidade.*.new (..));
|
| after():inject(){
| Object obj = thisJoinPoint.getThis();
| String valueOfContextVariable = null;
| Boolean createContextVariable=false;
|
| for(Field field:obj.getClass().getDeclaredFields()){
| if(field.isAnnotationPresent(In.class)){
|
| In in = field.getAnnotation(In.class);
|
| if(in.value().equals("")){
| valueOfContextVariable = field.getName();
| }else{
| valueOfContextVariable = in.value();
| }
|
| if(in.create())
| createContextVariable = true;
|
| field.setAccessible(true);
|
| try {
| field.set(obj, Component.getInstance(valueOfContextVariable, createContextVariable));
| } catch (IllegalStateException e) {
| log.error("Don´t have context active");
| }catch(Exception e){
| log.error(e);
| }
| }
| }
| }
|
| }
|
|
The code of Entity now can be written with:
| @Entity
| public class User{
|
| @In
| private UserRepository userRepository;
|
| //more code
| (...)
|
| }
|
... the Entity user isn't necessarily a Seam component, but works ;)
-----------------------------
[]´s
Alessandro Lazarotti
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101541#4101541
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101541
18 years, 5 months
[JBoss Seam] - Remoting behaviour
by cfthomas
Hi!
I'm developing a SEAM remoting app, so all things on the client side are done in JS and SEAM just handles remoting calls.
I'm using SLSB on the server that look like this:
| @Stateless
| public class MySLSB {
| private String prop1;
| ..
| @WebRemote
| public String getProperty() { return prop1; }
| }
|
I have no @Name or @Scope annotation because I use many different instances of the same type like this:
| <component name="x1" class="acme.MySLSB" scope="STATELESS">
| <property name="prop1">value1</property>
| </component>
|
| <component name="x2" class="acme.MySLSB" scope="STATELESS">
| <property name="prop1">value2</property>
| </component>
|
when I do a remoting call like this:
| var x1 = Seam.Component.getInstance('x1');
| x1.getProperty(function(prop1) {
| // do something with prop1
| });
|
and set a breakpoint on the serverside in my getProperty() method I sometimes get the right configuration (value1 in this case) or the wrong one.
(When I set logging to DEBUG I see that SEAM is configuring component x1 in both cases though!)
Two things I recognize here that could be problems:
* I'm using SLSB with ScopeType.STATELESS
* I'm not explicitly setting the conversationContextId before doing a remoting call
Please tell me what I'm doing wrong.
I'm currently using 2.0.0.CR2 and JBoss 4.2.2
Thank you,
Thomas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101530#4101530
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101530
18 years, 5 months