Resultó que me faltaban algunas dependencias de JSF: jsf-api.jar
y jsf-impl.jar
. Posteriormente, tomó los proporcionados por mi contenedor (WebSphere), que eran de la versión incorrecta, de ahí que no funcionara. Una vez que aplicar estos frascos de dependencia y de la versión correcta, ¡todo fue bueno!
No se puede crear el componente de costura, el alcance de la página no está activo; selectbooleancheckbox
Pregunta
Seam 2.2.2, JSF 1.2. Suena tan simple: un dataTable
donde cada fila tiene una casilla de verificación que quiero observar cuando se llama a algún botón. Tengo un controlador:
@Name("MyController")
@Scope(ScopeType.PAGE)
public class MyController {
private List<MyItem> myItems;
public MyItem[] getItemsList(boolean excluded) {
return myItems;
}
Tengo MyItem
escribe:
public class MyItem {
private boolean selected = false;
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
System.out.println("setting to " + selected);
this.selected = selected;
}
... other things ...
}
Este es mi xhtml:
<a:form id="formExcludedList">
<rich:dataTable id="excludeList"
value="#{MyController.getItemsList(true)}" var="o">
<rich:column>
<h:selectBooleanCheckbox id="selectComponent"
value="#{o.selected}" />
</rich:column>
Al hacer clic en la casilla de verificación MyItem.setSelected
no se ejecuta. Sin embargo, estoy obteniendo un registro funky: (arreglado por brevedad)
DEBUG createHotDeployment - Using Java hot deploy
DEBUG beginRequest - >>> Begin JSF request for <my page>
DEBUG begin - beginning transaction prior to phase: RESTORE_VIEW(1)
DEBUG begin - beginning JTA transaction
WARN getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
WARN getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
WARN getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
WARN getInstance - Cannot create Seam component, scope is not active: MyController(PAGE)
DEBUG restoreAndLockConversation - No stored conversation
DEBUG commitOrRollback - committing transaction after phase: INVOKE_APPLICATION(5)
DEBUG commit - committing JTA transaction
DEBUG begin - beginning transaction prior to phase: RENDER_RESPONSE(6)
DEBUG begin - beginning JTA transaction
DEBUG commitOrRollback - committing transaction after phase: RENDER_RESPONSE(6)
DEBUG commit - committing JTA transaction
DEBUG endRequest - Discarding conversation state: 7
DEBUG endRequest - After render response, destroying contexts
DEBUG flushAndDestroyContexts - ... et cetera
DEBUG destroy - destroying: ...
DEBUG destroy - destroying: ... et cetera
DEBUG endRequest - <<< End JSF request for <my page>
¡Tu ayuda muy apreciada!
Solución
Otros consejos
JBoss también puede lanzar este error si no puede encontrar seam.properties
en tu aplicación src/conf
directorio. El archivo puede estar vacío, pero debe estar allí para que el alcance esté activo.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow