Re: [xwiki-users] $doc.display for Radio Button
Op 19 mrt. 2014, om 11:25 heeft Marius Dumitru Florea het volgende geschreven: > On Tue, Mar 18, 2014 at 9:28 PM, gerritjankoekk...@gmail.com > wrote: >> >> >> Verstuurd vanaf mijn iPhone >> >>> Op 18 mrt. 2014 om 17:56 heeft Marius Dumitru Florea >>> het volgende geschreven: >>> >>> On Mon, Mar 17, 2014 at 8:54 PM, Gerritjan Koekkoek >>> wrote: Hi, If, in App Within Minutes, you select an attribute of type Static List with multiple options and you set the selection type to Radio Button the : $doc.display('SL1') shows the radio buttons in Edit mode, but not in Display mode. >>> I feel radio buttons should always display all the options and highlight the 'selected' one. But now, in view mode the user has nu clue what he/she can choose. It's a but odd to select EDIT before he/she can see the options. >>> >>> I don't agree. When I'm in view mode I'm interested in the selected >>> value. There can be many options and so displaying all of them >>> clutters the UI and distracts the user. >> >> I do not want to be a 'wise' guy but there is a choice in the type of >> controls >> Few (<10) mutually exclusive: radio >> Few options , more choices possible: check box >> Many options: select - dropdown >> > >> Radio buttons serve a specific UI purpose >> The mutually exclusiveness is special and should also be clear from view >> perspective especially if the viewer is not the owner of the record > > I understood your need / use case, but it's not very common, at lest > no one complained about this so far. Moreover, radio buttons are input > fields, so they are used for taking input from users. Using radio > buttons just for display (view mode) as read only is a bit of a hack. > If you need to display all possible values besides the selected one in > view mode then it's probably better to use a custom displayer for your > Static List property that lists all the possible values and marks the > selected value with some CSS. Alternatively, you can make the radio > buttons read-only in view mode, as I mentioned below. Is there a recommended way for such a customized displayer? I envision a Macro that would take the Class-Atribute Plus the Display-Value So if a Class-Attribute of type static list would hold 5 options and the display shows option 3 is selected What about this pseudocode #set($finalDisplayResult =’') #set($listOptions = $class.attribute.getOptions) #foreach($listOption in $listOptions) #if($listOption == $doc.display(’StaticList’)) #set($displayResult = ’1’) #else #set($displayResult = ’0’) #end $AddDisplayResult($displayResult) #end #macro($AddDisplayResult $displayResult) …. Display formatting #end Q: How do I get the listOptions? Q: How do I make sure the formatting is about the same as $doc.display(’StaticList’) in EDIT Mode? > > Hope this helps, > Marius > >>> In the sheet i've modified the generated code from; : $doc.display('SL1') -> : $doc.display('SL1', 'edit') But this allows the user to select another option (the control is active) >>> Is there a more elegant way to have the control show the radio buttons and the one currently selected highlighted but that the control is not active? >>> >>> You either make the radio buttons generated by $doc.display read-only >>> with JavaScript or you generate the radio buttons read only by >>> yourself. >> Ok, thanks >> >>> >>> Hope this helps, >>> Marius >>> Gerritjan ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users >>> ___ >>> users mailing list >>> users@xwiki.org >>> http://lists.xwiki.org/mailman/listinfo/users >> ___ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] $doc.display for Radio Button
On Tue, Mar 18, 2014 at 9:28 PM, gerritjankoekk...@gmail.com wrote: > > > Verstuurd vanaf mijn iPhone > >> Op 18 mrt. 2014 om 17:56 heeft Marius Dumitru Florea >> het volgende geschreven: >> >> On Mon, Mar 17, 2014 at 8:54 PM, Gerritjan Koekkoek >> wrote: >>> Hi, >>> >>> If, in App Within Minutes, you select an attribute of type Static List with >>> multiple options and you set the selection type to Radio Button the : >>> $doc.display('SL1') shows the radio buttons in Edit mode, but not in >>> Display mode. >> >>> I feel radio buttons should always display all the options and highlight >>> the 'selected' one. >>> But now, in view mode the user has nu clue what he/she can choose. >>> It's a but odd to select EDIT before he/she can see the options. >> >> I don't agree. When I'm in view mode I'm interested in the selected >> value. There can be many options and so displaying all of them >> clutters the UI and distracts the user. > > I do not want to be a 'wise' guy but there is a choice in the type of controls > Few (<10) mutually exclusive: radio > Few options , more choices possible: check box > Many options: select - dropdown > > Radio buttons serve a specific UI purpose > The mutually exclusiveness is special and should also be clear from view > perspective especially if the viewer is not the owner of the record I understood your need / use case, but it's not very common, at lest no one complained about this so far. Moreover, radio buttons are input fields, so they are used for taking input from users. Using radio buttons just for display (view mode) as read only is a bit of a hack. If you need to display all possible values besides the selected one in view mode then it's probably better to use a custom displayer for your Static List property that lists all the possible values and marks the selected value with some CSS. Alternatively, you can make the radio buttons read-only in view mode, as I mentioned below. Hope this helps, Marius >> >>> >>> In the sheet i've modified the generated code from; >>> : $doc.display('SL1') -> : $doc.display('SL1', 'edit') >>> But this allows the user to select another option (the control is active) >> >>> Is there a more elegant way to have the control show the radio buttons and >>> the one currently selected highlighted but that the control is not active? >> >> You either make the radio buttons generated by $doc.display read-only >> with JavaScript or you generate the radio buttons read only by >> yourself. > Ok, thanks > >> >> Hope this helps, >> Marius >> >>> >>> Gerritjan >>> ___ >>> users mailing list >>> users@xwiki.org >>> http://lists.xwiki.org/mailman/listinfo/users >> ___ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] $doc.display for Radio Button
Verstuurd vanaf mijn iPhone > Op 18 mrt. 2014 om 17:56 heeft Marius Dumitru Florea > het volgende geschreven: > > On Mon, Mar 17, 2014 at 8:54 PM, Gerritjan Koekkoek > wrote: >> Hi, >> >> If, in App Within Minutes, you select an attribute of type Static List with >> multiple options and you set the selection type to Radio Button the : >> $doc.display('SL1') shows the radio buttons in Edit mode, but not in >> Display mode. > >> I feel radio buttons should always display all the options and highlight >> the 'selected' one. >> But now, in view mode the user has nu clue what he/she can choose. >> It's a but odd to select EDIT before he/she can see the options. > > I don't agree. When I'm in view mode I'm interested in the selected > value. There can be many options and so displaying all of them > clutters the UI and distracts the user. I do not want to be a 'wise' guy but there is a choice in the type of controls Few (<10) mutually exclusive: radio Few options , more choices possible: check box Many options: select - dropdown Radio buttons serve a specific UI purpose The mutually exclusiveness is special and should also be clear from view perspective especially if the viewer is not the owner of the record > >> >> In the sheet i've modified the generated code from; >> : $doc.display('SL1') -> : $doc.display('SL1', 'edit') >> But this allows the user to select another option (the control is active) > >> Is there a more elegant way to have the control show the radio buttons and >> the one currently selected highlighted but that the control is not active? > > You either make the radio buttons generated by $doc.display read-only > with JavaScript or you generate the radio buttons read only by > yourself. Ok, thanks > > Hope this helps, > Marius > >> >> Gerritjan >> ___ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] $doc.display for Radio Button
On Mon, Mar 17, 2014 at 8:54 PM, Gerritjan Koekkoek wrote: > Hi, > > If, in App Within Minutes, you select an attribute of type Static List with > multiple options and you set the selection type to Radio Button the : > $doc.display('SL1') shows the radio buttons in Edit mode, but not in > Display mode. > > I feel radio buttons should always display all the options and highlight > the 'selected' one. > But now, in view mode the user has nu clue what he/she can choose. > It's a but odd to select EDIT before he/she can see the options. I don't agree. When I'm in view mode I'm interested in the selected value. There can be many options and so displaying all of them clutters the UI and distracts the user. > > In the sheet i've modified the generated code from; > : $doc.display('SL1') -> : $doc.display('SL1', 'edit') > But this allows the user to select another option (the control is active) > > Is there a more elegant way to have the control show the radio buttons and > the one currently selected highlighted but that the control is not active? You either make the radio buttons generated by $doc.display read-only with JavaScript or you generate the radio buttons read only by yourself. Hope this helps, Marius > > Gerritjan > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] $doc.display for Radio Button
Hi, If, in App Within Minutes, you select an attribute of type Static List with multiple options and you set the selection type to Radio Button the : $doc.display('SL1') shows the radio buttons in Edit mode, but not in Display mode. I feel radio buttons should always display all the options and highlight the 'selected' one. But now, in view mode the user has nu clue what he/she can choose. It's a but odd to select EDIT before he/she can see the options. In the sheet i've modified the generated code from; : $doc.display('SL1') -> : $doc.display('SL1', 'edit') But this allows the user to select another option (the control is active) Is there a more elegant way to have the control show the radio buttons and the one currently selected highlighted but that the control is not active? Gerritjan ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users