Filling day names in textbox - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Filling day names in textbox

Last post 02-28-2009 05:07 PM by Alec Pojidaev. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 01-05-2009 08:56 PM

    Filling day names in textbox

    Hi,

    I am creating a timesheet infopath form in which the day names should be shown atomatically without using code behind.

    There is an dropdown list which will have values like, Firstweek,secondweek... and based upon that those day names should be display

    Please help me

  • 01-05-2009 09:36 PM In reply to

    Re: Filling day names in textbox

    Hi,Do you want to display all the day names? If so, just add a rule to the drop down to set the day names in the text box.If the day names are different for each week then prepare an xml and using a rule by filtering the value in the drop down you can populate the value in text box. 
    Swathip
    www.ggktech.com
  • 01-05-2009 09:41 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Filling day names in textbox

    Do you want to autopopulate the day name in Text box or is that value coming from any xml?

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-05-2009 10:04 PM In reply to

    Re: Filling day names in textbox

    Yes, it is like the timesheet should be filled on weekly basis. So i need to associate the dates and daynames properly such that one textbox will have dayname and other will have date.

     My timesheet will look similar to this,

                     29        30            31                   01           02          03           04     

                  Monday  Tuesday   Wednesday     Thursday Friday  Saturday  Sunday

     here i am hardcoding the day names and the dates of the week should be populated.

  • 01-06-2009 04:53 AM In reply to

    Re: Filling day names in textbox

    Hi,
    If you are hard coding the values then just place the week name and the date and day values in the xml as shown below.

    <Weeks>

              <Week number="firstweek">

                       <Day dayName="Monday Tuesday Wednesday Thursday Friday Saturday Sunday" date="20 21 22 23 24 25 26"/>                      

              </Week>

              <Week number="Secondweek">

                       <Day dayName="Monday Tuesday Wednesday Thursday Friday Saturday Sunday" date="27 28 29 30 31 01 02"/>             

              </Week>

              <Week number="Thirdweek">

                       <Day dayName="Monday Tuesday Wednesday Thursday Friday Saturday Sunday" date="03 04 05 06 07 08 09"/>

              </Week>

    </Weeks>
     
    Save the above as Weeks.xml.
    Now take a receive data connection to retrieve the values.
     
    Go to drop down properties. 
    1.    Select Look up data from an external data source.
    2.    Select the weeks data source.
    3.    In the entries box, select number.
    4.    Click Rules button.
    5.    Click add button. Then click add action button.
    6.    Select set a field's value in the action drop down.
    7.    Select day text box field in the field.
    8.    Click fx button beside the value.
    9.    Then select dayName in the weeks data source then click filter data.
    10. Click  Add and select number from weeks data source in the first drop down, is equal to in the second drop down and the drop down field in the third drop down.
    11. Click ok until all the windows gets close.
    12. Do the same for date (Repeat step 4 to step 11).
     
     

     

    Swathip
    www.ggktech.com
  • 01-07-2009 02:40 AM In reply to

    Re: Filling day names in textbox

    Hi,

     First of all i need to thank you.

     Could you please explain me more clearly beacause i am new to Infopath.

    so from which drop down list i need to have the specified rule?

  • 01-07-2009 02:57 AM In reply to

    Re: Filling day names in textbox

    Hi,

    You said that you are using a drop down list for week names. Specify the rule for that drop down.

    Swathip
    www.ggktech.com
  • 01-07-2009 03:27 AM In reply to

    Re: Filling day names in textbox

    Hi

    I tried but the problem is like all the day names are getting populated in a single text box itself

    so is there any way to filter it to display only one day name per textbox

  • 01-07-2009 03:54 AM In reply to

    Re: Filling day names in textbox

    Hi,

    Yes i want to auto populate the day name.

    how can i do that without using any code behind

  • 01-07-2009 05:25 AM In reply to

    Re: Filling day names in textbox

    Hi,

    If you want the day names to be displayed in the different text boxes then use the following xml.

    <Weeks>

              <Week number="firstweek">

                       <Day dayName="Monday" date="20"/>

                       <Day dayName="Tuesday" date="21"/>

                       <Day dayName="Wednesday" date="22"/>

                       <Day dayName="Thursday" date="23"/>

                       <Day dayName="Friday" date="24"/>

                       <Day dayName="Saturday" date="25"/>

                       <Day dayName="Sunday" date="26"/>

              </Week>

              <Week number="Secondweek">

                       <Day dayName="Monday" date="27"/>

                       <Day dayName="Tuesday" date="28"/>

                       <Day dayName="Wednesday" date="29"/>

                       <Day dayName="Thursday" date="30"/>

                       <Day dayName="Friday" date="31"/>

                       <Day dayName="Saturday" date="01"/>

                       <Day dayName="Sunday" date="02"/>

              </Week>

              <Week number="Thirdweek">

                       <Day dayName="Monday" date="03"/>

                       <Day dayName="Tuesday" date="04"/>

                       <Day dayName="Wednesday" date="05"/>

                       <Day dayName="Thursday" date="06"/>

                       <Day dayName="Friday" date="07"/>

                       <Day dayName="Saturday" date="08"/>

                       <Day dayName="Sunday" date="09"/>

              </Week>

    </Weeks>

     

    Save the above as Weeks.xml.

    Now take a receive data connection to retrieve the values.

     

    Go to drop down properties.

    1.  Select Look up data from an external data source.

    2.  Select the weeks data source.

    3.  In the entries box, select number.

    4.  Click Rules button.

    5.    Click add button. Then click add action button.

    6.    Select set a field's value in the action drop down.

    7.    Select first day text box field in the field.

    8.    Click fx button beside the value.

    9.    Then select dayName in the weeks data source then click filter data.

    10. Click Add and select number from weeks data source in the first drop down, is equal to in the second drop down and the drop down field in the third drop down.

    11.  Click ok. In the Insert formula window click Edit Xpath check box. There change the Day/ with Day[1]/.

    12. Then click ok until all the windows gets closed. The expression will look like

    xdXDocument:GetDOM("weeks")/Weeks/Week/Day[1]/@dayName[../../@number = xdXDocument:get-DOM()/my:myFields/my:field4]

    13. Do the same for other text boxes (add another add action to set the second text box value. The only change is add day[2] instead of Day[1]. For third text box Day[3])

    14. Do the same for date (Repeat step 4 to step 13).

     

    Swathip
    www.ggktech.com
  • 01-07-2009 08:44 PM In reply to

    Re: Filling day names in textbox

    Hi,

     It is working fine but this is like hard coding the date. Is there any way to automate the dates for all the months in a year just like date picker property.

    Because the user may want to select a different month and year so in that what could be done?

  • 02-28-2009 05:07 PM In reply to

    Re: Filling day names in textbox

    Raajkumar:

    Hi,

     It is working fine but this is like hard coding the date. Is there any way to automate the dates for all the months in a year just like date picker property.

    Because the user may want to select a different month and year so in that what could be done?

     Check my article about date calculations.

    http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/

Page 1 of 1 (12 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.