How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?) - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?)

Last post 07-17-2010 06:44 AM by Skarn. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-24-2010 05:16 AM

    How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?)

    Hi all, i'am having a little issue and a i didn't find an answer to this during my investigation. I have web-browser form with a repeating table with attachment fields... what i want to do is if a row has their request answered (based on a field controled in the row) i want to make the attachment field read only. The Attachment Field is a repeating field so i really need sections to hide that fields. I tried to put a section in data source outside the repeating table but inside the form design i put that section inside the repeating table... and that is a problem because when i write a row to the repeating table via code with a button... the field disappear or every time i had a row he adds a new section of the attachment in each row.

     I'am adding a row to the repeating table with the following code:

    using (XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:ParecerExterno/my:TblPedIntsSec", NamespaceManager).AppendChild())
                    {

                        writer.WriteStartElement("TblPedInts", myNamespace);
                        writer.WriteElementString("dtPedInt", myNamespace, DateTime.Now.ToString("O"));
                        writer.WriteElementString("DesPedInt", myNamespace, "");
                        writer.WriteElementString("DestPedInt", myNamespace, nomePedido);
                        writer.WriteElementString("DocPedInt", myNamespace, "");
                        writer.WriteElementString("ControlPedInt", myNamespace, "0");
                        writer.WriteElementString("dtEntradaPedInt", myNamespace, String.Empty);
                        writer.WriteElementString("ParInterno", myNamespace, "");
                        writer.WriteElementString("RespostaPedInt", myNamespace, "");
                        writer.WriteEndElement();
                        //writer.WriteNode("CountPedInt", true);
                        writer.Close();

                    }

     

     I think that a way to do this is to have a section inside the repeating table group and then write that group with xml writer... maybe instead of writer.WriteElementString there is any function to write a group... i don't know...

    Can anyone help me with this please?... sorry for my bad english  

  • 05-24-2010 06:37 AM In reply to

    Re: How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?)

     A section control can be bound to anything.  You don't need to add a node in your data source just for the section control.  How about binding it to the same node as the file attachment control?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-24-2010 08:15 AM In reply to

    Re: How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?)

    Thanks for trying to help... well bound to the same attachment node a section is not a good ideia... but i'am trying to have a node inside the repeating table group and for one it worked well but when i tried to do the same method to other repeating table... kabong... broken form... so i'll keep trying

    Best Regards,

    Ricardo Pinto (Junior Developer)

  • 05-24-2010 08:25 AM In reply to

    Re: How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?)

     Why is it not a good idea?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-24-2010 08:30 AM In reply to

    Re: How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?)

    it's not a good ideia because it says i cannot repeat there and it appears at the right top a red ball with an (x) inside, like an error... well it is an error and it will not let me publish the form. Now that i'am trying to use a field inside the repeating table(datasource and design) as a section it says unbound(unable to store data).

  • 07-17-2010 06:44 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: How to Show/Hide File Attachments Fields in Repeating Tables (With Sections?)

    Two attachment controls bound to the same field. Put them both in the same place in the repeating section/table. Make one 'read only'. Put conditional formatting on them to make the 'read only' one invisible when the condition isn't met and the 'non-read only' one invisible when the condition is met. No extra sections should be needed.

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