[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: cvieira  XML
Profile for cvieira -> Messages posted by cvieira [59] Go to Page: Previous  1, 2, 3, 4 Next 
Author Message
Well, i didn't knew the existence of those log files... but that was the key to solve the problem

For some reason, all the metadata related to database model, connection, etc... became corrupted somehow (i think it was courtesy of netbeans

I've recovered those files from repository and made the necessary updates, and now the application works fine again... ufff

Many thanks for your help leading me to the right point of investigation ;)

Regards,
Unfortunately the problem still exists... i even downgraded CC version, and now it does not work on older version either...

A simple use of a bean does not work... for example, i'm getting a boolean from a dispatcher method to set it on "rendered" on a component. The component is always rendered no matter i return true or false on dispatcher method...

It's possible that some important file is corrupted and it's causing this strange behavior? Maybe i should create a new project from scratch?

Thanks for your help,

Carlos V.
HI Bjorn,

I'm using it in my project, because of this line of code:

Code:
 HttpSessionAccess.getCurrentResponse().sendError(403);
 


I have it a long time time in the project and never got any problems.

Anyway, i took it off, and the error is gone, but my application seems to not be working at all, and i did not made any changes to it.

For example, using an actionListener, where i open a popup... simply nothing happens, even if i thrown an exception, nothing appear in console window.

Any ideas of what could happened wrong on the project update? On the toolset all seems fine... i see all teh managed server beans, etc...

Regards,
Carlos V.
Hi, after installing latest release, i'm getting this error, which does not allow the application to run Ok (basically nothing on application works)... anyone is experiencing the same?

Code:
 19/Jan/2012 13:11:19 org.apache.catalina.loader.WebappClassLoader validateJarFile
 INFO: validateJarFile(D:\EnterpriseClient\server\tomcat\webapps\Prescryb\WEB-INF
 \lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Off
 ending class: javax/servlet/Servlet.class
 


I've tried to delete "D:\EnterpriseClient\server\tomcat\webapps\Prescryb\WEB-INF
\lib\servlet-api.jar", and use the one provided by tomcat on lib folder. When application is started, the error is gone but... the application still does not work... no request are done to the server and therefore i can't get any replies to the client...

I've made a normal installation of CaptainCasa, and then created the project using the CC Toolset, and made the updates normally.

Thanks!

Regards,
Thanks Bjorn!

Regards,
Hi Bjorn, i'm not trying to rush you on this fix but can you lead me to some workaround, if possible, of course, until is fixed?

It is the 2nd issue mentioned on this thread... the 1st issue i already saw that it was included on latest release (20120116).

Thanks again!

Regards,
Hi Bjorn, autocomplete field is working great now Thanks! May i assume that it will be part of the next release?

Regarding the other issue i mentioned, should i do the invalidateSession in some other way that works on both normal and embedded mode, or it may be a bug also?

Regards,
Hi Bjorn, Thanks for fast response!

Unfortunately, it still does not work with the new eclnt.jar. Can you check?

Also, can you check this other issue on embedded mode... when using:

Code:
 FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
 


I get these errors:

Code:
 Error occurred within the client processing.
 
 Please view the stack trace below and the client log for more information.
 
 
 java.lang.RuntimeException: org.xml.sax.SAXParseException: End of entity not allowed; an end tag is missing.
 	at org.eclnt.client.elements.PageParserUpdate.applyXML(PageParserUpdate.java:183)
 	at org.eclnt.client.page.Page.processUpdateResponse(Page.java:1194)
 	at org.eclnt.client.page.Page.access$2(Page.java:1169)
 	at org.eclnt.client.page.Page$MyUpdateDataTransferListener.dataTransferEnded(Page.java:158)
 	at org.eclnt.client.comm.http.DataTransfer.transferXMLFinished(DataTransfer.java:1006)
 	at org.eclnt.client.comm.http.DataTransfer.communicateToServerSynchronous(DataTransfer.java:226)
 	at org.eclnt.client.page.Page.transferDataRun(Page.java:1040)
 	at org.eclnt.client.page.Page$DataTransferRunner.run(Page.java:118)
 	at org.eclnt.client.page.Page.callServerRun(Page.java:1010)
 	at org.eclnt.client.page.Page$CallServerRunner.run(Page.java:78)
 	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
 	at java.awt.EventQueue.access$000(Unknown Source)
 	at java.awt.EventQueue$1.run(Unknown Source)
 	at java.awt.EventQueue$1.run(Unknown Source)
 	at java.security.AccessController.doPrivileged(Native Method)
 	at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
 	at java.awt.EventQueue.dispatchEvent(Unknown Source)
 	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
 	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 	at java.awt.EventDispatchThread.run(Unknown Source)
 Caused by: org.xml.sax.SAXParseException: End of entity not allowed; an end tag is missing.
 	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
 	at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3170)
 	at org.apache.crimson.parser.Parser2.content(Parser2.java:1837)
 	at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
 	at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
 	at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
 	at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
 	at javax.xml.parsers.SAXParser.parse(Unknown Source)
 	at org.eclnt.client.elements.PageParserUpdate.applyXML(PageParserUpdate.java:176)
 	... 23 more
 


Thank You!

Regards,
Hi, i'm using autocomplete component in several forms, and it works so much fine using on normal mode.

I need to get an embedded mode of the application, and got it working fine (i followed CC documentation on this issue). The only problem is that all fields of type autocomplete, doesn't work at all (it seems that getProposals(...) method of my class extended from DefaultAutoComplete2Provider is not even called...).

Can someone help me understanding what may be happening?

Also, on embedded mode, where can i find logs file? Maybe i can find some answer there (some error being thrown, etc...).

Thanks in advance!

Regards,
Hi Markus, "Inter Workpage Eventing" is a great mechanism for this - works great! Many thanks for pointing me to the right direction

Regards,
Hi Markus, yes i'm using the workplace... i've seen documentation on "Inter Workpage Eventing" and it sounds like perfect i will give it a try!

Thanks,
Hi, i have a base class that i'm using for all my forms... each component on the forms are connected to a adapterbinding field.

I've been using the following code with success for several components, like tfield, textarea, calendarfield... i'm trying to use it for working with autocomplete field, with both value and valueid properties. But for some reason, i can't get the values for that type of field. No matter i choose one item from the popup list, or just type some text on it, i always get null value...

Any suggestion of what could the problem be? Here is all the code (java classes and form JSP):

Thanks in advance!


DefaultFormAdapterBinding
Code:
 /*
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
 package net.tinylabs.prescryb.elements.adapterbinding;
 
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.logging.Logger;
 import java.util.regex.Pattern;
 import javax.faces.event.ActionEvent;
 import net.tinylabs.prescryb.mbeans.Dispatcher;
 import net.tinylabs.prescryb.util.Regex;
 import org.eclnt.jsfserver.elements.adapter.IComponentAdapterBinding;
 import org.eclnt.jsfserver.elements.events.BaseActionEventValueHelp;
 import org.eclnt.workplace.IWorkpageDispatcher;
 import org.eclnt.workplace.WorkpageDispatchedBean;
 
 /**
  *
  * @author Carlos Vieira (carlos.vieira at gmail.com)
  */
 public class DefaultFormAdapterBinding extends WorkpageDispatchedBean implements Serializable {
 
     static final Logger logger = Logger.getLogger(DefaultFormAdapterBinding.class.getName());
     // ------------------------------------------------------------------------
     // inner classes
     // ------------------------------------------------------------------------
     static Set<String> FIELDFIXATTRIBUTES = new HashSet<String>();
     static Set<String> FIELDDYNATTRIBUTES = new HashSet<String>();
 
     static {
         FIELDDYNATTRIBUTES.add("text");
         FIELDDYNATTRIBUTES.add("bgpaint");
         FIELDDYNATTRIBUTES.add("enabled");
         FIELDDYNATTRIBUTES.add("requestfocus");
         FIELDDYNATTRIBUTES.add("regex");
         FIELDDYNATTRIBUTES.add("value");
         //FIELDDYNATTRIBUTES.add("valueid");
     }
 
     /**
      * Adapter binding that is behind one form field.
      */
     public class FIELDAdapterBinding implements IComponentAdapterBinding {
 
         public String m_text;
         public String m_value;
         public String m_valueid;
         public String m_propertyName;
         public boolean m_enabled = true;
         long m_requestfocus = -1;
         public boolean m_hasError = false;
         public boolean m_isMandatory = false;
         public String m_regex;
 
         public FIELDAdapterBinding(boolean isMandatory, String propertyName, String regex) {
             m_isMandatory = isMandatory;
             m_propertyName = propertyName;
             m_regex = regex;
         }
         
         @Override
         public Class getAttibuteType(String attributeName) {
             return String.class;
         }
 
         @Override
         public Object getAttributeValue(String attributeName) {
             if ("text".equals(attributeName)) {
                 return m_text;
             }
             if ("value".equals(attributeName)) {
                 return m_value;
             }
             if ("valueid".equals(attributeName)) {
                 return m_valueid;
             }
             if ("bgpaint".equals(attributeName)) {
                 return getBgpaint();
             }
             if ("enabled".equals(attributeName)) {
                 return m_enabled;
             }
             if ("requestfocus".equals(attributeName)) {
                 return m_requestfocus;
             }
             if ("regex".equals(attributeName)) {
                 return m_regex;
             }
             throw new Error("Should never happen!");
         }
 
         @Override
         public Set<String> getDynamicAttributeNames() {
             return FIELDDYNATTRIBUTES;
         }
 
         @Override
         public Set<String> getFixAttributeNames() {
             return FIELDFIXATTRIBUTES;
         }
 
         @Override
         public void onAction(ActionEvent event) {
             if (event instanceof BaseActionEventValueHelp) {
                 openValidValueHelp(this);
             }
         }
 
         @Override
         public void setAttributeValue(String attributeName, Object value) {
             if ("text".equals(attributeName)) {
                 m_text = (String) value;
             }
             if ("value".equals(attributeName)) {
                 m_value = (String) value;
             }
             if ("valueid".equals(attributeName)) {
                 m_valueid = (String) value;
             }
         }
 
         private String getBgpaint() {
             if (m_hasError == true) {
                 return "error()";
             }
             if (m_isMandatory == true) {
                 return "mandatory()";
             }
             return null;
         }
 
     }
     // ------------------------------------------------------------------------
     // members
     // ------------------------------------------------------------------------
     Map<String, FIELDAdapterBinding> m_fields = new HashMap<String, FIELDAdapterBinding>();
 
     // ------------------------------------------------------------------------
     // constructors
     // ------------------------------------------------------------------------
     public DefaultFormAdapterBinding(IWorkpageDispatcher dispatcher) {
         super(dispatcher);
     }
 
     // ------------------------------------------------------------------------
     // public usage
     // ------------------------------------------------------------------------
     public Map<String, FIELDAdapterBinding> getFields() {
         return m_fields;
     }
 
     // ------------------------------------------------------------------------
     // private usage
     // ------------------------------------------------------------------------
     public void registerField(String propertyName, boolean isMandatory, String regex) {
         m_fields.put(propertyName, new FIELDAdapterBinding(isMandatory, propertyName, regex));
     }
 
     public boolean isGenericFieldValidationError(Dispatcher dispatcher) {
         boolean foundError = false;
         
         // reset error information
         for (FIELDAdapterBinding field : getFields().values()) {
             field.m_hasError = false;
         }
                
         // check for mandatory and regex
         for (FIELDAdapterBinding field : getFields().values()) {
             logger.info("FIELD = " + field.m_propertyName);
             logger.info("m_value = " + field.m_value + " | " + "m_valueid = " + field.m_valueid + " | m_text = " + field.m_text);
             if (field.m_isMandatory == true && (field.m_text == null || field.m_text.length() == 0) && (field.m_value == null || field.m_value.length() == 0) && (field.m_valueid == null || field.m_valueid.length() == 0)) {
                 foundError = true;
                 dispatcher.getStatusbar().writeAlert("Mandatory input field " + field.m_propertyName + " is missing");
             }
             
             if (field.m_regex != null && field.m_regex.length() > 0){                
                 if (!Regex.matches(field.m_regex, field.m_text, Pattern.CASE_INSENSITIVE)){
                     foundError = true;
                     dispatcher.getStatusbar().writeAlert("Field " + field.m_propertyName + " has not a valid value");
                 }
             }
         }
         
         return foundError;
     }
 
     public void openValidValueHelp(final FIELDAdapterBinding field) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 }
 



DrugBrandFormAdapterBinding
Code:
 /*
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
 package net.tinylabs.prescryb.workplace.settings;
 
 import net.tinylabs.prescryb.workplace.profile.*;
 import java.io.Serializable;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.faces.event.ActionEvent;
 import javax.persistence.Persistence;
 import net.tinylabs.prescryb.db.dao.DrugbrandDAO;
 import net.tinylabs.prescryb.db.dao.DruggenericDAO;
 import net.tinylabs.prescryb.db.entity.Drugbrand;
 import net.tinylabs.prescryb.db.jpa.exceptions.IllegalOrphanException;
 import net.tinylabs.prescryb.db.jpa.exceptions.NonexistentEntityException;
 import net.tinylabs.prescryb.elements.adapterbinding.DefaultFormAdapterBinding;
 import net.tinylabs.prescryb.mbeans.Dispatcher;
 import org.eclnt.jsfserver.defaultscreens.ModalPopup;
 import org.eclnt.jsfserver.elements.util.DefaultModalPopupListener;
 import org.eclnt.workplace.IWorkpageDispatcher;
 
 /**
  *
  * @author Carlos Vieira (carlos.vieira at gmail.com)
  */
 public class DrugBrandFormAdapterBinding extends DefaultFormAdapterBinding implements Serializable {
 
     private Dispatcher m_dispatcher;
     private DrugbrandDAO drugbrandDAO = new DrugbrandDAO(Persistence.createEntityManagerFactory("PrescrybPU"));
     private DruggenericDAO druggenericDAO = new DruggenericDAO(Persistence.createEntityManagerFactory("PrescrybPU"));
     private Drugbrand m_drug = null;
     private FIELDAdapterBinding m_drugname;
     private FIELDAdapterBinding m_drugdesc;
     private FIELDAdapterBinding m_drugnote;
     private FIELDAdapterBinding m_druggeneric;
     static final Logger logger = Logger.getLogger(DrugBrandFormAdapterBinding.class.getName());
     ISimpleDAOEvent m_callback;
 
     public void prepare(Drugbrand drug, ISimpleDAOEvent callback) {
         m_drug = drug;
         m_callback = callback;
 
         if (m_drug != null) {
             logger.log(Level.INFO, "Drug toString() = {0}", drug.toString());
 
             m_drugname.m_text = m_drug.getBrandName();
             m_drugdesc.m_text = m_drug.getBrandDesc();
             m_drugdesc.m_text = m_drug.getBrandNote();
             m_druggeneric.m_valueid = m_drug.getDrugGenericUUID().getUuid();
             m_druggeneric.m_value = m_drug.getDrugGenericUUID().getGenericName();
         } else {
             emptyFields();
         }
     }
 
     public DrugBrandFormAdapterBinding(IWorkpageDispatcher dispatcher) {
         super(dispatcher);
         m_dispatcher = (Dispatcher) dispatcher;
 
         registerField("drugName", true, null);
         registerField("drugDesc", true, null);
         registerField("drugNote", false, null);
         registerField("drugGeneric", true, null);
 
         m_drugname = getFields().get("drugName");
         m_drugdesc = getFields().get("drugDesc");
         m_drugnote = getFields().get("drugNote");
         m_druggeneric = getFields().get("drugGeneric");
     }
 
     public Drugbrand getDrugBrand() {
         return m_drug;
     }
 
     public void onSubmit(ActionEvent ae) {
         
         boolean foundError = true;
         //m_dispatcher.getStatusbar().writeAlert("Mandatory input field " + field.m_propertyName + " is missing");
         
         if (!isGenericFieldValidationError(m_dispatcher)) {
             try {
                 if (m_drug == null) {
                     m_drug = new Drugbrand();
                     m_drug.setBrandName(m_drugname.m_text);
                     m_drug.setBrandDesc(m_drugdesc.m_text);
                     m_drug.setBrandNote(m_drugnote.m_text);
                     m_drug.setDrugGenericUUID(druggenericDAO.findDruggeneric(m_druggeneric.m_valueid));
 
                     drugbrandDAO.create(m_drug);
                     m_dispatcher.getStatusbar().writeSuccessWithPopup("Drug was created with success");
 
                     m_drug = null;
                     emptyFields();
 
                     m_callback.entityCreated(m_drug);
                 } else {
                     m_drug.setBrandName(m_drugname.m_text);
                     m_drug.setBrandDesc(m_drugdesc.m_text);
                     m_drug.setBrandNote(m_drugnote.m_text);
                     m_drug.setDrugGenericUUID(druggenericDAO.findDruggeneric(m_druggeneric.m_valueid));
 
                     drugbrandDAO.edit(m_drug);
 
                     m_callback.entityUpdated(m_drug);
                     m_dispatcher.getStatusbar().writeSuccessWithPopup("Drug was edited with success");
                 }
             } catch (IllegalOrphanException ex) {
                 m_dispatcher.getStatusbar().writeAlert("IllegalOrphanException. Contact support!");
                 Logger.getLogger(ChangePasswordFormAdapterBinding.class.getName()).log(Level.SEVERE, null, ex);
             } catch (NonexistentEntityException ex) {
                 m_dispatcher.getStatusbar().writeAlert("NonexistentEntityException. Contact support!");
                 Logger.getLogger(ChangePasswordFormAdapterBinding.class.getName()).log(Level.SEVERE, null, ex);
             } catch (Exception ex) {
                 m_dispatcher.getStatusbar().writeAlert("Unknown error. Contact support!");
                 Logger.getLogger(ChangePasswordFormAdapterBinding.class.getName()).log(Level.SEVERE, null, ex);
             }
         }
     }
 
     public void onCreateDrugGeneric(ActionEvent ae) {
 
         final ModalPopup dlg = getOwningDispatcher().createModalPopup();
         DrugGenericFormAdapterBinding popupBean = m_dispatcher.getDrugGenericFormAdapterBinding();
         popupBean.prepare(null, new ISimpleDAOEvent() {
 
             @Override
             public void entityCreated(Object obj) {
                 dlg.close();
             }
 
             @Override
             public void entityUpdated(Object obj) {
                 return;
             }
         });
 
 
         ModalPopup.IModalPopupListener mpl = new DefaultModalPopupListener(dlg) {
 
             @Override
             public void reactOnPopupClosedByUser() {
                 dlg.close();
             }
         };
         
         dlg.open("/settings/druggenericfrm.jsp", "Create Drug Generic", 500, 225, mpl);
     }
 
     private void emptyFields() {
         m_drugname.m_text = "";
         m_drugdesc.m_text = "";
         m_drugnote.m_text = "";
         m_druggeneric.m_value = null;
         m_druggeneric.m_valueid = null;
     }
 }
 



DrugGenericAutoCompleteProvider
Code:
 /*
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
 package net.tinylabs.prescryb.workplace;
 
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 import javax.faces.event.ActionEvent;
 import javax.persistence.Persistence;
 import net.tinylabs.prescryb.db.dao.DruggenericDAO;
 import net.tinylabs.prescryb.db.entity.Druggeneric;
 import org.eclnt.jsfserver.defaultscreens.Statusbar;
 import org.eclnt.jsfserver.util.AutoCompleteMgr;
 import org.eclnt.jsfserver.util.DefaultAutoComplete2Provider;
 import org.eclnt.workplace.IWorkpageDispatcher;
 import org.eclnt.workplace.WorkpageDefaultLifecycleListener;
 import org.eclnt.workplace.WorkpageDispatchedBean;
 
 /**
  *
  * @author Carlos Vieira (carlos.vieira at gmail.com)
  */
 public class DrugGenericAutoCompleteProvider extends WorkpageDispatchedBean implements Serializable {
     // ------------------------------------------------------------------------
     // inner classes
     // ------------------------------------------------------------------------
 
     class AutoCompleteProvider extends DefaultAutoComplete2Provider {
 
         @Override
         public List<AutoCompleteItem> getProposals(String value) {
 
             List<Druggeneric> drugs = druggenericDAO.findDruggenericEntities();
             List<AutoCompleteItem> result = new ArrayList<AutoCompleteItem>();
 
             if (value.length() < 3 && !drugs.isEmpty()) {
                 result.add(new AutoCompleteItem("Input at least 3 characters", "", ""));
                 return result;
             }
             
             if (drugs.isEmpty()) {
                 result.add(new AutoCompleteItem("No information found", "", ""));
                 return result;
             }
 
             for (Druggeneric drug : drugs) {
                 result.add(new AutoCompleteItem(drug.getGenericName(), drug.getUuid(), drug.getGenericDesc()));
             }
 
             return result;
         }
     }
     // ------------------------------------------------------------------------
     // members
     // ------------------------------------------------------------------------
     AutoCompleteProvider m_acp;
     protected String m_value;
     protected String m_valueId;
     private DruggenericDAO druggenericDAO = new DruggenericDAO(Persistence.createEntityManagerFactory("PrescrybPU"));
 
     // ------------------------------------------------------------------------
     // constructors
     // ------------------------------------------------------------------------
     public DrugGenericAutoCompleteProvider(IWorkpageDispatcher dispatcher) {
         super(dispatcher);
         m_acp = new AutoCompleteProvider();
         AutoCompleteMgr.add(m_acp);
         getWorkpage().addLifecycleListener(new WorkpageDefaultLifecycleListener() {
 
             @Override
             public void reactOnDestroyed() {
                 super.reactOnDestroyed();
                 AutoCompleteMgr.remove(m_acp);
             }
         });
     }
 
     // ------------------------------------------------------------------------
     // public usage
     // ------------------------------------------------------------------------
     public String getValueURL() {
         return m_acp.getURL();
     }
 
     public String getValue() {
         return m_value;
     }
 
     public void setValue(String value) {
         m_value = value;
     }
 
     public String getValueId() {
         return m_valueId;
     }
 
     public void setValueId(String value) {
         m_valueId = value;
     }
 
     public void onValueFlush(ActionEvent event) {
         Statusbar.outputMessage("Passed value: " + m_value + " / Id: " + m_valueId);
     }
     // ------------------------------------------------------------------------
     // private usage
     // ------------------------------------------------------------------------
 }
 


Form JSP code
Code:
 
 <%@page contentType="text/html"%>
 <%@page pageEncoding="UTF-8"%>
 
 <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
 <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
 
 <%@taglib prefix="t" uri="/WEB-INF/eclnt"%>
 
 
 <!-- ========== CONTENT BEGIN ========== -->
 <f:view>
 <h:form>
 <f:subview id="settings_drugbrandfrmg_sv">
 <t:rowbodypane id="g_1" padding="20" rowdistance="5" >
 <t:row id="g_2" />
 <t:row id="g_3" >
 <t:label id="g_4" text="Name" width="125" />
 <t:field id="g_5" adapterbinding="#{d.drugBrandFormAdapterBinding.fields.drugName}" maxlength="100" width="200" />
 </t:row>
 <t:rowdistance id="g_6" />
 <t:row id="g_7" >
 <t:label id="g_8" text="Description" width="125" />
 <t:textarea id="g_9" adapterbinding="#{d.drugBrandFormAdapterBinding.fields.drugDesc}" height="50" maxlength="200" width="200" />
 </t:row>
 <t:rowdistance id="g_10" />
 <t:row id="g_11" >
 <t:label id="g_12" text="Notes" width="125" />
 <t:textarea id="g_13" adapterbinding="#{d.drugBrandFormAdapterBinding.fields.drugNote}" height="50" maxlength="200" width="200" />
 </t:row>
 <t:rowdistance id="g_14" />
 <t:row id="g_15" >
 <t:label id="g_16" text="Drug Generic" width="125" />
 <t:autocomplete id="g_17" adapterbinding="#{d.drugBrandFormAdapterBinding.fields.drugGeneric}" autocompletetimer="250" drawoddevenrows="true" flush="true" popupwidth="100%" userhint="Type the name of drug generic, and then select one from the list (Note: matching drugs generic are listed as you type)" value="#{d.drugGenericAutoCompleteProvider.value}" valueid="#{d.drugGenericAutoCompleteProvider.valueId}" valuesurl="#{d.drugGenericAutoCompleteProvider.valueURL}" width="200" withvaluecomment="true" />
 <t:icon id="g_18" actionListener="#{d.drugBrandFormAdapterBinding.onCreateDrugGeneric}" image="/images/icons/add.png" tooltip="Create Drug Generic" />
 </t:row>
 <t:rowdistance id="g_19" />
 <t:row id="g_20" >
 <t:coldistance id="g_21" width="215" />
 <t:button id="g_22" actionListener="#{d.drugBrandFormAdapterBinding.onSubmit}" text="Submit Drug" width="110" />
 </t:row>
 </t:rowbodypane>
 <t:pageaddons id="g_pa"/>
 </f:subview>
 </h:form>
 </f:view>
 <!-- ========== CONTENT END ========== -->
 
Hi, maybe you can help me with this issue on grid load on demand... i have this:

Code:
     public class Grid extends FIXGRIDListBinding<GridItem> {
         
         @Override
         public void renderingBegins() {
             super.renderingBegins();
             // ensure that always sbvalue+2*sbvisibleamount items are loaded
             int loadToIndex = getSbvalue() + 2 * getSbvisibleamount();
 
             List<Druggeneric> drugs = druggenericDAO.findDruggenericEntities(loadToIndex, getItems().size());
             logger.log(Level.INFO, "Loaded {0} results", drugs.size());
             for (Druggeneric drug : drugs) {
                 getItems().add(new GridItem(drug, this));
             }
         }
     }
 


It works fine for when do the scrolling, by getting from DB, just the next pack of needed rows, etc...... the problem is when i insert a new object... when i insert a new object (Druggeneric) on database, renderingBegins does not act like i would like... if the new item is in the last row, then grid is updated fine... but if it's returned to be on the middle of the grid, then a new row is inserted, but the object is a reference to the last row object... if i reload from database grid is updated fine, of course.

On the workpagedispatchedbean class, i have a method where i create the object and persist on database... after that, i do a reload of all grid, and that's fine... but, when i create an object within another workpagedispatchedbean, how can i make such reload, on all grids that list that kind of object?

I thinked on overriging listItemWasAdded method on the Grid class, but the problem is that this method is also triggered when i add an object on the renderingBegins method...

Any ideas?

Thanks,
Hi Bjorn, that was the perfect solution, thanks

Also, can you clarify to me if there is the possibility to set the initial scroll position? For example, if we have 24h schedule, i would like to initial scroll to be in 07h position, instead of 0h. Is this natively possible?

Thanks + Regards,
Hi, i'm implementing a schedule grid (based on CC Demo DemoScheduleGrid class). It works Ok, but i'm having difficulty on setting correctly the horizontal scrollbar.

Schedule component has several blocks, but i wish to show just some of them, and the rest i would like to see just by using scroll...

I am able to set the horizontal scrollbar. It is visible but no scroll possible because all blocks are present within the width of the grid. No matter i have 16 or 100 blocks, they all appear within the grid width, and no use of horizontal scrollbar is possible.

How can this be correctly setup?

Thanks in advance!
 
Profile for cvieira -> Messages posted by cvieira [59] Go to Page: Previous  1, 2, 3, 4 Next 
Go to:   
Powered by JForum 2.1.6 © JForum Team