Binding Question

Ok, I'm slowly, slowly starting to get my tiny little brain around the binding API.
I've worked out the following bit of code to 'or' together a bunch of boolean values:
BooleanProperty parent = new SimpleBooleanProperty();
BooleanProperty child1 = new SimpleBooleanProperty();
BooleanProperty child2 = new SimpleBooleanProperty();
BooleanProperty child3 = new SimpleBooleanProperty();
parent.bind(child1.or(child2).or(child3));
System.out.println(String.format("0) Parent=%s (child1=%s, child2=%s, child3=%s)",
        parent.get(), child1.get(), child2.get(), child3.get()));
child1.set(true);
System.out.println(String.format("0) Parent=%s (child1=%s, child2=%s, child3=%s)",
        parent.get(), child1.get(), child2.get(), child3.get()));Seems obvious now but originally I spent a lot of time working out why this wouldn't work (I guess I was thinking that since the '.bind' method was like an 'equals', the '.or' method was similar):
// don't do this at home
parent.or(child1);
parent.or(child2);
parent.or(child3);My problem now is that I don't know my variables up front. Imagine I've got a class that gets boolean values passed to it to bind to, how do I progressively bind to it in a nice way? Do I need to keep track of the BooleanBinding instance and add to this?
The best I've come up with for doing this is the following, but this seems horribly complex for what I want to do and I reckon (hoping) I'm missing something. Can anyone streamline the following at all?
public class MyClass
    private BooleanProperty parent;
    private BooleanProperty first;
    private BooleanBinding binding;
    public MyClass()
        parent = new SimpleBooleanProperty();
    public void trackThisGuy(BooleanProperty child)
        if (first == null)
            // first guy we have to bind directly
            parent.bind(child);
            first = child;
        else if (booleanBinding == null)
            // second guy we have to create our binding with the first guy
            booleanBinding = first.or( child );
            parent.bind(booleanBinding);     
        else
            // everyone else we add to our binding and rebind
            booleanBinding = booleanBinding.or(child);
            parent.bind(booleanBinding);
}I feel like I should be able to replace that whole mess of if-else statements with a single line of something like parent.or(child) but, as we found out above, that doesn't work.
Currently I'm just holding onto the BooleanProperty's passed in and then recreating the whole binding each time but this is not nice either.
Cheers for the help,
zonski

Hi Michael,
I have a few scenarios where I have hit this issue.
One example is the 'glasspane' example I have mentioned in a few posts earlier. In this, I have a top-level StackPane with a 'glasspane' in it that blocks the dialog (by preventing input and showing a loading cursor) whenever one of the child controllers is 'busy' (i.e. it is running a background thread).
The child controllers get added and removed dynamically on a regular basis. So I'd like to be able to have a method to do something like:
public void registerBusyWorker(BusyWorker child)
    glassPane.visibileProperty().orWithCurrentBinding(child.busyPoperty());
public void removeBusyWorker(BusyWorker child)
    glassPane.visibileProperty().removeFromCurrentBinding(child.busyPoperty());
} I've just used those method names to be explicit about what I am trying to do, I'm not suggesting they would be good names.
Of course I could implement this with the low level API and I could do it the old fashion way and roll my own event handlers, etc. I was just expecting the high level binding to give me something nice in this space. It could be that my case falls outside the 80-20 rule and it may not be worth catering for, but I've certainly hit it. Maybe my expectations of the API have been influenced by the Hibernate Criteria API too (http://docs.jboss.org/hibernate/core/3.3/reference/en/html/querycriteria.html) which has similar Java based 'expressions' but a totally different way of doing it.
If I implemented it using the low-level binding API I believe it would look like this:
private List<BusyWorker> busyWorkers = new ArrayList<BusyWorker>();
public void registerBusyWorker(BusyWorker child)
    busyWorkers.add(child);
    child.busyProperty().addListener(this);
    updateState();
public void removeBusyWorker(BusyWorker child)
    busyWorkers.remove(child);
    child.busyProperty().removeListener(this);
    updateState();
public void changed(ObservableValue<? extends Boolean> source, Boolean oldValue, Boolean newValue)
    updateState();
protected void updateState()
    for (BusyWorker : busyWorkers)
        if (busyWorker.isBusy())
            glassPane.setVisible(true);
            return;
    glassPane.setVisible(false);
}

Similar Messages

  • WSIF Binding Question

    I have a question about the capabilities of WSIF Bindings.
    In our current environment we have several session beans that we want to invoke from a BPEL process. We would like to invoke the session bean using a local interface and not the remotee interface. Is this possible?
    Some of the parameters for the methods on our EJB takes Java classes generated by the XMLBeans tool. As a result the classes are not serializable. Does WSIF require parameters to be serializable?
    Thanks,
    Frank

    A single instance is created at the first invocation [note: The initiate( null ) operation is invoked if the class is an instance of IWSIFJavaService].
    That single java object is invoked (concurrently) by all the process instances when they reach an <invoke> node which leverage WSIF Java binding.
    Edwin

  • Http Binding question

    Hello guys.
    I'm new in SOA Suite :) I have question about HTTP binding adapter. I downloaded MS wfetch application to test my REST composite application. I try invoke my composite :
    Host: 192.168.10.2:8001\r\n
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Content-Type: application/x-www-form-urlencoded\r\n
    \r\n
    entry_id=test&entry_type=eee&file_name=aaa&mime_type=fff&meta_data=rrrr
    At response I got :
    HTTP/1.1 500 Internal Server Error\r\n
    When I try to invoke my REST composite using xml it's work fine !! At Oracle MAN :
    For HTTP POST request methods, you can select a payload type of either URL-encoded (ampersand-separated name-value pairs) or XML.
    Please help me.
    Edited by: user5427713 on Feb 22, 2011 11:49 PM
    Edited by: user5427713 on Feb 22, 2011 11:50 PM

    Thank you. I created composite where interface is JCA HTTP Bindung Adapter. At Adapter configuration I set
    Verb : POST
    Payload Type : url-encoded
    Endpoint : /soa-infra/services/CDP/CDPProxyREST/ProxyInterface
    At Wfetch :
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Content-Type: application/x-www-form-urlencoded\r\n
    \r\n
    entry_id=test&entry_type=eee&file_name=aaa&mime_type=fff&meta_data=rrrr&uploadedFile=ddddd
    I got response error :
    HTTP/1.1 500 Internal Server Error\r\n
    X-Powered-By: Servlet/2.5 JSP/2.1\r\n
    X-ORACLE-DMS-ECID: 0000ItIYiI55yWK5qVp2iY1DN_6b00147b\r\n
    When I create request :
    Content-type: text/xml\r\n
    SOAPAction: "Request-Response"\r\n
    \r\n
    <soapenv: ... >
    <root:root><root:entry_id>ssadsd<root:entry_id><root:.......</root:root>
    I got normal response with data without error.

  • Mutt Binding Question [Solved]

    So I want to be able to abort/exit mutt's line editor with <esc> (like is default in many other programs..). I don't know why, but it seems there is no corresponding binding for this functionality. The default keybind for this is control-g listed here as "n/a."  If I do "macro editor <esc> \cg" escape will just put ^G in the line editor. Does anyone know how to fix this?
    Last edited by angelic_sedition (2014-04-27 05:29:29)

    jasonwryan wrote:http://unix.stackexchange.com/questions … pt-in-mutt
    No real solution on the mutt side it would seem.. that's pretty dissapointing. Enter is basically the same behaviour if nothing is typed and "macro editor <esc> <enter>" works for searches. That's useless for the editor when adding headers though since it will just go to the next header, so I've found the next best solution to be using something like xsendkey or xdotool to fake control-g:
    macro editor \e "<enter><shell-escape>xsendkey Control+g<enter>"
    It will just type the shell command without the first enter when adding headers. I guess this suffices (it doesn't cause any slowdown at least; index bindings work immediately after hitting escape) though I'm kind of surprised mutt doesn't and can't do this..

  • Adding OSX server to AD--binding questions and server type

    Currently my Macs are simply bound to AD, but I am going to add ML server to the mix so I can simplify management. After all my reading I am still unsure what to do with my current clients. I know the server is bound to both AD and OD, but does each client need to be bound to both?
    Regarding the server type is, should my OD be a master, replica, or relay?

    Yes, you have to bind the client and server to both OpenDirectory and ActiveDirectory. The configuration is commonly called "Magic Triangle". You'll find lots of examples online under that moniker.

  • Binding question i think (:

    I'm working on a website (holiday homes for rent). One of the
    pages is contact.cfm. People visiting the site will come to that
    page after clicking a text link "
    Contact us about this house"on a result page with available
    holiday homes. The problem is that that result page is not an
    actual part of my webpage but a external page loaded in a frame in
    my website. The contact link for a particular house looks like
    this:
    http://www.a20realestate.com/contact.cfm?ref=REF000176
    What I would like is that the reference number appears in my
    contact.cfm page
    How do I accomplish that? Has it something to do with formurl
    or binding?
    Thanks in advance

    Url variables passed to contact.cfm are accessible in the
    url structure
    <!--- in contact.cfm --->
    <cfif isDefined("url.ref")>
    <cfoutput>reference number is
    #url.ref#</cfoutput>
    </cfif>
    To display all url variables ..
    <cfdump var="#url#">

  • Session Binding Question

    Hello All,
    I might be missing something, but I am trying to bind a session when a user logs
    in and out of my web application in order to be able to actively track online usage,
    however I can't seem to get it to work.
    I would appreciate any help that may shed some light on the problem.
    I invoke the bind listener in a servlet thus:
    session.setAttribute("listener", listener);
    I have a simple BindListener Class:
    import javax.servlet.http.*;
    public class BindListener implements HttpSessionBindingListener
    public int numSessions = 0;
    public BindListener()
    public synchronized void valueBound(HttpSessionBindingEvent event)
    numSessions++;
    public synchronized void valueUnbound(HttpSessionBindingEvent event)
    numSessions--;
    public int getNumSessions()
    return numSessions;
    However when I call a jsp page to monitor the online connections with the command
    BindListener listener = new BindListener();
    listener.getNumSessions()
    It always reports a 0 value even though I have serveral sessions running.
    Can anyone help explain why the counter is not working?
    I would extremely grateful of any assistance on this issue.
    Thanks in advance.
    Regards
    Les,

    Greetings,
    I would appreciate any help that may shed some light
    on the problem.First, it's important to understand a couple things about binding listeners:
    1. A session binding listener is an object that listens for its own binding; IOW, it receives notifications when it specifically is bound to or unbound from the session; and
    2. A session binding listener is specific to the session to which it is bound.
    I invoke the bind listener in a servlet thus:
    session.setAttribute("listener", listener);After the container binds the specified listener instance to this particular session, it calls the object's valueBound method...
    Conversely, when (after) the object is removed from the session by calling
        session.removeAttribute( "listener" );or
        session.invalidate();  // Which implicitly calls the above ;)then it's valueUnbound method is called.
    I have a simple BindListener Class:
    import javax.servlet.http.*;
    public class BindListener implements
    HttpSessionBindingListener
    public int numSessions = 0;
    public BindListener()
    public synchronized void
    valueBound(HttpSessionBindingEvent event)Synchronizing this method only keeps multiple threads from concurrently calling it on this instance... Since it's the current container instance that calls these (container callback) methods, there will (should) be only one thread calling it...
    numSessions++;
    }numSessions will only ever be 1 (at most), since this method only gets called when the instance is bound to the session - which is only when your user logs in. Again, session objects ('listener' or otherwise), unless persisted, exist only for the life of the current session...
    public synchronized void
    valueUnbound(HttpSessionBindingEvent event)
    numSessions--;
    }Refer again to the above. Incidentally, what are you trying to achieve with this?
    public int getNumSessions()
    return numSessions;
    }Refer again to the above. :)
    However when I call a jsp page to monitor the online
    connections with the command
    BindListener listener = new BindListener();This simply invokes the class' constructor and - most importantly in this case ;) - creates a new instance of the class, and...
    listener.getNumSessions();
    It always reports a 0 value even though I haveSince this is a new instance whose 'numSessions' member is initialized to '0', the accessor is reporting correctly.
    To get an existing listener object for the current session use:
    <jsp:useBean id="listener" scope="session" class="BindListener"/>...then one of:
    <jsp:getProperty name="listener" property="numSessions"/>
    <%-- or --%>
    <%= listener.getNumSessions() %>Keep in mind, however, that the above only retrieves the listener object for, again, the current session and whose 'numSessions' will still only be '1' (as currently implemented ;).
    serveral sessions running.A session is a reference to a client's life in the application (refer to thread http://forum.java.sun.com/thread.jsp?forum=13&thread=249978 for further discussion on "session life"); one session cannot access the (in memory ;) information of other sessions...
    Can anyone help explain why the counter is not
    working?Refer again to all the above. :)
    I would extremely grateful of any assistance on this
    issue.If your goal is to track "online usage" then you're on the right track. However, as explained, the current implementation will only count the current session. To keep track of all sessions for a user your bean needs to persist and re-load the current count statistics for the user. The following illustrates:
    import java.io.*;
    import java.util.*;
    import javax.servlet.http.*;
    * <p>Tracks user login counts.  A count of user's accesses is stored
    * in a file within the webapp space.</p>
    * <p>NOTE: This class is intended only to illustrate a method for
    * managing persistent session tracking.</p>
    * @author     Tony "Vee Schade" Cook, [email protected]
    public class SessionTracker implements HttpSessionBindingListener
         * <p>Creates a new session tracking instance.
         * @param  sessionFile     the user specific session file.
        public SessionTracker( File sessionFile )
            this.sessionFile = sessionFile;
         * <p>Loads current session count.
        public void valueBound( HttpSessionBindingEvent event )
            Properties data = new Properties();
            try {
                data.load( new FileInputStream( sessionFile ) );
                numSessions = Integer.parseInt( data.getProperty( "count" ) );
            catch( Exception ex ) {
                /* Assume no persistent data, or corrupt/invalid...
                 * either way, accept default numSessions = 0
            /* Remember this session too! ;)
            numSessions++;
         * <p>Stores current session count for later retrieval.
        public void valueUnbound( HttpSessionBindingEvent event )
            Properties data = new Properties();
            data.setProperty( "count", Integer.toString( numSessions ) );
            try {
                data.store( new FileOutputStream( sessionFile ), sessionFile.toString() );
            catch( Exception ex ) {
                /* Sorry, Charley - "log" the error for the administrator.
                ex.printStackTrace();
         * <p>Returns current session count for this user.
        public int getNumSessions()
            return numSessions;
        private File sessionFile;
        private int numSessions;
    }The above should actually be using a database for the persistence if you also want to be able to efficiently access the count statistics from a separate session. Yet, the above illustrates what is needed (session persistence) and should get you started in the right direction. :)
    I hope this helps.
    Thanks in advance.
    Regards
    Les,Regards,
    Tony "Vee Schade" Cook

  • Access/SQL to PDF data binding question

    Hello,
    The goal = Using an access form, fill out fields which populate a table on the sql server. Open a PDF and data bind the fields to that table. Lock the fields with the correct information. Then send to an individual with read only data that is NOT bound to the server.
    I can get to binding the data and seeing the correct information populate on the PDF fields, but I'm stuck on how to make the fields read only and turn the data binding off through script.
    Any and all help is greatly appreciated!!
    I'm using LCD ES2, Access 2010, SQLExpress 2008 R2
    Thank you,
    James

    There are a number of ways you could do it, but the most seamless involve some type of programming. Here's a good article that discusses some of the ways: http://acrobatusers.com/articles/getting-external-data-acrobat-x-javascript
    In item #3 the article touches on the importTextData method. If you export the spreadsheet to a tab-delimited text file, you can use the doc.importTextData method to (manualy) import a row of data from the file: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.502.html
    This is probably the simplest method that will get you what you want. The first row of the data file has to be the tab-delimited field names.
    Another way that can be automated would be to create an FDF file using a macro in Excel and then loading the FDF into the form. If you haven't done this sort of thing before, it will involve a bit of a learning curve.

  • Simple binding question

    Hello,
    I have an inputText bound to a backed bean property in contrast to a an ADF bind attribute, the getter method for the inputText look up the value from a hashMap, while going through the debugger, it looks like the code returning the correct value, however, it does not show up on the page, could someone give me a hint to what is wrong with the below code, thnx
    public String getFirstname() {
    Long custid =
    (Long)ADFUtils.getBoundAttributeValue(getBindings(), "currentCustomer");
    if (custid != null && customerLookUp != null) {
    Customer cust = (Customer)customerLookUp.get(custid);
    if (cust != null)
    return cust.getCustFirstName();
    return this.firstname;
    }

    Hi,
    did you also provide a setter method before binding it with EL? If no - give it a try as it could solve the issue
    Frank

  • Another CFInput and CFC Binding question.

    I have been away from CF since version 5.  Now, I have a need to start back up
    on CF, but at version 9.  I am kind of liking these cfc's.
    Here is what I am having trouble with:
    I have a cfform(html) that has a handful of elements in it.  The first element is a cfselect which is bound to cfc.getClientList(Done this way to allow the drop down to be reusable).  This piece of the puzzle works just fine.  What I am trying to do from this is when a user selects a client from the dropdown, the remaining five elements are bound to another function called getClientDetail which has a returntype of query.  I want to be able to bind the 5 columns returned in my query to the 5 cfinputs below my cfselect.  Any thoughts on this would be helpful as I have tried almost everything I can think of to make this work.

    Copy the following 2 files into the same directory under your web root. The comments are self-explanatory.
    selectEmployee.cfm
    <!--- The cfajaxproxy tag creates a client-side proxy for the Employee CFC.
            View the generated page source to see the resulting JavaScript. 
            The Employee CFC is in the same directory as this page. --->
    <cfajaxproxy cfc="Employee" jsclassname="emp">
    <html>
        <head>
            <script type="text/javascript">
                /* Asynchronous call to get the employee details.
                   The function is called when the user selects an employee. */
                    var getEmployeeDetails = function(id){
                    var e = new emp();
                    e.setCallbackHandler(populateEmployeeDetails);
                    e.setErrorHandler(myErrorHandler);
                /* Pass the employee name to the getEmployees CFC function. */
                    e.getEmployeeDetails(id);
                /* Callback function: sets the results of getEmployeeDetails into input fields */
                var populateEmployeeDetails = function(employee)
                    var first_name = employee.DATA[0][0];
                    var email_name = employee.DATA[0][1];
                    var department = employee.DATA[0][2];
                    var phone      = employee.DATA[0][3];
                    var location   = employee.DATA[0][4];
                    document.empForm.fname.value = first_name;
                    document.empForm.email.value = email_name;
                    document.empForm.dept.value = department;
                    document.empForm.tel.value = phone;
                    document.empForm.loc.value = location;          
                /* Error handler */
                var myErrorHandler = function(statusCode, statusMsg)
                    /* blank the field entries*/
                    document.empForm.fname.value = '';
                    document.empForm.email.value = '';
                    document.empForm.dept.value = '';
                    document.empForm.tel.value = '';
                    document.empForm.loc.value = '';
                    alert('Status: ' + statusCode + '. ' + statusMsg);
            </script>
    </head>
    <body>
    <cfform name="empForm">
    Employee: <cfselect  value="emp_id" display="name" name="employee" bind="cfc:Employee.getEmployee()" bindonload="true" onChange="getEmployeeDetails(this.value)">
    </cfselect><br>
    First name: <cfinput name="fname"><br>
    E-mail name: <cfinput name="email"><br>
    Department: <cfinput name="dept"><br>
    Telephone: <cfinput name="tel"><br>
    Location: <cfinput name="loc"><br>
    <cfinput name="sbmt" type="submit" value="send" onclick="if(employee.value==''){alert('You must select an employee');return false;}">
    </cfform>
    </body>
    </html>
    Employee.cfc
    <cfcomponent output="false">
    <cffunction name="getEmployee" access="remote" output="false" returntype="any">
    <cfset var getAllEmployees = queryNew("","")>
    <cfset var arr = arrayNew(2)>
    <cfquery name = "getAllEmployees" dataSource = "cfdocexamples">
        SELECT Emp_ID,  FirstName || ' ' || LastName as Name
        FROM Employees
    </cfquery>
    <cfset arr[1][1]="">
    <cfset arr[1][2]="Select employee">
    <cfloop query="GetAllEmployees">
    <cfset arr[currentrow+1][1]=emp_id>
    <cfset arr[currentrow+1][2]=name>
    </cfloop>
    <!--- Alternative, if you require no "Select employee" option --->
    <!--- <cfloop query="GetAllEmployees">
    <cfset arr[currentrow][1]=emp_id>
    <cfset arr[currentrow][2]=name>
    </cfloop> --->
    <cfreturn arr>
    </cffunction>
    <cffunction name="getEmployeeDetails" access="remote" output="false" returntype="query">
    <cfargument name="employee_id">
    <cfset var employeeDetails = queryNew("","")>
    <cfset var emp_id = arguments.employee_id>
    <cfif isNumeric(emp_id)>
        <cfquery name = "employeeDetails" dataSource = "cfdocexamples">
            SELECT firstname, email as email_name, department, phone, location
            FROM Employees
            WHERE emp_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#emp_id#">
        </cfquery>
    </cfif>
    <!--- Will activate error-handler in the caller --->
    <cfif NOT isNumeric(emp_id) or employeeDetails.recordcount EQ 0>
        <cfthrow message="You selected no employee.">
    </cfif>
    <cfreturn employeeDetails>
    </cffunction>
    </cfcomponent>

  • EJB / JNDI binding question (ColdFusion 9)

    Hello,
    I am running ColdFusion 9 (developer edition) on my local machine (Windows XP SP3; 2,66Ghz; 2Gb RAM) through / using IIS 5.1.
    Using this environment I'm trying to implement the Belgian e-ID applet (hosted on Google code) authentication example. But for the authentication to work, the SDK pdf tells me to register an EJB in JNDI.The basic configuration (being adding servlet & servlet mapping sections in the web.xml configuration file) works for identification, but no results for authentication...
    I already contacted the eID site admin(s), requesting additional information on how to achieve this, but this yielded no results as well, as they forwarded me to the vendor of my web server (ColdFusion).
    To make a long story short, is it possible to provide me with an example on how to register this / an EJB for use with the technology mentioned above?
    Thanks in advance!

    Well, your web server isn't really ColdFusion - if you just installed CF using the default settings, you're using JRun for both your web server and for the underlying J2EE container required by CF. So I'd recommend looking at the JRun documentation - just Google "jrun ejb".
    The default location and availability of JRun components in a default install of CF is a bit different than it is with a full JRun install, so you might have to reinstall CF using the JRun option, which installs a full version of JRun and then installs CF as an individual JRun server instance.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Newbie question: Binding very large strings ( 4k) to OLAP query

    Hi there guys
    I am using Oracle 10.2 and I am trying to bind string variables to olap literals in my query string:
    SELECT TRUNC(IND-TO_DATE('01011900','ddmmyyyy')+2),VAL1
                   FROM (
                        SELECT *
                        FROM TABLE(
                             OLAP_TABLE(
                                  'OLAPFAME.MAG_CRD DURATION SESSION',
                                  :1 ))
                             MODEL
                                  DIMENSION BY(IND)
                                  MEASURES(VAL1,R2C1)
                                  RULES UPDATE SEQUENTIAL ORDER())
                   WHERE OLAP_CONDITION( R2C1, :2, 1 )=1
    I try and setString() to params 1 and 2, but it doesnt seem to work. The reason I am trying this is because when I pass large (>4K) DML string literals inline, I get ORA-01704. Hence me trying to bind to the variables via prepared statements (not even sure if this will get me past this 4k problem)!
    I have also read that I can store these large strings in variables and use those as a OLAP DML string via the ampersand syntax (not sure how to do this, ensuring that they would just have statement scope).
    Sorry if this is obtuse, but I'm at my wits end after a long days "trying stuff" :(
    Thanks in advance
    Adam

    Once again, I answer my own question. -_-;;
    The second process (fetch_comments) seems to be unnecessary. The Automated Row Fetch seems to be able to handle the 32K by itself. I'm still curious why the second process didn't work though....

  • Basic Question on Binding

    I am missing something obvious!! All I want to do is bind a property of an Entity to a textbox in a WPF grid. I have spent ages reading the various tutorials and seem to have failed to grasp what is needed. I can easily do it without binding but that would
    defeat the object of trying to understand binding.
    My XAML is
    <Grid x:Name="grdName" HorizontalAlignment="Left" Height="55" Margin="65,62,0,0" VerticalAlignment="Top" Width="268" Background="#FFE3E3E3" >
    <TextBox x:Name="txtSurname" HorizontalAlignment="Left" Height="24" Margin="106,21,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="63" TextChanged="txtSurname_TextChanged" DataContext="{Binding Path=Surname}"/>
    and the code-behind is
    private void cmbPersonKey_SelectionChanged(object sender, SelectionChangedEventArgs e)
    string p = cmbPersonKey.SelectedValue.ToString();
    Person thisPer = Helpers.context.People.Find(p);
    this.grdName.DataContext = thisPer;
    this.Show();
    John Meers

    You are setting the DataContext of the Grid to a Person object in your event handler. This means that any UI element in the Grid can bind to any property of the this Person object. For the Text to show up in the TextBox you should bind its Text property
    to a public property of the Person class:
    <TextBox x:Name="txtSurname" HorizontalAlignment="Left" Height="24"
    Margin="106,21,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="63"
    TextChanged="txtSurname_TextChanged" Text="{Binding Path=Surname}"/>
    If this doesn't work you need to make sure that your Helpers.context.People.Find method actually returns a Person object, that this Person object has a
    public property named "Surname" and that this property has a value.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • Some basic questions about rmi registry  context  "bind" and "lookup"

    We have more processing to do than can be accomplished with a single computer. To solve the problem I've implemented a distributed computing solution using RMI. (The first time I saw RMI was about 2 weeks ago, so please bear with me!)
    The implementation is a proof of concept not a fully fleshed out system. I have one "Workunit Distributor" computer and any number of "Data Processor" computers all on the same lan segment. "Workunit Distributor" and "Data Processor" computers are both RMI client and server to each other. The "Data Processor" computers are given the ip address and name of the "Data Distributor" on the commandline when they start. They communicate their willingness to receive and process a workunit to the ""Workunit Distributor" via a RMI call. Work units are sent to available "DataProcessors" and results are eventually returned to the "WorkunitDistributor" (minutes or hours later). The model program works quite well, and appears to be capable of doing the processing we need to get done.
    But now that it seems viable, I've been asked to make it a little more scalable, flexible and self configuring. In particular, instead of one "Workunit Distributor", any number of "Workunit Distributors" should be allowed to show up or disappear from the lan at any time and the system should continue to function. I've worked out a good scheme for how this can be done, but I have a couple of questions about the RMI registry (registries?). I'm trying to keep from implementing some functionality that may already be available as a library or subsystem.
    With my current model design, each computer binds to its own registry with a unique name. For instance:
    CRDataProcessorImpl crdpi = new CRDataProcessorImpl(svr);
    Context crDataProcessingContext = new InitialContext();
    crDataProcessingContext.bind("rmi:"+hostName, crdpi);
    Currently the "Data Processors" get the info they need for a Context lookup() of the one and only "Workunit Distributor" from the commandline. And the info the "Workunit Distributor" needs to do a Context lookup() of a "DataProcessor" is passed to it from each "DataProcessor" via a RMI call.
    But in the newer (yet to be implemented) scheme where any and all "Workunit Distributors" show up and disappear whenever they feel like, the naming bootstrapping scheme described above won't work.
    I can imagine a few ways of solving this problem. For instance, having "Workunit Distributors" multicast their contact information on the lan and have a worker thread on each "Data Processor" keep track of the naming information that was multicast. Another alternative (more organized, but more complex) might be to have a dedicated host with a "well known" address and port that "Workunit Distributors" and "Data Processors" could all go to, to register or look up at an application level. Sort of a "domain name service" for RMI. But both these schemes look like a lot of work to implement , debug and maintain.
    The BEST thing would be if there was one plain vanilla RMI registry that was usable by all RMI enabled computers instead of having each computer have its own local name registry. In volume 2 of the Core Java2 book it says that every registry must be local. I'm only hoping there's been progress since the book was published and now a central rmi registry is available.
    If you have any ideas about this I'd like to hear what you know.
    Thanks in advance for any advice.
    Lenny Wintfeld
    ps - I don't believe web services, as full featured as it is, is a useful alternative. I'm moving 100's (in the future possibly 1000's) of megabytes back an forth for processing.

    The local bind/rebind/unbind restriction is still there and it will always be there.
    I would look at
    (a) RMI/IIOP, where you use COSNaming as a registry, which doesn't have that registriction, and which also has location-independent object identifiers
    (b) Jini.

  • Question about cfdiv bind

    I'm trying to create a page that displays the results of a query, but will allow you to filter them by date, name, etc. I'm relatively new to this concept, but reading a bit online I found some examples that did what I'm trying to do. I have a few questions and a problem though, if someone is willing to provide a bit of guidance. If it matters, I'm using cf9.
    First, can you use a <cfdiv bind to submit multiple url parameters? If so, do I just use a semicolon to separate them like this:
    <cfdiv bind="url:mypage.cfm?param1={value1};param2={value2}" />
    Second, if you can use this functionality, what's the best way to send dates as url parameters? URLEncodedFormat() and then URLDecode()? All the examples of those tags surround them with # to indicate variables, but since you don't use that notation in a cfdiv bind, do I just put the whole thing inside the {} like this (and then use URLDecode(mydate) on the action page):
    <cfdiv bind="url:mypage.cfm?date1={URLEncodedFormat(mydate)} />
    Third, I'm having trouble getting the <cfdiv bind to display at all. I have an action page set up (mypage.cfm) that loads fine in a browser, but when I try to add it to another page like this, it doesn't work:
    <cfdiv bind="url:mypage.cfm" />
    I'm assuming this is because I'm not submitting any parameters on this page to be processed on mypage.cfm, but I don't know if that's true. I'm trying to get the div to display first, then add the dynamic form to filter the results, but maybe it doesn't work that way?
    Thanks for any help!
    Jeremy

    Thank you, I was able to get it mostly working. There was an issue with the server on my system so I had to re-install Coldfusion. It dawned on me that I had cleaned up some files that I was no longer using and might have accidentally gotten rid of something important.
    So it's definitely better now. I can change the dates so that I can display records that fall within those date parameters. What I'm trying to do now is be able to sort the records, and I'm having trouble with that. Right now I have a select menu named "sort" with a bunch of values that reference elements in the table: Last Name (Lname), Date Submitted (Reptime), and Date of Absence (Absence_Date). Then in my sql I have "ORDER BY <cfparam value="#url.sort# cfsqltype="cf_sql_varchar">. I don't get any errors or anything, I just don't get any changes to the displayed data. Here's my sql, the commented parts are not in the file, I added those for explanation here:
    <!--- There are two radio buttons to toggle between viewing all records and viewing the selected records based on the date parameters. This sets the start and end dates when view all is selected --->
    <cfif IsDefined("url.viewAll") AND #url.viewAll# EQ "yes">
      <cfset startDate="01/01/2012">
      <cfset endDate="12/12/2020">
    <cfelse>
    <!--- This sets the start and end dates based on the items in those fields if view all is not selected, and sets the dates to the view all dates if the date entry fields are empty --->
      <cfif IsDefined("url.startDate") AND #url.startDate# NEQ "">
        <cfset startDate="#url.startDate#">
      <cfelse>
        <cfset startDate="01/01/2012">
      </cfif>
      <cfif IsDefined("url.endDate") AND #url.endDate# NEQ "">
        <cfset endDate="#url.endDate#">
      <cfelse>
        <cfset endDate="12/12/2020">
      </cfif>
    </cfif>
    <!--- Defines the url.sort parameter and sets the default in the event no selection is made on the page. --->
    <cfparam name="url.sort" default="Absence_Date">
    <!--- And my query. Pretty self-explanatory, but the ORDER BY portion isn't working. Records are displayed in the order they appear in the database, which is the submit time (Reptime) --->
    <cfquery name="absences" datasource="ctband">
      SELECT *
      FROM Absences
      WHERE Absence_Date > <cfqueryparam value="#startDate#" cfsqltype="cf_sql_varchar"> AND Absence_Date < <cfqueryparam value="#endDate#" cfsqltype="cf_sql_varchar">
      ORDER BY <cfqueryparam value="#url.sort#" cfsqltype="cf_sql_varchar">
    </cfquery>

Maybe you are looking for