[JBoss Seam] - Re: document.getElementById() problem with JSF/Seam
by asookazian
thx for the reply. It seems you're right based on the view source (HTML rendered) in IE:
<input id="mainForm:hotels:3:hideme1" type="hidden" name="mainForm:hotels:3:hideme1" /><span id="mainForm:hotels:3:bigout">bigout</span>
I don't know why the hidden field's value ("hideme") is not showing above. val1 is blank and val2 is undefined in the javascript function when I run the app. I modified the main.xhtml from the seam booking example as a test below:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:a="http://richfaces.org/a4j"
| xmlns:ft="http://sourceforge.net/projects/facestrace"
| template="template.xhtml">
|
| <!-- content -->
| <ui:define name="content">
|
| <script type="text/javascript">
|
| function getInputHidden(obj, id, rowIndex) {
| alert('id = ' + id);
| alert('rowIndex = ' + rowIndex);
| val1 = document.getElementById("mainForm:hotels:1:hideme1");
| alert('val1 = ' + val1.value);
| val2 = document.getElementById("mainForm:hotels:1:bigout");
| alert('val2 = ' + val2.value);
| }
|
| </script>
|
| <span class="errors">
| <h:messages globalOnly="true"/>
| </span>
|
|
|
| <h:form id="mainForm">
| <h:outputText value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
| <h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
|
| <h:column>
| <f:facet name="header">Name</f:facet>
| #{hot.name}
| <h:inputHidden id="hideme1" value="hideme"/>
| <h:outputText id="bigout" value="bigout"/>
| </h:column>
| <h:column>
| <f:facet name="header">Address</f:facet>
| #{hot.address}
| </h:column>
| <h:column>
| <f:facet name="header">City, State</f:facet>
| #{hot.city}, #{hot.state}, #{hot.country}
| </h:column>
| <h:column>
| <f:facet name="header">Zip</f:facet>
| #{hot.zip}
| </h:column>
| <h:column>
| <f:facet name="header">Action</f:facet>
| <s:link id="viewHotel" value="View Hotel" onclick="getInputHidden(this, 'hideme1', #{hotels.getRowIndex()})" action="#{hotelBooking.selectHotel(hot)}"/>
| </h:column>
| </h:dataTable>
| <s:link value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
| </h:form>
|
| </ui:define>
|
| </ui:composition>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097112#4097112
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097112
18Â years, 9Â months
[EJB 3.0] - MDB MessageType problems
by viniciuscarvalho
Hello there! I'm running JBoss 4.2.1 and I have this class inheritance:
| public abstract class AbstractMDB implements MessageListener{
| @EJB
| private bizRef;
|
| public abstract void operateMessage(Element message);
|
| public void onMessage(Message message){
| bizRef.someMethod();
| //create the element
| operateMessage(element);
| }
|
| }
| @MessageDriven( activationConfig={
| @ActivationConfigProperty(propertyName="destinationType",propertyValue="javax.jms.Queue"),
| @ActivationConfigProperty(propertyName="destination", propertyValue="queue/QueueA"),
| @ActivationConfigProperty(propertyName="messagingType", propertyValue="javax.jms.MessageListener")
|
| })
| public class ConcreteMDB1 extends AbstractMDB{
| public void operateMessage(Element message){
|
| }
| }
|
Problem is that this code does not deploy :(
It throws a "unable to determine messagingType interface for MDB"
Is there a way to have an MDB that does not directly implements the MessageListener Interface? Could it be done according to the spec?
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097111#4097111
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097111
18Â years, 9Â months
[Beginners Corner] - Re: EJB3 Initialization Parameter
by pdgillen
-------- in ejb-jar.xml -------------------------------------
-------- inside the tag defining the EJB -------------
<env-entry>
<env-entry-name>SECURITY_PRINCIPAL</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>foo</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>SECURITY_CREDENTIALS</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>bar</env-entry-value>
</env-entry>
-------- inside my EJB -------------------------
@Resource
(
name="SECURITY_PRINCIPAL",
type=java.lang.String.class,
shareable=true
)
String secPrincipal;
@Resource
(
name="SECURITY_CREDENTIALS",
type=java.lang.String.class,
shareable=true
)
String secCredentials;
private InitialContext secureCtx = null;
---- then the method --------
private void getSecurityContext()
throws Exception
{
Properties sctxProps = new Properties();
sctxProps.setProperty(InitialContext.SECURITY_PRINCIPAL, secPrincipal);
sctxProps.setProperty(InitialContext.SECURITY_CREDENTIALS, secCredentials);
sctxProps.setProperty(InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jboss.security.jndi.JndiLoginInitialContextFactory");
secureCtx = new InitialContext(sctxProps);
}
--- and then inside the other method
try
{
getSecurityContext();
Object fbObj = secureCtx.lookup("foo/bar/Manager");
tem = (FooBar) PortableRemoteObject.narrow(fbObj,
FooBar.class);
}
catch(Exception e)
{
e.printStackTrace();
throw new RemoteException(""+e);
}
------------------
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097109#4097109
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097109
18Â years, 9Â months