Logging Hours of time spent watching movies.

classic Classic list List threaded Threaded
60 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
Man that one completely went over my head. I even changed the
submission to submit and back again. I new that, I had a true bonehead
moment. After I corrected it the moviez2.xml saved like a charm.
Tremendous thanks again on your part for having the patience with me.
I have only just begun on the whole XSLT and XForms path. I guess I
have been doing the Xforms for about 2 or 3 months now and the XSLT
for even shorter than that. Once again I consider this a complete
success. Thank you for everything,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
I do have a question about how to clean up the saved xml data though.

<?xml version="1.0" encoding="UTF-8"?>
<Time xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xf="http://
www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://
www.w3.org/2001/XMLSchema">
                        <TimeData>
                                <EntryDate>2007-09-12</EntryDate>
                                <StartTime>8</StartTime>
                                <StopTime>17</StopTime>
                                <BreakTime>1</BreakTime>
                                <TotalEntryTime>8</TotalEntryTime>
                                <TotalHours>8</TotalHours>
                                <Allocated>
                                        <Movie>Empire Strikes Back</Movie>
                                        <Hours>4</Hours>
                                </Allocated><Allocated>
                                        <Movie>Empire Strikes Back</Movie>
                                        <Hours>4</Hours>
                                </Allocated><Allocated>
                                        <Movie/>
                                        <Hours/>
                                </Allocated>
                        </TimeData>

                        <TimeData>
                                <EntryDate/>
                                <StartTime/>
                                <StopTime/>
                                <BreakTime/>
                                <TotalEntryTime>NaN</TotalEntryTime>
                                <TotalHours>0</TotalHours>
                                <Allocated>
                                        <Movie/>
                                        <Hours/>
                                </Allocated>
                        </TimeData>
                </Time>

in the first data set the last <Allocated> is still showing up empty.
Would that disappear with it in a separate instance? Also the last
data set that is completely empty. Would that be the relevant?
Have a great day,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
Okay not really worried to much about the extra stuff in the saved
data cause it's working. What if instead of having a calendar date
picker you have a drop down(or something) with the days of the week
and then they related to the current date for that day. There would be
a week ending date somewhere and then you could pick the day that you
watched movies all day. So the week ending date would have the days of
the week to pick from. Then after that you pick a date it relates to
the week ending date with an output in that day entry.  I have only
seen a calendar picker so I wasn't sure if a week ending date with an
individual day picker even existed.
Have a great day,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Logging Hours of time spent watching movies.

Clark, John
Matthew,

> Okay not really worried to much about the extra stuff in the saved
> data cause it's working.

Well, to answer the question briefly anyway, yes you could suppress the output of the extra XML structures by either moving them to a separate template instance or by using a `relevant` attribute on a bind.

> What if instead of having a calendar date
> picker you have a drop down(or something) with the days of the week
> and then they related to the current date for that day. There would be
> a week ending date somewhere and then you could pick the day that you
> watched movies all day. So the week ending date would have the days of
> the week to pick from. Then after that you pick a date it relates to
> the week ending date with an output in that day entry.  I have only
> seen a calendar picker so I wasn't sure if a week ending date with an
> individual day picker even existed.

I'm not entirely sure what you mean, here.  You could certainly use an `xf:select1` to allow the user to pick from the days of the week.  Is that what you're looking for?

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
In reply to this post by aceospade

> I'm not entirely sure what you mean, here.  You could certainly use an `xf:select1` to allow the user to pick from the days of the week.  Is that what you're looking for?

Yeah but when the day is picked it would know the date and of what
month and year. That's why there would be a week ending date. A date
range of sorts. Sept. 9-15 2007 is a date range if that range was
selected then the days Sun., Mon, Tues., so on and so on from the
select1 would reflect their corresponding date from that currently
selected date range(week ending). Does that make a little more sense?
Thanks again,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Logging Hours of time spent watching movies.

Clark, John
Matthew,

> Yeah but when the day is picked it would know the date and of what
> month and year. That's why there would be a week ending date. A date
> range of sorts. Sept. 9-15 2007 is a date range if that range was
> selected then the days Sun., Mon, Tues., so on and so on from the
> select1 would reflect their corresponding date from that currently
> selected date range(week ending). Does that make a little more sense?

Ok, yes, it does.  I don't think there's any elegant way to do that with XForms out of the box; you might have to implement a custom control.  What's wrong with just directly selecting the full date using the date picker as you have it set up now?  You can look for the right week, and then select the appropriate day of that week.

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
In reply to this post by aceospade

>  What's wrong with just directly selecting the full date using the date picker as you have it set up now?

Nothing! It's PERFECT!! I was just curious. I wanted to keep pushing
my boundaries and keep coming up with ideas that are great in my head
but I don't know if they actually exist or not. Another thing I got to
thinking about was what if there came a time to put a saved form into
the blank form. To Open/Load a form that has already been saved and
make changes or add another day. Then that got me thinking about the
end week because if you have two Wednesday's and they are on a
different week how would the form know the difference?
Have a great day,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Logging Hours of time spent watching movies.

Clark, John
Matthew,

> Another thing I got to
> thinking about was what if there came a time to put a saved form into
> the blank form. To Open/Load a form that has already been saved and
> make changes or add another day.

Sure, that's a common use case.  The way that you do that in XForms is with a submission that uses the "get" method, and which loads the result of the submission into an instance (with `replace="instance"` and the `instance` attribute).  And in this case you really could use the `xf:upload` control, as you would be selecting an existing file.  :)

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
In reply to this post by aceospade
This is what I put in so far:

<xf:instance id="load" xmlns="">
        <load>
            <File xsi:type="xs:anyURI">moviez.xml</File>
        </load>
</xf:instance>

<xf:submission id="load" replace="instance" method="get" >
  <xf:resource value="instance('load')/File"/>
</xf:submission>

in the head of the document and this:

<xf:upload ref="instance('load')/File">
    <xf:filename></xf:filename>
    <xf:mediatype></xf:mediatype>
</xf:upload>

below the other submit button. It gave me the Browse and Clear button
but when a file was selected all it did was put the file name in the
input box and the form was still empty. Is this even on the right
track? The other question about the days of the week isn't really a
big deal I was just thinking how you could have one file to load from
and add more entry's in it. So there would be 4 files for a month's
worth of watching movies. Thanks again,
Have a great day,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Logging Hours of time spent watching movies.

Clark, John
Matthew,

> <xf:submission id="load" replace="instance" method="get" >
>   <xf:resource value="instance('load')/File"/>
> </xf:submission>

When you trigger this submission, it will send a get request to the URI stored in "instance('load')/File", which looks good for loading a saved file.  However, you still need to tell it where you want it to put the loaded data; you do this using the `instance` attribute (see section 11.2, "The xforms-submit Event"[0], for details).

> <xf:upload ref="instance('load')/File">
>     <xf:filename></xf:filename>
>     <xf:mediatype></xf:mediatype>
> </xf:upload>
>
> below the other submit button. It gave me the Browse and Clear button
> but when a file was selected all it did was put the file name in the
> input box and the form was still empty. Is this even on the right
> track?

Yes, it is.  In your upload element, you use the `xf:filename` to tell the control where it should store the value of the file name, and the `xf:mediatype` to tell the control where it should store the value of the media type (i.e. MIME type).  If you don't specify an `xf:filename` element, then the file name will be stored in the node indicated with the `ref` attribute of the `xf:upload` control.  That said, I think you probably want to remove both the `xf:filename` and the `xf:mediatype` elements from your `xf:upload` element.  Removing the `xf:filename` element is equivalent to using `<xf:filename ref="."/>`.  See sections 8.1.6, "The upload Element"[1], and 8.1., "The filename Element"[2], for details.

[0] http://www.w3.org/TR/xforms11/#submit-evt-submit

[1] http://www.w3.org/TR/xforms11/#ui-upload

[2] http://www.w3.org/TR/xforms11/#ui-commonelems-filename

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
In reply to this post by aceospade

> However, you still need to tell it where you want it to put the loaded data; you do this using the `instance` attribute (see section 11.2, "The xforms-submit Event"[0], for details).

Like this:

<xf:submission id="load" replace="instance( )/Time" target="/TimeData"
method="get" >?

Have a great day,
Matthew


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Logging Hours of time spent watching movies.

Clark, John
> Like this:
>
> <xf:submission id="load" replace="instance( )/Time" target="/TimeData"
> method="get" >?

Note that the `replace` attribute only takes one of three values: "all", "instance", "text", and "none".

I think that the `target` attribute is not yet supported by the Mozilla XForms extension, so as I mentioned, you need to use the `instance` attribute.  Your full `xf:submission` might look like this:

<xf:submission id="load" replace="instance" instance="main" method="get">
        <xf:resource value="instance('load')/File"/>
</xf:submission>

Note that this refers to an instance with `id` of "main"; for this to work, you have to give your main instance an `id="main"` attribute.  Then, when you "send" this submission, it will load the data into the "main" instance.  Note that this will overwrite anything already in that instance.

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
In reply to this post by aceospade
> <xf:submission id="load" replace="instance" instance="main" method="get">
>         <xf:resource value="instance('load')/File"/>
> </xf:submission>
>
> Note that this refers to an instance with `id` of "main"; for this to work, you have to give your main instance an `id="main"` attribute.  Then, when you "send" this submission, it will load the data into the "main" instance.  Note that this will overwrite anything already in that instance.

Okay I get that. I figured you could tell the replace exactly what to
replace and the tell it what target to change. Still not real sure on
what is going on with the submission. If I already had a file saved
(jedi.xml) before I implemented the load technique would I still be
able to open that file and show it in the form?

The upload I have looks like this:

<xf:upload ref="instance('load')/File" replace="instance"
instance="main" >
        <xf:filename ref="." />
        <xf:mediatype ref="." />
</xf:upload>

I still can't get a previously saved form to appear in the blank form.
That would be really neat if at all possible. Thanks again for your
continued support.

Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Logging Hours of time spent watching movies.

Clark, John
> If I already had a file saved
> (jedi.xml) before I implemented the load technique would I still be
> able to open that file and show it in the form?

Absolutely.  This is one of the great things about XML; because it is an open technology, you can take XML created by one process and use it with a completely separate process (as long as both processes are using the same XML structures, or schema, of course).

> The upload I have looks like this:
>
> <xf:upload ref="instance('load')/File" replace="instance"
> instance="main" >
> <xf:filename ref="." />
> <xf:mediatype ref="." />
> </xf:upload>

As I showed in my previous message, the `replace` and `instance` attributes go on the `xf:submission` element.  Also, I wouldn't point both the `xf:filename` and the `xf:mediatype` at the same node, otherwise one might overwrite the other.  Since you're not using the media type information, I would just remove that element.

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
In reply to this post by aceospade
So in this case both processes are the same? I have read the specs
about the submission and tried a couple of different ways to get the
data loaded back into an empty form but with no luck. By empty form I
mean when the form first loads and it is blank. Then I could go to the
Browse button and select an XML file that was saved previously. Have
you been able to get a saved document loaded?
Have a great day,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
I was able to "src" the file in on the instance, make changes to it
and save it again. However I still am not able to "Load" a previous
XML file into the blank form. It always seems that the last thing(that
I can think of...for now :) ) is always the trouble maker. In the Save
Location text area I was wondering if there was a way to get that to
say the file name of the current file loaded. If and when the blasted
load works. ;) I Love the form it works great. Thanks a Million!
Have a great day,
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: Logging Hours of time spent watching movies.

Clark, John
In reply to this post by aceospade
Matthew,

> I have read the specs
> about the submission and tried a couple of different ways to get the
> data loaded back into an empty form but with no luck. By empty form I
> mean when the form first loads and it is blank. Then I could go to the
> Browse button and select an XML file that was saved previously. Have
> you been able to get a saved document loaded?

Yes, I was able to successfully implement save and load with your form, although I encountered a few problems along the way.  First, somehow it seems both the instance storing the loaded file name and the submission for doing the load were given the same ID: "load".  Clearly, this would be a problem, as only one element in an XML document can have a given ID.  The next problem that I discovered was when when I tried to perform the load, the Error Console pointed out that the instance data was invalid.  Clearly, when we're loading data into an instance, we're not interested in the validity of the current data, so I had to turn this off using the `validate` attribute on the `xf:submission` element.  Then everything worked just fine.

I should have attached the working form to this email for your perusal, although it could certainly use some cleaning up.

Take care,

    John L. Clark

===================================

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2007).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.



_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
In reply to this post by aceospade

> I should have attached the working form to this email for your perusal, although it could certainly use some cleaning up.

Which email? On the forum or in gmail?

Thanks,
Matthew


_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
So you added validation="false" to the xf:submission and it worked?
Was there something else? I changed the load in the instance to load-
form and accordingly. Is there a way to have the saved data default to
an .xml extension without typing it in.
Thank you,
Matthew



_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: Logging Hours of time spent watching movies.

aceospade
The form is a great SUCCESS!!! Thanks to everyone that has given me
insight. Mainly John Clark! Now the question becomes, after the form
is loaded when the add entry button is hit an entry is put right
underneath the first entry. Is there a way to set the focus of the new
entry to be put at the end of the form without clicking in it? Thanks
again to everyone for helping!!
Have a spendiferous day!
Matthew

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
123