How to set up a master/detail Spry select

Hello, I was trying to build a master/detail select using Spry following the example in the samples folder, but I didn't succed. I think I'm pretty close. I'm using two datasets from two diffrent xml files. The problem is that I don't know how to set a filter probably. Thanks so much.
This is my code:
<script type="text/javascript">
<!--
var dsRubro = new Spry.Data.XMLDataSet("rubro_xml.php", "root/row");
dsRubro.setColumnType("idConsultaRubro", "number");
var dsCategoria = new Spry.Data.XMLDataSet("categoria_xml.php", "root/row");
dsCategoria.setColumnType("idConsultaRubro", "number");
dsCategoria.setColumnType("idConsultaCategoria", "number");
dsCategoria.setColumnType("orden", "number");
//-->
</script>
</head>
<body>
<form>
Rubro:
<span spry:region="dsRubro" id="rubroSelector">
<select spry:repeatchildren="dsRubro" name="rubroSelect" onchange="document.forms[0].categoriaSelect.disabled = true; dsRubro.setCurrentRowNumber(this.selectedIndex);">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{idConsultaRubro}" selected="selected">{descripcion}</option>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{idConsultaRubro}">{descripcion}</option>
</select>
</span>
Categoria:
<span spry:region="dsCategoria" id="categoriaSelector">
<select spry:repeatchildren="dsCategoria" id="categoriaSelect" name="categoriaSelect">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{idConsultaCategoria}" selected="selected">{descripcion}</option>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{idConsultaCategoria}">{descripcion}</option>
</select>
</span>

Use XPath to filter the data in the second dataset as follows
<!DOCTYPE html>
<html xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script>
var dsRubro = new Spry.Data.XMLDataSet("rubro_xml.php", "root/row");
dsRubro.setColumnType("idConsultaRubro", "number");
var dsCategoria = new Spry.Data.XMLDataSet("categoria_xml.php[idConsultaRubro=-1]", "root/row");
dsCategoria.setColumnType("idConsultaRubro", "number");
dsCategoria.setColumnType("idConsultaCategoria", "number");
dsCategoria.setColumnType("orden", "number");
function newXPath(cat){
    dsCategoria.setXPath('root/row[idConsultaRubro='+cat+']');
    dsCategoria.loadData();
</script>
</head>
<body>
<form>
Rubro:
<span spry:region="dsRubro" id="rubroSelector">
<select spry:repeatchildren="dsRubro" name="rubroSelect"  onchange="newXPath(this.value)">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{idConsultaRubro}" selected="selected">{descripcion}</option>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{idConsultaRubro}">{descripcion}</option>
</select>
</span>
Categoria:
<span spry:region="dsCategoria" id="categoriaSelector">
<select spry:repeatchildren="dsCategoria" id="categoriaSelect" name="categoriaSelect">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{idConsultaCategoria}" selected="selected">{descripcion}</option>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{idConsultaCategoria}">{descripcion}</option>
</select>
</span>
</body>
</html>
I hope this helps.
Ben

Similar Messages

  • How to move elements within the master region of a Master/Detail spry data set?

    Hi there,
    I am unsure of how to move the different items within the master region of a master/detail spry dataset. The default style is such that if I include 3 or more elements e.g. Thumb, etc., they are stacked vertically :
    How do I move them so that they can be positioned differently? The look I am going for is one where the thumb image is positioned to the left while the other items are stacked alongside it so that the end effect for the master region would look like this:
    I greatly appreciate the help! Thanks!

    This is the complete page
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Check :: Fashion+Lifestyle</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMasterDetail_final.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    <!--
    var cal4 = new Spry.Data.HTMLDataSet("calendarList.html", "calendarList", {sortOnLoad: "When", sortOrderOnLoad: "ascending"});
    cal4.setColumnType("Thumb", "html");
    cal4.setColumnType("Picture", "html");
    cal4.setColumnType("When", "date");
    function MM_effectAppearFade(targetElement, duration, from, to, toggle)
        Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function closeAd() {
        document.getElementById('adRollover').style.visibility='hidden';   
    function MM_effectBlind(targetElement, duration, from, to, toggle)
        Spry.Effect.DoBlind(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function MM_effectSlide(targetElement, duration, from, to, toggle)
        Spry.Effect.DoSlide(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter)
        Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter});
    //-->
    </script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="pageContainer">
        <div id="adBanners">
            <div id="halfBanner"><a href="#" onClick="document.getElementById('adRollover').style.visibility='visible';"><img src="images/banner_half_1.jpg" alt="Half Banner" width="237" height="90" /></a></div>
            <div id="leaderboardBanner"><a href="#"><img src="images/banner_leaderboard_1.jpg" width="728" height="90" alt="Leaderboard Banner" /></a></div>
            <div class="clearFloats"></div>
        </div><!--div#adBanners-->
        <div id="mainHeader">
            <div id="homepageLink"><a href="index.html"><img src="images/spacer.gif" width="400" height="100" /></a></div>
            <ul id="MenuBar1" class="MenuBarHorizontal">
                <li><a href="feature.html">FEATURES</a></li>
                <li><a href="#">FASHION</a></li>
                <li><a href="calendar.html" class="on">CALENDAR</a></li>
                <li><a href="#">VIDEO</a></li>
                <li><a href="blog.html">BLOG</a></li>
            </ul>
        </div><!--div#mainHeader-->
        <div class="MasterDetail">
          <div class="DetailContainer" id="event" spry:detailregion="cal4">
            <div class="DetailPicture">{Picture}</div>
            <div class="DetailColumn DetailTitle">{What}</div>
            <div class="DetailColumn"><div class="DetailLabel">WHEN:</div> {When}
            </div>
            <div class="DetailColumn"><div class="DetailLabel">WHERE:</div> {Where}
            </div>
            <div class="DetailColumn">{Details}</div>
          </div>
          <div id="calHeader"><p><img src="images/calendar_hdr.gif" width="492" height="100" /></p></div>
          <div spry:region="cal4" class="MasterContainer" onclick="MM_effectAppearFade(this, 1000, 0, 100, false); MM_effectBlind('event', 1000, '0%', '100%', false);">
            <div class="MasterColumn" spry:repeat="cal4" spry:setrow="cal4" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected"><div class="MasterColumnPicture">{Thumb}</div>
              <div class="MasterColumnTitle">{What}</div>
              <div class="MasterColumnText"><div class="DetailLabel">WHEN:</div> {When}</div>
              <div class="MasterColumnText"><div class="DetailLabel">WHERE:</div> {Where}</div>
              <div style="clear:both"></div>
            </div>
          </div>
          <br style="clear:both" />
        </div>
    </div><!--div#pageContainer-->
    <div id="footer">
        <div class="text">Use of this site constitutes acceptance of our User Agreement and Privacy Policy. &copy; 2008 Adobe All rights reserved. The material on this site may not be reproduced, distributed, transmitted, cached, or otherwise used, except with the prior written permission of Adobe is a trademark owned by Adobe.</div>
    </div><!--div#footer-->
    <div id="adRollover" style="visibility: hidden;">
    <script language="javascript">
        if (AC_FL_RunContent == 0) {
            alert("This page requires AC_RunActiveContent.js.");
        } else {
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
                'width', '536',
                'height', '479',
                'src', 'watch_ad',
                'quality', 'high',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'wmode', 'transparent',
                'devicefont', 'false',
                'id', 'watch_ad',
                'bgcolor', '#ffffff',
                'name', 'watch_ad',
                'menu', 'true',
                'allowFullScreen', 'false',
                'allowScriptAccess','sameDomain',
                'movie', 'watch_ad',
                'salign', ''
                ); //end AC code
    </script>
    <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="536" height="479" id="watch_ad" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="watch_ad.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
        <param name="wmode" value="transparent" /><embed src="watch_ad.swf" quality="high" bgcolor="#ffffff" width="536" height="479" name="watch_ad" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </noscript>
    </div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>

  • Can I set up a Master-Detail Page with report regions for 2 Detail Tables?

    Hi there,
    I am just starting to use Application Express.
    I have a Table (A) with Master-Detail relationships to two Tables B & C.
    I can set up a Master-Detail Page between Table A and Table B, where the records displayed in Table B change when switching between records in Table A. I would like to add Table C to the page and for this to work in the same way.
    Is this possible in APEX? (I've tried adding a report region for Table C and making the Region Source dependent on the same ID field as is used by the report region for Table B but I keep getting "No Data Found" for Table C).
    Many thanks.

    Thanks, but the text needs to be on a single master page which every page is assigned to. This is so the text alternates correctly regardless of whether new pages are inserted or moved. If I assigned separate master pages to individual pages and then moved the pages to a different location, the alternating footer text would then fall out of sync. I hope that made sense!

  • How order by  use in master detail form

    hi master
    sir i have master detail form but show data with out order by
    my need is form show data in order on date
    please give me idea how order by use in master detail form
    thank
    aamir

    Set "Order by Clause" Property at block level
    Cheers
    Gouri Sankar

  • How to set authorization in more detail for ME11,e.g. material group, etc.?

    Hi,
    As we know, we can use plant, purchasing organization, purchasing group as authorization object to carry out authorization check when creating purchasing info record in ME11.
    But now my customer wants to set authorization in more detail, for example, use material group and some certain fields in vendor master.
    It seems standard authorization setting for ME11 cannot do this.
    Is there any method to meet the need? or some enhancements or BADi?
    Thanks
    Wesley

    Hi, Akhileshwar
    Thanks for your information. I have thought of creating authorization object values, but the problem is where to let SAP carry out the authorization check to the new object in ME11/ME12.
    So I think maybe some enhancements can let us write authority check code to do it.
    But I am not sure which enhancement or user exit can be used to write this code.
    Wesley

  • How to set public even show detail to to all users

    How to set public even to show detail to all users or group. By default the public event only show "Busy" on calendar.

    Change the calendar's "everybody" permissions to include "Read" permisssion

  • How to create a specific  master detail

    hi,
    my problem is that i have 3 tables(tab1,tab2,tab3);
    tab1 is master of tab2.
    tab 2 is master of tab3.
    i would like to make a master detail page between tab1 and tab3 without using tab2.
    i am using jdev10.1.3.2 and ADF BC Swing.
    can you help me.
    7rouz

    i've the same kind of treatement in my application.
    i did it this way.
    i created a view object based on entity tab1.
    i created a view object based on a join of entities tab2 and tab3
    (don't forget to create associations between your 3 entites first)
    i then created a viewlink between these two views.
    In the application module, i added the first view and then the second view via the first view.
    You can then use this to created your master/detail relation from the data control palette.
    hope it helps.
    J.

  • How to set special rows in jtable not selectable

    Hello programmers,
    anybody knows how to set special rows(p.E. row 0) in jtable not selectable.
    in advance thanks for your answers

    table = new JTable(...)
         public void changeSelection(int row, int column, boolean toggle, boolean extend)
              if (row == 0)
                   return;
              else
                   super.changeSelection(row, column, toggle, extend);
    };

  • How to insert text in Master-Detail tables

    I have created a table for storing web pages as follows,
    TABLE Pages -- Master
    (Page_ID NUMBER PRIMARY KEY,
    NAME VARCHAR2(15),
    BODY CHAR(1));
    TABLE Pages_Detail -- Detail
    (Id NUMBER,
    lno NUMBER,
    Text VARCHAR2(50));
    I created a DETAIL_DATASTORE preference and set the id column as a foreign key to Page_Id. I tried to create an index on Body but it had copilation errors taht i cannot get to. Is it an interMedia config problem or am i doing something wrong? Please help
    Thanks!
    null

    Hi,
    Please list the errors that u are getting. Also check that your listener and tnsnames.ora file is configured for external procedures
    Listener should have the following entries:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/8.1.6)
    (PROGRAM = extproc)
    Entry in tnsnames.ora will be:
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    HTH,
    Siddharth

  • How to capture event in Master Detail report of OBIEE

    Hi,
    Is there is any way we can capture which account is clicked in master report and store it in BI variable i.e. presentation\request\session?
    My requirement is that in 1st report there will be certain account and some more column. Each account here is the parent account which have more then 1 child member On click of a particular account in 1st report, we need to display child account member in another report i.e.
    In 1st report we have below account
    Cash
    Asset
    XYZ
    On click of Cash i need to display cash.1, cash.2,cash3 account, if user click on Asset i need to display Asset.1, Asset.2 account in another report.

    Hi
    Use action links for your requirement.
    steps:
    1. Create a report1 with Account as column.
    2. from criteria select Account column properties
    3. In interation tab Value (Primary interaction select action link)
    4. Create (+ ) Action using Child columns
    5. Save and execute
    Please mark it useful/ Correct.
    Thanks

  • How to change the Product master details using BAPI

    Hello Friends,
    I need to change the few fields in product master like Safety Stock Method, Service Level (%) etc,
    can any one tell BAPI or any Function module to change Product Master.
    Thanks in Advance ,
    Ravi

    Hi,
    using this BAPI you can create or change products
    BAPI_PRDSRVAPS_SAVEMULTI2     - Create or Change Products
    Thanks
    sreeni

  • How to upload the BP master details in huge amount from flat file to CRM database

    Hi,
    Could you any body please help me initially the best method to upload Business partner data from flat file and if possible with any sample code available?
    Basically I am an ABAP consultant. In ERP I used to do BDC or lsmw  in generally?
    This is a mission critical thing for me.

    Hi Chitturi,
    I did not come across the scenario for custom include fields from BAPI of partner creation. But if the fields are not appearing in the import/tables structure fields then you probably need to update the corresponding DB Table for those fields separately,else BAPI will update the same. You will get partner guid and partner number from export parameters of the BAPI.
    Regards,
    Dipesh
    Message was edited by: Joaquin Fornas

  • How to set the desired font to the selected text in textframe?

    Hi,
    I want to change the font(let's say Times New Roman) of selected text in textframe when I click on  menu-item of my plug-in.
    I went through the Adobe Text Engine documentation and  tried some code for setting font but failed. I don't see any member function in IFont class to set desired font, so unable to move forward.
    plz see the code. I would like to know one more thing that how can we set a particular font for a textframe?
    TextRangesRef rangesRef = NULL;
    result = sAIDocument->GetTextSelection(&rangesRef);
    aisdk::check_ai_error(result);
    ITextRanges ranges(rangesRef);
    if (ranges.GetSize() > 0)
         ITextRange range = ranges.Item(0);
         ICharFeatures features = range.GetUniqueLocalCharFeatures();
         IFont  font;                     // I don't see any method to put desired font.
       // features.SetFont(); 
    Thanks.
    D.A

    First, get the font:
    AIFontKey fontKey = 0;
    AIErr error = sAIFont->FindFont("Times New Roman Regular", kAIAnyFontTechnology, kNativeAIScript, 0, &fontKey);
    // do something with error
    ATE::FontRef fontRef = 0;
    error = sAIFont->FontFromFontKey(fontKey, &fontRef);
    // do something with error
    ATE::IFont font(fontRef);
    Then, apply it like this:
    ATE::TextRangeRef textRangeRef = 0;
    AIErr error = sAITextFrame->GetATETextRange(handle_to_artwork, &textRangeRef);
    // check error
    ATE::ITextRange textRange(textRangeRef);
    ATE::ICharFeatures charFeatures = textRange.GetUniqueLocalCharFeatures();
    charFeatures.SetFont(font);
    textRange.ReplaceOrAddLocalCharFeatures(charFeatures);
    There are a few other ways to set the text, but you need to understand how character & paragraph styles interact with each other to understand the differneces. This is the most straight forward way to do it though.

  • How to set column widths in tables for selected table only, not globally throughout document?

    I've been utilizing the below script (thank you so much Ramkumar. P!) to set column widths throughout a sizable InDesign book with tables on every page and it is truly a time saver. At this point in time, I have three versions of it because there are different column widths throughout the book. Is it possible to augment the script to run only on a selected text frame (containing a table)? If so, would someone be kind enough to share the augmented script with me? I've been trying to figure out this seemingly simple change through trial and error with no success as yet. I realize this is a totally newbie request and I'm entirely at the mercy of the kindness of the Javascript gods that contribute within this forum. Seeing that in a different post related to this script, one such guru responded to a request as simple as "Where do I put the scripts in InDesign" gave me enough courage to ask for some help! Thank you in advance to anyone willing to provide a solution.
      var myDoc = app.activeDocument;
         var myWidths = [100, 100, 150, 150];
         for(var T=0; T < myDoc.textFrames.length; T++){
             for(var i=0; i < myDoc.textFrames[T].tables.length; i++){
                 for(var j=0; j < myWidths.length; j++){
                     myDoc.textFrames[T].tables[i].columns[j].width = myWidths[j];
         alert("Table width updated successfully...");

    Hello all
    I have the same problem in that I'm not a scripting person, but was able to get the above script working without problem, and it does set irregular table column widths perfectly, so thanks to Ramkumar. P for that.
    BUT, it changes the column width for ALL tables in the document, whereas I would like to just target the selected table.
    Any ideas as to how I might amend this script to achieve this?
    Thx, Christian

  • How to set a radio button to be selected?

    I'm trying to find out how to do something that should be seemingly simple. That is to create a little function that selects a random radio button as selected. I have 3 radio buttons in a group (see code):
    </mx:ApplicationControlBar>
    <mx:RadioButtonGroup id="radiogroupZ"/>
    <mx:RadioButton x="10" y="608" label="Button 1" groupName="radiogroupZ"/>
    <mx:RadioButton x="10" y="634" label="Button 2" groupName="radiogroupZ"/>
    <mx:RadioButton x="10" y="660" label="Button 3" groupName="radiogroupZ"/>
    I've tried all kinds of code to try to set Button 1, 2 or 3 as selected but the compiler keeps giving me errors.
    Can someone give me an example of a simple function that will set one of these as highlighted? All I need is the code that basically says for example: "Select Button 1 in the group "radiogroupZ to be selected".
    Thanks

    // This will have the first button selected.
    <mx:RadioButtonGroupd id="radiogroupZ" selectedValue="somethingHere1"/>
    <mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere1" groupName="radioGroupZ"/>
    <mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere2" groupName="radioGroupZ"/>
    <mx:RadioButton x="10" y="608" label="Button 1" value="somethingHere3" groupName="radioGroupZ"/>
    // To select something in a function
    private function functionName():void
         radiogroupZ.selectedValue = "somethingHere1";

Maybe you are looking for

  • While creating MViews in oracle 9i database connecting to table in an orac

    Hi all,. While creating MViews in oracle 9i database connecting to table in an oracle 11g database.... Eg : create materilized view testmview as select * from testtable@db_linkname ORA-03113: end-of-file on communication channel any idea Regards, Shi

  • How to delete pictures that downloaded from laptop?

    How do I delete pictures that downloaded from laptop? Thanks :-)

  • CR850 Internet Sales R/3 Edition

    Dear All, I would like to have some inputs on Internet Sales using R/3. Can I have documents on CR850 Internet Sales R/3 Edition. Please send it to my mail id <removed by moderator> Regards, Rakesh Message was edited by: Oxana Noa Zubarev

  • Consuming webservice error

    We have extracted the WSDL file successfully received from client but when tried to access/consume the web service got below mentioned error message: org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found definiti

  • RAW Images from Canon Digital Rebel XT

    Does (or will) iPhoto 5 support the RAW files from the Canon Digital Rebel XT?